Class Ticket
- java.lang.Object
-
- org.opennms.api.integration.ticketing.Ticket
-
public class Ticket extends java.lang.ObjectOpenNMS Trouble Ticket Model class used to contain common ticket data by implementations ofTicketerPluginAPI.- Author:
- Mathew Brozowski, David Hustace
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTicket.StateEnumeration 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 voidaddAttribute(java.lang.String key, java.lang.String value)Adds a single free form attribute to the Ticket.java.lang.IntegergetAlarmId()Returns the ID of the originator alarmjava.lang.StringgetAttribute(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.StringgetDetails()TODO: This should probably turn into a collection of comments.java.lang.StringgetId()This should be the ticket ID assigned by the HelpDesk system.java.net.InetAddressgetIpAddress()Returns the IP address of the originator alarmjava.lang.StringgetModificationTimestamp()A timestamp to be used for optimistic locking with the trouble ticketing systemjava.lang.IntegergetNodeId()Returns the ID of the originator nodejava.util.List<RelatedAlarmSummary>getRelatedAlarms()Ticket.StategetState()Returns the currentTicket.Statejava.lang.StringgetSummary()Returns a simple high level summary about the ticket that is generated from the Alarm logmsg.java.lang.StringgetUser()User name owning/createing the ticket.booleanhasAttributes()booleanhasId()booleanisSituation()voidsetAlarmId(java.lang.Integer alarmId)Sets the ID of the originator alarm.voidsetAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)Store a list of free form attributes in the Ticket.voidsetDetails(java.lang.String details)TODO: This should probably turn into a collection of comments or some such thing.voidsetId(java.lang.String id)The TicketerPlugin should set the ID.voidsetIpAddress(java.net.InetAddress ipAddress)Sets the IP address of the originator alarm.voidsetModificationTimestamp(java.lang.String modificationTimestamp)setModificationTimestampvoidsetNodeId(java.lang.Integer nodeId)Sets the ID of the originator node.voidsetRelatedAlarms(java.util.List<RelatedAlarmSummary> relatedAlarms)Set related alarms for the current alarm associated with ticket.voidsetSituation(boolean situation)Set as true if this alarm is a situation.voidsetState(Ticket.State state)Sets the Ticket state to one of theTicket.StateEnums.voidsetSummary(java.lang.String summary)Set a summary into the ticket.voidsetUser(java.lang.String user)Set the user name owning the ticket.java.lang.StringtoString()
-
-
-
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- aMapobject.
-
addAttribute
public void addAttribute(java.lang.String key, java.lang.String value)Adds a single free form attribute to the Ticket.- Parameters:
key- aStringobject.value- aStringobject.
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
Gets a single free form attribute from a Ticket.- Parameters:
key- aStringobject.- Returns:
- a
Stringobject.
-
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- aStringobject.
-
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- aStringobject.
-
getId
public java.lang.String getId()
This should be the ticket ID assigned by the HelpDesk system.- Returns:
- a
Stringobject.
-
hasId
public boolean hasId()
-
hasAttributes
public boolean hasAttributes()
-
setId
public void setId(java.lang.String id)
The TicketerPlugin should set the ID.- Parameters:
id- aStringobject.
-
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- aStringobject.
-
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.StateEnums.- Parameters:
state- aTicket.Stateobject.
-
getModificationTimestamp
public java.lang.String getModificationTimestamp()
A timestamp to be used for optimistic locking with the trouble ticketing system- Returns:
- a
Stringobject.
-
setModificationTimestamp
public void setModificationTimestamp(java.lang.String modificationTimestamp)
setModificationTimestamp
- Parameters:
modificationTimestamp- aStringobject.
-
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- aIntegerobject.
-
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- aIntegerobject.
-
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- aInetAddressobject.
-
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
ListofRelatedAlarmSummarycontaining related alarm details
-
setRelatedAlarms
public void setRelatedAlarms(java.util.List<RelatedAlarmSummary> relatedAlarms)
Set related alarms for the current alarm associated with ticket.- Parameters:
relatedAlarms- aListofRelatedAlarmSummary
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-