org.opennms.bb.dp.events
Class EventTroubleTicket

java.lang.Object
  |
  +--org.opennms.bb.dp.events.EventAttributeStateOnOff
        |
        +--org.opennms.bb.dp.events.EventTroubleTicket
All Implemented Interfaces:
Serializable

public class EventTroubleTicket
extends EventAttributeStateOnOff
implements Serializable

This class is designed to encapsulate the tticket entry in the Event DTD. It encapsulates both the tickets state and the textual information associated with the ticket.

Version:
CVS $Revision: 1.4 $
Author:
Brian Weaver, OpenNMS
See Also:
Serialized Form

Field Summary
private  String m_tticket
          The trouble ticket text.
 
Fields inherited from class org.opennms.bb.dp.events.EventAttributeStateOnOff
m_state, STATE_OFF, STATE_ON
 
Constructor Summary
EventTroubleTicket()
          Constructs a new trouble ticket instance with the default value.
EventTroubleTicket(EventTroubleTicket second)
          Constructs a new instance of this class based on the value passed by the instance.
EventTroubleTicket(String tticket)
          Constructs a new instance with the specific trouble ticket text and the default state of on.
EventTroubleTicket(String tticket, int state)
          Constructs a new trouble ticket with the specific textual message and the passed state.
 
Method Summary
 String getTicket()
          Returns the trouble ticket text that is currently set.
(package private)  void serializeToXML(PrintStream ps)
          Writes self to event stream
 void set(String tticket, int state)
          Sets the trouble ticket instance information.
 void setTicket(String tticket)
          Sets the trouble ticket message.
 
Methods inherited from class org.opennms.bb.dp.events.EventAttributeStateOnOff
getState, setState
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_tticket

private String m_tticket
The trouble ticket text.
Constructor Detail

EventTroubleTicket

public EventTroubleTicket()
Constructs a new trouble ticket instance with the default value. The text is null by default and the state is set to ON.

EventTroubleTicket

public EventTroubleTicket(String tticket)
Constructs a new instance with the specific trouble ticket text and the default state of on.
Parameters:
tticket - The trouble ticket text.

EventTroubleTicket

public EventTroubleTicket(String tticket,
                          int state)
Constructs a new trouble ticket with the specific textual message and the passed state.
Parameters:
tticket - The trouble ticket text.
state - The state of the trouble ticket.

EventTroubleTicket

public EventTroubleTicket(EventTroubleTicket second)
Constructs a new instance of this class based on the value passed by the instance.
Parameters:
second - The instance to mirror in self.
Method Detail

serializeToXML

void serializeToXML(PrintStream ps)
Writes self to event stream

getTicket

public String getTicket()
Returns the trouble ticket text that is currently set.
Returns:
The trouble ticket text.

setTicket

public void setTicket(String tticket)
Sets the trouble ticket message.
Parameters:
tticket - The new trouble ticket text.

set

public void set(String tticket,
                int state)
Sets the trouble ticket instance information.
Parameters:
tticket - The trouble ticket text.
state - The trouble ticket state (on|off).