Package com.groiss.notification
Class NotificationEvent
java.lang.Object
java.util.EventObject
com.groiss.notification.NotificationEvent
- All Implemented Interfaces:
Serializable
Class for events representing changed NotificationItems.
Instances are created through the notification subsystem.
It is normally not necessary to construct any instances.
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionNotificationEvent
(NotificationItem ni, short type) ConstructorNotificationEvent
(NotificationItem ni, short type, Agent agent) ConstructorNotificationEvent
(NotificationItem ni, short type, Agent agent, OrgUnit dept) ConstructorNotificationEvent
(NotificationItem ni, short type, Agent agent, OrgUnit dept, boolean isObsolete) Constructor -
Method Summary
Modifier and TypeMethodDescriptiongetAgent()
long
Get the commit time stamp.long
Get the create time stamp.getNi()
Get the NotificationItem the event is transporting.Get the id of the sending session.Check, if an event is for private notification without substitution.int
getType()
Get the type of the event.Get the unique tag of the server.boolean
Determine if the event is obsolete.boolean
Check, if an event is for private notification without substitution.void
Mark event as obsolete.void
setCommitTimeStamp
(long commitTimeStamp) Set the commit time stamp.void
setFolderOid
(Long folderOid) void
Set NotificatinoItem the event will transport.void
setOriginatingSessionId
(String sessionid) Sets the id of the originating sessionvoid
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.void
setSessionId
(String sessionId) Can be used to designate an event for (very) private notification without substitution for just a single session.void
setUniqueServerTag
(String servertag) Sets the unique tag of the server.toString()
Converts a NotificationEvent to a string representation.void
unmark event as obsolete.Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
NotificationEvent
Constructor- Parameters:
ni
- the NotificationItem which triggered the notificationtype
- is ni added or deleted
-
NotificationEvent
Constructor- Parameters:
ni
- the NotificationItem which triggered the notificationtype
- is ni added or deletedagent
- the agent the event is destined for.
-
NotificationEvent
Constructor- Parameters:
ni
- the NotificationItem which triggered the notificationtype
-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 notificationtype
-agent
- the agent (user or role)dept
- the organizational unitisObsolete
- true, if mail notification should be suppressed
-
-
Method Details
-
setNi
Set NotificatinoItem the event will transport.- Parameters:
ni
- the item to set
-
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
-
getUniqueServerTag
Get the unique tag of the server.- Returns:
- the server tag
-
setUniqueServerTag
Sets the unique tag of the server.- Parameters:
servertag
- the id of the server to set
-
getOriginatingSessionId
Get the id of the sending session.- Returns:
- the session id
-
setOriginatingSessionId
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
-
setFolderOid
-
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
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
Check, if an event is for private notification without substitution. -
toString
Converts a NotificationEvent to a string representation.- Overrides:
toString
in classEventObject
- Returns:
- the string representation of the receiver.
-