Class ModuleEntries
- java.lang.Object
-
- com.contentful.java.cma.ModuleEntries
-
public class ModuleEntries extends java.lang.ObjectEntries Module.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classModuleEntries.AsyncAsync module.
-
Constructor Summary
Constructors Constructor Description ModuleEntries(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create entries module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMAEntryarchive(CMAEntry entry)Archive an Entry.ModuleEntries.Asyncasync()CMAEntrycreate(java.lang.String contentTypeId, CMAEntry entry)Create a new Entry in the configured space and environment.CMAEntrycreate(java.lang.String spaceId, java.lang.String environmentId, java.lang.String contentTypeId, CMAEntry entry)Create a new Entry.protected com.contentful.java.cma.ServiceEntriescreateService(retrofit2.Retrofit retrofit)java.lang.Integerdelete(CMAEntry entry)Delete an Entry.CMAArray<CMAEntry>fetchAll()Fetch all Entries from the configured space and environment.CMAArray<CMAEntry>fetchAll(java.lang.String spaceId, java.lang.String environmentId)Fetch all entries from the given space and environment.CMAArray<CMAEntry>fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)Fetch all entries from the given space and environment matching the query.CMAArray<CMAEntry>fetchAll(java.util.Map<java.lang.String,java.lang.String> query)Fetch all entries matching the query from the configured space and environment.CMAArray<CMASnapshot>fetchAllSnapshots(CMAEntry entry)Fetch all snapshots of an entry.CMAEntryfetchOne(java.lang.String entryId)Fetch an entry with the givenentryIdfrom the configured space and environment.CMAEntryfetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String entryId)Fetch an entry with the given entryId from the given environment and space.CMASnapshotfetchOneSnapshot(CMAEntry entry, java.lang.String snapshotId)Fetch a specific snapshot of an entry.CMAEntrypublish(CMAEntry entry)Publish an Entry.CMAEntryunArchive(CMAEntry entry)Un-Archive an Entry.CMAEntryunPublish(CMAEntry entry)Un-Publish an Entry.CMAEntryupdate(CMAEntry entry)Update an Entry.
-
-
-
Constructor Detail
-
ModuleEntries
public ModuleEntries(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)Create entries module.- Parameters:
retrofit- the retrofit instance to be used to create the service.callbackExecutor- to tell on which thread it should run.spaceId- the space to be used when not given.environmentId- the environment to be used when not given.environmentIdConfigured- internal helper to see if environment was set.
-
-
Method Detail
-
createService
protected com.contentful.java.cma.ServiceEntries createService(retrofit2.Retrofit retrofit)
-
archive
public CMAEntry archive(CMAEntry entry)
Archive an Entry.- Parameters:
entry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.
-
create
public CMAEntry create(java.lang.String contentTypeId, CMAEntry entry)
Create a new Entry in the configured space and environment.In case the given
entryhas an ID associated with it, that ID will be used, otherwise the server will auto-generate an ID that will be contained in the response upon success.- Parameters:
contentTypeId- Content Type IDentry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if configured environment id is null.java.lang.IllegalArgumentException- if contentTypeId is null.java.lang.IllegalArgumentException- if entry is null.- See Also:
CMAClient.Builder.setSpaceId(String),CMAClient.Builder.setEnvironmentId(String)
-
create
public CMAEntry create(java.lang.String spaceId, java.lang.String environmentId, java.lang.String contentTypeId, CMAEntry entry)
Create a new Entry.In case the given
entryhas an ID associated with it, that ID will be used, otherwise the server will auto-generate an ID that will be contained in the response upon success.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)andCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- Space IDenvironmentId- Environment IDcontentTypeId- Content Type IDentry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if environmentId is null.java.lang.IllegalArgumentException- if contentTypeId is null.java.lang.IllegalArgumentException- if entry is null.
-
delete
public java.lang.Integer delete(CMAEntry entry)
Delete an Entry.- Parameters:
entry- Entry ID- Returns:
- Integer representing the success (204) of the action
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if environmentId is null.java.lang.IllegalArgumentException- if entryId is null.java.lang.IllegalArgumentException- if entry is null.
-
fetchAll
public CMAArray<CMAEntry> fetchAll()
Fetch all Entries from the configured space and environment.This fetch uses the default parameter defined in
DefaultQueryParameter.FETCH.- Returns:
CMAArrayresult instance- 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)
-
fetchAll
public CMAArray<CMAEntry> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
Fetch all entries matching the query from the configured space and environment.This fetch uses the default parameter defined in
DefaultQueryParameter.FETCH- Parameters:
query- the criteria to filter on.- Returns:
CMAArrayresult instance- 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)
-
fetchAll
public CMAArray<CMAEntry> fetchAll(java.lang.String spaceId, java.lang.String environmentId)
Fetch all entries from the given space and environment.This fetch uses the default parameter defined in
DefaultQueryParameter.FETCHThis method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)andCMAClient.Builder.setEnvironmentId(String).- Parameters:
spaceId- Space IDenvironmentId- Environment ID- Returns:
CMAArrayresult instance- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if environmentId is null.
-
fetchAll
public CMAArray<CMAEntry> fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)
Fetch all entries from the given space and environment matching the query.- Parameters:
spaceId- Space IDenvironmentId- Environment IDquery- Query- Returns:
CMAArrayof entries matching the query.- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if environmentId is null.
-
fetchOne
public CMAEntry fetchOne(java.lang.String entryId)
Fetch an entry with the givenentryIdfrom the configured space and environment.- Parameters:
entryId- Entry ID- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if configured space id is null.java.lang.IllegalArgumentException- if configured environment id is null.java.lang.IllegalArgumentException- if entry id is null.- See Also:
CMAClient.Builder.setSpaceId(String),CMAClient.Builder.setEnvironmentId(String)
-
fetchOne
public CMAEntry fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String entryId)
Fetch an entry with the given entryId from the given environment and space.- Parameters:
spaceId- Space IDenvironmentId- Environment IDentryId- Entry ID- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if space id is null.java.lang.IllegalArgumentException- if environment id is null.java.lang.IllegalArgumentException- if entry id is null.
-
publish
public CMAEntry publish(CMAEntry entry)
Publish an Entry.- Parameters:
entry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.
-
unArchive
public CMAEntry unArchive(CMAEntry entry)
Un-Archive an Entry.- Parameters:
entry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.
-
unPublish
public CMAEntry unPublish(CMAEntry entry)
Un-Publish an Entry.- Parameters:
entry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.
-
update
public CMAEntry update(CMAEntry entry)
Update an Entry.- Parameters:
entry- Entry- Returns:
CMAEntryresult instance- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.java.lang.IllegalArgumentException- if entry's version is null.
-
fetchAllSnapshots
public CMAArray<CMASnapshot> fetchAllSnapshots(CMAEntry entry)
Fetch all snapshots of an entry.- Parameters:
entry- the entry whose snapshots to be returned.- Returns:
- an array of snapshots.
- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.
-
fetchOneSnapshot
public CMASnapshot fetchOneSnapshot(CMAEntry entry, java.lang.String snapshotId)
Fetch a specific snapshot of an entry.- Parameters:
entry- the entry whose snapshot to be returned.snapshotId- the snapshot to be returned.- Returns:
- an array of snapshots.
- Throws:
java.lang.IllegalArgumentException- if entry is null.java.lang.IllegalArgumentException- if entry's id is null.java.lang.IllegalArgumentException- if entry's space id is null.java.lang.IllegalArgumentException- if snapshotId is null.
-
async
public ModuleEntries.Async async()
- Returns:
- a module with a set of asynchronous methods.
-
-