Package com.contentful.java.cma
Class ModuleLocales.Async
- java.lang.Object
-
- com.contentful.java.cma.ModuleLocales.Async
-
- Enclosing class:
- ModuleLocales
public class ModuleLocales.Async extends java.lang.ObjectHandler for asynchronous requests.
-
-
Constructor Summary
Constructors Constructor Description Async()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMACallback<CMALocale>create(CMALocale locale, CMACallback<CMALocale> callback)Asynchronously create a new locale in the configured space and environment.CMACallback<CMALocale>create(java.lang.String spaceId, java.lang.String environmentId, CMALocale locale, CMACallback<CMALocale> callback)Asynchronously create a new locale.CMACallback<java.lang.Integer>delete(CMALocale locale, CMACallback<java.lang.Integer> callback)Delete the given locale instance asynchronously.CMACallback<CMAArray<CMALocale>>fetchAll(CMACallback<CMAArray<CMALocale>> callback)Fetch all locales from the configured space and environment, asynchronously.CMACallback<CMAArray<CMALocale>>fetchAll(java.lang.String spaceId, java.lang.String environmentId, CMACallback<CMAArray<CMALocale>> callback)Fetch all locales of the given space and environment, asynchronously.CMACallback<CMALocale>fetchOne(java.lang.String localeId, CMACallback<CMALocale> callback)Fetches one locale by the configured space and environment, asynchronously.CMACallback<CMALocale>fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String localeId, CMACallback<CMALocale> callback)Fetches one locale by its id and the given space and environment, asynchronously.CMACallback<CMALocale>update(CMALocale locale, CMACallback<CMALocale> callback)Update the given locale instance on Contentful, asynchronously.
-
-
-
Method Detail
-
fetchAll
public CMACallback<CMAArray<CMALocale>> fetchAll(CMACallback<CMAArray<CMALocale>> callback)
Fetch all locales from the configured space and environment, asynchronously.- Parameters:
callback- a callback to be called, once the results are present.- Returns:
- a callback for the array fetched.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if configured environment id is null.- See Also:
CMAClient.Builder.setSpaceId(String),CMAClient.Builder.setEnvironmentId(String),ModuleLocales.fetchAll()
-
fetchAll
public CMACallback<CMAArray<CMALocale>> fetchAll(java.lang.String spaceId, java.lang.String environmentId, CMACallback<CMAArray<CMALocale>> callback)
Fetch all locales of the given space and environment, asynchronously.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)andCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space identifier identifying the space.environmentId- the environment identifier identifying the space.callback- a callback to be called, once the results are present.- Returns:
- a callback for the array fetched.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if environment id is null.- See Also:
ModuleLocales.fetchAll(String, String)
-
fetchOne
public CMACallback<CMALocale> fetchOne(java.lang.String localeId, CMACallback<CMALocale> callback)
Fetches one locale by the configured space and environment, asynchronously.- Parameters:
localeId- the id of the locale to be found.callback- a callback to be called, once the results are present.- Returns:
- a callback handling the response.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if configured environment id is null.java.lang.IllegalArgumentException- if locale id is null.- See Also:
ModuleLocales.fetchOne(String),CMAClient.Builder.setSpaceId(String),CMAClient.Builder.setEnvironmentId(String)
-
fetchOne
public CMACallback<CMALocale> fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String localeId, CMACallback<CMALocale> callback)
Fetches one locale by its id and the given space and environment, asynchronously.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)andCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space the given environment is hosted in.environmentId- the environment this locale is hosted in.localeId- the id of the locale to be found.callback- a callback to be called, once the results are present.- Returns:
- a callback handling the response.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if locale id is null.- See Also:
ModuleLocales.fetchOne(String, String, String)
-
create
public CMACallback<CMALocale> create(CMALocale locale, CMACallback<CMALocale> callback)
Asynchronously create a new locale in the configured space and environment.- Parameters:
locale- the new locale to be created.callback- a callback to be called, once the results are present.- Returns:
- a callback for the responses.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if configured environment id is null.java.lang.IllegalArgumentException- if locale is null.- See Also:
ModuleLocales.create(CMALocale),CMAClient.Builder.setSpaceId(String),CMAClient.Builder.setEnvironmentId(String)
-
create
public CMACallback<CMALocale> create(java.lang.String spaceId, java.lang.String environmentId, CMALocale locale, CMACallback<CMALocale> callback)
Asynchronously create a new locale. Using the given space and environment.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)andCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space id hosting the environment.environmentId- the environment id to host the locale.locale- the new locale to be created.callback- a callback to be called, once the results are present.- Returns:
- a callback for the responses.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if locale is null.- See Also:
ModuleLocales.create(String, String, CMALocale)
-
update
public CMACallback<CMALocale> update(CMALocale locale, CMACallback<CMALocale> callback)
Update the given locale instance on Contentful, asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
locale- the locale fetched from Contentful, updated by caller, to be updated.callback- a callback to be called, once the results are present.- Returns:
- the updated locale callback.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if locale is null.java.lang.IllegalArgumentException- if locale id is null.java.lang.IllegalArgumentException- if locale does not have a version attached.- See Also:
ModuleLocales.update(CMALocale)
-
delete
public CMACallback<java.lang.Integer> delete(CMALocale locale, CMACallback<java.lang.Integer> callback)
Delete the given locale instance asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
locale- the locale fetched from Contentful, updated by caller, to be deleted.callback- a callback to be called, once the results are present.- Returns:
- a callback for asynchronous interaction.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if locale id is null.- See Also:
ModuleLocales.delete(CMALocale)
-
-