Class Notification

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    NotificationMessage, NotificationRequest

    public abstract class Notification
    extends java.lang.Object
    implements java.io.Serializable
    A base class for both notification request and result objects.
    Author:
    TIBCO Spotfire
    See Also:
    Serialized Form
    • Field Detail

      • NotificationPrefix

        public static final java.lang.String NotificationPrefix
        The prefix for every notification.
        See Also:
        Constant Field Values
      • NotificationSeparator

        public static final char NotificationSeparator
        The separator character used between notification strings.
        See Also:
        Constant Field Values
      • NotificationAttributeSeparator

        public static final char NotificationAttributeSeparator
        The character that separates the attribute value from the attribute name.
        See Also:
        Constant Field Values
      • NotificationDataSeparator

        public static final char NotificationDataSeparator
        The character that separates notification data.
        See Also:
        Constant Field Values
      • NotificationObjectSeparator

        public static final char NotificationObjectSeparator
        The character that separates notification objects.
        See Also:
        Constant Field Values
      • ATTR_JOB_ID

        public static final java.lang.String ATTR_JOB_ID
        Notification attribute name: job ID.
        See Also:
        Constant Field Values
      • ATTR_NOTIFICATION_ID

        public static final java.lang.String ATTR_NOTIFICATION_ID
        Notification attribute name: notification ID.
        See Also:
        Constant Field Values
      • ATTR_CLIENT_IP

        public static final java.lang.String ATTR_CLIENT_IP
        Notification attribute name: client IP.
        See Also:
        Constant Field Values
      • ATTR_PORT

        public static final java.lang.String ATTR_PORT
        Notification attribute name: port number.
        See Also:
        Constant Field Values
      • ATTR_SERVER_ID

        public static final java.lang.String ATTR_SERVER_ID
        Notification attribute name: server ID.
        See Also:
        Constant Field Values
      • ATTR_NOTIFICATION_MESSAGE_TYPE

        public static final java.lang.String ATTR_NOTIFICATION_MESSAGE_TYPE
        Notification attribute name: notification message type.
        See Also:
        Constant Field Values
      • ATTR_NOTIFICATION_TYPE

        public static final java.lang.String ATTR_NOTIFICATION_TYPE
        Notification attribute name: notification type.
        See Also:
        Constant Field Values
      • ATTR_DATE

        public static final java.lang.String ATTR_DATE
        Notification attribute name: notification date.
        See Also:
        Constant Field Values
      • ATTR_DATA

        public static final java.lang.String ATTR_DATA
        Notification attribute name: notification data.
        See Also:
        Constant Field Values
      • ATTR_EMAIL

        public static final java.lang.String ATTR_EMAIL
        Notification attribute name: e-mail.
        See Also:
        Constant Field Values
      • ATTR_EMAIL_ON_TYPE

        public static final java.lang.String ATTR_EMAIL_ON_TYPE
        Notification attribute name: notification e-mail on type.
        See Also:
        Constant Field Values
      • ATTR_VALUE_EMAIL_ON_ALL

        public static final java.lang.String ATTR_VALUE_EMAIL_ON_ALL
        Notification attribute name: email on all.
        See Also:
        Constant Field Values
      • ATTR_VALUE_EMAIL_ON_DONE

        public static final java.lang.String ATTR_VALUE_EMAIL_ON_DONE
        Notification attribute name: email on job done.
        See Also:
        Constant Field Values
      • ATTR_VALUE_EMAIL_ON_FAILED

        public static final java.lang.String ATTR_VALUE_EMAIL_ON_FAILED
        Notification attribute name: email on job failure.
        See Also:
        Constant Field Values
      • ATTR_VALUE_EMAIL_ON_INTERRUPTED

        public static final java.lang.String ATTR_VALUE_EMAIL_ON_INTERRUPTED
        Notification attribute name: email on job interrupted.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Notification

        public Notification()
    • Method Detail

      • getAttributeValue

        public java.lang.String getAttributeValue​(java.lang.String attr)
        Retrieves the named attribute value from the notification.
        Parameters:
        attr - The name of a notification attribute.
        Returns:
        The value of the attribute.
      • getAttributeValuePair

        public java.lang.String getAttributeValuePair​(java.lang.String attr)
        Retrieves the named attribute name/value pair from the notification.
        Parameters:
        attr - The name of a notification attribute.
        Returns:
        The value of the attribute.
      • setAttributeValue

        public void setAttributeValue​(java.lang.String attr,
                                      java.lang.String value)
        Sets an attribute value.
        Parameters:
        attr - The name of the attribute to be set.
        value - The value of the attribute to be set.
      • getAttributeList

        public java.util.List<java.lang.String> getAttributeList()
        Retrieves the attribute list of the notification.
        Returns:
        A list of notification attributes.
      • hasAllRequiredAttributesSpecified

        public boolean hasAllRequiredAttributesSpecified()
        Checks whether all required attributes are specified.
        Returns:
        true if all required attributes have been specified; otherwise false.
      • isJobStatusNotification

        public boolean isJobStatusNotification()
        Checks whether the notification is for job status change.
        Returns:
        true if the notification is for job status change; otherwise false.
      • getNotificationMessageType

        public static eNotificationMessageType getNotificationMessageType​(java.lang.String val)
        Retrieves the enum type of the corresponding notification type string.
        Returns:
        An enum type value.
        See Also:
        eNotificationMessageType
      • getNotificationMessageTypeValue

        public static java.lang.String getNotificationMessageTypeValue​(eNotificationMessageType type)
        Retrieves the value of the type attribute of the notification.
        Parameters:
        type - An enum type value.
        Returns:
        A string.
        See Also:
        eNotificationMessageType
      • getNotificationMessageTypeValue

        public java.lang.String getNotificationMessageTypeValue()
        Retrieves the value of the type attribute of the notification.
        Returns:
        A string.
      • setTime

        public void setTime​(java.util.Date time)
        Sets the time attribute.
        Parameters:
        time - The time to set.
      • getTime

        public java.util.Date getTime()
        Retrieves the time.
        Returns:
        The time.
      • setNotificationType

        public void setNotificationType​(NotificationType notificationType)
      • setJobId

        public void setJobId​(java.lang.String jobId)
        Sets the job ID.
        Parameters:
        jobId - The job ID to set.
      • getJobId

        public java.lang.String getJobId()
        Retrieves the job ID.
        Returns:
        The job ID.
      • setClientIP

        public void setClientIP​(java.lang.String clientIP)
        Sets the client IP.
        Parameters:
        clientIP - The client IP to set.
      • getClientIP

        public java.lang.String getClientIP()
        Retrieves the client IP.
        Returns:
        The client IP.
      • setPort

        public void setPort​(int port)
        Sets the port.
        Parameters:
        port - The port to set.
      • getPort

        public int getPort()
        Retrieves the port.
        Returns:
        The port.
      • setNotificationId

        public void setNotificationId​(java.lang.String notificationId)
        Sets the notification ID.
        Parameters:
        notificationId - The notification ID to set.
      • getNotificationId

        public java.lang.String getNotificationId()
        Retrieves the notification ID.
        Returns:
        The notification ID.
      • getCanonicalString

        public java.lang.String getCanonicalString()
        Retrieves the string representation of the notification.
        Returns:
        The string representation of the notification.
      • toString

        public java.lang.String toString()
        Retrieves the string representation of the notification message.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation of the notification message.