Class Ticket


  • public class Ticket
    extends Object
    OpenNMS Trouble Ticket Model class used to contain common ticket data by implementations of TicketerPlugin API.
    Author:
    Mathew Brozowski, David Hustace
    • Constructor Detail

      • Ticket

        public Ticket()
    • Method Detail

      • getAttributes

        public Map<String,​String> getAttributes()

        getAttributes

        Returns:
        a Map of free from attributes of the ticket. Typically, from OnmsAlarm attributes.
      • setAttributes

        public void setAttributes​(Map<String,​String> attributes)
        Store a list of free form attributes in the Ticket. Typically, from the OnmsAlarm attributes.
        Parameters:
        attributes - a Map object.
      • addAttribute

        public void addAttribute​(String key,
                                 String value)
        Adds a single free form attribute to the Ticket.
        Parameters:
        key - a String object.
        value - a String object.
      • getAttribute

        public String getAttribute​(String key)
        Gets a single free form attribute from a Ticket.
        Parameters:
        key - a String object.
        Returns:
        a String object.
      • getSummary

        public String getSummary()
        Returns a simple high level summary about the ticket that is generated from the Alarm logmsg.
        Returns:
        A string containing the summary of the ticket.
      • setSummary

        public void setSummary​(String summary)
        Set a summary into the ticket. Typically the alarm's logmsg.
        Parameters:
        summary - a String object.
      • getDetails

        public String getDetails()
        TODO: This should probably turn into a collection of comments.
        Returns:
        A string of details about the Ticket.
      • setDetails

        public void setDetails​(String details)
        TODO: This should probably turn into a collection of comments or some such thing.
        Parameters:
        details - a String object.
      • getId

        public String getId()
        This should be the ticket ID assigned by the HelpDesk system.
        Returns:
        a String object.
      • hasId

        public boolean hasId()
      • hasAttributes

        public boolean hasAttributes()
      • setId

        public void setId​(String id)
        The TicketerPlugin should set the ID.
        Parameters:
        id - a String object.
      • getUser

        public String getUser()
        User name owning/createing the ticket. Will be set initially to the user name set in the parameter of the create ticket event.
        Returns:
        a String containing the user name that owns the ticket.
      • setUser

        public void setUser​(String user)
        Set the user name owning the ticket. Typically set by the TicketerServiceLayer implemenation as the user name parameter from the create ticket event.
        Parameters:
        user - a String object.
      • getState

        public Ticket.State getState()
        Returns the current Ticket.State
        Returns:
        the ticket state enum.
      • setState

        public void setState​(Ticket.State state)
        Sets the Ticket state to one of the Ticket.State Enums.
        Parameters:
        state - a Ticket.State object.
      • getModificationTimestamp

        public String getModificationTimestamp()
        A timestamp to be used for optimistic locking with the trouble ticketing system
        Returns:
        a String object.
      • setModificationTimestamp

        public void setModificationTimestamp​(String modificationTimestamp)

        setModificationTimestamp

        Parameters:
        modificationTimestamp - a String object.
      • getAlarmId

        public Integer getAlarmId()
        Returns the ID of the originator alarm
        Returns:
        the alarm ID.
      • setAlarmId

        public void setAlarmId​(Integer alarmId)
        Sets the ID of the originator alarm.
        Parameters:
        alarmId - a Integer object.
      • getNodeId

        public Integer getNodeId()
        Returns the ID of the originator node
        Returns:
        the node ID.
      • setNodeId

        public void setNodeId​(Integer nodeId)
        Sets the ID of the originator node.
        Parameters:
        nodeId - a Integer object.
      • getIpAddress

        public InetAddress getIpAddress()
        Returns the IP address of the originator alarm
        Returns:
        the IP address.
      • setIpAddress

        public void setIpAddress​(InetAddress ipAddress)
        Sets the IP address of the originator alarm.
        Parameters:
        ipAddress - a InetAddress object.
      • isSituation

        public boolean isSituation()
        Returns:
        boolean depending on whether alarm is situation or not. default is false.
      • setSituation

        public void setSituation​(boolean situation)
        Set as true if this alarm is a situation.
        Parameters:
        situation - whether or not this alarm is a situation.