wt.vc
Class VersionControlServiceEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.vc.VersionControlServiceEvent
All Implemented Interfaces:
Serializable

public class VersionControlServiceEvent
extends KeyedEvent
implements Serializable

Provides a service specific event extended from KeyedEvent used in conjunction with the standard implementation of the server-side functionality as defined by the VersionControlService interface. This event could also be used by a custom implementation of the VersionControlService.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private  Object auxEventData
           
private static String CLASSNAME
           
static String NEW_ITERATION
          A constant that defines an event marking the occurrance of the creation of an iteration, not version.
static String NEW_VERSION
          A constant that defines an event marking the occurrance of the creation of a version, that is the very first iteration created in its iteration line (i.e., branch).
static String POST_DELETE_ITERATION
          A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch.
static String POST_DELETE_ITERATIONS
          A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch.
static String POST_INSERT_ITERATION
          A constant that defines an event marking the occurrance of the INSERT ITERATION of an iteration to the end of a branch.
static String POST_MERGE
          A constant that defines an event marking the occurrance of a merge of one version into another.
static String POST_ROLLBACK
          A constant that defines an event marking the occurrance of the rollback (unsuperseding) of an iteration with another one.
static String POST_ROLLUP
          A constant that defines an event marking the occurrance of the rollup of an iteration(s) with another one.
static String POST_SUPERSEDE
          A constant that defines an event marking the occurrance of the superseding of the "latest" iteration with another "latest" one.
static String PRE_DELETE_ITERATION
          A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch.
static String PRE_DELETE_ITERATIONS
          A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch.
static String PRE_INSERT_ITERATION
          A constant that defines an event marking the occurrance of the INSERT ITERATION of an iteration to the end of a branch.
static String PRE_MERGE
          A constant that defines an event marking the occurrance of a merge of one version into another.
static String PRE_NEW_VERSION
          A constant that defines an event marking the occurrance of the creation of a new version, that is the very first iteration created in its iteration line (i.e., branch).
static String PRE_ROLLBACK
          A constant that defines an event marking the occurrance of the rollback (unsuperseding) of an iteration that is about to commense.
static String PRE_ROLLUP
          A constant that defines an event marking the occurrance of the rollup of an iteration(s) that is about to commense.
static String PRE_SUPERSEDE
          A constant that defines an event marking the occurrance of the replacement of a new iteration that is about to commense.
private static String RESOURCE
           
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
VersionControlServiceEvent(String eventType, Iterated eventTarget)
          Constructs an versioning service's event from the event type and target.
VersionControlServiceEvent(String eventType, Iterated eventTarget, Object auxEventData)
          Constructs an versioning service's event from the event type, target object, and auxiliary object.
VersionControlServiceEvent(String eventType, Object eventTarget)
          Constructs an service's event from the event type and object target.
VersionControlServiceEvent(String eventType, Vector eventTarget)
          Constructs an versioning service's event from the event type and target.
VersionControlServiceEvent(String eventType, Versioned eventTarget)
          Constructs an versioning service's event from the event type and target.
VersionControlServiceEvent(String eventType, WTCollection eventTarget)
          Constructs a versioning service's event from the event type, multiple target objects as WTCollection.
VersionControlServiceEvent(String eventType, WTCollection eventTarget, Object auxEventData)
          Constructs an versioning service's event from the event type, target collection, and auxiliary object.
VersionControlServiceEvent(String eventType, WTValuedMap eventTarget)
          Constructs a versioning service's event from the event type, WTValuedMap with target objects as key and auxiliary objects as values.
 
Method Summary
private static VersionControlServiceEvent createMultiObjectMergeEvent(String eventType, WTValuedMap sourceToDestinationsMap, WTValuedMap sourceToNewIterationsMap, WTValuedMap newIterationToDestinationsMap, WTValuedMap destinationToNewIterationMap)
           
private static VersionControlServiceEvent createSingleObjectMergeEvent(String eventType, Versioned newIter, Versioned source, Versioned destination)
           
(package private) static void fireMultiObjectMergeEvent(ManagerService managerService, String eventType, WTValuedMap sourceToDestinationsMap, WTValuedMap sourceToNewIterationsMap, WTValuedMap newIterationToDestinationsMap, WTValuedMap destinationToNewIterationMap)
           
(package private) static void fireSingleObjectMergeEvent(ManagerService managerService, String eventType, Versioned newIter, Versioned source, Versioned destination)
           
static String generateEventKey(String eventType)
          Generates an event key from an event type.
 Iterated getAppendedIteration()
          Gets the iteration [target] of the event.
 Object getAuxEventData()
          Gets the value of the attribute: auxEventData; auxilliary event data above and beyond main target object

