Class AdministrativeDomainManagerEvent
- All Implemented Interfaces:
Serializable,wt.events.summary.SummarizedEvent
AdministrativeDomainManagerEvent encapsulates the events
posted by an AdministrativeDomainManager. Currently, the possible event
types are:
- PRE_CHANGE_DOMAIN
- POST_CHANGE_DOMAIN
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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAdministrativeDomainManagerEvent(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.AdministrativeDomainManagerEvent(AdministrativeDomainManager mgr, String evnt, Object tgt, AdminDomainRef domain_ref, boolean commit) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateEventKey(String event_type) Helper method that generates the event key from the event type and the issuing manager.Convenience method meant to be used primarily for single object AdministrativeDomainManagerEvent events.getDomainRef(int index) Convience method to be used with multi-object AdministrativeDomainManagerEvent events.intReturns the size of the domain references collection.getEventTarget(int index) Convience method to be used with multi-object AdministrativeDomainManagerEvent events.intReturns the size of the event target objects collection.booleanReturns true if the change of domain is persisted in the database; false otherwise.Methods inherited from class wt.events.KeyedEvent
generateEventKey, getEventKey, getEventTarget, getEventType
-
Constructor Details
-
AdministrativeDomainManagerEvent
public AdministrativeDomainManagerEvent(String evnt, Object tgt, AdminDomainRef domain_ref, boolean commit) throws WTException Event constructor for domain change events. The domain change event signals a change of the administrative domain to which a DomainAdministered object belongs. On a PRE_CHANGE_DOMAIN eventdomain_refis the domain to which the DomainAdministered object is being moved. On a POST_CHANGE_DOMAIN eventdomain_refis the domain that the object was moved from. Thecommitvalue is true if the change of domain is persisted in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true- Parameters:
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- Throws:
WTException
-
AdministrativeDomainManagerEvent
public AdministrativeDomainManagerEvent(AdministrativeDomainManager mgr, String evnt, Object tgt, AdminDomainRef domain_ref, boolean commit) throws WTException Deprecated.Event constructor for domain change events. The domain change event signals a change of the administrative domain to which a DomainAdministered object belongs. On a PRE_CHANGE_DOMAIN eventdomain_refis the domain to which the DomainAdministered object is being moved. On a POST_CHANGE_DOMAIN eventdomain_refis the domain that the object was moved from. Thecommitvalue is true if the change of domain is persisted in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true- Parameters:
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- Throws:
WTException
-
AdministrativeDomainManagerEvent
public AdministrativeDomainManagerEvent(String evnt, WTList targets, AdminDomainRef domain_ref, boolean commit) throws WTException Event constructor for multi-object domain change events. The domain change event signals a change of the administrative domain to which one or more DomainAdministered objects belong. On a PRE_CHANGE_DOMAIN eventdomain_refis the domain to which the DomainAdministered objects are being moved. On a POST_CHANGE_DOMAIN eventdomain_refis 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
commitvalue is true if the change of domain is persisted in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true- Parameters:
evnt- the type of the eventtargets- Collection ofDomainAdministeredobjects that are the targets of this event.domain_ref- The domain reference associated with eachDomainAdministeredobject in the targets collection.commit- commit status- Throws:
WTException
-
AdministrativeDomainManagerEvent
public AdministrativeDomainManagerEvent(String evnt, WTList targets, WTList domain_refs, boolean commit) throws WTException Event constructor for multi-object domain change events. The domain change event signals a change of the administrative domain to which one or more DomainAdministered objects belong. On a PRE_CHANGE_DOMAIN event the domain references in thedomain_refscollection are the domains the target DomainAdministered objects are being moved to. On a POST_CHANGE_DOMAIN event the domain references in thedomain_refscollection 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
commitvalue is true if the change of domain is persisted in the database by the AdministrativeDomainManager; false otherwise.
Supported API: true- Parameters:
evnt- the type of the eventtargets- Collection ofDomainAdministeredobjects that are the targets of this event.domain_refs- Collection ofAdminDomainRefsassociated with the correspondingDomainAdministeredobjects in the targets collection.commit- commit status- Throws:
WTException
-
-
Method Details
-
generateEventKey
Helper method that generates the event key from the event type and the issuing manager.
Supported API: true- Parameters:
event_type-- Returns:
- String
-
getDomainRef
Convenience method meant to be used primarily for single object AdministrativeDomainManagerEvent events.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- Returns:
- AdminDomainRef
-
getDomainRef
Convience method to be used with multi-object AdministrativeDomainManagerEvent events.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- Parameters:
index-- Returns:
- AdminDomainRef
-
getDomainRefsSize
public int getDomainRefsSize()Returns the size of the domain references collection. For single object events if the domain reference is not null, 1 is returned. For both multi-object and single object events if the domain reference is null, 0 is returned.
Supported API: true- Returns:
- int
-
getEventTarget
Convience method to be used with multi-object AdministrativeDomainManagerEvent events.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- Parameters:
index-- Returns:
- Object
-
getEventTargetsSize
public int getEventTargetsSize()Returns the size of the event target objects collection. For single object events if the event target is not null, 1 is returned. For both multi-object and single object events if the target object is null, 0 is returned.
Supported API: true- Returns:
- int
-
isChangeCommitted
public boolean isChangeCommitted()Returns true if the change of domain is persisted in the database; false otherwise.
Supported API: true- Returns:
- boolean
-