|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.xnode.XNodeStoreImpl
public class XNodeStoreImpl
Provides an implementation of the XNodeStore API as a database manager for XNode (XML Node) content. This class currently uses either a Berkeley DB JE or file system-based backend store (the former is the default).
The XNode Implementation (the package org.ceryle.xnode.*, both its source code and documentation), are released under the Apache 2.0 License. For more details, check the LICENSE file contained with the distribution, or see The Ceryle Project for more information. It is distributed with no warranty.
Individual XNodes are stored in XNodeCollections, which are in turn
stored in a root XNodeCollection. The createCollection(String,boolean)
method is used to create all but the root collection, which is lazily
created using the getRootCollection() method (and may be called
repeatedly, as it simply returns the existing root collection once created).
SetModel,
a class that implements a variety of List, Set and UI APIs, backed by a
Vector. Throughout the implementation this object gets cast as per need,
and ideally the XNode API would include SetModel, but in the interests of
it not being tied to Ceryle the getCollectionIndex() method just
returns a List. This is admittedly a bit messy.
See notes at bottom of code for version details.
| Field Summary | |
|---|---|
static String |
DATABASE_STORAGE
The System property name for the XNode database storage path. |
static String |
DEFAULT_XNODESTORE_PROVIDER
The class name of the default implementation for the XNodeStoreProvider. |
static String |
ENCODING
The character encoding used by all Database content ("UTF-8"). |
protected static String |
m_rootURI
A String containing the URL of the default root collection. |
static String |
privateCollectionName
The String constant used as the name of the private (Ceryle) Collection ("_private"). |
static String |
PROPERTY_XNODESTORE_PROVIDER
The XNode property name for the XNodeStoreProvider implementation class name. |
static String |
READ_ONLY
The System property name for the XNode database read only flag. |
static String |
SAFE_OVERWRITE_MODE
The System property name for the XNode database safe overwrite mode. |
static String |
USE_CACHE
The System property name for the XNode database use cache flag. |
static String |
USE_CHANGE_CACHE
The System property name for the XNode database use change cache flag. |
static String |
USE_REVISION_CONTROL
The System property name for the XNode database use revision control flag. |
static String |
XNODE_DEFAULT_STORAGE
The default value for the Ceryle database storage path. |
static String |
XNODE_HOME_DIRECTORY
The System property name for the XNode application installation directory. |
static String |
XNODESTORE_PROVIDER
The System property name for the XNodeStoreProvider implementation class name. |
| Fields inherited from interface org.purl.xnode.XNodeStore |
|---|
ALL_COLLECTIONS, DATABASE_ROOT, FEATURE_COPY_MOVE, XNODE_DEFAULT_ROOT, XNODE_PROTOCOL |
| Constructor Summary | |
|---|---|
XNodeStoreImpl(MessageHandler messagehandler,
XMLProcessor xmlprocessor)
Constructor provided with a MessageHandler and a well-formed XML Processor. |
|
| Method Summary | |
|---|---|
XNode |
addXNode(String cid,
String nid,
Node node)
Insert a new XNode with ID nid and DOM Node node content into the XNodeCollection with ID cid. |
XNode |
addXNode(String cid,
String nid,
String content)
Insert a new XNode with ID nid whose content is the String content, into the XNodeCollection with ID cid. |
void |
addXNodeStoreListener(XNodeStoreListener listener)
Adds listener as a listener for changes to the XNodeStore. |
boolean |
canOptimize()
Returns true if the current provider is capable of optimization. |
boolean |
closeCollection(String cid)
Close an existing XNodeCollection cid. |
void |
closeDatabase(XNodeCollection collection)
Close the XNodeCollection's database. |
void |
connect(String root,
String driver,
int timeout)
Make a database connection to the XNodeCollection root and establish service, using timeout as the maximum number of seconds to wait for the collection manager to open before abandoning. |
void |
copyXNode(String scid,
String snid,
String dcid,
String dnid,
boolean move,
boolean overwrite)
Copy the XNode with ID snid from Collection scid to XNode nid in the Collection ID cid. |
void |
copyXNode(XNodeID xids,
XNodeID xidd,
boolean move,
boolean overwrite)
Copy the XNode with XNodeID xids to XNodeID xidd. |
XNodeCollection |
createCollection(String cid,
boolean overwrite)
Create (or recreate, if it already exists) an XNodeCollection identified by cid. |
XNode |
createRevision(String cid,
String nid)
Creates a revision of the specified XNode, storing it internal to the XNode. |
XNode |
createRevision(XNode xnode)
Creates a revision of the provided XNode, storing it internal to the XNode. |
XNode |
createRevision(XNodeID xid)
Creates a revision of the specified XNode, storing it internal to the XNode. |
XNode |
createXNode(String nid,
Node node)
Returns an XNode provided a DOM Node node. |
void |
deleteCollection(String cid)
Delete an existing XML database XNodeCollection cid. |
protected void |
deleteContent(String did,
String rid)
Essential access to org.purl.xnode.XNodeProvider#deleteContent(String,String). |
void |
deleteXNode(String cid,
String nid)
Delete the XNode identified by ID nid from the XNodeCollection cid. |
void |
deleteXNode(XNodeID xid)
Delete the XNode identified by the XNodeID xid. |
void |
disconnect()
Disconnect any connection to the root XNodeCollection and close down all services. |
protected void |
fireXNodeStoreEvent(XNodeState state,
String cid,
String nid)
Notify all listeners having a registered interest in change events occurring in this XNodeStore. |
Clock |
getClock()
Returns the Clock used to provide timestamps. |
XNodeCollection |
getCollection(String cid)
Load and return an existing XML database XNodeCollection cid, returning null if a matching XNodeCollection does not exist. |
List |
getCollectionIndex()
Returns a List view of the collection index, as provided by the root collection. |
String |
getCollectionMetadata(String cid,
String name)
Return the value of the XNodeCollection metadata property name for the XNodeCollection whose ID is cid, null if it has not been set. |
protected String |
getContent(String did,
String rid)
Essential access to org.purl.xnode.XNodeProvider#getContent(String,String). |
int |
getContentSize(String did,
String rid)
Essential access to org.purl.xnode.XNodeProvider#getContentSize(String,String). |
String |
getDatabaseURI(String cid,
String nid)
Returns a URI-like String representing the Collection ID cid and Node ID id using the currently available database (if DB services are unavailable, returns null). |
String |
getDatabaseURI(XNodeID xid)
Returns a URI-like String representing the XNodeID xid using using the currently available database (if DB services are unavailable, returns null). |
List |
getIndex(String cid)
Return a List containing the index of XNode IDs within the XNodeCollection cid. |
MessageHandler |
getMessageHandler()
Returns the MessageHandler used by this XNodeStore. |
XNodeRevisionManager |
getRevisionManager()
Returns the XNodeRevisionManager for this XNodeStore, null if revision control is not active or supported. |
XNodeCollection |
getRootCollection()
Returns the lazily-created root XNodeCollection. |
String |
getRootURI()
Return the URL of the root XNodeCollection as a String. |
XNodeState |
getState()
Returns the state of this XNodeStore. |
float |
getStorageRatio()
Non-essential access to BerkeleyDBProvider.getStorageRatio(). |
Document |
getTextDocument()
Returns a blank Document containing a <xnode:Text> Element wrapping an empty CDATA section. |
XMLProcessor |
getXMLProcessor()
Returns the XMLProcessor used by this XNodeStore. |
XNode |
getXNode(String cid,
String nid)
Retrieves an XNode with ID nid from XNodeCollection with ID cid, or null if unable to retrieve. |
XNode |
getXNode(XNodeID xid)
Retrieves an XNode specified via the XNodeID xid, or null if unable to retrieve. |
XNodeCollectionFactory |
getXNodeCollectionFactory()
Returns a lazily-instantiated XNodeCollectionFactory. |
Node |
getXNodeContent(XNode xnode)
Returns the DOM Node node envelope provided an XNode. |
Node |
getXNodeContent(XNodeID xid)
Returns the DOM Node node envelope provided an XNodeID. |
XNodeFactory |
getXNodeFactory()
Returns a lazily-instantiated XNodeFactory. |
XNodeStoreChangeCache |
getXNodeStoreChangeCache()
Returns the XNodeStore's change cache if available. |
Set |
getXNodeStoreListeners()
Return a Set containing the XNodeStoreListeners of the XNodeStore. |
boolean |
hasCollection(String cid)
Returns true if there is a record of an XNodeCollection ID matching cid and the XNodeCollection object exists in the root cache. |
boolean |
hasCollectionID(String cid)
Returns true if there is a record of an XNodeCollection ID matching cid in the metadata of the root collection. |
boolean |
hasXNode(String cid,
String nid)
Returns true if an XNode with ID nid from XNodeCollection with ID cid exists, false if not. |
boolean |
hasXNode(XNodeID xid)
Returns true if an XNode matching the XNodeID xid exists, false if not. |
boolean |
isConnected()
Returns true if the database is running and its service is available. |
boolean |
isReadOnly()
Returns true if the database is in a read only state. |
boolean |
isRevisionControlActive()
Returns true if the revision control features are active. |
XNode |
modifyXNode(String cid,
String nid,
Node node)
Modify an XNode with ID nid in the XNodeCollection cid, replacing its content with the DOM Node node, returning the modified XNode. |
XNode |
modifyXNode(String cid,
String nid,
String content)
Modify an XNode with ID nid in XNodeCollection cid, replacing its contents with the contents of the String content, returning the modified XNode. |
XNode |
modifyXNode(XNodeID xid,
Node node)
Modify an XNode with XNodeID xid, replacing its content with the DOM Node node, returning the modified XNode. |
void |
optimize(ActionListener listener)
Non-essential access to BerkeleyDBProvider.optimize(ActionListener). |
XNode |
recreateXNode(Node node)
Returns an XNode provided a DOM Node node, assuming the provided node's content is a serialization of an XNode (some minor validation will necessarily occur). |
void |
removeXNodeStoreListener(XNodeStoreListener listener)
Removes listener from the XNodeStore. |
void |
setCachingEnabled(boolean enabled)
Sets the document caching features on or off. |
void |
setCollectionMetadata(String cid,
String name,
String value)
Set a metadata property of XNodeCollection metadata (a name-value pair) for the XNodeCollection whose ID is cid. |
protected void |
setProperties()
Called upon instantiation of the class, this method establishes the XNodeStore properties. |
void |
setReadOnly(boolean readOnly)
Sets the database to a read only state when the parameter is true. |
void |
setRevisionControlEnabled(boolean enabled)
Sets the revision control features on or off. |
void |
setState(XNodeState state)
Sets the state of this XNodeStore to the XNodeState state. |
void |
setXNodeMetadata(XNode xnode,
Document doc,
Map metadata)
Sets various XNode metadata based upon application and Document information, including content type and the DOCTYPE declaration's name and identifiers. |
void |
setXNodeMetadata(XNode xnode,
Document doc,
String title,
String systemId,
String source,
String mimetype)
Sets a subset of the XNode metadata based upon application and Document information, including content type and the DOCTYPE declaration's name and identifiers. |
void |
setXNodeProperties(XNode xnode,
Map properties)
For an XNode with ID nid in XNodeCollection cid, set the named properties provided by the key-value pairs found in the Map properties. |
void |
setXNodeProperty(XNode xnode,
String name,
String value)
For an XNode with ID nid in XNodeCollection cid, set the named property name whose value is the String value. |
void |
start()
Start the database service. |
void |
stop()
Shuts down the database service. |
boolean |
touch(String cid,
XNode xnode)
Touches (updates the modification date of) the XNode xnode in the XNodeCollection cid and if the XNode exists, sets the state to XNode.NODE_MODIFY. |
String |
toURI(XNodeID xid)
Returns a URI representation of the XNodeID xid based on the root database URI, eg., ""xnode://db/cid/nid". |
XNode |
writeXNode(String cid,
XNode xnode)
Write the XNode xnode to the XNodeCollection cid. |
protected void |
writeXNodeToDatabase(XNode xnode,
XNodeCollection collection,
boolean overwrite)
Essential access to org.purl.xnode.XNodeProvider#writeXNodeToDatabase(XNode,XNodeCollection,boolean). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String XNODESTORE_PROVIDER
public static final String PROPERTY_XNODESTORE_PROVIDER
XNODESTORE_PROVIDER prefixed with
Ceryle's property base URI Constants.CERYLE_PROP.
The value is "http://purl.org/ceryle/prop/#xnode.database.provider".
public static final String DEFAULT_XNODESTORE_PROVIDER
public static final String XNODE_HOME_DIRECTORY
public static final String DATABASE_STORAGE
public static final String USE_CHANGE_CACHE
public static final String USE_CACHE
public static final String READ_ONLY
public static final String USE_REVISION_CONTROL
public static final String SAFE_OVERWRITE_MODE
public static final String privateCollectionName
public static final String XNODE_DEFAULT_STORAGE
public static final String ENCODING
protected static String m_rootURI
| Constructor Detail |
|---|
public XNodeStoreImpl(MessageHandler messagehandler,
XMLProcessor xmlprocessor)
throws XNodeException
messagehandler - provides message services.xmlprocessor - provides XML parsing/processing services.
XNodeException - if unable to instantiate the class.| Method Detail |
|---|
protected void setProperties()
throws XNodeException
XNodeException - if the database directory doesn't exist or can't be read.public XNodeStoreChangeCache getXNodeStoreChangeCache()
This is not an XNode API method.
public void start()
throws XNodeException
start in interface XNodeStoreXNodeException - if unable to open the database.
public void stop()
throws XNodeException
stop in interface XNodeStoreXNodeException - if an error occurs while stopping the database.
public List getCollectionIndex()
throws XNodeException
getCollectionIndex in interface XNodeStoreXNodeException - if unable to provide the List.public boolean hasCollection(String cid)
IMPORTANT:
This is an indication of the existence of the XNodeCollection in the
root collection cache, not simply its ID occurring in the index
(which is the answer returned from getCollectionIndex().
hasCollection in interface XNodeStorecid - the XNodeCollection ID String.
public boolean hasCollectionID(String cid)
This is not an XNode API method.
cid - the XNodeCollection ID String.
public void setCachingEnabled(boolean enabled)
public void setRevisionControlEnabled(boolean enabled)
public boolean isRevisionControlActive()
(This is an XNode API method)
isRevisionControlActive in interface XNodeStorepublic void setReadOnly(boolean readOnly)
public boolean isReadOnly()
public XNodeFactory getXNodeFactory()
getXNodeFactory in interface XNodeStorepublic XNodeCollectionFactory getXNodeCollectionFactory()
getXNodeCollectionFactory in interface XNodeStorepublic boolean isConnected()
(This is an XNode API method)
isConnected in interface XNodeStore
public XNodeCollection getRootCollection()
throws XNodeException
(This is an XNode API method)
getRootCollection in interface XNodeStoreXNodeException
public XNodeCollection createCollection(String cid,
boolean overwrite)
throws XNodeException
(This is an XNode API method)
createCollection in interface XNodeStorecid - the XNodeCollection ID String.overwrite - when true allows overwriting of an existing XNodeCollection.
XNodeException - if unable to create the XNodeCollection
public XNodeCollection getCollection(String cid)
throws XNodeException
(This is an XNode API method)
getCollection in interface XNodeStorecid - the XNodeCollection ID String.
XNodeException - if unable to locate the XNodeCollection
public List getIndex(String cid)
throws XNodeException
(This is an XNode API method)
getIndex in interface XNodeStorecid - the XNodeCollection ID String.
XNodeException - if the XNodeCollection ID is invalid or the XNodeCollection(s) did not exist.
public boolean closeCollection(String cid)
throws XNodeException
(This is an XNode API method)
closeCollection in interface XNodeStorecid - the XNodeCollection ID String.
XNodeException - if the XNodeCollection ID is invalid or the XNodeCollection(s) did not exist.XNodeState
public void closeDatabase(XNodeCollection collection)
throws XNodeException
This is not an XNode API method.
XNodeException - if an error occurs during closing of the Database.
public void deleteCollection(String cid)
throws XNodeException
(This is an XNode API method)
deleteCollection in interface XNodeStorecid - the XNodeCollection ID String.
XNodeException - if the XNodeCollection ID is invalid, the XNodeCollection(s)
did not exist, or an error occurred.
public void setCollectionMetadata(String cid,
String name,
String value)
throws XNodeException
setCollectionMetadata in interface XNodeStoreXNodeException
public String getCollectionMetadata(String cid,
String name)
throws XNodeException
getCollectionMetadata in interface XNodeStoreXNodeExceptionpublic boolean hasXNode(XNodeID xid)
(This is an XNode API method)
hasXNode in interface XNodeStorexid - the XNodeID.
public boolean hasXNode(String cid,
String nid)
throws XNodeException
(This is an XNode API method)
hasXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the XNode ID String.
XNodeException - if either ID is invalid.
public XNode getXNode(String cid,
String nid)
throws XNodeException
(This is an XNode API method)
getXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the XNode ID String.
XNodeException - if the XNodeCollection is unavailable or either ID is invalid.
public XNode getXNode(XNodeID xid)
throws XNodeException
(This is an XNode API method)
getXNode in interface XNodeStorexid - the XNodeID.
XNodeException - if an error occurs retrieving the XNodeCollection or XNode.
public Node getXNodeContent(XNodeID xid)
throws XNodeException
This is not an XNode API method.
xid - the XNodeID of the XNode to be processed
XNodeException - if an error occurs during recreation.
public Node getXNodeContent(XNode xnode)
throws XNodeException
(This is an XNode API method)
getXNodeContent in interface XNodeStorexnode - the XNode to be processed
XNodeException - if an error occurs during recreation.
public XNode addXNode(String cid,
String nid,
String content)
throws XNodeException
Note: This method implies that the supplied content String be well-formed XML, as it will by necessity be parsed into a DOM Node. This is a convenience class for those unwilling to parse their own content, the downside being that if the content is not well-formed, an exception is thrown and nothing gets stored. Of course, if the content isn't well-formed, it has to be fixed anyway (unless one wants to store it as text/plain by wrapping it in a CDATA section).
(This is an XNode API method)
addXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the ID String of the stored XNode.content - the String content to be parsed into a DOM Node.
XNodeException - if unable to add the XNode to the XNodeCollection.
public XNode addXNode(String cid,
String nid,
Node node)
throws XNodeException
(This is an XNode API method)
addXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the ID String for the stored XNode.node - the DOM Node content.
XNodeException - if unable to add the XNode to the XNodeCollection.
public XNode modifyXNode(String cid,
String nid,
String content)
throws XNodeException
(This is an XNode API method)
modifyXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the ID String of the stored XNode.content - the String content to be parsed into a DOM Node.
XNodeException - if unable to add the XNode to the XNodeCollection.
public XNode modifyXNode(String cid,
String nid,
Node node)
throws XNodeException
(This is an XNode API method)
modifyXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the ID String for the stored XNode.node - the new DOM Node content.
XNodeException - if unable to add the XNode to the XNodeCollection.
public XNode modifyXNode(XNodeID xid,
Node node)
throws XNodeException
(This is an XNode API method)
modifyXNode in interface XNodeStorexid - the XNode identifier.node - the new DOM Node content.
XNodeException - if unable to add the XNode to the XNodeCollection.public Clock getClock()
This is not an XNode API method.
public XNode writeXNode(String cid,
XNode xnode)
throws XNodeException
This method is generally used to set metadata on an existing XNode, so document-level metadata (e.g., creation or modification timestamps) are not altered by this method — this just writes the XNode to the XNodeCollection.
(This is an XNode API method)
writeXNode in interface XNodeStorecid - the XNodeCollection ID Stringxnode - the XNode to be written.
XNodeException - if unable to add the XNode to the XNodeCollection.
public int getContentSize(String did,
String rid)
org.purl.xnode.XNodeProvider#getContentSize(String,String).
protected String getContent(String did,
String rid)
throws XNodeException
org.purl.xnode.XNodeProvider#getContent(String,String).
XNodeException
protected void deleteContent(String did,
String rid)
throws XNodeException
org.purl.xnode.XNodeProvider#deleteContent(String,String).
XNodeException
protected void writeXNodeToDatabase(XNode xnode,
XNodeCollection collection,
boolean overwrite)
throws XNodeException
org.purl.xnode.XNodeProvider#writeXNodeToDatabase(XNode,XNodeCollection,boolean).
XNodeExceptionpublic float getStorageRatio()
BerkeleyDBProvider.getStorageRatio().
This is currently considered a temporary method.
public void optimize(ActionListener listener)
BerkeleyDBProvider.optimize(ActionListener).
This is currently considered a temporary method.
public boolean canOptimize()
public boolean touch(String cid,
XNode xnode)
throws XNodeException
NOTE: this is a temporary method.
This is not an XNode API method.
cid - the XNodeCollection ID Stringxnode - the XNode to be added
XNodeException - if unable to touch the XNode.
public XNode createXNode(String nid,
Node node)
throws XNodeException
recreateXNode(Node), the provided content does not
include the XNode; it is the content meant to be enclosed
in the envelope. The Node is optional; if not provided, an
empty XNode is returned.
The XNode is created but not written to the XNodeStore.
(This is an XNode API method)
createXNode in interface XNodeStorenode - the DOM Node to be used as the XNode source.nid - the ID String of the stored XNode.
XNodeException - if unable to recreate the XNode.
public XNode recreateXNode(Node node)
throws XNodeException
This is not an XNode API method.
node - the DOM Node to be used as the XNode source.
XNodeException - if unable to recreate the XNode.
public void deleteXNode(String cid,
String nid)
throws XNodeException
(This is an XNode API method)
deleteXNode in interface XNodeStorecid - the XNodeCollection ID String.nid - the XNode ID String.
XNodeException - if the XNodeCollection is unavailable, either ID is invalid, or otherwise unable to delete.
public void deleteXNode(XNodeID xid)
throws XNodeException
(This is an XNode API method)
deleteXNode in interface XNodeStorexid - the XNodeID identifier for the XNode.
XNodeException - if the XNode does not exist or otherwise unable to delete.
public void setXNodeProperty(XNode xnode,
String name,
String value)
throws XNodeException
Note: this only modifies the property of the supplied XNode and does not involve any transactions with the database, which must be performed separately.
(This is an XNode API method)
setXNodeProperty in interface XNodeStorexnode - the XNode to which the property is to be set.name - the name of the property.value - the value of the property.
XNodeException - if the XNode does not exist or the property is invalid.
public void setXNodeProperties(XNode xnode,
Map properties)
throws XNodeException
This also modifies the DOM Elements for these properties.
Note: this only modifies the properties of the supplied XNode and does not involve any transactions with the database, which must be performed separately.
(This is an XNode API method)
setXNodeProperties in interface XNodeStorexnode - the XNode to which the properties are to be set.properties - the Map containing the properties.
XNodeException - if the XNode does not exist or any of the properties are invalid.public String getRootURI()
(This is an XNode API method)
getRootURI in interface XNodeStorepublic Document getTextDocument()
public String getDatabaseURI(XNodeID xid)
(This is an XNode API method)
xid - the XNodeID
public String getDatabaseURI(String cid,
String nid)
(This is an XNode API method)
getDatabaseURI in interface XNodeStorecid - the collection ID.nid - the node ID.
public String toURI(XNodeID xid)
(This is an XNode API method)
toURI in interface XNodeStorexid - the XNodeID to convert to a URI.
public void setState(XNodeState state)
(This is an XNode API method)
state - an XNodeState indicating the processing state to be set.XNodeStatepublic XNodeState getState()
(This is an XNode API method)
getState in interface XNodeStoreXNodeState
public void setXNodeMetadata(XNode xnode,
Document doc,
String title,
String systemId,
String source,
String mimetype)
throws ProcessException
Three of the metadata fields are Dublin Core Metadata Terms: "title" (DC.title), "systemId" (DC.identifier), and "mimetype" (DC.format).
This is not an XNode API method.
xnode - the XNode in which the metadata is to be stored.doc - the source document used to obtain DOCTYPE informationtitle - the optional title of the source documentsystemId - the optional system identifier of the stored documentsource - the optional system identifier of the source documentmimetype - the optional MIME content type of the document
ProcessException - if an error occurs while setting metadata
public void setXNodeMetadata(XNode xnode,
Document doc,
Map metadata)
throws ProcessException
This is not an XNode API method.
xnode - the XNode in which the metadata is to be stored.doc - the source document used to obtain DOCTYPE informationmetadata - a Map containing name-value pairs
ProcessException - if an error occurs while setting metadatapublic Set getXNodeStoreListeners()
This is not an XNode API method.
public void addXNodeStoreListener(XNodeStoreListener listener)
(This is an XNode API method)
addXNodeStoreListener in interface XNodeStorelistener - the XNodeStoreListener to be addedXNodeStoreListenerpublic void removeXNodeStoreListener(XNodeStoreListener listener)
(This is an XNode API method)
removeXNodeStoreListener in interface XNodeStorelistener - the XNodeStoreListener to be removedXNodeStoreListener
protected void fireXNodeStoreEvent(XNodeState state,
String cid,
String nid)
public XNodeRevisionManager getRevisionManager()
getRevisionManager in interface XNodeStore
public XNode createRevision(String cid,
String nid)
throws XNodeException
getXNode(String,String).
createRevision in interface XNodeStorecid - the XNodeCollection ID String.nid - the XNode ID String.
XNodeException - if an error occurs in creating the revision.
public XNode createRevision(XNodeID xid)
throws XNodeException
createRevision in interface XNodeStorexid - the XNodeID specifying the XNode.
XNodeException - if an error occurs in creating the revision.
public XNode createRevision(XNode xnode)
throws XNodeException
createRevision in interface XNodeStorexnode - the XNode to process.
XNodeException - if an error occurs in creating the revision.
public void copyXNode(String scid,
String snid,
String dcid,
String dnid,
boolean move,
boolean overwrite)
throws XNodeException
copyXNode in interface XNodeStorescid - the source Collection ID.snid - the source XNode ID.dcid - the destination Collection ID.dnid - the destination XNode ID.move - when true, deletes the source XNodeoverwrite - when true, will overwrite any existing dcid/dnid
XNodeException - if the copy/move is not successful.
public void copyXNode(XNodeID xids,
XNodeID xidd,
boolean move,
boolean overwrite)
throws XNodeException
copyXNode in interface XNodeStorexids - the source XNodeID.xidd - the destination XNodeID.move - when true, deletes the source XNode.overwrite - when true, will overwrite any existing XNode.
XNodeException - if the copy/move is not successful.public MessageHandler getMessageHandler()
public XMLProcessor getXMLProcessor()
public void connect(String root,
String driver,
int timeout)
throws XNodeException
(This is an XNode API method)
This method is unimplemented due to this not being a client-server database, throwing an UnsupportedOperationException.
connect in interface XNodeStoreroot - the URI of the root XNodeCollection.driver - the driver identifier for the database providertimeout - time in seconds to wait before abandoning.
XNodeException - if unable to make the connection.
public void disconnect()
throws XNodeException
(This is an XNode API method)
This method is unimplemented due to this not being a client-server database, throwing an UnsupportedOperationException.
disconnect in interface XNodeStoreXNodeException - if an error occurs during this process.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||