Supported API: false
private  Object getAuxObjFromTargetMap(Object obj)
           
 WTValuedMap getDestinationsToMergedIterationMap()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge destination objects to newly created "merged" objects.
 Iterated getIteration()
          Gets the iteration [target] of the event.
 Versioned getMergeDestinationIteration()
          For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the destination of the merge operation.
 WTCollection getMergeDestinationIterations()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a collection of all merge destination objects.
 Versioned getMergedIteration()
          For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the result of the merge operation.
 WTSet getMergedIterations()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a set of all the newly created "merged" objects.
 WTValuedMap getMergedIterationToDestinationsMap()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a map from newly created "merged" objects to merge destination objects.
 Versioned getMergeSourceIteration()
          For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the source of the merge operation.
 WTSet getMergeSourceIterations()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a set of all merge source objects.
 WTValuedMap getMergeSourceToDestinationsMap()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge source to merge destination objects.
 WTValuedMap getMergeSourceToMergedIterationsMap()
          For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge source to newly created "merged" objects.
 Vector getRolledBackIterations()
          Gets all of the iterations that have been rolled back to the one becoming the latest iteration.
 Vector getRolledUpIterations()
          Gets all of the iterations that have been rolled up from the one becoming the very first iteration.
 Iterated getSupersededIteration()
          Gets the old superseded iteration [target] of the event.
 Iterated getSupersedingIteration()
          Gets the new superseding iteration [target] of the event.
 WTCollection getTargetCollection()
          Returns target object as WTCollection.

Supported API: false
private  Iterator getTargetCollectionIterator()
           
 WTValuedMap getTargetMap()
          Returns target object as WTValuedMap

Supported API: false
private  Iterator getTargetMapIterator()
           
 KeyedEvent toMultiObjectEvent()
          

Supported API: false
 KeyedEvent[] toSingleObjectEvents()
          

Supported API: false
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, getEventTarget, getEventType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

NEW_ITERATION

public static final String NEW_ITERATION
A constant that defines an event marking the occurrance of the creation of an iteration, not version. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

NEW_VERSION

public static final String NEW_VERSION
A constant that defines an event marking the occurrance of the creation of a version, that is the very first iteration created in its iteration line (i.e., branch). Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_SUPERSEDE

public static final String PRE_SUPERSEDE
A constant that defines an event marking the occurrance of the replacement of a new iteration that is about to commense. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

POST_SUPERSEDE

public static final String POST_SUPERSEDE
A constant that defines an event marking the occurrance of the superseding of the "latest" iteration with another "latest" one. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_ROLLBACK

public static final String PRE_ROLLBACK
A constant that defines an event marking the occurrance of the rollback (unsuperseding) of an iteration that is about to commense. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

POST_ROLLBACK

public static final String POST_ROLLBACK
A constant that defines an event marking the occurrance of the rollback (unsuperseding) of an iteration with another one. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_ROLLUP

public static final String PRE_ROLLUP
A constant that defines an event marking the occurrance of the rollup of an iteration(s) that is about to commense. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

POST_ROLLUP

public static final String POST_ROLLUP
A constant that defines an event marking the occurrance of the rollup of an iteration(s) with another one. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_INSERT_ITERATION

public static final String PRE_INSERT_ITERATION
A constant that defines an event marking the occurrance of the INSERT ITERATION of an iteration to the end of a branch. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values

POST_INSERT_ITERATION

public static final String POST_INSERT_ITERATION
A constant that defines an event marking the occurrance of the INSERT ITERATION of an iteration to the end of a branch. Listener's of this event can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values

PRE_DELETE_ITERATION

public static final String PRE_DELETE_ITERATION
A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values

POST_DELETE_ITERATION

public static final String POST_DELETE_ITERATION
A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch. Listener's of this event can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values

PRE_MERGE

public static final String PRE_MERGE
A constant that defines an event marking the occurrance of a merge of one version into another. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto. They also have an opportunity to modify or amend the newly formed "merge" iterations prior to their initial persistence in the database.

Supported API: true

See Also:
Constant Field Values

POST_MERGE

public static final String POST_MERGE
A constant that defines an event marking the occurrance of a merge of one version into another. Listener's of this event can stipulate that post conditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

auxEventData

private Object auxEventData

PRE_NEW_VERSION

public static final String PRE_NEW_VERSION
A constant that defines an event marking the occurrance of the creation of a new version, that is the very first iteration created in its iteration line (i.e., branch). Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_DELETE_ITERATIONS

