com.arsdigita.versioning
Class Versions

java.lang.Object
  extended bycom.arsdigita.versioning.Versions

public final class Versions
extends Object

This class provides methods for rolling back to a previous point in the versioning log.

Version:
$Revision: #31 $ $DateTime: 2004/04/07 16:07:11 $
Author:
Joseph A. Bank (jbank@alum.mit.edu), Stanislav Freidin, Vadim Nasardinov (vadimn@redhat.com)

Field Summary
static EventProcessorManager EPM
          This should be considered an implementation detail that is subject to change.
static VersioningMetadata.NodeVisitor NODE_VISITOR
          This should be considered an implementation detail that is subject to change.
 
Method Summary
static Difference diff(OID oid, BigInteger fromID, BigInteger toID)
           
static Difference diff(OID oid, Transaction from, Transaction to)
           
static Audited getAuditInfo(OID oid)
          Returns the audit info for the data object identified by oid.
static BigInteger getMostRecentTxnID(OID oid, String tag)
          Returns the most recent versioning txn id for this oid that has been tagged with tag.
static TransactionCollection getTaggedTransactions(OID oid)
           
static TransactionCollection getTaggedTransactions(OID oid, boolean down)
           
static void resumeVersioning()
          Resumes the recording of changes to versioned data objects within the current transaction.
static DataObject rollback(OID oid, BigInteger txnID)
          Rolls back the versioned data object specified by oid to an earlier state specified by the changeID and returns the rolled back data object.
static void suspendVersioning()
          Suspends the recording of changes to versioned data objects within the current transaction.
static void tag(OID oid, String tag)
          Tags changes made in the current session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_VISITOR

public static final VersioningMetadata.NodeVisitor NODE_VISITOR
This should be considered an implementation detail that is subject to change.


EPM

public static final EventProcessorManager EPM
This should be considered an implementation detail that is subject to change.

Method Detail

tag

public static void tag(OID oid,
                       String tag)
Tags changes made in the current session.

Parameters:
tag - a short string identifying the set of changes made in the current session.

suspendVersioning

public static void suspendVersioning()
                              throws VersioningException

Suspends the recording of changes to versioned data objects within the current transaction. All changes made after this call will be discarded. All pending tags will be applied.

Throws:
VersioningException - if there are unflushable pending events
See Also:
resumeVersioning()

resumeVersioning

public static void resumeVersioning()
                             throws VersioningException

Resumes the recording of changes to versioned data objects within the current transaction.

Throws:
VersioningException - if there are unflushable pending events
See Also:
suspendVersioning()

getMostRecentTxnID

public static BigInteger getMostRecentTxnID(OID oid,
                                            String tag)
Returns the most recent versioning txn id for this oid that has been tagged with tag.


getTaggedTransactions

public static TransactionCollection getTaggedTransactions(OID oid,
                                                          boolean down)

getTaggedTransactions

public static TransactionCollection getTaggedTransactions(OID oid)

diff

public static Difference diff(OID oid,
                              BigInteger fromID,
                              BigInteger toID)

diff

public static Difference diff(OID oid,
                              Transaction from,
                              Transaction to)

rollback

public static DataObject rollback(OID oid,
                                  BigInteger txnID)
Rolls back the versioned data object specified by oid to an earlier state specified by the changeID and returns the rolled back data object.

The resulting rolled back data objects are not explicitly saved. Unless you choose to call save() explicitly in your own code after rollback, the rolled back objects will be saved implicitly when the transaction is committed.


getAuditInfo

public static Audited getAuditInfo(OID oid)

Returns the audit info for the data object identified by oid. May return null if no auditing info can be found for the specified oid.



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC