public final class ModuleEntries
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ModuleEntries.Async
Async module.
|
Constructor and Description |
---|
ModuleEntries(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor,
java.lang.String spaceId,
java.lang.String environmentId,
boolean environmentIdConfigured)
Create entries module.
|
Modifier and Type | Method and Description |
---|---|
CMAEntry |
archive(CMAEntry entry)
Archive an Entry.
|
ModuleEntries.Async |
async() |
CMAEntry |
create(java.lang.String contentTypeId,
CMAEntry entry)
Create a new Entry in the configured space and environment.
|
CMAEntry |
create(java.lang.String spaceId,
java.lang.String environmentId,
java.lang.String contentTypeId,
CMAEntry entry)
Create a new Entry.
|
protected com.contentful.java.cma.ServiceEntries |
createService(retrofit2.Retrofit retrofit) |
java.lang.Integer |
delete(CMAEntry entry)
Delete an Entry.
|
CMAArray<CMAEntry> |
fetchAll()
Fetch all Entries from the configured space and environment.
|
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<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<CMASnapshot> |
fetchAllSnapshots(CMAEntry entry)
Fetch all snapshots of an entry.
|
CMAEntry |
fetchOne(java.lang.String entryId)
Fetch an entry with the given
entryId from the configured space and environment. |
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.
|
CMASnapshot |
fetchOneSnapshot(CMAEntry entry,
java.lang.String snapshotId)
Fetch a specific snapshot of an entry.
|
CMAEntry |
publish(CMAEntry entry)
Publish an Entry.
|
CMAEntry |
unArchive(CMAEntry entry)
Un-Archive an Entry.
|
CMAEntry |
unPublish(CMAEntry entry)
Un-Publish an Entry.
|
CMAEntry |
update(CMAEntry entry)
Update an Entry.
|
public ModuleEntries(retrofit2.Retrofit retrofit, java.util.concurrent.Executor callbackExecutor, java.lang.String spaceId, java.lang.String environmentId, boolean environmentIdConfigured)
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.protected com.contentful.java.cma.ServiceEntries createService(retrofit2.Retrofit retrofit)
public CMAEntry archive(CMAEntry entry)
entry
- EntryCMAEntry
result instancejava.lang.IllegalArgumentException
- if entry is null.java.lang.IllegalArgumentException
- if entry's id is null.public CMAEntry create(java.lang.String contentTypeId, CMAEntry entry)
In case the given entry
has 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.
contentTypeId
- Content Type IDentry
- EntryCMAEntry
result instancejava.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.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAEntry create(java.lang.String spaceId, java.lang.String environmentId, java.lang.String contentTypeId, CMAEntry entry)
In case the given entry
has 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)
and
CMAClient.Builder.setEnvironmentId(String)
.
spaceId
- Space IDenvironmentId
- Environment IDcontentTypeId
- Content Type IDentry
- EntryCMAEntry
result instancejava.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.public java.lang.Integer delete(CMAEntry entry)
entry
- Entry IDjava.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.public CMAArray<CMAEntry> fetchAll()
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
.
CMAArray
result instancejava.lang.IllegalArgumentException
- if configured space id is null.java.lang.IllegalArgumentException
- if configured environment id is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAArray<CMAEntry> fetchAll(java.util.Map<java.lang.String,java.lang.String> query)
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
query
- the criteria to filter on.CMAArray
result instancejava.lang.IllegalArgumentException
- if configured space id is null.java.lang.IllegalArgumentException
- if configured environment id is null.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAArray<CMAEntry> fetchAll(java.lang.String spaceId, java.lang.String environmentId)
This fetch uses the default parameter defined in DefaultQueryParameter.FETCH
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)
and
CMAClient.Builder.setEnvironmentId(String)
.
spaceId
- Space IDenvironmentId
- Environment IDCMAArray
result instancejava.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if environmentId is null.public CMAArray<CMAEntry> fetchAll(java.lang.String spaceId, java.lang.String environmentId, java.util.Map<java.lang.String,java.lang.String> query)
spaceId
- Space IDenvironmentId
- Environment IDquery
- QueryCMAArray
of entries matching the query.java.lang.IllegalArgumentException
- if spaceId is null.java.lang.IllegalArgumentException
- if environmentId is null.public CMAEntry fetchOne(java.lang.String entryId)
entryId
from the configured space and environment.entryId
- Entry IDCMAEntry
result instancejava.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.CMAClient.Builder.setSpaceId(String)
,
CMAClient.Builder.setEnvironmentId(String)
public CMAEntry fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String entryId)
spaceId
- Space IDenvironmentId
- Environment IDentryId
- Entry IDCMAEntry
result instancejava.lang.IllegalArgumentException
- if space id is null.java.lang.IllegalArgumentException
- if environment id is null.java.lang.IllegalArgumentException
- if entry id is null.public CMAEntry publish(CMAEntry entry)
entry
- EntryCMAEntry
result instancejava.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.public CMAEntry unArchive(CMAEntry entry)
entry
- EntryCMAEntry
result instancejava.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.public CMAEntry unPublish(CMAEntry entry)
entry
- EntryCMAEntry
result instancejava.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.public CMAEntry update(CMAEntry entry)
entry
- EntryCMAEntry
result instancejava.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.public CMAArray<CMASnapshot> fetchAllSnapshots(CMAEntry entry)
entry
- the entry whose snapshots to be returned.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.public CMASnapshot fetchOneSnapshot(CMAEntry entry, java.lang.String snapshotId)
entry
- the entry whose snapshot to be returned.snapshotId
- the snapshot to be returned.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.public ModuleEntries.Async async()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.