public static final String PRE_DELETE_ITERATIONS
A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch. Listener's of this event can stipulate that preconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values

POST_DELETE_ITERATIONS

public static final String POST_DELETE_ITERATIONS
A constant that defines an event marking the occurrance of the DELETE ITERATION of an iteration from a branch. Listener's of this event can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: false

See Also:
Constant Field Values
Constructor Detail

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  Versioned eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an versioning service's event from the event type and target.

Supported API: false

Parameters:
eventType -
eventTarget -
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  Object eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an service's event from the event type and object target.

Supported API: false

Parameters:
eventType -
eventTarget -
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  Vector eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an versioning service's event from the event type and target.

Supported API: false

Parameters:
eventType -
eventTarget -
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  Iterated eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an versioning service's event from the event type and target.

Supported API: false

Parameters:
eventType -
eventTarget -
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  Iterated eventTarget,
                                  Object auxEventData)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an versioning service's event from the event type, target object, and auxiliary object.

Supported API: false

Parameters:
eventType -
eventTarget -
auxEventData - auxilliary event data above and beyond main target object
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  WTCollection eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs a versioning service's event from the event type, multiple target objects as WTCollection. This constructor is used for multi object events. PRE_ROLLUP as a single object event passes Vector of Iterated objects. This should be WTCollection in case of multi object event

Supported API: false

Parameters:
eventType -
eventTarget - eventTarget for MultiObject event
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  WTCollection eventTarget,
                                  Object auxEventData)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs an versioning service's event from the event type, target collection, and auxiliary object.

Supported API: false

Parameters:
eventType - the type of event (as per String constants in this class)
eventTarget - eventTarget for multi-object event
auxEventData - auxilliary event data above and beyond main target object
Throws:
VersionControlException
WTPropertyVetoException

VersionControlServiceEvent

public VersionControlServiceEvent(String eventType,
                                  WTValuedMap eventTarget)
                           throws VersionControlException,
                                  WTPropertyVetoException
Constructs a versioning service's event from the event type, WTValuedMap with target objects as key and auxiliary objects as values. This constructor is used for multi object event in place of single object event that has auxilary data.

PRE_SUPERSEDE event passes Vector of Iteration and Replacement as 2 elements. In case of multi object event this should be WTValuedHashMap with targetObject as key and the auxiliary data as value.

Supported API: false

Parameters:
eventType -
eventTarget - eventTarget for MultiObject event
Throws:
VersionControlException
WTPropertyVetoException
Method Detail

getAuxEventData

public Object getAuxEventData()
Gets the value of the attribute: auxEventData; auxilliary event data above and beyond main target object

Supported API: false

Returns:
Object

generateEventKey

public static String generateEventKey(String eventType)
Generates an event key from an event type.

Supported API: false

Parameters:
eventType -
Returns:
String

getSupersededIteration

public Iterated getSupersededIteration()
Gets the old superseded iteration [target] of the event. This is only applicable to when an iteration is about to be superseded.

Supported API: true

Returns:
Iterated
See Also:
PRE_SUPERSEDE

getSupersedingIteration

public Iterated getSupersedingIteration()
Gets the new superseding iteration [target] of the event. This is only applicable to when an iteration is about to be superseded.

Supported API: true

Returns:
Iterated
See Also:
PRE_SUPERSEDE

getRolledBackIterations

public Vector getRolledBackIterations()
Gets all of the iterations that have been rolled back to the one becoming the latest iteration. This is only applicable to when an iteration is about to be rolled back. The order of iterations returned is from most recent to least.

Supported API: true

Returns:
Vector
See Also:
PRE_ROLLBACK

getRolledUpIterations

public Vector getRolledUpIterations()
Gets all of the iterations that have been rolled up from the one becoming the very first iteration. This is only applicable to when an iteration is about to be rolled back. The order of iterations returned is from most recent to least.

Supported API: true

Returns:
Vector
See Also:
PRE_ROLLUP

getIteration

public Iterated getIteration()
Gets the iteration [target] of the event. This is only applicable to when a new "latest" iteration has been created, or when an iteration has become superseded, or when an iteration has become rolled back.

Supported API: true

Returns:
Iterated
See Also:
NEW_VERSION, POST_SUPERSEDE, POST_ROLLBACK

getAppendedIteration

public Iterated getAppendedIteration()
Gets the iteration [target] of the event. This is only applicable to when a new "latest" iteration has been appended

Supported API: true

Returns:
Iterated
See Also:
getIteration()

getMergeSourceIteration

public Versioned getMergeSourceIteration()
For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the source of the merge operation.

