wt.vc.wip
Class WorkInProgressServiceEvent

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

public class WorkInProgressServiceEvent
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 WorkInProgressService interface. This event could also be used by a custom implementation of the WorkInProgressService.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  boolean multiObjectTrx
           
static String POST_CHECKIN
          A constant that defines an event marking the occurrance of a checkin that has completed.
static String POST_CHECKOUT
          A constant that defines an event marking the occurrance of a checkout that has completed.
static String POST_UNDO_CHECKOUT
          A constant that defines an event marking the occurrance of an undo of a checkout that has completed.
static String PRE_CHECKIN
          A constant that defines an event marking the occurrance of a checkin that is about to commense.
static String PRE_CHECKOUT
          A constant that defines an event marking the occurrance of a checkout that is about to commense.
static String PRE_UNDO_CHECKOUT
          A constant that defines an event marking the occurrance of an undo of a checkout that is about to commense.
private static String RESOURCE
           
private  WorkInProgressService service
           
private  Folder workingFolder
           
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
WorkInProgressServiceEvent(String eventType, Object eventTarget)
          

Supported API: false
WorkInProgressServiceEvent(String eventType, WTCollection eventTarget)
          

Supported API: false
WorkInProgressServiceEvent(String eventType, WTValuedMap eventTarget, Folder a_workingFolder)
          Constructs an WIP service's event from the map of Workables and event type, as well as the working folder of the target object.
WorkInProgressServiceEvent(WorkInProgressService service, String eventType, Vector eventTarget)
          Constructs an WIP service's event from the specified service and its event type and target.
WorkInProgressServiceEvent(WorkInProgressService service, String eventType, Vector eventTarget, Folder workingFolder)
          Constructs an WIP service's event from the specified service, its event type and target, and the working folder of the target object.
WorkInProgressServiceEvent(WorkInProgressService service, String eventType, Workable eventTarget)
          Constructs an WIP service's event from the specified service and its event type and target.
 
Method Summary
static String generateEventKey(String eventType)
          Generates an event key from an event type.
 Object getEventTarget()
          Gets the value of the attribute: eventTarget; The primary target of this event.
 Workable getOriginalCopy()
          Gets the original copy target of the event.
 WorkInProgressService getService()
          Gets the object for the association that plays role: service; The WIP service that emits events.
 Workable getTarget()
          Deprecated. Replaced by getOriginalCopy()
 WTValuedMap getTargetMap()
          Return a WTValuedMap with key=original copy and value = working copy.
 WTCollection getTargets()
          Gets the event targent (WTKeyedMap of original - working pairs) as a WTCollection.
 Workable getWorkingCopy()
          Gets the working copy target of the event.
 Folder getWorkingFolder()
          Gets the value of the attribute: workingFolder.
 boolean isMultiObjectTrx()
          Gets the value of the attribute: multiObjectTrx; Flag to indicate if this event was dispatched in the context of a call to a MultiWorkInProgressSerivce method where there is an enclosing transaction for all wip operations on each object (one_transaction argument is true).
private  void serviceValidate(WorkInProgressService a_Service)
           
protected  void setMultiObjectTrx(boolean a_MultiObjectTrx)
          Sets the value of the attribute: multiObjectTrx; Flag to indicate if this event was dispatched in the context of a call to a MultiWorkInProgressSerivce method where there is an enclosing transaction for all wip operations on each object (one_transaction argument is true).
 void setService(WorkInProgressService a_Service)
          Sets the object for the association that plays role: service; The WIP service that emits events.
protected  void setWorkingFolder(Folder a_WorkingFolder)
          Sets the value of the attribute: workingFolder.
 KeyedEvent toMultiObjectEvent()
          Given a single object event, if the event's target is a Vector returns a single KeyedEvent with a WTKeyedMap target having key = original copy and value = working copy.
 KeyedEvent[] toSingleObjectEvents()
          Given a multi-object WorkInProgressServiceEvent if the event's target is a WTCollection returns an array of KeyedEvents each with a Workable event target.
 
Methods inherited from class wt.events.KeyedEvent
generateEventKey, generateEventKey, getConceptualClassname, getEventKey, 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

PRE_CHECKIN

public static final String PRE_CHECKIN
A constant that defines an event marking the occurrance of a checkin 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_CHECKIN

public static final String POST_CHECKIN
A constant that defines an event marking the occurrance of a checkin that has completed. Listener's of this event can perform post-processing related to the checkin of an object, and can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_CHECKOUT

public static final String PRE_CHECKOUT
A constant that defines an event marking the occurrance of a checkout 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_CHECKOUT

public static final String POST_CHECKOUT
A constant that defines an event marking the occurrance of a checkout that has completed. Listener's of this event can perform post-processing related to the checkout of an object, and can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

PRE_UNDO_CHECKOUT

public static final String PRE_UNDO_CHECKOUT
A constant that defines an event marking the occurrance of an undo of a checkout 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_UNDO_CHECKOUT

public static final String POST_UNDO_CHECKOUT
A constant that defines an event marking the occurrance of an undo of a checkout that has completed. Listener's of this event can perform post-processing related to the undo of a checkout of an object, and can stipulate that postconditions have not been satisfied by means of throwing an exception which acts as a veto.

Supported API: true

See Also:
Constant Field Values

workingFolder

private Folder workingFolder

multiObjectTrx

private boolean multiObjectTrx

service

private WorkInProgressService service
Constructor Detail

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(WorkInProgressService service,
                                  String eventType,
                                  Workable eventTarget)
                           throws WorkInProgressException,
                                  WTPropertyVetoException
Constructs an WIP service's event from the specified service and its event type and target.

Supported API: false

