public abstract class ReadOnlyConnector extends Connector
Connector
class that is readable and can never update content. The connector always
throws DocumentStoreException
s whenever it is asked to store
,
update
, or remove
documents. Thus, do not subclass if
your custom connector can sometimes modify content.Connector.ExtraProperties
DEFAULT_ROOT_ID
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, getChildReference, getContext, getDocumentById, getDocumentId, getDocumentPathsById, getEnvironment, getLogger, getMimeTypeDetector, getRepositoryName, getRootDocumentId, getSourceName, getTransactionManager, hasDocument, initialize, isCacheable, isQueryable, log, moveExtraProperties, nameFrom, nameFrom, nameFrom, newChildReference, newConnectorChangedSet, newDocument, newPageDocument, pathFactory, pathFrom, pathFrom, propertyFactory, readDocument, setExtraPropertiesStore, shutdown, translator, writeDocument
public final boolean removeDocument(String id)
Connector
removeDocument
in class Connector
id
- a non-null
string.public final void storeDocument(Document document)
Connector
storeDocument
in class Connector
document
- a non-null
Document
instance.public final void updateDocument(DocumentChanges documentChanges)
Connector
updateDocument
in class Connector
documentChanges
- a non-null
DocumentChanges
object which contains granular information about all the
changes.public String newDocumentId(String parentId, Name newDocumentName, Name newDocumentPrimaryType)
Connector
newDocumentId
in class Connector
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 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()
Connector
isReadonly
in class Connector
true
if the connector has been configured in read-only mode, false otherwise.Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.