|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.duracloud.client.ContentStoreImpl
public class ContentStoreImpl
Provides access to a content store
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.duracloud.client.ContentStore |
---|
ContentStore.AccessType |
Field Summary |
---|
Fields inherited from interface org.duracloud.client.ContentStore |
---|
CONTENT_CHECKSUM, CONTENT_MIMETYPE, CONTENT_MODIFIED, CONTENT_SIZE, SPACE_ACCESS, SPACE_COUNT, SPACE_CREATED, SPACE_SIZE |
Constructor Summary | |
---|---|
ContentStoreImpl(java.lang.String baseURL,
org.duracloud.storage.domain.StorageProviderType type,
java.lang.String storeId,
org.duracloud.common.web.RestHttpHelper restHelper)
Creates a ContentStore |
Method Summary | |
---|---|
java.lang.String |
addContent(java.lang.String spaceId,
java.lang.String contentId,
java.io.InputStream content,
long contentSize,
java.lang.String contentMimeType,
java.lang.String contentChecksum,
java.util.Map<java.lang.String,java.lang.String> contentProperties)
Adds content to a space. |
java.lang.String |
copyContent(java.lang.String srcSpaceId,
java.lang.String srcContentId,
java.lang.String destSpaceId,
java.lang.String destContentId)
This method copies the content item found in source-space with the id of source-content-id into the dest-space, naming it to dest-content-id. |
void |
createSpace(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> spaceProperties)
Creates a new space. |
void |
deleteContent(java.lang.String spaceId,
java.lang.String contentId)
Removes content from a space. |
void |
deleteSpace(java.lang.String spaceId)
Deletes a space. |
java.lang.String |
getBaseURL()
Gets the base URL pointing to the DuraCloud DuraStore REST API |
Content |
getContent(java.lang.String spaceId,
java.lang.String contentId)
Gets content from a space. |
java.util.Map<java.lang.String,java.lang.String> |
getContentProperties(java.lang.String spaceId,
java.lang.String contentId)
Retrieves the properties associated with content. |
Space |
getSpace(java.lang.String spaceId,
java.lang.String prefix,
long maxResults,
java.lang.String marker)
Provides a space, including the id and properties of the space as well as a limited list of the content items within a space. |
ContentStore.AccessType |
getSpaceAccess(java.lang.String spaceId)
Gets the access setting of the space, either OPEN or CLOSED. |
java.util.Iterator<java.lang.String> |
getSpaceContents(java.lang.String spaceId)
Retrieves the complete list of content items within a space. |
java.util.Iterator<java.lang.String> |
getSpaceContents(java.lang.String spaceId,
java.lang.String prefix)
Retrieves the complete list of content items within a space. |
java.util.Map<java.lang.String,java.lang.String> |
getSpaceProperties(java.lang.String spaceId)
Retrieves the properties associated with a space. |
java.util.List<java.lang.String> |
getSpaces()
Provides a listing of all spaces IDs. |
java.lang.String |
getStorageProviderType()
Gets the storage provider type StorageProviderType |
java.lang.String |
getStoreId()
Gets the ID of this content store |
java.util.List<java.lang.String> |
getSupportedTasks()
Gets a listing of the supported tasks. |
java.lang.String |
moveContent(java.lang.String srcSpaceId,
java.lang.String srcContentId,
java.lang.String destSpaceId,
java.lang.String destContentId)
This method moves the content item found in source-space with the id of source-content-id into the dest-space, naming it to dest-content-id. |
java.lang.String |
performTask(java.lang.String taskName,
java.lang.String taskParameters)
Perform a task which is outside of the standard set of storage activites but is available through one or more storage providers. |
void |
setContentProperties(java.lang.String spaceId,
java.lang.String contentId,
java.util.Map<java.lang.String,java.lang.String> contentProperties)
Sets the properties associated with content. |
void |
setSpaceAccess(java.lang.String spaceId,
ContentStore.AccessType spaceAccess)
Sets the accessibility of a space to either OPEN or CLOSED. |
void |
setSpaceProperties(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> spaceProperties)
Sets the properties associated with a space. |
void |
validateContentId(java.lang.String contentId)
Checks a content ID to ensure that it conforms to all restrictions |
void |
validateSpaceId(java.lang.String spaceId)
Checks a space ID to ensure that it conforms to all restrictions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentStoreImpl(java.lang.String baseURL, org.duracloud.storage.domain.StorageProviderType type, java.lang.String storeId, org.duracloud.common.web.RestHttpHelper restHelper)
baseURL
- a String
object.type
- a StorageProviderType
object.storeId
- a String
object.Method Detail |
---|
public java.lang.String getBaseURL()
ContentStore
getBaseURL
in interface ContentStore
public java.lang.String getStoreId()
getStoreId
in interface ContentStore
public java.lang.String getStorageProviderType()
StorageProviderType
getStorageProviderType
in interface ContentStore
public java.util.List<java.lang.String> getSpaces() throws ContentStoreException
getSpaces
in interface ContentStore
ContentStoreException
- if an error occurspublic java.util.Iterator<java.lang.String> getSpaceContents(java.lang.String spaceId) throws ContentStoreException
getSpaceContents
in interface ContentStore
spaceId
- the identifier of the DuraCloud Space
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic java.util.Iterator<java.lang.String> getSpaceContents(java.lang.String spaceId, java.lang.String prefix) throws ContentStoreException
getSpaceContents
in interface ContentStore
spaceId
- the identifier of the DuraCloud Spaceprefix
- only retrieve content ids with this prefix (null for all content ids)
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic Space getSpace(java.lang.String spaceId, java.lang.String prefix, long maxResults, java.lang.String marker) throws ContentStoreException
getSpace
in interface ContentStore
spaceId
- the identifier of the DuraCloud Spaceprefix
- only retrieve content ids with this prefix (null for all content ids)maxResults
- the maximum number of content ids to return in the list (0 indicates default - which is 1000)marker
- the content id marking the last item in the previous set (null to specify first set of ids)
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic void createSpace(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> spaceProperties) throws ContentStoreException
createSpace
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacespaceProperties
- a map of properties entries for the space
InvalidIdException
- if the space ID is not valid
ContentStoreException
- if the space already exists or cannot be createdpublic void deleteSpace(java.lang.String spaceId) throws ContentStoreException
deleteSpace
in interface ContentStore
spaceId
- the identifier of the DuraCloud Space
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic java.util.Map<java.lang.String,java.lang.String> getSpaceProperties(java.lang.String spaceId) throws ContentStoreException
getSpaceProperties
in interface ContentStore
spaceId
- the identifier of the DuraCloud Space
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic void setSpaceProperties(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> spaceProperties) throws ContentStoreException
setSpaceProperties
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacespaceProperties
- a map of properties entries for the space
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic ContentStore.AccessType getSpaceAccess(java.lang.String spaceId) throws ContentStoreException
getSpaceAccess
in interface ContentStore
spaceId
- the identifier of the DuraCloud Space
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic void setSpaceAccess(java.lang.String spaceId, ContentStore.AccessType spaceAccess) throws ContentStoreException
setSpaceAccess
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacespaceAccess
- the access setting for this space - OPEN or CLOSED
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic java.lang.String addContent(java.lang.String spaceId, java.lang.String contentId, java.io.InputStream content, long contentSize, java.lang.String contentMimeType, java.lang.String contentChecksum, java.util.Map<java.lang.String,java.lang.String> contentProperties) throws ContentStoreException
addContent
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacecontentId
- the identifier of the new content itemcontent
- the new content as a streamcontentSize
- the size of the contentcontentMimeType
- the MIME type of the contentcontentChecksum
- the MD5 checksum of the content, or null if the checksum is not knowncontentProperties
- a map of properties values to be linked to this content
InvalidIdException
- if the content ID is not valid
NotFoundException
- if the space does not exist
ContentStoreException
- if an error occurspublic java.lang.String copyContent(java.lang.String srcSpaceId, java.lang.String srcContentId, java.lang.String destSpaceId, java.lang.String destContentId) throws ContentStoreException
ContentStore
copyContent
in interface ContentStore
srcSpaceId
- of content to copysrcContentId
- of content to copydestSpaceId
- where copied content will end updestContentId
- given to copied content
ContentStoreException
- on errorpublic java.lang.String moveContent(java.lang.String srcSpaceId, java.lang.String srcContentId, java.lang.String destSpaceId, java.lang.String destContentId) throws ContentStoreException
ContentStore
moveContent
in interface ContentStore
srcSpaceId
- of content to movesrcContentId
- of content to movedestSpaceId
- where moved content will end updestContentId
- given to moved content
ContentStoreException
- on errorpublic Content getContent(java.lang.String spaceId, java.lang.String contentId) throws ContentStoreException
getContent
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacecontentId
- the identifier of the content item
NotFoundException
- if the space or content does not exist
ContentStoreException
- if an error occurspublic void deleteContent(java.lang.String spaceId, java.lang.String contentId) throws ContentStoreException
deleteContent
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacecontentId
- the identifier of the content item
NotFoundException
- if the space or content does not exist
ContentStoreException
- if an error occurspublic void setContentProperties(java.lang.String spaceId, java.lang.String contentId, java.util.Map<java.lang.String,java.lang.String> contentProperties) throws ContentStoreException
setContentProperties
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacecontentId
- the identifier of the content itemcontentProperties
- a map of properties values to be linked to this content
NotFoundException
- if the space or content does not exist
ContentStoreException
- if an error occurspublic java.util.Map<java.lang.String,java.lang.String> getContentProperties(java.lang.String spaceId, java.lang.String contentId) throws ContentStoreException
getContentProperties
in interface ContentStore
spaceId
- the identifier of the DuraCloud SpacecontentId
- the identifier of the content item
NotFoundException
- if the space or content does not exist
ContentStoreException
- if an error occurspublic void validateSpaceId(java.lang.String spaceId) throws InvalidIdException
validateSpaceId
in interface ContentStore
spaceId
- ID to validate
InvalidIdException
- if the space ID is invalidpublic void validateContentId(java.lang.String contentId) throws InvalidIdException
validateContentId
in interface ContentStore
contentId
- ID to validate
InvalidIdException
- if the content ID is invalidpublic java.util.List<java.lang.String> getSupportedTasks() throws ContentStoreException
getSupportedTasks
in interface ContentStore
ContentStoreException
public java.lang.String performTask(java.lang.String taskName, java.lang.String taskParameters) throws ContentStoreException
performTask
in interface ContentStore
taskName
- the name of the task to be performedtaskParameters
- the parameters of the task, what is included here
and how the information is formatted is
task-specific
ContentStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |