|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface XNodeRevisionManager
XNodeRevisionManager is an interface providing revision control manager features for XNode 1.2.
The XNode API (the package org.purl.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.
This adds a new, optional element <xnode:Repository> to the document, which contains zero or more <xnode:Revision> elements, each containing the metadata and document content of a single revision.
Given that the revision control features are optional, apart from bug fixes XNode 1.1 documents are nominally valid in XNode 1.2.
| Field Summary | |
|---|---|
static int |
REV_LIMIT_ACTION_DELETE
The enumerated constant used to indicate that upon exceeding a revision limit, the revision manager should delete the revisions exceeding the limit according to an acceptable metric, usually age. |
static int |
REV_LIMIT_ACTION_WARN
The enumerated constant used to indicate that upon exceeding a revision limit, the revision manager should emit a warning. |
| Method Summary | |
|---|---|
XNodeRevision |
createRevision(String cid,
String nid,
boolean write)
Generate a new revision by creating a new XNodeRevision using the current document and metadata content of the specified XNode. |
XNodeRevision |
createRevision(XNode xnode)
Create a new revision by copying the current document and metadata content of the specified XNode to its repository. |
XNodeRevision |
createRevision(XNodeID xid,
boolean write)
Generate a new revision by creating a new XNodeRevision using the current document and metadata content of the specified XNode. |
boolean |
deleteRevision(XNodeRevision revision)
Delete the provided revision from its parent XNode. |
int |
deleteRevisions(List revisions)
Delete the List of revisions from their parent XNode(s). |
boolean |
exceedsRevisionCountLimit(XNode xnode)
Returns true if the provided XNode exceeds the set revision count limit. |
boolean |
exceedsRevisionSpaceLimit(XNode xnode)
Returns true if the provided XNode exceeds the set revision space limit. |
List |
getAllRevisions(XNode xnode)
Returns a List containing all revisions of the provided XNode. |
String |
getDisplayableRevisionDateOf(XNodeRevision revision)
Returns a display version of the revision date of the XNodeRevision. |
Object |
getProperty(XNode xnode,
String name,
int version)
Return a metadata property by name for a specified revision. |
XNodeRevision |
getRevision(String cid,
String nid,
int version)
Return a specific revision version of the specified XNode, document nid of Collection cid. |
XNodeRevision |
getRevision(XNode xnode,
int version)
Return a specific revision version of the specified XNode, document nid of Collection cid. |
int |
getRevisionCount(XNode xnode)
Return the count of available revisions for the provided XNode. |
int |
getRevisionCountLimit()
Returns the revision count limit, i.e., the maximum number of revisions. |
int[] |
getRevisionIndex(XNode xnode)
Return an ordered array of all revision numbers. |
List |
getRevisions(XNode xnode,
int[] versions)
Returns a List containing the specified revisions of the provided XNode. |
List |
getRevisionsBefore(XNode xnode,
Date date)
Returns a List containing the revisions prior to the provided Date. |
int |
getRevisionSize(XNode xnode,
int version)
Return the stored size in characters of the specified revision of the provided XNode. |
int |
getRevisionSpaceLimit()
Returns the revision space limit (in KB), i.e., the maximum space used by stored revisions. |
XNode |
getXNodeFromRevision(XNode xnode,
int version)
Recreates an XNode provided one of its version numbers. |
XNodeRevision |
recreateRevision(XNode xnode,
int version)
Recreate an existing revision from the specified XNode's repository. |
int |
restoreRevision(XNodeRevision revision)
Restore the provided XNodeRevision as a replacement for its parent XNode. |
void |
setRevisionCountLimit(int limit)
Sets the revision count limit (units: revision) to limit. |
void |
setRevisionSpaceLimit(int limit)
Sets the revision space limit (units: KB) to limit. |
| Field Detail |
|---|
static final int REV_LIMIT_ACTION_WARN
static final int REV_LIMIT_ACTION_DELETE
| Method Detail |
|---|
XNode getXNodeFromRevision(XNode xnode,
int version)
xnode - the XNode to be queried.version - the revision number.
XNodeRevision createRevision(String cid,
String nid,
boolean write)
throws XNodeException
cid - the Collection ID String.nid - the Node ID String.write - if true, writes the updated XNode to the database.
XNodeException - if the XNode does not exist, or the process fails for any reason
XNodeRevision createRevision(XNodeID xid,
boolean write)
throws XNodeException
xid - the XNodeID specifying an XNode.write - if true, writes the updated XNode to the database.
XNodeException - if the XNode does not exist, or the process fails for any reason
XNodeRevision createRevision(XNode xnode)
throws XNodeException
xnode - the XNode to process.
XNodeException - if the process fails for any reason.
XNodeRevision recreateRevision(XNode xnode,
int version)
throws XNodeException
xnode - the parent XNode to process.version - the XNodeRevision to recreate.
XNodeException - if the process fails for any reason.
int restoreRevision(XNodeRevision revision)
throws XNodeException
revision - the XNodeRevision to restore.
XNodeException - if the restoration fails.
boolean deleteRevision(XNodeRevision revision)
throws XNodeException
revision - the XNodeRevision to be deleted.
XNodeException - if the deletion fails for any reason.
int deleteRevisions(List revisions)
throws XNodeException
revisions - the List of XNodeRevisions to be deleted.
XNodeException - if the process fails for any reason.
int getRevisionCount(XNode xnode)
throws XNodeException
xnode - the parent XNode to process.
XNodeException - if the process fails for any reasonint getRevisionCountLimit()
void setRevisionCountLimit(int limit)
limit - the limit set, in count of revisions.boolean exceedsRevisionCountLimit(XNode xnode)
xnode - the XNode to process.
int getRevisionSize(XNode xnode,
int version)
throws XNodeException
xnode - the XNode to process.version - the XNodeRevision to recreate.
XNodeExceptionint getRevisionSpaceLimit()
void setRevisionSpaceLimit(int limit)
limit - the limit set, in KB.boolean exceedsRevisionSpaceLimit(XNode xnode)
xnode - the XNode to process.
int[] getRevisionIndex(XNode xnode)
throws XNodeException
xnode - the XNode to process.
XNodeException
List getRevisions(XNode xnode,
int[] versions)
throws XNodeException
xnode - the XNode to process.versions - the array of requested version numbers.
XNodeException - if there is a processing error.
XNodeRevision getRevision(String cid,
String nid,
int version)
throws XNodeException
cid - the Collection ID String.nid - the XNode ID String.
XNodeException - if the XNode does not exist, or the process fails for any reason
XNodeRevision getRevision(XNode xnode,
int version)
throws XNodeException
xnode - the XNode to be processed.version - the version number of the requested revision.
XNodeException - if the process fails for any reason.
List getAllRevisions(XNode xnode)
throws XNodeException
xnode - the XNode to process.
XNodeException - if there is a processing error.String getDisplayableRevisionDateOf(XNodeRevision revision)
revision - the XNodeRevision to be processed.
List getRevisionsBefore(XNode xnode,
Date date)
throws XNodeException
xnode - the XNode to be processed.date - the Date threshold.
XNodeException
Object getProperty(XNode xnode,
String name,
int version)
throws XNodeException
xnode - the XNode to be processed.name - the property name.version - the revision number.
XNodeException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||