|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ContentStore
Provides low-level retrieval of content
readers and
writers.
Implementations of this interface should be soley responsible for
providing persistence and retrieval of the content against a
content URL.
Content URLs must consist of a prefix or protocol followed by an
implementation-specific identifier. For example, the content URL format
for file stores is store://year/month/day/GUID.bin
Where the store cannot handle a particular content URL request, the
UnsupportedContentUrlException must be generated. This will allow
various implementations to provide fallback code to other stores where
possible.
Where a store cannot serve a particular request because the functionality
is just not available, the UnsupportedOperationException should
be thrown. Once again, there may be fallback handling provided for these
situations.
| Nested Class Summary | |
|---|---|
static interface |
ContentStore.ContentUrlHandler
Iterface for to use during iteration over content URLs. |
| Field Summary | |
|---|---|
static ContentContext |
NEW_CONTENT_CONTEXT
An empty content context used to retrieve completely new content. |
static java.lang.String |
PROTOCOL_DELIMITER
The delimiter that must be found in all URLS, i.e :// |
| Method Summary | |
|---|---|
boolean |
delete(java.lang.String contentUrl)
Deletes the content at the given URL. |
boolean |
exists(java.lang.String contentUrl)
Check for the existence of content in the store. |
org.alfresco.service.cmr.repository.ContentReader |
getReader(java.lang.String contentUrl)
Get the accessor with which to read from the content at the given URL. |
java.lang.String |
getRootLocation()
Get the location where the store is rooted. |
long |
getSpaceFree()
Calcualates the remaing free space in the underlying store. |
long |
getSpaceTotal()
Calculates the total storage space of the underlying store. |
long |
getSpaceUsed()
Calculates the total size of stored content, excluding any other data in the underlying storage. |
long |
getTotalSize()
Deprecated. Since 3.3.3 use ContentStore.getSpaceUsed(). |
void |
getUrls(ContentStore.ContentUrlHandler handler)
Get all URLs for the store, regardless of creation time. |
void |
getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
Get a set of all content URLs in the store. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(ContentContext context)
Get an accessor with which to write content to a location within the store. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
Deprecated. |
boolean |
isContentUrlSupported(java.lang.String contentUrl)
Check if the content URL format is supported by the store. |
boolean |
isWriteSupported()
Check if the store supports write requests. |
| Field Detail |
|---|
static final ContentContext NEW_CONTENT_CONTEXT
ContentStore.getWriter(ContentContext)static final java.lang.String PROTOCOL_DELIMITER
| Method Detail |
|---|
boolean isContentUrlSupported(java.lang.String contentUrl)
contentUrl - the content URL to check
UnsupportedContentUrlException when given
this URL.boolean isWriteSupported()
long getTotalSize()
ContentStore.getSpaceUsed().
ContentStore.getSpaceFree(),
ContentStore.getSpaceTotal()long getSpaceUsed()
long getSpaceFree()
NOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
long getSpaceTotal()
NOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
java.lang.String getRootLocation()
boolean exists(java.lang.String contentUrl)
The implementation of this may be more efficient than first getting a
reader to check for existence, although
that check should also be performed.
contentUrl - the path to the content
UnsupportedContentUrlException - if the content URL supplied is not supported by the store
org.alfresco.service.cmr.repository.ContentIOException - if an IO error occursContentReader.exists()org.alfresco.service.cmr.repository.ContentReader getReader(java.lang.String contentUrl)
contentUrl - the path to where the content is located
UnsupportedContentUrlException - if the content URL supplied is not supported by the store
org.alfresco.service.cmr.repository.ContentIOException - if an IO error occursContentStore.exists(String),
ContentReader.exists(),
EmptyContentReaderorg.alfresco.service.cmr.repository.ContentWriter getWriter(ContentContext context)
The store will ensure that the new content URL will
be valid for all subsequent read attempts.
By supplying a reader to existing content, the store implementation may
enable random access. The store implementation
can enable this by copying the existing content into the new location
before supplying a writer onto the new content.
context - the context of content.
java.lang.UnsupportedOperationException - if the store is unable to provide the information
UnsupportedContentUrlException - if the content URL supplied is not supported by the store
ContentExistsException - if the content URL is already in use
org.alfresco.service.cmr.repository.ContentIOException - if an IO error occurs#getWriteSupport(),
ContentAccessor.addListener(ContentStreamListener),
ContentAccessor.getContentUrl()
org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
ContentStore.getWriter(ContentContext).
ContentStore.getWriter(ContentContext)
void getUrls(ContentStore.ContentUrlHandler handler)
throws org.alfresco.service.cmr.repository.ContentIOException
org.alfresco.service.cmr.repository.ContentIOException - if an IO error occurs
java.lang.UnsupportedOperationException - if the store is unable to provide the information#getUrls(Date, Date)
void getUrls(java.util.Date createdAfter,
java.util.Date createdBefore,
ContentStore.ContentUrlHandler handler)
throws org.alfresco.service.cmr.repository.ContentIOException
createdAfter - all URLs returned must have been created after this date. May be null.createdBefore - all URLs returned must have been created before this date. May be null.handler - the callback that will passed each URL
org.alfresco.service.cmr.repository.ContentIOException - if an error occurs
java.lang.UnsupportedOperationException - if the store is unable to provide the informationboolean delete(java.lang.String contentUrl)
A delete cannot be forced since it is much better to have the file remain longer than desired rather than deleted prematurely.
contentUrl - the URL of the content to delete
java.lang.UnsupportedOperationException - if the store is unable to perform the action
UnsupportedContentUrlException - if the content URL supplied is not supported by the store
org.alfresco.service.cmr.repository.ContentIOException - if an error occurs
if an IO error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||