|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.duracloud.storage.provider.ProbedStorageProvider
public abstract class ProbedStorageProvider
This class wraps a StorageProvider implementation, collecting timing metrics while passing calls down.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.duracloud.storage.provider.StorageProvider |
---|
StorageProvider.AccessType |
Field Summary | |
---|---|
protected Metric |
metric
|
protected MetricsTable |
metricsTable
|
protected StorageProvider |
storageProvider
|
Fields inherited from interface org.duracloud.storage.provider.StorageProvider |
---|
CONTENT_METADATA_SUFFIX, DEFAULT_MAX_RESULTS, DEFAULT_MIMETYPE, HTTP_NOT_FOUND, METADATA_CONTENT_CHECKSUM, METADATA_CONTENT_MD5, METADATA_CONTENT_MIMETYPE, METADATA_CONTENT_MODIFIED, METADATA_CONTENT_SIZE, METADATA_SPACE_ACCESS, METADATA_SPACE_COUNT, METADATA_SPACE_CREATED, RFC822_DATE_FORMAT, SPACE_METADATA_SUFFIX |
Constructor Summary | |
---|---|
ProbedStorageProvider()
|
Method Summary | |
---|---|
java.lang.String |
addContent(java.lang.String spaceId,
java.lang.String contentId,
java.lang.String contentMimeType,
long contentSize,
java.lang.String contentChecksum,
java.io.InputStream content)
Adds content to a space. |
void |
createSpace(java.lang.String spaceId)
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.io.InputStream |
getContent(java.lang.String spaceId,
java.lang.String contentId)
Gets content from a space. |
java.util.Map<java.lang.String,java.lang.String> |
getContentMetadata(java.lang.String spaceId,
java.lang.String contentId)
Retrieves the metadata associated with content. |
protected abstract MetricsProbed |
getProbedCore()
|
StorageProvider.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,
java.lang.String prefix)
Provides access to the content files within a space. |
java.util.List<java.lang.String> |
getSpaceContentsChunked(java.lang.String spaceId,
java.lang.String prefix,
long maxResults,
java.lang.String marker)
Provides a listing of the content files within a space. |
java.util.Map<java.lang.String,java.lang.String> |
getSpaceMetadata(java.lang.String spaceId)
Retrieves the metadata associated with a space. |
java.util.Iterator<java.lang.String> |
getSpaces()
Provides a listing of all spaces owned by a customer. |
void |
setContentMetadata(java.lang.String spaceId,
java.lang.String contentId,
java.util.Map<java.lang.String,java.lang.String> contentMetadata)
Sets the metadata associated with content. |
void |
setMetricsTable(MetricsTable metricsTable)
|
void |
setSpaceAccess(java.lang.String spaceId,
StorageProvider.AccessType access)
Sets the accessibility of a space to either OPEN or CLOSED. |
void |
setSpaceMetadata(java.lang.String spaceId,
java.util.Map<java.lang.String,java.lang.String> spaceMetadata)
Sets the metadata associated with a space. |
protected void |
setStorageProvider(StorageProvider storageProvider)
|
protected void |
startMetric(java.lang.String methodName)
|
protected void |
stopMetric(java.lang.String methodName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected StorageProvider storageProvider
protected MetricsTable metricsTable
protected Metric metric
Constructor Detail |
---|
public ProbedStorageProvider()
Method Detail |
---|
protected abstract MetricsProbed getProbedCore()
protected void startMetric(java.lang.String methodName)
protected void stopMetric(java.lang.String methodName)
public void setMetricsTable(MetricsTable metricsTable)
setMetricsTable
in interface MetricsProbed
protected void setStorageProvider(StorageProvider storageProvider)
public java.lang.String addContent(java.lang.String spaceId, java.lang.String contentId, java.lang.String contentMimeType, long contentSize, java.lang.String contentChecksum, java.io.InputStream content) throws StorageException
StorageProvider
addContent
in interface StorageProvider
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacecontentMimeType
- - the MIME type of the content being addedcontentSize
- - the file size (in bytes) of the content being addedcontentChecksum
- - the MD5 checksum of the content being added (null if no checksum is known)content
- - content to add
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic void createSpace(java.lang.String spaceId) throws StorageException
StorageProvider
createSpace
in interface StorageProvider
spaceId
- - ID of the space
StorageException
- if space with ID spaceId already existspublic void deleteContent(java.lang.String spaceId, java.lang.String contentId) throws StorageException
StorageProvider
deleteContent
in interface StorageProvider
spaceId
- - ID of the spacecontentId
- - ID of the content in the space
NotFoundException
- if space with ID spaceId does not exist or the
content item with ID contentId does not exist
StorageException
- if errors occurpublic void deleteSpace(java.lang.String spaceId) throws StorageException
StorageProvider
deleteSpace
in interface StorageProvider
spaceId
- - ID of the space
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic java.io.InputStream getContent(java.lang.String spaceId, java.lang.String contentId) throws StorageException
StorageProvider
getContent
in interface StorageProvider
spaceId
- - ID of the spacecontentId
- - ID of the content in the space
NotFoundException
- if space with ID spaceId does not exist or the
content item with ID contentId does not exist
StorageException
- if errors occurpublic java.util.Map<java.lang.String,java.lang.String> getContentMetadata(java.lang.String spaceId, java.lang.String contentId) throws StorageException
StorageProvider
getContentMetadata
in interface StorageProvider
spaceId
- - ID of the spacecontentId
- - ID of the content in the space
NotFoundException
- if space with ID spaceId does not exist or the
content item with ID contentId does not exist
StorageException
- if errors occurpublic StorageProvider.AccessType getSpaceAccess(java.lang.String spaceId) throws StorageException
StorageProvider
getSpaceAccess
in interface StorageProvider
spaceId
- - ID of the space
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic java.util.Iterator<java.lang.String> getSpaceContents(java.lang.String spaceId, java.lang.String prefix) throws StorageException
StorageProvider
getSpaceContents
in interface StorageProvider
spaceId
- - ID of the spaceprefix
- - The prefix of the content id (null for no constraints)
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic java.util.List<java.lang.String> getSpaceContentsChunked(java.lang.String spaceId, java.lang.String prefix, long maxResults, java.lang.String marker) throws StorageException
StorageProvider
getSpaceContentsChunked
in interface StorageProvider
spaceId
- - ID of the 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 (1000))marker
- - The content ID marking the last item in the previous set (null indicates the first set of ids)
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic java.util.Map<java.lang.String,java.lang.String> getSpaceMetadata(java.lang.String spaceId) throws StorageException
StorageProvider
getSpaceMetadata
in interface StorageProvider
spaceId
- - ID of the space
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic java.util.Iterator<java.lang.String> getSpaces() throws StorageException
StorageProvider
getSpaces
in interface StorageProvider
StorageException
public void setContentMetadata(java.lang.String spaceId, java.lang.String contentId, java.util.Map<java.lang.String,java.lang.String> contentMetadata) throws StorageException
StorageProvider
setContentMetadata
in interface StorageProvider
spaceId
- - ID of the spacecontentId
- - ID of the content in the spacecontentMetadata
- - new content metadata
NotFoundException
- if space with ID spaceId does not exist or the
content item with ID contentId does not exist
StorageException
- if errors occurpublic void setSpaceAccess(java.lang.String spaceId, StorageProvider.AccessType access) throws StorageException
StorageProvider
setSpaceAccess
in interface StorageProvider
spaceId
- - ID of the spaceaccess
- - New space access value
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occurpublic void setSpaceMetadata(java.lang.String spaceId, java.util.Map<java.lang.String,java.lang.String> spaceMetadata) throws StorageException
StorageProvider
setSpaceMetadata
in interface StorageProvider
spaceId
- - ID of the spacespaceMetadata
- - Updated space metadata
NotFoundException
- if space with ID spaceId does not exist
StorageException
- if errors occur
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |