public abstract class ReadOnlyConnector extends Connector
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.Connector.ExtraProperties| Constructor and Description |
|---|
ReadOnlyConnector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isReadonly()
Indicates if the connector instance has been configured in read-only mode.
|
String |
newDocumentId(String parentId,
Name newDocumentName,
Name newDocumentPrimaryType)
Generates an identifier which will be assigned when a new document (aka. child) is created under an existing document
(aka.parent).
|
boolean |
removeDocument(String id)
Removes the document with the given id.
|
void |
storeDocument(Document document)
Stores the given document.
|
void |
updateDocument(DocumentChanges documentChanges)
Updates a document using the provided changes.
|
checkFieldNotNull, extraPropertiesFor, extraPropertiesStore, factories, getBinaryValue, getCacheTtlSeconds, getChildReference, getContext, getDocumentById, getDocumentId, getDocumentPathsById, getEnvironment, getLogger, getMimeTypeDetector, getRepositoryName, getSourceName, getTransactionManager, hasDocument, initialize, isQueryable, log, nameFrom, nameFrom, nameFrom, newChildReference, newConnectorChangedSet, newDocument, newPageDocument, pathFactory, pathFrom, pathFrom, propertyFactory, readDocument, setExtraPropertiesStore, shutdown, translator, writeDocumentpublic final boolean removeDocument(String id)
ConnectorremoveDocument in class Connectorid - a non-null string.public final void storeDocument(Document document)
ConnectorstoreDocument in class Connectordocument - a non-null Document instance.public final void updateDocument(DocumentChanges documentChanges)
ConnectorupdateDocument in class ConnectordocumentChanges - a non-null DocumentChanges object which contains
granular information about all the changes.public String newDocumentId(String parentId, Name newDocumentName, Name newDocumentPrimaryType)
ConnectornewDocumentId in class ConnectorparentId - 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 documentnewDocumentPrimaryType - a non-null Name which represents the child document's
primary type.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.public boolean isReadonly()
ConnectorisReadonly in class Connectortrue if the connector has been configured in read-only mode, false otherwise.Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.