org.opennms.bb.dp.events
Class EventLogMessage

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

public class EventLogMessage
extends Object
implements Serializable

This class is designed to encapsulate the logmsg element contained in the Event DTD. It contains the textual log message and the destination attribute value, as defined by the DTD.

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

Field Summary
static int LOGNDISPLAY
          The log option for Logging the message and displaying the message in the event browser.
static int LOGONLY
          The log option for only writting the message to permanent storage.
private  int m_how
          The log options
private  String m_message
          The log message
static int SUPPRESS
          The log option for suppressing the event in both the permanent storage and the realtime console.
 
Constructor Summary
EventLogMessage()
          Constructs a new log message instance.
EventLogMessage(EventLogMessage second)
          Constructs a new instance with the same data as the passed instance.
EventLogMessage(String message)
          Constructs a new instance with the log message equal to the passed value and the log option equal to LOGNDISPLAY.
EventLogMessage(String message, int logopt)
          Constructs a new instance with the specific message and log option.
 
Method Summary
 int getLogOption()
          Returns the log option for this instance.
 String getMessage()
          Returns the message text associated with this log message.
(package private)  void serializeToXML(PrintStream ps)
          Writes self to event stream
 void set(String message, int logopt)
          Sets the message and log option for this object's instance.
 void setLogOption(int logopt)
          Sets the log option for this instance.
 void setMessage(String message)
          Sets the log message text.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

LOGNDISPLAY

public static final int LOGNDISPLAY
The log option for Logging the message and displaying the message in the event browser.

LOGONLY

public static final int LOGONLY
The log option for only writting the message to permanent storage. No display of the message is performed.

SUPPRESS

public static final int SUPPRESS
The log option for suppressing the event in both the permanent storage and the realtime console.

m_how

private int m_how
The log options

m_message

private String m_message
The log message
Constructor Detail

EventLogMessage

public EventLogMessage()
Constructs a new log message instance. This format is described in the Event DTD under the element logmsg.

EventLogMessage

public EventLogMessage(EventLogMessage second)
Constructs a new instance with the same data as the passed instance. This is in essance a copy constructor.
Parameters:
second - The object to be copied into self.

EventLogMessage

public EventLogMessage(String message)
Constructs a new instance with the log message equal to the passed value and the log option equal to LOGNDISPLAY.
Parameters:
message - The message text
See Also:
LOGNDISPLAY

EventLogMessage

public EventLogMessage(String message,
                       int logopt)
Constructs a new instance with the specific message and log option.
Parameters:
message - The log message.
logopt - The log option.
See Also:
LOGNDISPLAY, LOGONLY, SUPPRESS
Method Detail

serializeToXML

void serializeToXML(PrintStream ps)
Writes self to event stream

getLogOption

public int getLogOption()
Returns the log option for this instance.
Returns:
The log option.

setLogOption

public void setLogOption(int logopt)
Sets the log option for this instance.
Parameters:
logopt - The log option.

getMessage

public String getMessage()
Returns the message text associated with this log message.
Returns:
The log message text.

setMessage

public void setMessage(String message)
Sets the log message text.
Parameters:
message - The new log message.

set

public void set(String message,
                int logopt)
Sets the message and log option for this object's instance. This allows both the message and option to be set in one call.
Parameters:
message - The new message text.
logopt - The log option for this instance.