Supported API: true

Returns:
Versioned

getMergeDestinationIteration

public Versioned getMergeDestinationIteration()
For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the destination of the merge operation.

Supported API: true

Returns:
Versioned

getMergedIteration

public Versioned getMergedIteration()
For single-object PRE_MERGE and POST_MERGE events (only), this method returns the iteration which is the result of the merge operation.

Supported API: true

Returns:
Versioned

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException


Supported API: false

Overrides:
toSingleObjectEvents in class KeyedEvent
Returns:
KeyedEvent[]
Throws:
WTException

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()


Supported API: false

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
KeyedEvent

getTargetMap

public WTValuedMap getTargetMap()
Returns target object as WTValuedMap

Supported API: false

Returns:
WTValuedMap

getTargetCollection

public WTCollection getTargetCollection()
Returns target object as WTCollection.

Supported API: false

Returns:
WTCollection

getMergeSourceToDestinationsMap

public WTValuedMap getMergeSourceToDestinationsMap()
For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge source to merge destination objects.

Supported API: true

Returns:
WTValuedMap

getMergeSourceToMergedIterationsMap

public WTValuedMap getMergeSourceToMergedIterationsMap()
For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge source to newly created "merged" objects.

Supported API: true

Returns:
WTValuedMap

getMergedIterationToDestinationsMap

public WTValuedMap getMergedIterationToDestinationsMap()
For PRE_MERGE and POST_MERGE event types (only), this method returns a map from newly created "merged" objects to merge destination objects.

Supported API: true

Returns:
WTValuedMap

getDestinationsToMergedIterationMap

public WTValuedMap getDestinationsToMergedIterationMap()
For PRE_MERGE and POST_MERGE event types (only), this method returns a map from merge destination objects to newly created "merged" objects.

Supported API: true

Returns:
WTValuedMap

getMergeSourceIterations

public WTSet getMergeSourceIterations()
For PRE_MERGE and POST_MERGE event types (only), this method returns a set of all merge source objects.

Supported API: true

Returns:
WTSet

getMergeDestinationIterations

public WTCollection getMergeDestinationIterations()
For PRE_MERGE and POST_MERGE event types (only), this method returns a collection of all merge destination objects.

Supported API: true

Returns:
WTCollection

getMergedIterations

public WTSet getMergedIterations()
For PRE_MERGE and POST_MERGE event types (only), this method returns a set of all the newly created "merged" objects.

Supported API: true

Returns:
WTSet

getTargetMapIterator

private Iterator getTargetMapIterator()
                               throws WTException
Throws:
WTException

getAuxObjFromTargetMap

private Object getAuxObjFromTargetMap(Object obj)
                               throws WTException
Throws:
WTException

getTargetCollectionIterator

private Iterator getTargetCollectionIterator()
                                      throws WTException
Throws:
WTException

createSingleObjectMergeEvent

private static VersionControlServiceEvent createSingleObjectMergeEvent(String eventType,
                                                                       Versioned newIter,
                                                                       Versioned source,
                                                                       Versioned destination)
                                                                throws VersionControlException,
                                                                       WTPropertyVetoException
Throws:
VersionControlException
WTPropertyVetoException

fireSingleObjectMergeEvent

static void fireSingleObjectMergeEvent(ManagerService managerService,
                                       String eventType,
                                       Versioned newIter,
                                       Versioned source,
                                       Versioned destination)
                                throws WTException,
                                       VersionControlException,
                                       WTPropertyVetoException
Throws:
WTException
VersionControlException
WTPropertyVetoException

createMultiObjectMergeEvent

private static VersionControlServiceEvent createMultiObjectMergeEvent(String eventType,
                                                                      WTValuedMap sourceToDestinationsMap,
                                                                      WTValuedMap sourceToNewIterationsMap,
                                                                      WTValuedMap newIterationToDestinationsMap,
                                                                      WTValuedMap destinationToNewIterationMap)
                                                               throws VersionControlException,
                                                                      WTPropertyVetoException
Throws:
VersionControlException
WTPropertyVetoException

fireMultiObjectMergeEvent

static void fireMultiObjectMergeEvent(ManagerService managerService,
                                      String eventType,
                                      WTValuedMap sourceToDestinationsMap,
                                      WTValuedMap sourceToNewIterationsMap,
                                      WTValuedMap newIterationToDestinationsMap,
                                      WTValuedMap destinationToNewIterationMap)
                               throws WTException,
                                      VersionControlException,
                                      WTPropertyVetoException
Throws:
WTException
VersionControlException
WTPropertyVetoException