Interface EventDefinition

    • Field Detail

      • VERSION_EVENTDEFINITION

        static final com.redwood.scheduler.infrastructure.logging.Versions VERSION_EVENTDEFINITION
      • BEHAVIOR_MAINTENANCE

        @Deprecated
        static final Long BEHAVIOR_MAINTENANCE
        Deprecated.
        This is no longer used

        Behavior for System events that can't be modified, however file events can be added or removed. System Events with this behavior can change the file events that will raise this event.

      • SEC_PRIV_VIEW

        static final String SEC_PRIV_VIEW
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_RAISE

        static final String SEC_PRIV_RAISE
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_CLEAR

        static final String SEC_PRIV_CLEAR
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_CLEARPENDINGEVENTS

        static final String SEC_PRIV_CLEARPENDINGEVENTS
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_DELETEARCHIVEDEVENTS

        static final String SEC_PRIV_DELETEARCHIVEDEVENTS
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_EDIT

        static final String SEC_PRIV_EDIT
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_PRIV_DELETE

        static final String SEC_PRIV_DELETE
        This privilege can be granted at a group level. This privilege can be granted at an instance level.
        See Also:
        Constant Field Values
      • SEC_RANK_CREATE

        static final String SEC_RANK_CREATE
        This rank is made of the following privileges: create
        See Also:
        Constant Field Values
      • SEC_RANK_MANAGEEVENTS

        static final String SEC_RANK_MANAGEEVENTS
        This rank is made of the following privileges: view , raise , clear , deleteArchivedEvents , clearPendingEvents
        See Also:
        Constant Field Values
      • SEC_RANK_EDIT

        static final String SEC_RANK_EDIT
        This rank is made of the following privileges: create , view , raise , clear , deleteArchivedEvents , clearPendingEvents , edit
        See Also:
        Constant Field Values
      • SEC_RANK_DELETE

        static final String SEC_RANK_DELETE
        This rank is made of the following privileges: create , view , raise , clear , deleteArchivedEvents , clearPendingEvents , delete
        See Also:
        Constant Field Values
      • SEC_RANK_ALL

        static final String SEC_RANK_ALL
        This rank is made of the following privileges: create , view , raise , clear , clearPendingEvents , deleteArchivedEvents , edit , delete
        See Also:
        Constant Field Values
    • Method Detail

      • getCurrentRaisedEvent

        Event getCurrentRaisedEvent()
        Get the value for CurrentRaisedEvent. (The currently raised Event. If isRaised()==false, then this will return null.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getLastRaisedEvent

        Event getLastRaisedEvent()
        Get the value for LastRaisedEvent. (The last raised Event. If getCurrentRaisedEvent != null, then this method will return the same Event.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • isRaised

        boolean isRaised()
        Get the value for Raised. (Is this event currently raised?)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • isRequiresCommentOnRaise

        boolean isRequiresCommentOnRaise()
        Get the value for RequiresCommentOnRaise. (If set, prompt the user for a comment on the raise of the event)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getDefaultRaiseComment

        String getDefaultRaiseComment()
        Get the value for DefaultRaiseComment. (Default comment that will be set as RaiserComment on a newly raised event.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • isRequiresCommentOnClear

        boolean isRequiresCommentOnClear()
        Get the value for RequiresCommentOnClear. (If set, prompt the user for a comment on the clear of the event)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getDefaultClearComment

        String getDefaultClearComment()
        Get the value for DefaultClearComment. (Default comment that will be set as ClearerComment on the cleared event.)
        Returns:
        the field
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setRequiresCommentOnRaise

        void setRequiresCommentOnRaise​(boolean newRequiresCommentOnRaise)
        Set the value for RequiresCommentOnRaise. (If set, prompt the user for a comment on the raise of the event)
        Parameters:
        newRequiresCommentOnRaise - the new value for RequiresCommentOnRaise.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setDefaultRaiseComment

        void setDefaultRaiseComment​(String newDefaultRaiseComment)
        Set the value for DefaultRaiseComment. (Default comment that will be set as RaiserComment on a newly raised event.) This value is optional.
        Parameters:
        newDefaultRaiseComment - the new value for DefaultRaiseComment.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setRequiresCommentOnClear

        void setRequiresCommentOnClear​(boolean newRequiresCommentOnClear)
        Set the value for RequiresCommentOnClear. (If set, prompt the user for a comment on the clear of the event)
        Parameters:
        newRequiresCommentOnClear - the new value for RequiresCommentOnClear.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setDefaultClearComment

        void setDefaultClearComment​(String newDefaultClearComment)
        Set the value for DefaultClearComment. (Default comment that will be set as ClearerComment on the cleared event.) This value is optional.
        Parameters:
        newDefaultClearComment - the new value for DefaultClearComment.
        Throws:
        ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • raise

        Event raise()
             throws PendingEventsNotAllowedException
        Raise an instance of this EventDefinition. The session needs to be persisted before the Event will be raised in the database. If the event is raised in the context of a job, the RaiserObject will be set to this job. Otherwise it will default to the current user. The comment will be "raised automatically" resp. "raised manually", unless a raise comment was specified for the event definition.
        Returns:
        The newly raised Event.
        Throws:
        PendingEventsNotAllowedException - Cannot raise event; isPendingEventsAllowed is false and the event is already raised.
      • clear

        void clear()
        Clear the currently raised Event for this EventDefinition. This method will not do anything if there is no currently-raised event. The session needs to be persisted before the Event will be cleared in the database.
      • clearAllPending

        void clearAllPending()
        Clear all the pending events for this EventDefinition. This method will not do anything if there are no pending events. The session needs to be persisted before events will be cleared in the database.
      • clearAllPending

        void clearAllPending​(Job job,
                             String clearerComment)
        Clear all the pending events for this EventDefinition. This method will not do anything if there are no pending events. The session needs to be persisted before events will be cleared in the database. Convenience function to clear and set Job and Comment in one go.
        Parameters:
        job - The Job that caused this Event to be cleared, can be null if it is not being cleared by a Job.
        clearerComment - The comment that should be associated with the clearing of this event.
      • raise

        Event raise​(Job job,
                    String raiserComment)
             throws PendingEventsNotAllowedException
        Raise an Event instance for this EventDefinition. The session needs to be persisted before the Event will be raised in the database. Convenience function to raise and set Job and Comment in one go.
        Parameters:
        job - The Job that caused this Event to be raised, can be null if it is not being raised by a Job. If set to null, the default rules for raise() will apply.
        raiserComment - The comment that should be associated with this raised event.
        Returns:
        The newly raised Event.
        Throws:
        PendingEventsNotAllowedException - Cannot raise event; isPendingEventsAllowed is false and the event is already raised.
      • clear

        void clear​(Job job,
                   String clearerComment)
        Clear the currently raised Event instance for this EventDefinition. This method will not do anything if there is no currently-raised event. The session needs to be persisted before the Event will be cleared in the database. Convenience function to clear and set Job and Comment in one go.
        Parameters:
        job - The Job that caused this Event to be cleared, can be null if it is not being cleared by a Job.
        clearerComment - The comment that should be associated with the clearing of this event.
      • getEvents

        RWIterable<Event> getEvents()
        Get an RWIterable over a collection of Events, the collection will be ordered by UniqueId. If the collection is empty, an empty iterator will be returned, that is, this method will never return null. A list of events that have been created by calling raise().
        Specified by:
        getEvents in interface EventDefinitionComp
        Returns:
        An RWIterable over a collection of Event objects , the collection will be ordered by UniqueId.
      • createEvent

        Event createEvent()
        Create a new Event linked to this object.
        Returns:
        a new Event.
      • getEventByRaisedSequence

        Event getEventByRaisedSequence​(Long raisedSequence)
        Get the Event by RaisedSequence.
        Parameters:
        raisedSequence -
        Returns:
        the Event, or null if it could not be found
      • getFileEventDefinitionByName

        FileEventDefinition getFileEventDefinitionByName​(String name)
        Get the FileEventDefinition by NameEventDefinition.
        Parameters:
        name -
        Returns:
        the FileEventDefinition, or null if it could not be found
      • getMonitorEventByLinkableMonitor

        MonitorEvent getMonitorEventByLinkableMonitor​(LinkableMonitor linkableMonitor)
        Get the MonitorEvent by MonitorEvent.
        Parameters:
        linkableMonitor -
        Returns:
        the MonitorEvent, or null if it could not be found
      • checkCreatePrivilege

        RequiredPermission checkCreatePrivilege()
        Check whether or not the create action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkViewPrivilege

        RequiredPermission checkViewPrivilege()
        Check whether or not the view action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkRaisePrivilege

        RequiredPermission checkRaisePrivilege()
        Check whether or not the raise action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkClearPrivilege

        RequiredPermission checkClearPrivilege()
        Check whether or not the clear action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkClearPendingEventsPrivilege

        RequiredPermission checkClearPendingEventsPrivilege()
        Check whether or not the clearPendingEvents action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkDeleteArchivedEventsPrivilege

        RequiredPermission checkDeleteArchivedEventsPrivilege()
        Check whether or not the deleteArchivedEvents action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkEditPrivilege

        RequiredPermission checkEditPrivilege()
        Check whether or not the edit action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkDeletePrivilege

        RequiredPermission checkDeletePrivilege()
        Check whether or not the delete action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.