Class NotificationEvent

java.lang.Object
java.util.EventObject
com.groiss.notification.NotificationEvent
All Implemented Interfaces:
Serializable

public class NotificationEvent extends EventObject
Class for events representing changed NotificationItems. Instances are created through the notification subsystem. It is normally not necessary to construct any instances.
See Also:
  • Constructor Details

    • NotificationEvent

      public NotificationEvent(NotificationItem ni, short type)
      Constructor
      Parameters:
      ni - the NotificationItem which triggered the notification
      type - is ni added or deleted
    • NotificationEvent

      public NotificationEvent(NotificationItem ni, short type, Agent agent)
      Constructor
      Parameters:
      ni - the NotificationItem which triggered the notification
      type - is ni added or deleted
      agent - the agent the event is destined for.
    • NotificationEvent

      public NotificationEvent(NotificationItem ni, short type, Agent agent, OrgUnit dept)
      Constructor
      Parameters:
      ni - the NotificationItem which triggered the notification
      type -
      agent - the agent (user or role)
      dept - the organizational unit
    • NotificationEvent

      public NotificationEvent(NotificationItem ni, short type, Agent agent, OrgUnit dept, boolean isObsolete)
      Constructor
      Parameters:
      ni - the NotificationItem which triggered the notification
      type -
      agent - the agent (user or role)
      dept - the organizational unit
      isObsolete - true, if mail notification should be suppressed
  • Method Details

    • setNi

      public void setNi(NotificationItem ni)
      Set NotificatinoItem the event will transport.
      Parameters:
      ni - the item to set
    • getNi

      public NotificationItem getNi()
      Get the NotificationItem the event is transporting.
      Returns:
      the events NotificationItem
    • markObsolete

      public void markObsolete()
      Mark event as obsolete. Only applies to items which are StepInstances. Obsolete events are not send via email notification.
    • unmarkObsolete

      public void unmarkObsolete()
      unmark event as obsolete. Only applies to items which are StepInstances. Obsolete events are not send via email notification.
    • isObsolete

      public boolean isObsolete()
      Determine if the event is obsolete.
      Returns:
      true if the event is not to be send via email notification.
    • getAgent

      public Agent getAgent()
    • getUniqueServerTag

      public String getUniqueServerTag()
      Get the unique tag of the server.
      Returns:
      the server tag
    • setUniqueServerTag

      public void setUniqueServerTag(String servertag)
      Sets the unique tag of the server.
      Parameters:
      servertag - the id of the server to set
    • getOriginatingSessionId

      public String getOriginatingSessionId()
      Get the id of the sending session.
      Returns:
      the session id
    • setOriginatingSessionId

      public void setOriginatingSessionId(String sessionid)
      Sets the id of the originating session
      Parameters:
      sessionid - the id of the session to set
    • getCreateTimeStamp

      public long getCreateTimeStamp()
      Get the create time stamp.
      Returns:
      Returns the createTimeStamp.
    • getCommitTimeStamp

      public long getCommitTimeStamp()
      Get the commit time stamp.
      Returns:
      Returns the commitTimeStamp.
    • setCommitTimeStamp

      public void setCommitTimeStamp(long commitTimeStamp)
      Set the commit time stamp.
      Parameters:
      commitTimeStamp - The commitTimeStamp to set.
    • getType

      public int getType()
      Get the type of the event.
      Returns:
      the type of the event
      See Also:
    • getFolderOid

      public Long getFolderOid()
    • setFolderOid

      public void setFolderOid(Long folderOid)
    • setPrivate

      public void setPrivate(boolean isPrivate)
      Can be used to designate an event for private notification without substitution (all sessions of this user; 'for your eyes only'); agent must be a User.
    • isPrivate

      public boolean isPrivate()
      Check, if an event is for private notification without substitution.
    • setSessionId

      public void setSessionId(String sessionId)
      Can be used to designate an event for (very) private notification without substitution for just a single session. agent must be a User. Implies isPrivate.
    • getSessionId

      public String getSessionId()
      Check, if an event is for private notification without substitution.
    • toString

      public String toString()
      Converts a NotificationEvent to a string representation.
      Overrides:
      toString in class EventObject
      Returns:
      the string representation of the receiver.