|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.AbstractContentStore
public abstract class AbstractContentStore
Base class providing support for different types of content stores.
Since content URLs have to be consistent across all stores for reasons of replication and backup, the most important functionality provided is the generation of new content URLs and the checking of existing URLs.
Implementations must override either of the getWriter methods;
AbstractContentStore.getWriter(ContentContext)
or AbstractContentStore.getWriterInternal(ContentReader, String)
.
AbstractContentStore.getWriter(ContentReader, String)
,
AbstractContentStore.getWriterInternal(ContentReader, String)
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.alfresco.repo.content.ContentStore |
---|
ContentStore.ContentUrlHandler |
Field Summary |
---|
Fields inherited from interface org.alfresco.repo.content.ContentStore |
---|
NEW_CONTENT_CONTEXT, PROTOCOL_DELIMITER |
Constructor Summary | |
---|---|
AbstractContentStore()
|
Method Summary | |
---|---|
boolean |
delete(java.lang.String contentUrl)
Override if the derived class supports the operation. |
boolean |
exists(java.lang.String contentUrl)
Simple implementation that uses the reader's exists method as its implementation. |
protected org.alfresco.util.Pair |
getContentUrlParts(java.lang.String contentUrl)
Splits the content URL into its component parts as separated by protocol delimiter . |
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()
Uses AbstractContentStore.getSpaceUsed() , which is the equivalent method. |
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)
Override to provide an implementation. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(ContentContext context)
An implementation that does some sanity checking before requesting a writer from the store. |
org.alfresco.service.cmr.repository.ContentWriter |
getWriter(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
Shortcut method to ContentStore.getWriter(ContentContext) . |
protected org.alfresco.service.cmr.repository.ContentWriter |
getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader,
java.lang.String newContentUrl)
Implement to supply a store-specific writer for the given existing content and optional target content URL. |
boolean |
isContentUrlSupported(java.lang.String contentUrl)
Override this method to supply a efficient and direct check of the URL supplied. |
static boolean |
isValidContentUrl(java.lang.String contentUrl)
Checks that the content conforms to the format protocol://identifier as specified in the contract of the ContentStore interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.alfresco.repo.content.ContentStore |
---|
getReader, isWriteSupported |
Constructor Detail |
---|
public AbstractContentStore()
Method Detail |
---|
public static final boolean isValidContentUrl(java.lang.String contentUrl)
ContentStore
interface.
contentUrl
- the content URL to check
protected org.alfresco.util.Pair getContentUrlParts(java.lang.String contentUrl)
protocol delimiter
.
contentUrl
- the content URL to split
UnsupportedContentUrlException
- if the content URL is invalidpublic boolean isContentUrlSupported(java.lang.String contentUrl)
ContentStore.getReader(String)
throws the UnsupportedContentUrlException
exception.
isContentUrlSupported
in interface ContentStore
contentUrl
- the content URL to check
UnsupportedContentUrlException
when given
this URL.public boolean delete(java.lang.String contentUrl)
delete
in interface ContentStore
contentUrl
- the URL of the content to delete
java.lang.UnsupportedOperationException
- alwayspublic final void getUrls(ContentStore.ContentUrlHandler handler) throws org.alfresco.service.cmr.repository.ContentIOException
ContentStore
getUrls
in interface ContentStore
org.alfresco.service.cmr.repository.ContentIOException
- if an IO error occursContentStore.getUrls(Date, Date, ContentUrlHandler)
public void getUrls(java.util.Date createdAfter, java.util.Date createdBefore, ContentStore.ContentUrlHandler handler) throws org.alfresco.service.cmr.repository.ContentIOException
getUrls
in interface ContentStore
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
java.lang.UnsupportedOperationException
- always
org.alfresco.service.cmr.repository.ContentIOException
- if an error occursprotected org.alfresco.service.cmr.repository.ContentWriter getWriterInternal(org.alfresco.service.cmr.repository.ContentReader existingContentReader, java.lang.String newContentUrl)
existingContentReader
- a reader onto any content to initialize the new writer withnewContentUrl
- an optional target for the new content
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 occurspublic org.alfresco.service.cmr.repository.ContentWriter getWriter(ContentContext context)
AbstractContentStore.getWriterInternal(ContentReader, String)
must be supplied.
getWriter
in interface ContentStore
context
- the context of content.
AbstractContentStore.getWriterInternal(ContentReader, String)
public final org.alfresco.service.cmr.repository.ContentWriter getWriter(org.alfresco.service.cmr.repository.ContentReader existingContentReader, java.lang.String newContentUrl)
ContentStore
ContentStore.getWriter(ContentContext)
.
getWriter
in interface ContentStore
ContentContext
,
ContentStore.getWriter(ContentContext)
public boolean exists(java.lang.String contentUrl)
reader's exists
method as its implementation.
Override this method if a more efficient implementation is possible.
exists
in interface ContentStore
contentUrl
- the path to the content
ContentReader.exists()
public final long getTotalSize()
AbstractContentStore.getSpaceUsed()
, which is the equivalent method. This method is now
final in order to catch any implementations that should switch over to AbstractContentStore.getSpaceUsed()
.
getTotalSize
in interface ContentStore
ContentStore.getSpaceFree()
,
ContentStore.getSpaceTotal()
public long getSpaceUsed()
ContentStore
getSpaceUsed
in interface ContentStore
public long getSpaceFree()
ContentStore
NOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
getSpaceFree
in interface ContentStore
public long getSpaceTotal()
ContentStore
NOTE: For efficiency, some implementations may provide a guess.
Implementations should focus on calculating a size value quickly, rather than accurately.
getSpaceTotal
in interface ContentStore
public java.lang.String getRootLocation()
getRootLocation
in interface ContentStore
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |