Interface ProcessServerCheck

  • All Superinterfaces:
    Detail, NamedDetailObject, ProcessServerCheckComp, Readable, SchedulerEntity, SchedulerEntityComp

    public interface ProcessServerCheck
    extends ProcessServerCheckComp, NamedDetailObject, Readable
    A check on the status of a particular part of the server that the ProcessServer runs on. A ProcessServerCheck creates a Monitor Check with the path /System/ProcessServers/${ProcessServer}/Check/${Name} A ProcessServerCheck creates a Monitor Value with the path /System/ProcessServers/${ProcessServer}/Check/${Name}/${Style-Derived} where ${Style-Derived} is a term derived from the style. For Process,Socket,Win32Service it is Count. For LogFile and Win32Eventlog it is Message.
    • Method Detail

      • isEnabled

        boolean isEnabled()
        Get the value for Enabled. (Whether this process server check is currently enabled.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getStyle

        ProcessServerCheckStyle getStyle()
        Get the value for Style. (The style or type of the check) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getAttribute1

        String getAttribute1()
        Get the value for Attribute1. (The first attribute, meaning is style dependent) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getAttribute2

        String getAttribute2()
        Get the value for Attribute2. (The second attribute, meaning is style dependent)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getPollInterval

        Long getPollInterval()
        Get the value for PollInterval. (Polling interval that servers as the upper bound for how often the check is performed.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getSeverity

        Long getSeverity()
        Get the value for Severity. (The severity that the resulting monitor check will get when the check fails the condition, or null for the system default.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getConditionExpression

        String getConditionExpression()
        Get the value for ConditionExpression. (The (optional) condition expression. If this is set, then the expression is evaluated to evaluate whether the condition is met. The default condition is '= Count < 1' which means that the Monitor will be set to a severity if no item in the system matches the search condition(s) set in Attribute 1 and 2.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getDelayAmount

        Long getDelayAmount()
        Get the value for DelayAmount. ( Number of 'delay time units' after a ProcessServerCheck has failed to rerun the check. On failure of the check for the second time a relevant reaction will be triggered. Leave unassigned or assign null if the check is not to be rerun on failure. ) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getDelayUnits

        TimeUnit getDelayUnits()
        Get the value for DelayUnits. (Time units for 'delay amount' - seconds, minutes, hours, days. May not be null, defaults to minutes) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getAddress

        String getAddress()
        Get the value for Address. (The address parameter of the reaction job)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMessage

        String getMessage()
        Get the value for Message. (The message parameter of the reaction job)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getData

        String getData()
        Get the value for Data. (The data parameter of the reaction job)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setEnabled

        void setEnabled​(boolean newEnabled)
        Set the value for Enabled. (Whether this process server check is currently enabled.)
        Parameters:
        newEnabled - the new value for Enabled.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setStyle

        void setStyle​(ProcessServerCheckStyle newStyle)
        Set the value for Style. (The style or type of the check) This value is mandatory.
        Parameters:
        newStyle - the new value for Style. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setAttribute1

        void setAttribute1​(String newAttribute1)
        Set the value for Attribute1. (The first attribute, meaning is style dependent) This value is mandatory.
        Parameters:
        newAttribute1 - the new value for Attribute1. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setAttribute2

        void setAttribute2​(String newAttribute2)
        Set the value for Attribute2. (The second attribute, meaning is style dependent) This value is optional.
        Parameters:
        newAttribute2 - the new value for Attribute2.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setPollInterval

        void setPollInterval​(Long newPollInterval)
        Set the value for PollInterval. (Polling interval that servers as the upper bound for how often the check is performed.) This value is mandatory.
        Parameters:
        newPollInterval - the new value for PollInterval. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setSeverity

        void setSeverity​(Long newSeverity)
        Set the value for Severity. (The severity that the resulting monitor check will get when the check fails the condition, or null for the system default.) This value is optional.
        Parameters:
        newSeverity - the new value for Severity.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setConditionExpression

        void setConditionExpression​(String newConditionExpression)
        Set the value for ConditionExpression. (The (optional) condition expression. If this is set, then the expression is evaluated to evaluate whether the condition is met. The default condition is '= Count < 1' which means that the Monitor will be set to a severity if no item in the system matches the search condition(s) set in Attribute 1 and 2.) This value is optional.
        Parameters:
        newConditionExpression - the new value for ConditionExpression.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setDelayAmount

        void setDelayAmount​(Long newDelayAmount)
        Set the value for DelayAmount. ( Number of 'delay time units' after a ProcessServerCheck has failed to rerun the check. On failure of the check for the second time a relevant reaction will be triggered. Leave unassigned or assign null if the check is not to be rerun on failure. ) This value is mandatory.
        Parameters:
        newDelayAmount - the new value for DelayAmount. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setDelayUnits

        void setDelayUnits​(TimeUnit newDelayUnits)
        Set the value for DelayUnits. (Time units for 'delay amount' - seconds, minutes, hours, days. May not be null, defaults to minutes) This value is mandatory.
        Parameters:
        newDelayUnits - the new value for DelayUnits. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setAddress

        void setAddress​(String newAddress)
        Set the value for Address. (The address parameter of the reaction job) This value is optional.
        Parameters:
        newAddress - the new value for Address.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMessage

        void setMessage​(String newMessage)
        Set the value for Message. (The message parameter of the reaction job) This value is optional.
        Parameters:
        newMessage - the new value for Message.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setData

        void setData​(String newData)
        Set the value for Data. (The data parameter of the reaction job) This value is optional.
        Parameters:
        newData - the new value for Data.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getParameters

        List<ProcessServerCheckAttributeInfo> getParameters()
        A list of ProcessServerCheckAttributeInfo objects describing each attribute. Each object contains a translation keys that is used as the label for the attribute. The list will contain zero, one or two object. Zero objects means there are no attributes for the check and both fields are disabled. One object means one attribute1 is made available and attribute2 is disabled. Two objects makes both attributes available for entry.
        Returns:
        The list of ProcessServerCheckAttributeInfo objects describing the attributes
      • validate

        void validate()
               throws com.redwood.scheduler.api.exception.ProcessServerCheckValidateException,
                      com.redwood.scheduler.api.exception.ProcessServerCheckSystemException
        Ensures that the parameters set for a ProcessServerCheck are valid
        Throws:
        com.redwood.scheduler.api.exception.ProcessServerCheckValidateException - The attributes defined for a Process Server Check failed validation
        com.redwood.scheduler.api.exception.ProcessServerCheckSystemException - An IO or other system exception occurred while executing a Process Server Check
      • execute

        void execute()
              throws com.redwood.scheduler.api.exception.ProcessServerCheckFailException,
                     com.redwood.scheduler.api.exception.ProcessServerCheckValidateException,
                     com.redwood.scheduler.api.exception.ProcessServerCheckSystemException
        Executes the ProcessServerCheck
        Throws:
        com.redwood.scheduler.api.exception.ProcessServerCheckFailException - A Process Server Check failed to meet the defined threshold(s)
        com.redwood.scheduler.api.exception.ProcessServerCheckValidateException - The attributes defined for a Process Server Check failed validation
        com.redwood.scheduler.api.exception.ProcessServerCheckSystemException - An IO or other system exception occurred while executing a Process Server Check
      • executeAndReact

        void executeAndReact()
                      throws com.redwood.scheduler.api.exception.ProcessServerCheckValidateException,
                             com.redwood.scheduler.api.exception.ProcessServerCheckSystemException
        Executes the ProcessServerCheck and takes action if the check fails
        Throws:
        com.redwood.scheduler.api.exception.ProcessServerCheckValidateException - The attributes defined for a Process Server Check failed validation
        com.redwood.scheduler.api.exception.ProcessServerCheckSystemException - An IO or other system exception occurred while executing a Process Server Check
      • getProcessServer

        ProcessServer getProcessServer()
        Get the ProcessServer.
        Returns:
        ProcessServer
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getAdHocAlertSource

        AdHocAlertSource getAdHocAlertSource()
        Get the AdHocAlertSource.
        Returns:
        AdHocAlertSource
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • getJobDefinition

        JobDefinition getJobDefinition()
        Get the JobDefinition.
        Returns:
        JobDefinition
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • setAdHocAlertSource

        void setAdHocAlertSource​(AdHocAlertSource newAdHocAlertSource)
        Set the value for AdHocAlertSource. This value is optional.
        Parameters:
        newAdHocAlertSource - is the object to set AdHocAlertSource to. AdHocAlertSource that is used to raise an alert when the ProcessServerCheck fails
      • setJobDefinition

        void setJobDefinition​(JobDefinition newJobDefinition)
        Set the value for JobDefinition. This value is optional.
        Parameters:
        newJobDefinition - is the object to set JobDefinition to. Reaction JobDefiniton that is submitted on failure of the ProcessServerCheck
      • getProcessServerCheckLogByCreationTime

        ProcessServerCheckLog getProcessServerCheckLogByCreationTime​(DateTimeZone creationTime)
        Get the ProcessServerCheckLog by ProcessServerCheckCreationTime.
        Parameters:
        creationTime -
        Returns:
        the ProcessServerCheckLog, or null if it could not be found