wt.representation
Class RepresentationServiceEvent

java.lang.Object
  extended bywt.events.KeyedEvent
      extended bywt.representation.RepresentationServiceEvent
All Implemented Interfaces:
Serializable

public class RepresentationServiceEvent
extends KeyedEvent
implements Serializable

This event can be used to trigger the creation of a Representation for a Representable. It indicates all business information/objects needed for generation of the Representation are present in the database.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  ConfigSpec configSpec
           
static String MULTI_READY_TO_PUBLISH
          Constant containing the event type for the multi_ready_to_publish event.
static String READY_TO_PUBLISH
          Constant containing the event type for the ready_to_publish event.
private static String RESOURCE
           
 
Fields inherited from class wt.events.KeyedEvent
 
Constructor Summary
RepresentationServiceEvent(String eventType, Map targetMap)
          Create a RepresentationServiceEvent with a Map target.
RepresentationServiceEvent(String eventType, Object target)
          Creates a RepresentationServiceEvent instance.
RepresentationServiceEvent(String eventType, Persistable persistable)
          Constructs a RepresentationServiceEvent

Supported API: false
RepresentationServiceEvent(String eventType, Vector objectsToPublish, ConfigSpec configSpec)
          Constructs a RepresentationServiceEvent

Supported API: false
RepresentationServiceEvent(String eventType, WTCollection targets)
          Create a multi-object instance of RepresentationServiceEvent.
 
Method Summary
static String generateEventKey(String eventType)
          Generates a unique event key for the event type

Supported API: false
 ConfigSpec getConfigSpec()
          Get the ConfigSpec from the Event

Supported API: false
 Vector getObjectsToPublish()
          Get the objects to be published from the Event

Supported API: false
 KeyedEvent toMultiObjectEvent()
          If the target is an instance of Persistable then a KeyedEvent with a single element WTCollection as its target is returned.
 KeyedEvent[] toSingleObjectEvents()
          If the target is a WTCollection a KeyedEvent[] is returned where each KeyedEvent has a Persistable target.
 
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

READY_TO_PUBLISH

public static final String READY_TO_PUBLISH
Constant containing the event type for the ready_to_publish event.

Supported API: false

See Also:
Constant Field Values

MULTI_READY_TO_PUBLISH

public static final String MULTI_READY_TO_PUBLISH
Constant containing the event type for the multi_ready_to_publish event.

Supported API: false

See Also:
Constant Field Values

configSpec

private ConfigSpec configSpec
Constructor Detail

RepresentationServiceEvent

public RepresentationServiceEvent(String eventType,
                                  Persistable persistable)
Constructs a RepresentationServiceEvent

Supported API: false

Parameters:
eventType -
persistable -

RepresentationServiceEvent

public RepresentationServiceEvent(String eventType,
                                  WTCollection targets)
Create a multi-object instance of RepresentationServiceEvent.

Supported API: false

Parameters:
eventType -
targets -

RepresentationServiceEvent

public RepresentationServiceEvent(String eventType,
                                  Map targetMap)
Create a RepresentationServiceEvent with a Map target. The target has keys = Vectors of Persistables and values = configspecs.

Supported API: false

Parameters:
eventType -
targetMap -

RepresentationServiceEvent

public RepresentationServiceEvent(String eventType,
                                  Object target)
Creates a RepresentationServiceEvent instance.

Supported API: false

Parameters:
eventType -
target -

RepresentationServiceEvent

public RepresentationServiceEvent(String eventType,
                                  Vector objectsToPublish,
                                  ConfigSpec configSpec)
Constructs a RepresentationServiceEvent

Supported API: false

Parameters:
eventType -
objectsToPublish -
configSpec - should be an EPMDocConfigSpec
Method Detail

generateEventKey

public static String generateEventKey(String eventType)
Generates a unique event key for the event type

Supported API: false

Parameters:
eventType -
Returns:
String

toMultiObjectEvent

public KeyedEvent toMultiObjectEvent()
If the target is an instance of Persistable then a KeyedEvent with a single element WTCollection as its target is returned. If the target is a Vector then a KeyedEvent is returned with a single element Map as its target. The Map has key = Vector and value = ConfigSpec.

Supported API: false

Overrides:
toMultiObjectEvent in class KeyedEvent
Returns:
KeyedEvent

toSingleObjectEvents

public KeyedEvent[] toSingleObjectEvents()
                                  throws WTException
If the target is a WTCollection a KeyedEvent[] is returned where each KeyedEvent has a Persistable target. If the target is a Map then a KeyedEvent[] is returned where each KeyedEvent has a Vector target and a corresponding ConfigSpec value.

Supported API: false

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

getConfigSpec

public ConfigSpec getConfigSpec()
Get the ConfigSpec from the Event

Supported API: false

Returns:
ConfigSpec

getObjectsToPublish

public Vector getObjectsToPublish()
Get the objects to be published from the Event

Supported API: false

Returns:
Vector of objects