Ontimize Document Management 0.035EN

com.ontimize.dms.jcr
Interface JcrVersion

All Superinterfaces:
JcrWrapper, JcrWrapperProperty
All Known Implementing Classes:
JcrVersionBase

public interface JcrVersion
extends JcrWrapperProperty

Handle node stream versions.

Since:
13/01/2009, 14/01/2009 Implementation., 15/01/2009 Node version with creation date., 27/03/2009 Refactoring. Insert file stream in a subnode., 17/06/2009 List method of a node version., 14/10/2010 Added internal alias map and node manager., 25/10/2010 Remove duplicates and nulls in list and size methods.

Method Summary
 Node getNode(java.lang.Number version)
          Searchs in current node the version node in the version history.
 JcrStream getStream(java.lang.Number version)
          Returns the saved stream in the version node.
 JcrStream getStream(java.lang.Number version, boolean data)
          Returns the saved stream in the version node.
 java.lang.Number last()
          Searchs in node version history the last version ID.
 EntityResult list(java.lang.Number version, java.util.List keys, java.util.Map alias)
          Version information on the current node.
 java.lang.Number next()
          Calculates the next version ID.
 JcrNode remove(java.lang.Number version)
          Removes a existing version of the current node, or current node if version is null.
 java.lang.Number size()
          Count saved versions on this node.
 
Methods inherited from interface com.ontimize.dms.jcr.JcrWrapperProperty
getProperty, hasProperty, setProperty
 
Methods inherited from interface com.ontimize.dms.jcr.JcrWrapper
getInnerSession, getInternal, getSession, getWrapper, save
 

Method Detail

getNode

Node getNode(java.lang.Number version)
             throws RepositoryException

Searchs in current node the version node in the version history.

Parameters:
version - Version number ID
Returns:
Node version if found.
If node version ID is invalid, returns null.
If node is a directory, returns null.
If version is null, returns the base node.
Throws:
RepositoryException - if JCR exception ocurrs.

getStream

JcrStream getStream(java.lang.Number version)
                    throws RepositoryException

Returns the saved stream in the version node.

Parameters:
version - Version number ID.
Returns:
Stream handler for selected version node.
Stream handler for root version if version is null.
Throws:
RepositoryException - if JCR exception ocurrs.

getStream

JcrStream getStream(java.lang.Number version,
                    boolean data)
                    throws RepositoryException

Returns the saved stream in the version node.

Parameters:
version - Version number ID.
data - True returns the stream data and related properties.
False to return the stream related properties.
Returns:
Stream handler for selected version node.
Stream handler for root version if version is null.
Throws:
RepositoryException - if JCR exception ocurrs.

list

EntityResult list(java.lang.Number version,
                  java.util.List keys,
                  java.util.Map alias)
                  throws RepositoryException

Version information on the current node.

alias Map can be null.

Parameters:
version - Version number ID.
keys - List with keys to return.
alias - Map with keys conversion rules.
Returns:
ResultEntidad with version information.
Throws:
RepositoryException - if JCR exception ocurrs.

last

java.lang.Number last()
                      throws RepositoryException

Searchs in node version history the last version ID.

Parameters:
node - Where to search the version ID.
Returns:
Number with the last ID in the version history.
Throws:
RepositoryException - if JCR exception ocurrs.

next

java.lang.Number next()
                      throws RepositoryException

Calculates the next version ID. Searchs the last saved ID and increments a unit.

Returns:
Number with the last ID in the version history.
Throws:
RepositoryException

size

java.lang.Number size()
                      throws RepositoryException

Count saved versions on this node.

Returns:
Number of saved versions of this node.
Throws:
RepositoryException - if JCR exception ocurrs.

remove

JcrNode remove(java.lang.Number version)
               throws LockException,
                      RepositoryException

Removes a existing version of the current node, or current node if version is null.

Parameters:
version - To delete.
Returns:
Current node
Throws:
LockException - if the current node is locked.
RepositoryException - if JCR exception ocurrs.

Ontimize Document Management