|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lwes.Event
public class Event
| Field Summary | |
|---|---|
static short |
DEFAULT_ENCODING
|
static java.lang.String |
ENCODING
Reserved metadata keywords |
static CharacterEncoding[] |
ENCODING_STRINGS
|
static short |
ISO_8859_1
Encoding variables |
static java.lang.String |
RECEIPT_TIME
|
static java.lang.String |
SENDER_IP
|
static java.lang.String |
SENDER_PORT
|
static short |
UTF_8
|
| Constructor Summary | |
|---|---|
Event(byte[] bytes,
boolean validate,
EventTemplateDB eventTemplateDB)
Creates an event by deserializing a raw byte array. |
|
Event(byte[] bytes,
EventTemplateDB eventTemplateDB)
Creates an event by deserializing a raw byte array. |
|
Event(java.lang.String eventName,
boolean validate,
EventTemplateDB eventTemplateDB)
Create an event called eventName |
|
Event(java.lang.String eventName,
boolean validate,
EventTemplateDB eventTemplateDB,
short encoding)
Create an event called eventName |
|
Event(java.lang.String eventName,
EventTemplateDB eventTemplateDB)
Create an event called eventName |
|
| Method Summary | |
|---|---|
Event |
copy()
Returns a mutable copy of the event. |
void |
deserialize(byte[] bytes)
Deserialize the Event from byte array |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(java.lang.String attributeName)
Generic accessor, checks if an attribute exists and returns its value. |
boolean |
getBoolean(java.lang.String attributeName)
Accessor that returns a boolean value for attribute attributeName |
short |
getEncoding()
Get the character encoding for this event |
java.util.Enumeration<java.lang.String> |
getEventAttributeNames()
Returns an enumeration of all the event attribute names |
java.lang.String |
getEventName()
Returns the name of the event |
EventTemplateDB |
getEventTemplateDB()
Returns the EventTemplateDB for this event, used for validation of types and attributes. |
java.net.InetAddress |
getInetAddress(java.lang.String attributeName)
Accessor that returns an InetAddress, for attribute attributeName |
short |
getInt16(java.lang.String attributeName)
Accessor that returns an short, for attribute attributeName |
int |
getInt32(java.lang.String attributeName)
Accessor that returns an int, for attribute attributeName |
long |
getInt64(java.lang.String attributeName)
Accessor that returns an long, for attribute attributeName |
byte[] |
getIPAddress(java.lang.String attributeName)
Accessor that returns an IP address in bytes, for attribute attributeName |
java.lang.String |
getString(java.lang.String attributeName)
Accessor that returns an String, for attribute attributeName |
int |
getUInt16(java.lang.String attributeName)
Accessor that returns an unsigned short, in the guise of an int, for attribute attributeName |
long |
getUInt32(java.lang.String attributeName)
Accessor that returns an unsigned int, in the guise of an long, for attribute attributeName |
java.math.BigInteger |
getUInt64(java.lang.String attributeName)
Accessor that returns an unsigned long, in the guise of an BigInteger, for attribute attributeName |
boolean |
isValidating()
Returns true if the event validates against the EventTemplateDB before making changes |
byte[] |
serialize()
Serializes the Event into a byte array |
void |
set(java.lang.String attributeName,
java.lang.Object attributeValue)
Set the object's attribute attributeName with the Object given |
void |
setBoolean(java.lang.String attributeName,
boolean aBool)
Sets the given attribute with a boolean value given by aBool. |
void |
setBoolean(java.lang.String attributeName,
java.lang.Boolean aBool)
Sets the given attribute with a Boolean value given by aBool. |
void |
setEncoding(short encoding)
Set the character encoding for event strings |
void |
setEventName(java.lang.String name)
Sets the name of the Event |
void |
setEventTemplateDB(EventTemplateDB eventTemplateDB)
Sets the EventTemplateDB for this event, used for validation of types and attributes. |
void |
setInt16(java.lang.String attributeName,
short aNumber)
Set the given attribute with the short value given by aNumber. |
void |
setInt16(java.lang.String attributeName,
java.lang.Short aNumber)
Set the given attribute with the Short value given by aNumber. |
void |
setInt32(java.lang.String attributeName,
int aNumber)
Set the given attribute with the int value given by aNumber. |
void |
setInt32(java.lang.String attributeName,
java.lang.Integer aNumber)
Set the given attribute with the Integer value given by aNumber. |
void |
setInt64(java.lang.String attributeName,
long aNumber)
Set the given attribute with the long value given by aNumber. |
void |
setInt64(java.lang.String attributeName,
java.lang.Long aNumber)
Set the given attribute with the Long value given by aNumber. |
void |
setIPAddress(java.lang.String attributeName,
byte[] address)
Set the given attribute with the ip address value given by address |
void |
setIPAddress(java.lang.String attributeName,
java.net.InetAddress address)
Set the given attribute with the ip address value given by address |
void |
setIPAddress(java.lang.String attributeName,
IPAddress address)
Set the given attribute with the ip address value given by address |
void |
setString(java.lang.String attributeName,
java.lang.String aString)
Set the given attribute with a String |
void |
setUInt16(java.lang.String attributeName,
int aNumber)
Set the given attribute with the unsigned short value given by aNumber. |
void |
setUInt16(java.lang.String attributeName,
java.lang.Integer aNumber)
Set the given attribute with the Integer value given by aNumber. |
void |
setUInt32(java.lang.String attributeName,
long aNumber)
Set the given attribute with the unsigned int value given by aNumber. |
void |
setUInt32(java.lang.String attributeName,
java.lang.Long aNumber)
Set the given attribute with the Long value given by aNumber. |
void |
setUInt64(java.lang.String attributeName,
java.math.BigInteger aNumber)
Set the given attribute with the BigInteger value given by aNumber. |
void |
setUInt64(java.lang.String attributeName,
long aNumber)
Set the given attribute with the unsigned long value given by aNumber. |
void |
setUInt64(java.lang.String attributeName,
java.lang.Long aNumber)
Set the given attribute with the Long value given by aNumber. |
void |
setValidating(boolean validate)
Set to true if the event should validate against the EventTemplateDB before making changes |
int |
size()
Returns the number of attributes in the event |
java.lang.String |
toString()
Returns a String representation of this event |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ENCODING
public static final java.lang.String RECEIPT_TIME
public static final java.lang.String SENDER_IP
public static final java.lang.String SENDER_PORT
public static final short ISO_8859_1
public static final short UTF_8
public static final short DEFAULT_ENCODING
public static final CharacterEncoding[] ENCODING_STRINGS
| Constructor Detail |
|---|
public Event(java.lang.String eventName,
EventTemplateDB eventTemplateDB)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
eventName - the name of the eventeventTemplateDB - the EventTemplateDB to use for validation
NoSuchEventException - if the Event does not exist in the EventTemplateDB
NoSuchAttributeException - if an attribute does not exist in the EventTemplateDB
NoSuchAttributeTypeException - if an attribute type does not exist in the EventTemplateDB
public Event(java.lang.String eventName,
boolean validate,
EventTemplateDB eventTemplateDB)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
eventName - the name of the eventvalidate - true if the EventTemplateDB should be checked for types before all mutationseventTemplateDB - the EventTemplateDB to use for validation
NoSuchEventException - if the Event does not exist in the EventTemplateDB
NoSuchAttributeException - if an attribute does not exist in the EventTemplateDB
NoSuchAttributeTypeException - if an attribute type does not exist in the EventTemplateDB
public Event(java.lang.String eventName,
boolean validate,
EventTemplateDB eventTemplateDB,
short encoding)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
eventName - the name of the eventvalidate - true if the EventTemplateDB should be checked for types before all mutationsencoding - the character encoding used by the event
NoSuchEventException - if the Event does not exist in the EventTemplateDB
NoSuchAttributeException - if an attribute does not exist in the EventTemplateDB
NoSuchAttributeTypeException - if an attribute type does not exist in the EventTemplateDB
public Event(byte[] bytes,
EventTemplateDB eventTemplateDB)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
bytes - the raw bytes to converteventTemplateDB - the EventTemplateDB to use to validate the event
NoSuchEventException
NoSuchAttributeException
NoSuchAttributeTypeException
public Event(byte[] bytes,
boolean validate,
EventTemplateDB eventTemplateDB)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
bytes - the raw bytes to convertvalidate - whether or not to validate the eventeventTemplateDB - the EventTemplateDB to use to validate the event
NoSuchEventException
NoSuchAttributeException
NoSuchAttributeTypeException| Method Detail |
|---|
public java.util.Enumeration<java.lang.String> getEventAttributeNames()
public int size()
public boolean isValidating()
public void setValidating(boolean validate)
validate - the validating valuepublic EventTemplateDB getEventTemplateDB()
public void setEventTemplateDB(EventTemplateDB eventTemplateDB)
eventTemplateDB - the EventTemplateDB to be used for validationpublic java.lang.String getEventName()
public void setEventName(java.lang.String name)
throws NoSuchEventException
name - the name of the event
NoSuchEventException - if the event is validating and does not exist in the EventTemplateDBpublic short getEncoding()
public void setEncoding(short encoding)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
encoding - the character encoding
NoSuchAttributeTypeException - if the type for the encoding attribute does not exist
NoSuchAttributeException - if the encoding attribute does not exist
public java.lang.Object get(java.lang.String attributeName)
throws NoSuchAttributeException
attributeName - name of the attribute to lookup
NoSuchAttributeException - if the attribute does not exist in this event
public boolean getBoolean(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public int getUInt16(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public short getInt16(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public long getUInt32(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public int getInt32(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public java.math.BigInteger getUInt64(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public long getInt64(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public java.lang.String getString(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public java.net.InetAddress getInetAddress(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public byte[] getIPAddress(java.lang.String attributeName)
throws AttributeNotSetException,
NoSuchAttributeException
attributeName - the name of the attribute to fetch
AttributeNotSetException - if the attribute has not been set in this event
NoSuchAttributeException - if the attribute does not exist in this event
public void set(java.lang.String attributeName,
java.lang.Object attributeValue)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the name of the attribute to setattributeValue - the object to set the attribute with
NoSuchAttributeException - if the attribute does not exist in this event
NoSuchAttributeTypeException - if there is an attribute with an undefined type
public void setBoolean(java.lang.String attributeName,
boolean aBool)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaBool - the boolean value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setBoolean(java.lang.String attributeName,
java.lang.Boolean aBool)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaBool - the boolean value to set
NoSuchAttributeException
NoSuchAttributeTypeException
public void setUInt16(java.lang.String attributeName,
int aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the unsigned short value as an integer
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt16(java.lang.String attributeName,
java.lang.Integer aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the value
NoSuchAttributeException
NoSuchAttributeTypeException
public void setInt16(java.lang.String attributeName,
short aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the short value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setInt16(java.lang.String attributeName,
java.lang.Short aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the short value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt32(java.lang.String attributeName,
long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the unsigned int value as a long
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt32(java.lang.String attributeName,
java.lang.Long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the value
NoSuchAttributeException
NoSuchAttributeTypeException
public void setInt32(java.lang.String attributeName,
int aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the integer value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setInt32(java.lang.String attributeName,
java.lang.Integer aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the Integer value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt64(java.lang.String attributeName,
long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the value
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt64(java.lang.String attributeName,
java.lang.Long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the value
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setUInt64(java.lang.String attributeName,
java.math.BigInteger aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the value
NoSuchAttributeException
NoSuchAttributeTypeException
public void setInt64(java.lang.String attributeName,
long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the long value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setInt64(java.lang.String attributeName,
java.lang.Long aNumber)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaNumber - the Long value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setString(java.lang.String attributeName,
java.lang.String aString)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaString - the String value to set
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setIPAddress(java.lang.String attributeName,
byte[] address)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaddress - the ip address in bytes
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setIPAddress(java.lang.String attributeName,
java.net.InetAddress address)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaddress - the ip address in bytes
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDB
public void setIPAddress(java.lang.String attributeName,
IPAddress address)
throws NoSuchAttributeException,
NoSuchAttributeTypeException
attributeName - the attribute to setaddress - the ip address in bytes
NoSuchAttributeException - if the attribute does not exist in the event
NoSuchAttributeTypeException - if the attribute type does not match the EventTemplateDBpublic byte[] serialize()
public void deserialize(byte[] bytes)
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
bytes - the byte array containing a serialized Event
NoSuchEventException
NoSuchAttributeException
NoSuchAttributeTypeException
public Event copy()
throws NoSuchEventException,
NoSuchAttributeException,
NoSuchAttributeTypeException
NoSuchEventException - if the Event does not exist in the EventTemplateDB
NoSuchAttributeException - if the attribute does not exist in this event
NoSuchAttributeTypeException - if there is an attribute that does not match a type in the EventTemplateDBpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||