Added the notion of a ContentContext to select the content store to write to.

Added AbstractRoutingContentStore as a start base implementation.
Added warnings to drive config away from disused setTransactionService towards setRetryingTransactionHelper.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5734 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-05-21 09:16:31 +00:00
parent 8ee3f781f4
commit 6f4ab835fe
14 changed files with 631 additions and 56 deletions

View File

@@ -31,6 +31,7 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.service.cmr.repository.ContentIOException;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.util.GUID;
/**
@@ -45,16 +46,6 @@ import org.alfresco.util.GUID;
*/
public abstract class AbstractContentStore implements ContentStore
{
/**
* Simple implementation that uses the
* {@link ContentReader#exists() reader's exists} method as its implementation.
*/
public boolean exists(String contentUrl) throws ContentIOException
{
ContentReader reader = getReader(contentUrl);
return reader.exists();
}
/**
* Creates a new content URL. This must be supported by all
* stores that are compatible with Alfresco.
@@ -126,8 +117,33 @@ public abstract class AbstractContentStore implements ContentStore
return path;
}
/**
* Simple implementation that uses the
* {@link ContentReader#exists() reader's exists} method as its implementation.
*/
public boolean exists(String contentUrl) throws ContentIOException
{
ContentReader reader = getReader(contentUrl);
return reader.exists();
}
/**
* Searches for URLs using null dates.
*
* @see ContentStore#getUrls(java.util.Date, java.util.Date)
*/
public final Set<String> getUrls() throws ContentIOException
{
return getUrls(null, null);
}
/**
* @see ContentContext
* @see ContentStore#getWriter(ContentContext)
*/
public final ContentWriter getWriter(ContentReader existingContentReader, String newContentUrl) throws ContentIOException
{
ContentContext ctx = new ContentContext(existingContentReader, newContentUrl);
return getWriter(ctx);
}
}