org.modeshape.jcr.federation.spi
Class ReadOnlyConnector
java.lang.Object
org.modeshape.jcr.federation.spi.Connector
org.modeshape.jcr.federation.spi.ReadOnlyConnector
- Direct Known Subclasses:
- GitConnector
public abstract class ReadOnlyConnector
- extends Connector
A specialized abstract Connector class that is readable and can never update content. The connector always
throws DocumentStoreExceptions whenever it is asked to store,
update, or remove documents. Thus, do not subclass if
your custom connector can sometimes modify content.
| Methods inherited from class org.modeshape.jcr.federation.spi.Connector |
checkFieldNotNull, extraPropertiesFor, extraPropertiesStore, factories, getBinaryValue, getCacheTtlSeconds, getChildReference, getContext, getDocumentById, getDocumentId, getLogger, getMimeTypeDetector, getRepositoryName, getSourceName, getTransactionManager, hasDocument, initialize, isQueryable, nameFrom, nameFrom, nameFrom, newChildReference, newDocument, newPageDocument, propertyFactory, readDocument, setExtraPropertiesStore, shutdown, translator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadOnlyConnector
public ReadOnlyConnector()
removeDocument
public final boolean removeDocument(String id)
- Description copied from class:
Connector
- Removes the document with the given id.
- Specified by:
removeDocument in class Connector
- Parameters:
id - a non-null string.
- Returns:
- true if the document was removed, or false if there was no document with the given id
storeDocument
public final void storeDocument(Document document)
- Description copied from class:
Connector
- Stores the given document.
- Specified by:
storeDocument in class Connector
- Parameters:
document - a non-null Document instance.
updateDocument
public final void updateDocument(DocumentChanges documentChanges)
- Description copied from class:
Connector
- Updates a document using the provided changes.
- Specified by:
updateDocument in class Connector
- Parameters:
documentChanges - a non-null DocumentChanges object which contains
granular information about all the changes.
newDocumentId
public String newDocumentId(String parentId,
Name newDocumentName)
- Description copied from class:
Connector
- Generates an identifier which will be assigned when a new document (aka. child) is created under an existing document (aka.parent).
This method should be implemented only by connectors which support writing.
- Specified by:
newDocumentId in class Connector
- Parameters:
parentId - a non-null String which represents the identifier of the parent under which the new document
will be created.newDocumentName - a non-null Name which represents the name that will be given to the child document
- Returns:
- either a
non-null String which will be assigned as the new identifier, or null which means
that no "special" id format is required. In this last case, the repository will auto-generate a random id.
Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.