com.telelogic.cs.api
Class TriggerEvent

java.lang.Object
  extended by com.telelogic.cs.api.TriggerEvent
Direct Known Subclasses:
AttributeEvent, GeneralEvent, RelationEvent, ScheduledEvent, SubscriptionEvent, SubscriptionRelationEvent, TransitionEvent

public abstract class TriggerEvent
extends java.lang.Object

The superclass for all "event" objects that are made available to in-process triggers. Used to lookup information about the particular trigger that occurred. All event types are registered under the name "event".

Since:
4.7 06

Constructor Summary
TriggerEvent()
           
 
Method Summary
 void fail(java.lang.String errorMessage)
          Indicates that the current trigger has failed.
abstract  User getAdminUser()
          Gets information about the admin user for the database the trigger fired in.
 java.lang.String getFailure()
          Gets the failure message is fail was called.
abstract  java.lang.String getTriggerType()
          Gets the type of this trigger, that is the type of action the spawned this trigger.
abstract  User getTriggerUser()
          Gets information about this user that performed the action that fired this trigger.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TriggerEvent

public TriggerEvent()
Method Detail

getTriggerType

public abstract java.lang.String getTriggerType()
Gets the type of this trigger, that is the type of action the spawned this trigger. Can be used to determine what kind of trigger is firing if the same trigger script is reused for multiple trigger types.

Returns:
a name for the type of operation this trigger is for.

getTriggerUser

public abstract User getTriggerUser()
Gets information about this user that performed the action that fired this trigger.

Returns:
details about the trigger user.

getAdminUser

public abstract User getAdminUser()
Gets information about the admin user for the database the trigger fired in. Can be used in triggers to perform operations as an admin when triggers should run without security restrictions.

Returns:
details about the admin user.

fail

public void fail(java.lang.String errorMessage)
Indicates that the current trigger has failed. This may prevent the current operation from proceeding (depending on whether this is a pre or post trigger) and will likely display the error message in the interface or send it to the log.

Calling this method indicates the something bad has happened and can be used in any trigger. If you are writing a pre-transition trigger and simply want to gracefully indicate that the transition should not proceed, instead call stopTransition.

Parameters:
errorMessage - an error message for an end user indicating why this trigger failed. May be shown in the interface or be sent to the log file.

getFailure

public java.lang.String getFailure()
Gets the failure message is fail was called.

Returns:
the failure message, or null if fail was never called.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


© Copyright IBM Corporation 2000, 2009
US Government Users Restricted Rights--Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Notices