Class Ticket
- java.lang.Object
-
- org.opennms.api.integration.ticketing.Ticket
-
public class Ticket extends 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(String key, String value)
Adds a single free form attribute to the Ticket.Integer
getAlarmId()
Returns the ID of the originator alarmString
getAttribute(String key)
Gets a single free form attribute from a Ticket.Map<String,String>
getAttributes()
getAttributesString
getDetails()
TODO: This should probably turn into a collection of comments.String
getId()
This should be the ticket ID assigned by the HelpDesk system.InetAddress
getIpAddress()
Returns the IP address of the originator alarmString
getModificationTimestamp()
A timestamp to be used for optimistic locking with the trouble ticketing systemInteger
getNodeId()
Returns the ID of the originator nodeList<RelatedAlarmSummary>
getRelatedAlarms()
Ticket.State
getState()
Returns the currentTicket.State
String
getSummary()
Returns a simple high level summary about the ticket that is generated from the Alarm logmsg.String
getUser()
User name owning/createing the ticket.boolean
hasAttributes()
boolean
hasId()
boolean
isSituation()
void
setAlarmId(Integer alarmId)
Sets the ID of the originator alarm.void
setAttributes(Map<String,String> attributes)
Store a list of free form attributes in the Ticket.void
setDetails(String details)
TODO: This should probably turn into a collection of comments or some such thing.void
setId(String id)
The TicketerPlugin should set the ID.void
setIpAddress(InetAddress ipAddress)
Sets the IP address of the originator alarm.void
setModificationTimestamp(String modificationTimestamp)
setModificationTimestampvoid
setNodeId(Integer nodeId)
Sets the ID of the originator node.void
setRelatedAlarms(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(String summary)
Set a summary into the ticket.void
setUser(String user)
Set the user name owning the ticket.String
toString()
-
-
-
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
- aMap
object.
-
addAttribute
public void addAttribute(String key, String value)
Adds a single free form attribute to the Ticket.
-
getAttribute
public String getAttribute(String key)
Gets a single free form attribute from a Ticket.
-
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
- aString
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
- aString
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
- aString
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
- 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 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
- aString
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
- aInteger
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
- aInteger
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
- 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 List<RelatedAlarmSummary> getRelatedAlarms()
- Returns:
- a
List
ofRelatedAlarmSummary
containing related alarm details
-
setRelatedAlarms
public void setRelatedAlarms(List<RelatedAlarmSummary> relatedAlarms)
Set related alarms for the current alarm associated with ticket.- Parameters:
relatedAlarms
- aList
ofRelatedAlarmSummary
-
-