Package sage.api

Class SystemMessageAPI


  • public class SystemMessageAPI
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void DeleteAllSystemMessages()
      Deletes all the SystemMessages from the queue.
      void DeleteSystemMessage​(sage.msg.SystemMessage message)
      Deletes the specified SystemMessage from the queue.
      int GetSystemAlertLevel()
      Gets the global alert level in the system.
      long GetSystemMessageEndTime​(sage.msg.SystemMessage message)
      Gets the time when this SystemMessage was last posted.
      int GetSystemMessageLevel​(sage.msg.SystemMessage message)
      Returns the alert level for the SystemMessage that was specified.
      int GetSystemMessageRepeatCount​(sage.msg.SystemMessage message)
      Gets the number of times this message was repeated.
      sage.msg.SystemMessage[] GetSystemMessages()
      Returns the list of SystemMessage objects currently in the queue.
      java.lang.String GetSystemMessageString​(sage.msg.SystemMessage message)
      Gets the 'message string' associated with this SystemMessage.
      long GetSystemMessageTime​(sage.msg.SystemMessage message)
      Gets the time when this SystemMessage was first posted.
      int GetSystemMessageTypeCode​(sage.msg.SystemMessage message)
      Returns an integer which represents the type of SystemMessage that was specified.
      java.lang.String GetSystemMessageTypeName​(sage.msg.SystemMessage message)
      Returns a localized string which represents the type of SystemMessage that was specified.
      java.lang.String GetSystemMessageVariable​(sage.msg.SystemMessage message, java.lang.String VarName)
      Returns the SystemMessage variable property associated with the specified SystemMessage.
      java.lang.String[] GetSystemMessageVariableNames​(sage.msg.SystemMessage message)
      Returns the names of the variables associated with the specified SystemMessage.
      boolean IsSystemMessageObject​(java.lang.Object SystemMessage)
      Returns true if the passed in argument is a SystemMessage object
      void PostSystemMessage​(int MessageCode, int MessageLevel, java.lang.String MessageString, java.util.Properties MessageVariables)
      Creates a new SystemMessage and posts it to the message queue.
      void ResetSystemAlertLevel()
      Resets the global alert level in the system back to zero.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SystemMessageAPI

        public SystemMessageAPI()
    • Method Detail

      • GetSystemAlertLevel

        public int GetSystemAlertLevel()
        Gets the global alert level in the system.
        Returns:
        a value from 0-3; with 0=No Alert, 1=Info Alert, 2=Warning Alert, 3=Error Alert
        Since:
        6.6
      • GetSystemMessages

        public sage.msg.SystemMessage[] GetSystemMessages()
        Returns the list of SystemMessage objects currently in the queue.
        Returns:
        an array of SystemMessage objects currently in the queue
        Since:
        6.6
      • ResetSystemAlertLevel

        public void ResetSystemAlertLevel()
        Resets the global alert level in the system back to zero.
        Since:
        6.6
      • DeleteAllSystemMessages

        public void DeleteAllSystemMessages()
        Deletes all the SystemMessages from the queue. This will not have any effect on the global alert level.
        Since:
        6.6
      • DeleteSystemMessage

        public void DeleteSystemMessage​(sage.msg.SystemMessage message)
        Deletes the specified SystemMessage from the queue. This will not have any effect on the global alert level.
        Parameters:
        message - the SystemMessage object to delete
        Since:
        6.6
      • GetSystemMessageString

        public java.lang.String GetSystemMessageString​(sage.msg.SystemMessage message)
        Gets the 'message string' associated with this SystemMessage. This is the same result as converting the object to a String.
        Parameters:
        message - the SystemMessage object to get the 'message string' for
        Returns:
        the 'message string' for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageTime

        public long GetSystemMessageTime​(sage.msg.SystemMessage message)
        Gets the time when this SystemMessage was first posted.
        Parameters:
        message - the SystemMessage object to get the time of
        Returns:
        the time for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageEndTime

        public long GetSystemMessageEndTime​(sage.msg.SystemMessage message)
        Gets the time when this SystemMessage was last posted. For messages that did not repeat this will be the same as GetSystemMessageTime. For messages that repeated; this will be the time of the last repeating occurence.
        Parameters:
        message - the SystemMessage object to get the end time of
        Returns:
        the end time for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageRepeatCount

        public int GetSystemMessageRepeatCount​(sage.msg.SystemMessage message)
        Gets the number of times this message was repeated. For a message that repeated once (i.e. it had 2 occurences), this method will return 2.
        Parameters:
        message - the SystemMessage object to get the repeat count for
        Returns:
        the repeat count for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageTypeName

        public java.lang.String GetSystemMessageTypeName​(sage.msg.SystemMessage message)
        Returns a localized string which represents the type of SystemMessage that was specified.
        Parameters:
        message - the SystemMessage object to get the type of
        Returns:
        the type for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageTypeCode

        public int GetSystemMessageTypeCode​(sage.msg.SystemMessage message)
        Returns an integer which represents the type of SystemMessage that was specified.
        Parameters:
        message - the SystemMessage object to get the type of
        Returns:
        the type for the specified SystemMessage
        Since:
        6.6
      • GetSystemMessageLevel

        public int GetSystemMessageLevel​(sage.msg.SystemMessage message)
        Returns the alert level for the SystemMessage that was specified.
        Parameters:
        message - the SystemMessage object to get the alert level of
        Returns:
        a value from 0-3; with 0=No Alert, 1=Info Alert, 2=Warning Alert, 3=Error Alert
        Since:
        6.6
      • GetSystemMessageVariable

        public java.lang.String GetSystemMessageVariable​(sage.msg.SystemMessage message,
                                                         java.lang.String VarName)
        Returns the SystemMessage variable property associated with the specified SystemMessage. Depending upon the type of message; different variables will be assigned that can be used to do further analysis/processing on the message or to guide the user through resolution steps.
        Parameters:
        message - the SystemMessage object to lookup the variable in
        VarName - the name of the variable to lookup in this SystemMessage (string based values)
        Returns:
        a String that corresponds to the requested variable or null if it does not exist
        Since:
        6.6
      • PostSystemMessage

        public void PostSystemMessage​(int MessageCode,
                                      int MessageLevel,
                                      java.lang.String MessageString,
                                      java.util.Properties MessageVariables)
        Creates a new SystemMessage and posts it to the message queue. Predefined message codes of interest for posting messages are:
        SOFTWARE_UPDATE_MSG = 1202
        STORAGE_MONITOR_MSG = 1203
        GENERAL_MSG = 1204

        You may also use other user-defined message codes which should be greater than 9999. To give those messages a 'type name' which will be visible by the user; you can defined a message variable with the name 'typename' and then that will be displayed.
        Parameters:
        MessageCode - the integer code that specifies the type of message
        MessageLevel - the integer code specifying the level of the message; 0=Status(does not raise global level),1=Info, 2=Warning, 3=Error
        MessageString - a localized message string that explains what the message is in detail
        MessageVariables - a java.util.Properties object which has name->value pairs that represent variables corresponding to the details of this message
        Since:
        6.6
      • IsSystemMessageObject

        public boolean IsSystemMessageObject​(java.lang.Object SystemMessage)
        Returns true if the passed in argument is a SystemMessage object
        Parameters:
        SystemMessage - the object to test to see if it is a SystemMessage object
        Returns:
        true if the passed in argument is a SystemMessage object, false otherwise
        Since:
        7.0
      • GetSystemMessageVariableNames

        public java.lang.String[] GetSystemMessageVariableNames​(sage.msg.SystemMessage message)
        Returns the names of the variables associated with the specified SystemMessage. Depending upon the type of message; different variables will be assigned that can be used to do further analysis/processing on the message or to guide the user through resolution steps. The actual values can be retrieved with GetSystemMessageVariable.
        Parameters:
        message - the SystemMessage object to get the variable names of
        Returns:
        a String array with all the names of the variables for the specified SystemMessage
        Since:
        7.0