org.opennms.bb.dp.events
Class EventHeader

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

public class EventHeader
extends Object
implements Serializable

EventHeader holds data from the

..
block in the incoming event stream. This is usually the same information that is contained in the headers from all the DTDs that describe documents that are sent between two different processes.

Version:
$Revision: 1.4 $
Author:
Sowmya Kumaraswamy, Brian Weaver, OpenNMS.org
See Also:
Serialized Form

Field Summary
private  Calendar m_created
          the creation date of this event stream
private  String m_dpName
          the distributed poller sending the events
private  String m_mstation
          master station associated with the poller sending the event
private  String m_ver
          the dtd version used
 
Constructor Summary
EventHeader()
          Constructs a new event header object with the default values.
EventHeader(EventHeader second)
          Construct a new event header object that is a duplicate of the passed object.
EventHeader(String ver, String dpName, String mstation, Calendar created)
          Constructs a EventHeader object with all the specific value.
 
Method Summary
 String getDPName()
          Returns the distributed poller name
 String getMStation()
          Returns the master station address information
 Calendar getTimestamp()
          Returns the time when the header was created.
 String getVersion()
          Returns the current version text.
(package private)  void serializeToXML(PrintStream ps)
          Writes self to event stream
 void setDPName(String dpName)
          Sets the distributed poller name
 void setMStation(String mstation)
          Sets the master station field
 void setTimestamp(Calendar c)
          Sets the time that the header was created.
 void setTimestamp(Date d)
          Sets the time that the header was created.
 void setVersion(String version)
          Sets the version string for the header
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_ver

private String m_ver
the dtd version used

m_dpName

private String m_dpName
the distributed poller sending the events

m_created

private Calendar m_created
the creation date of this event stream

m_mstation

private String m_mstation
master station associated with the poller sending the event
Constructor Detail

EventHeader

public EventHeader()

Constructs a new event header object with the default values. The default values are null for all string elements and the singular calendar element is initialized to the current time.


EventHeader

public EventHeader(EventHeader second)

Construct a new event header object that is a duplicate of the passed object. For all purposes the new instances is an exact copy of the passed value.

Parameters:
second - The instance to be copied.

EventHeader

public EventHeader(String ver,
                   String dpName,
                   String mstation,
                   Calendar created)
Constructs a EventHeader object with all the specific value.
Parameters:
ver - The version of the header
dpName - The distributed poller name from the header.
mstation - The configured master station for the poller.
created - The header's timestamp.
Method Detail

serializeToXML

void serializeToXML(PrintStream ps)
Writes self to event stream

getVersion

public String getVersion()
Returns the current version text.

setVersion

public void setVersion(String version)
Sets the version string for the header
Parameters:
version - The version information for the header.

getDPName

public String getDPName()
Returns the distributed poller name

setDPName

public void setDPName(String dpName)
Sets the distributed poller name
Parameters:
dpName - The distributed poller name.

getMStation

public String getMStation()
Returns the master station address information

setMStation

public void setMStation(String mstation)
Sets the master station field
Parameters:
mstation - The new text for the master staion.

getTimestamp

public Calendar getTimestamp()
Returns the time when the header was created.

setTimestamp

public void setTimestamp(Calendar c)
Sets the time that the header was created.
Parameters:
d - The date the header was created.

setTimestamp

public void setTimestamp(Date d)
Sets the time that the header was created.
Parameters:
d - The date the header was created.