|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.events.KeyedEvent
wt.admin.AdministrativeDomainManagerEvent
AdministrativeDomainManagerEvent
encapsulates the events
posted by an AdministrativeDomainManager. Currently, the possible event
types are:
In addition to the usual event target object, or target objects for the
multi-object variant of the event, AdministrativeDomainManagerEvent
events also contain a domain reference (domain_ref
), or
domain references for the multi-object variant. The domain_ref
has different meanings for the different AdministrativeDomainManagerEvent
event types. For PRE_CHANGE_DOMAIN
types, domain_ref
is the domain reference for the domain that the DomainAdministered
object is being moved to. For POST_CHANGE_DOMAIN
types domain_ref
is the domain reference for the domain that the object was moved from.
Event target objects are expected to be DomainAdministered
objects.
For multi-object events it is assumed there is a one-to-one correspondence
between target objects in the targets
collection and domain
references in the domain_refs
collection. The first domain_ref
corresponds to the first target
, the second domain_ref
corresponds to the second target
, and so on. This means
the number of domain references in the domain_refs
collection
must be the same as the number of event target objects. The one exception
is that when creating an event object instead of a collection of domain
references you can specify a single domain reference. In this case the
single domain reference applies to all target objects.
For multi-object events you can access the event targets and the domain_refs
collections in one of two ways. The first is to get the collection of
event targets or the collection of domain_refs and iterate over the collections.
Use the super.getEventTarget() method to get the targets collection and
the getDomainRefs() method to get the domain_refs collection. The second
is to use convenience methods that allow you to get target objects or
domain_refs by specifying an index. There are also convenience methods
to get the sizes of the collections.
Supported API: true
Extendable: false
Field Summary | |
private static String |
CLASSNAME
|
private boolean |
commitChange
|
private WTList |
domainRefs
|
private int |
domainRefsSize
|
private int |
eventTargetsSize
|
static String |
POST_CHANGE_DOMAIN
Constant containing the event type for the POST_CHANGE_DOMAIN event. |
static String |
PRE_CHANGE_DOMAIN
Constant containing the event type for the PRE_CHANGE_DOMAIN event. |
private static String |
RESOURCE
|
Fields inherited from class wt.events.KeyedEvent |
|
Constructor Summary | |
AdministrativeDomainManagerEvent(AdministrativeDomainManager mgr,
String evnt,
Object tgt,
AdminDomainRef domain_ref,
boolean commit)
Deprecated. |
|
AdministrativeDomainManagerEvent(String evnt,
Object tgt,
AdminDomainRef domain_ref,
boolean commit)
Event constructor for domain change events. |
|
AdministrativeDomainManagerEvent(String evnt,
WTList targets,
AdminDomainRef domain_ref,
boolean commit)
Event constructor for multi-object domain change events. |
|
AdministrativeDomainManagerEvent(String evnt,
WTList targets,
WTList domain_refs,
boolean commit)
Event constructor for multi-object domain change events. |
Method Summary | |
static String |
generateEventKey(String event_type)
Helper method that generates the event key from the event type and the issuing manager. |
AdminDomainRef |
getDomainRef()
Convenience method meant to be used primarily for single object AdministrativeDomainManagerEvent events. |
AdminDomainRef |
getDomainRef(int index)
Convience method to be used with multi-object AdministrativeDomainManagerEvent events. |
WTList |
getDomainRefs()
Gets the value of the attribute: domainRefs. |
int |
getDomainRefsSize()
Returns the size of the domain references collection. |
Object |
getEventTarget(int index)
Convience method to be used with multi-object AdministrativeDomainManagerEvent events. |
int |
getEventTargetsSize()
Returns the size of the event target objects collection. |
boolean |
isChangeCommitted()
Returns true if the change of domain is persisted in the database; false otherwise. |
void |
setDomainRefs(WTList a_DomainRefs)
Sets the value of the attribute: domainRefs. |
KeyedEvent |
toMultiObjectEvent()
Converts a single object AdministrativeDomainManagerEvent
event into a multi-object AdministrativeDomainManagerEvent
event. |
KeyedEvent[] |
toSingleObjectEvents()
Converts a mutli-object AdministrativeDomainManagerEvent
event into multiple single object AdministrativeDomainManagerEvent
events. |
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 |
private static final String RESOURCE
private static final String CLASSNAME
private boolean commitChange
public static final String PRE_CHANGE_DOMAIN
public static final String POST_CHANGE_DOMAIN
private WTList domainRefs
private int domainRefsSize
private int eventTargetsSize
Constructor Detail |
public AdministrativeDomainManagerEvent(String evnt, Object tgt, AdminDomainRef domain_ref, boolean commit) throws WTException
domain_ref
is the domain to which the DomainAdministered object is being moved.
On a POST_CHANGE_DOMAIN event domain_ref
is the domain
that the object was moved from. The commit
value is true
if the change of domain is persisted in the database by the AdministrativeDomainManager;
false otherwise.
evnt
- the type of the eventtgt
- The DomainAdministered object that is the target of the event. If tgt is null, a WTInvalidParameterException is thrown.domain_ref
- A domain reference associated with the DomainAdministered object. If domain_ref is null, a WTInvalidParameterException is thrown.commit
- commit status
WTException
public AdministrativeDomainManagerEvent(AdministrativeDomainManager mgr, String evnt, Object tgt, AdminDomainRef domain_ref, boolean commit) throws WTException
domain_ref
is the domain to which the DomainAdministered object is being moved.
On a POST_CHANGE_DOMAIN event domain_ref
is the domain
that the object was moved from. The commit
value is true
if the change of domain is persisted in the database by the AdministrativeDomainManager;
false otherwise.
mgr
- the AdministrativeDomainManager service that issued the eventevnt
- the type of the eventtgt
- The DomainAdministered object that is the target of the event. If tgt is null, a WTInvalidParameterException is thrown.domain_ref
- A domain reference associated with the DomainAdministered object. If domain_ref is null, a WTInvalidParameterException is thrown.commit
- commit status
WTException
public AdministrativeDomainManagerEvent(String evnt, WTList targets, AdminDomainRef domain_ref, boolean commit) throws WTException
domain_ref
is the domain to which the DomainAdministered
objects are being moved. On a POST_CHANGE_DOMAIN event domain_ref
is the domain that the objects were moved from.
targets is expected to be a collection of one or more DomainAdministered objects. If the targets collection is null or empty, a WTInvalidParameterException is thrown.
domain_ref is the domain reference that applies to each target object. If the domain_ref is null, a WTInvalidParameterException is thrown.
The commit
value is true if the change of domain is persisted
in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true
evnt
- the type of the eventtargets
- Collection of DomainAdministered
objects that are the targets of this event.domain_ref
- The domain reference associated with each DomainAdministered
object in the targets collection.commit
- commit status
WTException
public AdministrativeDomainManagerEvent(String evnt, WTList targets, WTList domain_refs, boolean commit) throws WTException
domain_refs
collection
are the domains the target DomainAdministered objects are being moved
to. On a POST_CHANGE_DOMAIN event the domain references in the domain_refs
collection are the domains that the target objects were moved from.
targets is expected to be a collection of one or more DomainAdministered objects. If the targets collection is null or empty, a WTInvalidParameterException is thrown.
domain_refs is a collection of one or more AdminDomainRef objects. The number of AdminDomainRef objects in the collection has to be either one OR the same as the number of objects in the targets collection. If the collection has only one AdminDomainRef object, this AdminDomainRef applies to all target objects in the targets collection; otherwise, the first AdminDomainRef in the collection corresponds to the first target object in the targets collection, the second AdminDomainRef corresponds to the second target object, and so on. If the domain_refs collection is null, empty, or not the correct size, a WTInvalidParameterException is thrown.
The commit
value is true if the change of domain is persisted
in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true
evnt
- the type of the eventtargets
- Collection of DomainAdministered
objects that are the targets of this event.domain_refs
- Collection of AdminDomainRefs
associated with the corresponding DomainAdministered
objects in the targets collection.commit
- commit status
WTException
Method Detail |
public WTList getDomainRefs()
public void setDomainRefs(WTList a_DomainRefs) throws WTPropertyVetoException
a_DomainRefs
-
WTPropertyVetoException
public static String generateEventKey(String event_type)
event_type
-
public AdminDomainRef getDomainRef()
For single object events this method returns the AdminDomainRef associated with the event.
For multi-object events this method can be used to get the AdminDomainRef
associated with the event for the case where there is a single AdminDomainRef
that applies to all target objects of the multi-object event. If this
method is called for multi-object events that have more than one AdminDomainRef,
null is returned. For this case either iterate over the domain_refs
collection or use the getDomainRef(int index) method instead.
Supported API: true
public AdminDomainRef getDomainRef(int index)
Returns an AdminDomainRef from the collection of AdminDomainRefs specified
by the index parameter. The first element in the collection is index
0. If the input index is out of range, null is returned.
Supported API: true
index
-
public int getDomainRefsSize()
public Object getEventTarget(int index)
Returns an event target object from the collection of target objects
specified by the index parameter. The first element in the collection
is index 0. If the input index is out of range or this is a single
object event, null is returned.
Supported API: true
index
-
public int getEventTargetsSize()
public boolean isChangeCommitted()
public KeyedEvent toMultiObjectEvent()
AdministrativeDomainManagerEvent
event into a multi-object AdministrativeDomainManagerEvent
event. If the AdministrativeDomainManagerEvent constructor throws
an exception, null is returned.
toMultiObjectEvent
in class KeyedEvent
public KeyedEvent[] toSingleObjectEvents() throws WTException
AdministrativeDomainManagerEvent
event into multiple single object AdministrativeDomainManagerEvent
events. One single object event is created for each target object
in the multi-object event targets collection.
toSingleObjectEvents
in class KeyedEvent
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |