Class Ticket
- java.lang.Object
-
- org.opennms.api.integration.ticketing.Ticket
-
public class Ticket extends java.lang.Object
OpenNMS Trouble Ticket Model class used to contain common ticket data by implementations ofTicketerPlugin
API.- Author:
- Mathew Brozowski, David Hustace
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Ticket.State
Enumeration for representation of a Ticket's state.
-
Constructor Summary
Constructors Constructor Description Ticket()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttribute(java.lang.String key, java.lang.String value)
Adds a single free form attribute to the Ticket.java.lang.Integer
getAlarmId()
Returns the ID of the originator alarmjava.lang.String
getAttribute(java.lang.String key)
Gets a single free form attribute from a Ticket.java.util.Map<java.lang.String,java.lang.String>
getAttributes()
getAttributesjava.lang.String
getDetails()
TODO: This should probably turn into a collection of comments.java.lang.String
getId()
This should be the ticket ID assigned by the HelpDesk system.java.net.InetAddress
getIpAddress()
Returns the IP address of the originator alarmjava.lang.String
getModificationTimestamp()
A timestamp to be used for optimistic locking with the trouble ticketing systemjava.lang.Integer
getNodeId()
Returns the ID of the originator nodejava.util.List<RelatedAlarmSummary>
getRelatedAlarms()
Ticket.State
getState()
Returns the currentTicket.State
java.lang.String
getSummary()
Returns a simple high level summary about the ticket that is generated from the Alarm logmsg.java.lang.String
getUser()
User name owning/createing the ticket.boolean
hasAttributes()
boolean
hasId()
boolean
isSituation()
void
setAlarmId(java.lang.Integer alarmId)
Sets the ID of the originator alarm.void
setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Store a list of free form attributes in the Ticket.void
setDetails(java.lang.String details)
TODO: This should probably turn into a collection of comments or some such thing.void
setId(java.lang.String id)
The TicketerPlugin should set the ID.void
setIpAddress(java.net.InetAddress ipAddress)
Sets the IP address of the originator alarm.void
setModificationTimestamp(java.lang.String modificationTimestamp)
setModificationTimestampvoid
setNodeId(java.lang.Integer nodeId)
Sets the ID of the originator node.void
setRelatedAlarms(java.util.List<RelatedAlarmSummary> relatedAlarms)
Set related alarms for the current alarm associated with ticket.void
setSituation(boolean situation)
Set as true if this alarm is a situation.void
setState(Ticket.State state)
Sets the Ticket state to one of theTicket.State
Enums.void
setSummary(java.lang.String summary)
Set a summary into the ticket.void
setUser(java.lang.String user)
Set the user name owning the ticket.java.lang.String
toString()
-
-
-
Method Detail
-
getAttributes
public java.util.Map<java.lang.String,java.lang.String> getAttributes()
getAttributes
- Returns:
- a Map of free from attributes of the ticket. Typically, from OnmsAlarm attributes.
-
setAttributes
public void setAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Store a list of free form attributes in the Ticket. Typically, from the OnmsAlarm attributes.- Parameters:
attributes
- aMap
object.
-
addAttribute
public void addAttribute(java.lang.String key, java.lang.String value)
Adds a single free form attribute to the Ticket.- Parameters:
key
- aString
object.value
- aString
object.
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Gets a single free form attribute from a Ticket.- Parameters:
key
- aString
object.- Returns:
- a
String
object.
-
getSummary
public java.lang.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(java.lang.String summary)
Set a summary into the ticket. Typically the alarm's logmsg.- Parameters:
summary
- aString
object.
-
getDetails
public java.lang.String getDetails()
TODO: This should probably turn into a collection of comments.- Returns:
- A string of details about the Ticket.
-
setDetails
public void setDetails(java.lang.String details)
TODO: This should probably turn into a collection of comments or some such thing.- Parameters:
details
- aString
object.
-
getId
public java.lang.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(java.lang.String id)
The TicketerPlugin should set the ID.- Parameters:
id
- aString
object.
-
getUser
public java.lang.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(java.lang.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
- aString
object.
-
getState
public Ticket.State getState()
Returns the currentTicket.State
- Returns:
- the ticket state enum.
-
setState
public void setState(Ticket.State state)
Sets the Ticket state to one of theTicket.State
Enums.- Parameters:
state
- aTicket.State
object.
-
getModificationTimestamp
public java.lang.String getModificationTimestamp()
A timestamp to be used for optimistic locking with the trouble ticketing system- Returns:
- a
String
object.
-
setModificationTimestamp
public void setModificationTimestamp(java.lang.String modificationTimestamp)
setModificationTimestamp
- Parameters:
modificationTimestamp
- aString
object.
-
getAlarmId
public java.lang.Integer getAlarmId()
Returns the ID of the originator alarm- Returns:
- the alarm ID.
-
setAlarmId
public void setAlarmId(java.lang.Integer alarmId)
Sets the ID of the originator alarm.- Parameters:
alarmId
- aInteger
object.
-
getNodeId
public java.lang.Integer getNodeId()
Returns the ID of the originator node- Returns:
- the node ID.
-
setNodeId
public void setNodeId(java.lang.Integer nodeId)
Sets the ID of the originator node.- Parameters:
nodeId
- aInteger
object.
-
getIpAddress
public java.net.InetAddress getIpAddress()
Returns the IP address of the originator alarm- Returns:
- the IP address.
-
setIpAddress
public void setIpAddress(java.net.InetAddress ipAddress)
Sets the IP address of the originator alarm.- Parameters:
ipAddress
- aInetAddress
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.
-
getRelatedAlarms
public java.util.List<RelatedAlarmSummary> getRelatedAlarms()
- Returns:
- a
List
ofRelatedAlarmSummary
containing related alarm details
-
setRelatedAlarms
public void setRelatedAlarms(java.util.List<RelatedAlarmSummary> relatedAlarms)
Set related alarms for the current alarm associated with ticket.- Parameters:
relatedAlarms
- aList
ofRelatedAlarmSummary
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-