ECS_Event

- Container class for event data

SYNOPSIS

#include <ECS/Event.hh>
class ECS_Event
{
 public:
	_ECSAIO_PRIVAPI ECS_Event();
	_ECSAIO_PRIVAPI ECS_Event
	 (
	   const char* encodingType,
	   const char* eventSyntax
	 );
	_ECSAIO_PRIVAPI ECS_Event
	 (
	   const char* encodingType,
	   const char* eventSyntax,
	   const char* pdu,
	   int32 createTime = -1
	 );
	_ECSAIO_PRIVAPI ECS_Event
	 (
	   const char* encodingType,
	   const char* eventSyntax,
	   const void* pdu,
	   int32 pduLength = -1,
	   int32 createTime = -1
	 );
	_ECSAIO_PRIVAPI ECS_Event(ECS_Event const& other);
	ECS_Event const& operator=(ECS_Event const& other);
	_ECSAIO_PRIVAPI virtual ~ECS_Event();
	virtual ostream& print(ostream& os) const;
	_ECSAIO_PRIVAPI const char* getEncodingType() const;
	_ECSAIO_PRIVAPI void setEncodingType(const char* encodingType);
	_ECSAIO_PRIVAPI const char* getEventSyntax() const;
	_ECSAIO_PRIVAPI void setEventSyntax(const char* eventSyntax);
	_ECSAIO_PRIVAPI const char* getPdu() const;
	_ECSAIO_PRIVAPI int32 getPduLength() const;
	_ECSAIO_PRIVAPI void setPdu(const char* pdu);
	_ECSAIO_PRIVAPI void setPdu
	 (
	   const void* pdu,
	   int32 pduLength = -1
	 );
	_ECSAIO_PRIVAPI int32 getCreationTime() const;
	_ECSAIO_PRIVAPI void setCreationTime(int32 createTime);
	_ECSAIO_PRIVAPI void resetCreationTime();
	};

CLASS TYPE

Concrete

AUDIENCE

ECS Developers

DESCRIPTION

This class represents the format in which event data is input to, and output from, the ECS engine. The most significant part of the event is the PDU (Protocol Data Unit). This is an arbitrarily long sequence of bytes containing the raw event data.

This class also contains the encoding type, event syntax and creation time.

Constructors and Destructors

_ECSAIO_PRIVAPI ECS_Event();
The default constructor
_ECSAIO_PRIVAPI ECS_Event
(
const char* encodingType,
const char* eventSyntax
);
A constructor which allows encoding type and event syntax to be specified.
_ECSAIO_PRIVAPI ECS_Event
(
const char* encodingType,
const char* eventSyntax,
const char* pdu,
int32 createTime = -1
);
A constructor which allows all attributes to be specified.

If create time is not specified (or negative) it will default to the current time.

_ECSAIO_PRIVAPI ECS_Event
(
const char* encodingType,
const char* eventSyntax,
const void* pdu,
int32 pduLength = -1,
int32 createTime = -1
);
A constructor which allows all attributes to be specified. This constructor is for use when the PDU is not a null-terminated string of characters

If create time is not specified (or negative) it will default to the current time.

_ECSAIO_PRIVAPI ECS_Event(ECS_Event const& other);
The copy constructor
ECS_Event const& operator=(ECS_Event const& other);
The assignment operator
_ECSAIO_PRIVAPI virtual ~ECS_Event();
The destructor

Utility

virtual ostream& print(ostream& os) const;
Prints a textual representation of the class to the output stream specified via os.
_ECSAIO_PRIVAPI const char* getEncodingType() const;
Returns the encoding type of this event as a string.
_ECSAIO_PRIVAPI void setEncodingType(const char* encodingType);
Sets the encoding type of this event. Supported encoding types are mdl, cmip, and snmp
_ECSAIO_PRIVAPI const char* getEventSyntax() const;
Returns the event syntax of this event as a string
_ECSAIO_PRIVAPI void setEventSyntax(const char* eventSyntax);
Returns the event syntax of this event as a string
_ECSAIO_PRIVAPI const char* getPdu() const;
Returns a string containing the PDU
_ECSAIO_PRIVAPI int32 getPduLength() const;
Returns the length of the PDU
_ECSAIO_PRIVAPI void setPdu(const char* pdu);
Sets the PDU to the supplied string.
_ECSAIO_PRIVAPI void setPdu(const void* pdu, int32 pduLength = -1);
Sets the PDU to the supplied character string.

If the pduLength is not specified (or negative) then the PDU is considered to be terminated by the first null character in the string.

If the pduLength supplied is positive then that number of characters will be copied from the character string to the PDU. Nulls within that range of characters will be copied like any other character.

_ECSAIO_PRIVAPI int32 getCreationTime() const;
Returns the creation time of this event as seconds since the epoch.
_ECSAIO_PRIVAPI void setCreationTime(int32 createTime);
Set the creation time of this event in seconds since the epoch.

Note: setting the creation time disables the automatic modification of the creation time when the PDU is set.

_ECSAIO_PRIVAPI void resetCreationTime();
Resets the creation time to the current time (in seconds since the epoch). The creation time will be automatically updated whenever the PDU is set.

NOTES

None

SEE ALSO

None

LIBRARY

ECS

VERSION

1.5

DATE RELEASED

1998/04/03

AUTHOR(S)

Hewlett-Packard Company

COPYRIGHT

Copyright (c) 1997 Hewlett-Packard Company. All Rights Reserved.