Parameters:
service -
eventType -
eventTarget -
Throws:
WorkInProgressException
WTPropertyVetoException

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(WorkInProgressService service,
                                  String eventType,
                                  Vector eventTarget)
                           throws WorkInProgressException,
                                  WTPropertyVetoException
Constructs an WIP service's event from the specified service and its event type and target.

Supported API: false

Parameters:
service -
eventType -
eventTarget -
Throws:
WorkInProgressException
WTPropertyVetoException

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(WorkInProgressService service,
                                  String eventType,
                                  Vector eventTarget,
                                  Folder workingFolder)
                           throws WorkInProgressException,
                                  WTPropertyVetoException
Constructs an WIP service's event from the specified service, its event type and target, and the working folder of the target object.

Supported API: false

Parameters:
service -
eventType -
eventTarget -
workingFolder - Folder that the object has been checked-out to.
Throws:
WorkInProgressException
WTPropertyVetoException

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(String eventType,
                                  WTValuedMap eventTarget,
                                  Folder a_workingFolder)
Constructs an WIP service's event from the map of Workables and event type, as well as the working folder of the target object.

Supported API: false

Parameters:
eventType -
eventTarget -
a_workingFolder -

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(String eventType,
                                  WTCollection eventTarget)


Supported API: false

Parameters:
eventType -
eventTarget -

WorkInProgressServiceEvent

public WorkInProgressServiceEvent(String eventType,
                                  Object eventTarget)


Supported API: false

Parameters:
eventType -
eventTarget -
Method Detail

getWorkingFolder

public Folder getWorkingFolder()
Gets the value of the attribute: workingFolder.

Supported API: false

Returns:
Folder

setWorkingFolder

protected void setWorkingFolder(Folder a_WorkingFolder)
Sets the value of the attribute: workingFolder.

Supported API: false

Parameters:
a_WorkingFolder -

isMultiObjectTrx

public boolean isMultiObjectTrx()
Gets the value of the attribute: multiObjectTrx; Flag to indicate if this event was dispatched in the context of a call to a MultiWorkInProgressSerivce method where there is an enclosing transaction for all wip operations on each object (one_transaction argument is true).

Supported API: false

Returns:
boolean
See Also:
wt.vc.wip.MultiWorkInProgressSerivce

setMultiObjectTrx

protected void setMultiObjectTrx(boolean a_MultiObjectTrx)
                          throws WTPropertyVetoException
Sets the value of the attribute: multiObjectTrx; Flag to indicate if this event was dispatched in the context of a call to a MultiWorkInProgressSerivce method where there is an enclosing transaction for all wip operations on each object (one_transaction argument is true).

Supported API: false

Parameters:
a_MultiObjectTrx -
Throws:
WTPropertyVetoException
See Also:
wt.vc.wip.MultiWorkInProgressSerivce

getService

public WorkInProgressService getService()
Gets the object for the association that plays role: service; The WIP service that emits events.

Supported API: false

Returns:
WorkInProgressService
See Also:
WorkInProgressService

setService

public void setService(WorkInProgressService a_Service)
                throws WTPropertyVetoException
Sets the object for the association that plays role: service; The WIP service that emits events.

Supported API: false

Parameters:
a_Service -
Throws:
WTPropertyVetoException
See Also:
WorkInProgressService

serviceValidate

private void serviceValidate(WorkInProgressService a_Service)
                      throws WTPropertyVetoException
Parameters:
a_Service -
Throws:
WTPropertyVetoException

generateEventKey

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

Supported API: false

Parameters:
eventType -
Returns:
String

getOriginalCopy

public Workable getOriginalCopy()
Gets the original copy target of the event.

Supported API: true

Returns:
Workable
See Also:
wt.vc.wip.PRE_CHECKOUT, wt.vc.wip.POST_CHECKOUT, wt.vc.wip.PRE_CHECKIN, wt.vc.wip.POST_CHECKIN, wt.vc.wip.PRE_UNDO_CHECKOUT, wt.vc.wip.POST_UNDO_CHECKOUT

getWorkingCopy

public Workable getWorkingCopy()
Gets the working copy target of the event.

Supported API: true

Returns:
Workable
See Also:
wt.vc.wip.POST_CHECKOUT, wt.vc.wip.PRE_CHECKIN, wt.vc.wip.POST_CHECKIN, wt.vc.wip.PRE_UNDO_CHECKOUT, wt.vc.wip.POST_UNDO_CHECKOUT

getTarget

public Workable getTarget()
Deprecated. Replaced by getOriginalCopy()

Gets the original copy target of the event.

Supported API: true

Returns:
Workable
See Also:
wt.vc.wip.PRE_CHECKOUT

getTargetMap

public WTValuedMap getTargetMap()
Return a WTValuedMap with key=original copy and value = working copy.

Supported API: true

Returns:
WTValuedMap

getTargets

public WTCollection getTargets()
Gets the event targent (WTKeyedMap of original - working pairs) as a WTCollection.

Supported API: true

Returns:
WTCollection

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()
Given a single object event, if the event's target is a Vector returns a single KeyedEvent with a WTKeyedMap target having key = original copy and value = working copy. If the event target is a Workable returns a single KeyedEvent with a WTCollection containing only the Workable.

Supported API: false

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
KeyedEvent

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException
Given a multi-object WorkInProgressServiceEvent if the event's target is a WTCollection returns an array of KeyedEvents each with a Workable event target. If the event's target is a WTKeyedMap returns an array of KeyedEvents each having a Vector eventTarget with two elements, the original copy and then the working copy, and a workingFolder value.

Supported API: false

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

getEventTarget

public Object getEventTarget()
Description copied from class: KeyedEvent
Gets the value of the attribute: eventTarget; The primary target of this event. May be null.

Supported API: false

Overrides:
getEventTarget in class KeyedEvent
Returns:
Object