Class ModuleRoles.Async
- java.lang.Object
-
- com.contentful.java.cma.ModuleRoles.Async
-
- Enclosing class:
- ModuleRoles
public class ModuleRoles.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<CMARole>create(CMARole role, CMACallback<CMARole> callback)Asynchronously create a new role.CMACallback<CMARole>create(java.lang.String spaceId, CMARole role, CMACallback<CMARole> callback)Asynchronously create a new role.CMACallback<java.lang.Integer>delete(CMARole role, CMACallback<java.lang.Integer> callback)Delete the given role instance asynchronously.CMACallback<CMAArray<CMARole>>fetchAll(CMACallback<CMAArray<CMARole>> callback)Fetch all roles of this space, asynchronously.CMACallback<CMAArray<CMARole>>fetchAll(java.lang.String spaceId, CMACallback<CMAArray<CMARole>> callback)Fetch all roles of this space, asynchronously.CMACallback<CMAArray<CMARole>>fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMARole>> callback)Fetch specific roles of this space.CMACallback<CMAArray<CMARole>>fetchAll(java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMARole>> callback)Fetch specific roles of this space.CMACallback<CMARole>fetchOne(java.lang.String roleId, CMACallback<CMARole> callback)Fetches one role by its id from Contentful asynchronously.CMACallback<CMARole>fetchOne(java.lang.String spaceId, java.lang.String roleId, CMACallback<CMARole> callback)Fetches one role by its id from Contentful asynchronously.CMACallback<CMARole>update(CMARole role, CMACallback<CMARole> callback)Update the given role instance on Contentful, asynchronously.
-
-
-
Method Detail
-
fetchAll
public CMACallback<CMAArray<CMARole>> fetchAll(CMACallback<CMAArray<CMARole>> callback)
Fetch all roles of this space, 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 spaceId is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
ModuleRoles.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMARole>> fetchAll(java.lang.String spaceId, CMACallback<CMAArray<CMARole>> callback)
Fetch all roles of this space, asynchronously.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space 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 spaceId is null.- See Also:
ModuleRoles.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMARole>> fetchAll(java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMARole>> callback)
Fetch specific roles of this space.- Parameters:
query- the search criteria to search for.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if configured spaceId is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String),ModuleRoles.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMARole>> fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMARole>> callback)
Fetch specific roles of this space.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space identifier identifying the space.query- the search criteria to search for.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.- See Also:
ModuleRoles.fetchAll(String)
-
fetchOne
public CMACallback<CMARole> fetchOne(java.lang.String spaceId, java.lang.String roleId, CMACallback<CMARole> callback)
Fetches one role by its id from Contentful asynchronously.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space this role is hosted by.roleId- the id of the role 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 role id is null.- See Also:
ModuleRoles.fetchOne(String, String)
-
fetchOne
public CMACallback<CMARole> fetchOne(java.lang.String roleId, CMACallback<CMARole> callback)
Fetches one role by its id from Contentful asynchronously.- Parameters:
roleId- the id of the role 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 role id is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String),ModuleRoles.fetchOne(String, String)
-
create
public CMACallback<CMARole> create(java.lang.String spaceId, CMARole role, CMACallback<CMARole> callback)
Asynchronously create a new role.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- the space id to host the role.role- the new role 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 role is null.- See Also:
ModuleRoles.create(String, CMARole)
-
create
public CMACallback<CMARole> create(CMARole role, CMACallback<CMARole> callback)
Asynchronously create a new role.- Parameters:
role- the new role 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 role is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String),ModuleRoles.create(String, CMARole)
-
update
public CMACallback<CMARole> update(CMARole role, CMACallback<CMARole> callback)
Update the given role instance on Contentful, asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
role- the role fetched from Contentful, updated by caller, to be updated.callback- a callback to be called, once the results are present.- Returns:
- the updated role callback.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if role is null.java.lang.IllegalArgumentException- if role id is null.java.lang.IllegalArgumentException- if role does not have a version attached.- See Also:
ModuleRoles.update(CMARole)
-
delete
public CMACallback<java.lang.Integer> delete(CMARole role, CMACallback<java.lang.Integer> callback)
Delete the given role instance asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
role- the role 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 role id is null.- See Also:
ModuleRoles.delete(CMARole)
-
-