Class ModuleSpaceMemberships.Async
- java.lang.Object
-
- com.contentful.java.cma.ModuleSpaceMemberships.Async
-
- Enclosing class:
- ModuleSpaceMemberships
public class ModuleSpaceMemberships.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<CMASpaceMembership>create(CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)Asynchronously create a new membership.CMACallback<CMASpaceMembership>create(java.lang.String spaceId, CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)Asynchronously create a new membership.CMACallback<java.lang.Integer>delete(CMASpaceMembership membership, CMACallback<java.lang.Integer> callback)Delete the given membership instance asynchronously.CMACallback<CMAArray<CMASpaceMembership>>fetchAll(CMACallback<CMAArray<CMASpaceMembership>> callback)Fetch all memberships of this space, asynchronously.CMACallback<CMAArray<CMASpaceMembership>>fetchAll(java.lang.String spaceId, CMACallback<CMAArray<CMASpaceMembership>> callback)Fetch all memberships of this space, asynchronously.CMACallback<CMAArray<CMASpaceMembership>>fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMASpaceMembership>> callback)Fetch all memberships of this space, asynchronously.CMACallback<CMAArray<CMASpaceMembership>>fetchAll(java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMASpaceMembership>> callback)Fetch all memberships of the configured space, asynchronously.CMACallback<CMASpaceMembership>fetchOne(java.lang.String membershipId, CMACallback<CMASpaceMembership> callback)Fetches one space membership by its id from Contentful asynchronously.CMACallback<CMASpaceMembership>fetchOne(java.lang.String spaceId, java.lang.String membershipId, CMACallback<CMASpaceMembership> callback)Fetches one space membership by its id from Contentful asynchronously.CMACallback<CMASpaceMembership>update(CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)Update the given membership instance on Contentful, asynchronously.
-
-
-
Method Detail
-
fetchAll
public CMACallback<CMAArray<CMASpaceMembership>> fetchAll(CMACallback<CMAArray<CMASpaceMembership>> callback)
Fetch all memberships of this space, asynchronously.- Parameters:
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),ModuleSpaceMemberships.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMASpaceMembership>> fetchAll(java.lang.String spaceId, CMACallback<CMAArray<CMASpaceMembership>> callback)
Fetch all memberships 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- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.- See Also:
ModuleSpaceMemberships.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMASpaceMembership>> fetchAll(java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMASpaceMembership>> callback)
Fetch all memberships of the configured space, asynchronously.- Parameters:
query- define which space memberships to return.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:
ModuleSpaceMemberships.fetchAll(String)
-
fetchAll
public CMACallback<CMAArray<CMASpaceMembership>> fetchAll(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> query, CMACallback<CMAArray<CMASpaceMembership>> callback)
Fetch all memberships 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.query- define which space memberships to return.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:
ModuleSpaceMemberships.fetchAll(String)
-
fetchOne
public CMACallback<CMASpaceMembership> fetchOne(java.lang.String membershipId, CMACallback<CMASpaceMembership> callback)
Fetches one space membership by its id from Contentful asynchronously.- Parameters:
membershipId- the id of the membership to be found.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if membership id is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String),ModuleSpaceMemberships.fetchOne(String, String)
-
fetchOne
public CMACallback<CMASpaceMembership> fetchOne(java.lang.String spaceId, java.lang.String membershipId, CMACallback<CMASpaceMembership> callback)
Fetches one space membership 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 membership is hosted by.membershipId- the id of the membership to be found.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if membership id is null.- See Also:
ModuleSpaceMemberships.fetchOne(String, String)
-
create
public CMACallback<CMASpaceMembership> create(java.lang.String spaceId, CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)
Asynchronously create a new membership.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 membership.membership- the new membership to be created.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if membership is null.- See Also:
ModuleSpaceMemberships.create(String, CMASpaceMembership)
-
create
public CMACallback<CMASpaceMembership> create(CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)
Asynchronously create a new membership.- Parameters:
membership- the new membership to be created.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if membership is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
ModuleSpaceMemberships.create(String, CMASpaceMembership)
-
update
public CMACallback<CMASpaceMembership> update(CMASpaceMembership membership, CMACallback<CMASpaceMembership> callback)
Update the given membership instance on Contentful, asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
membership- the membership fetched from Contentful, updated by caller, to be updated.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if membership is null.java.lang.IllegalArgumentException- if membership id is null.java.lang.IllegalArgumentException- if membership does not have a version attached.- See Also:
ModuleSpaceMemberships.update(CMASpaceMembership)
-
delete
public CMACallback<java.lang.Integer> delete(CMASpaceMembership membership, CMACallback<java.lang.Integer> callback)
Delete the given membership instance asynchronously.Please make sure that the instance provided is fetched from Contentful. Otherwise you will get an exception thrown.
- Parameters:
membership- the membership fetched from Contentful, updated by caller, to be deleted.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if membership id is null.- See Also:
ModuleSpaceMemberships.delete(CMASpaceMembership)
-
-