edu.uci.isr.yancees.server.dispatcher.elvin
Class OldElvinEvent

java.lang.Object
  extended byedu.uci.isr.yancees.server.dispatcher.elvin.OldElvinEvent
All Implemented Interfaces:
EventInterface, MessageInterface, java.io.Serializable

public class OldElvinEvent
extends java.lang.Object
implements EventInterface

An event An event is structured as a set of named and typed bodyAttributes. Attribute names are strings.

A valid attribute name must begin with a letter ('a'-'z', 'A'-'Z') or an underscore character ('_'), and may contain only letters, underscores, digits ('0'-'9'), the dot character ('.'), the forward slash character ('/'), and the dollar sign ('$'). Attribute names must be unique within a OldElvinEvent.

Example:


      OldElvinEvent alert = new OldElvinEvent();
      alert.putAttribute("threat", "virus");
      alert.putAttribute("name", "melissa");
      alert.putAttribute("total_infected", 25);
      alert.putAttribute("os/name", "win32");
      alert.putAttribute("os/version", "98");
  

See Also:
Serialized Form

Field Summary
static java.lang.String ATTRIBUTE
           
static java.lang.String BODY
           
static java.lang.String EVENT
          Tags used from the event to express siena constraints.
static java.lang.String HEADER
           
static java.lang.String NAME
           
static java.lang.String TYPE_ATTRIBUTE
           
static java.lang.String VALUE
           
 
Constructor Summary
OldElvinEvent()
          constructs an empty OldElvinEvent.
OldElvinEvent(EventInterface evt)
          initialized the current object using the generic event provided.
OldElvinEvent(org.w3c.dom.Node n)
          initialized the current object using the generic event represented in the form of a DOM tree.
OldElvinEvent(OldElvinEvent n)
          creates a deep copy of a given OldElvinEvent.
 
Method Summary
 void clearAll()
          Removes every attribute from this OldElvinEvent.
 void clearBody()
          removes every body attribute from this OldElvinEvent.
 void clearHeader()
          Removes every header attribute from this OldElvinEvent.
 AttValue getBodyAttribute(java.lang.String name)
          returns the value of an attribute or null if that attribute does not exist in this OldElvinEvent.
 java.util.Iterator getBodyAttributeNamesIterator()
          Returns an iterator for the set of attribute names of this OldElvinEvent body.
 AttValue[] getBodyAttValues()
           
 int getBodySize()
          returns the number of bodyAttributes in this OldElvinEvent.
 java.util.Date getDateCreated()
           
 java.util.Date getDateReceivedInServer()
           
 org.w3c.dom.Node getDOM()
           
 AttValue getHeaderAttribute(java.lang.String name)
          returns the value of an attribute or null if that attribute does not exist in this OldElvinEvent.
 java.util.Iterator getHeaderAttributeNamesIterator()
          returns an iterator for the set of attribute names of this OldElvinEvent header.
 AttValue[] getHeaderAttValues()
           
 int getHeaderSize()
          returns the number of headerAttributes in this OldElvinEvent.
 long getId()
           
 java.lang.String getXMLTextContent()
           
 void putBodyAttribute(java.lang.String name, AttValue value)
          set the value of an attribute.
 void putBodyAttribute(java.lang.String name, boolean value)
          set the value of an attribute.
 void putBodyAttribute(java.lang.String name, byte[] value)
          sets the value of an attribute.
 void putBodyAttribute(java.lang.String name, double value)
          set the value of an attribute.
 void putBodyAttribute(java.lang.String name, long value)
          set the value of an attribute.
 void putBodyAttribute(java.lang.String name, java.lang.String value)
          set the value of an attribute.
 void putHeaderAttribute(java.lang.String name, AttValue value)
          set the value of an attribute.
 void putHeaderAttribute(java.lang.String name, boolean value)
          set the value of an attribute.
 void putHeaderAttribute(java.lang.String name, byte[] value)
          sets the value of an attribute.
 void putHeaderAttribute(java.lang.String name, double value)
          set the value of an attribute.
 void putHeaderAttribute(java.lang.String name, long value)
          set the value of an attribute.
 void putHeaderAttribute(java.lang.String name, java.lang.String value)
          set the value of an attribute.
 void setDOM(org.w3c.dom.Node n)
          Changes current event node, parsing it.
 void setXMLTextContent(java.lang.String content)
          Changes the content of this message.
 int size()
          returns the number of bodyAttributes in this OldElvinEvent.
 java.lang.String toString()
          Prints the structure of the evetn using a free notation.
 java.lang.String toXML()
          Prints the XML hierarchy that represents the current event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT

public static final java.lang.String EVENT
Tags used from the event to express siena constraints. these tags are imported from the sienaEvent.xsd schema and used in the sienaSubscriptin.xsd

See Also:
Constant Field Values

BODY

public static final java.lang.String BODY
See Also:
Constant Field Values

HEADER

public static final java.lang.String HEADER
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

VALUE

public static final java.lang.String VALUE
See Also:
Constant Field Values

ATTRIBUTE

public static final java.lang.String ATTRIBUTE
See Also:
Constant Field Values

TYPE_ATTRIBUTE

public static final java.lang.String TYPE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

OldElvinEvent

public OldElvinEvent()
constructs an empty OldElvinEvent.


OldElvinEvent

public OldElvinEvent(EventInterface evt)
initialized the current object using the generic event provided. In other words, gets a generic event and initializes this specific OldElvinEvent. Searches the already parsed DOM tree and extracts the attributes and values.

Parameters:
evt - is an object of type Event which will be narrowed and parsed according to the OldElvinEvent representation.

OldElvinEvent

public OldElvinEvent(org.w3c.dom.Node n)
              throws ParsingException
initialized the current object using the generic event represented in the form of a DOM tree.


OldElvinEvent

public OldElvinEvent(OldElvinEvent n)
creates a deep copy of a given OldElvinEvent.

Method Detail

getId

public long getId()
Specified by:
getId in interface MessageInterface

setDOM

public void setDOM(org.w3c.dom.Node n)
            throws ParsingException
Changes current event node, parsing it.

Specified by:
setDOM in interface MessageInterface
Parameters:
n -
Throws:
EventParsingException
ParsingException

getDOM

public org.w3c.dom.Node getDOM()
Specified by:
getDOM in interface MessageInterface
Returns:
a reference to the current eventDOM model tree.

getBodyAttValues

public AttValue[] getBodyAttValues()
Returns:
a list of AttValue objects of the body of the event

getHeaderAttValues

public AttValue[] getHeaderAttValues()
Returns:
a list of AttValue objects of the header of the event

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             java.lang.String value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - String value.

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             byte[] value)
sets the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - byte array value.

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             long value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - integer value.

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             double value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - double value.

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             boolean value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - boolean value.

putBodyAttribute

public void putBodyAttribute(java.lang.String name,
                             AttValue value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - value.

getBodyAttribute

public AttValue getBodyAttribute(java.lang.String name)
returns the value of an attribute or null if that attribute does not exist in this OldElvinEvent.

Parameters:
name - attribute name.

getBodySize

public int getBodySize()
returns the number of bodyAttributes in this OldElvinEvent.


putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               java.lang.String value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - String value.

putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               byte[] value)
sets the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - byte array value.

putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               long value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - integer value.

putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               double value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - double value.

putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               boolean value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - boolean value.

putHeaderAttribute

public void putHeaderAttribute(java.lang.String name,
                               AttValue value)
set the value of an attribute. Add the attribute if that is not present.

Parameters:
name - attribute name.
value - value.

getHeaderAttribute

public AttValue getHeaderAttribute(java.lang.String name)
returns the value of an attribute or null if that attribute does not exist in this OldElvinEvent.

Parameters:
name - attribute name.

getHeaderSize

public int getHeaderSize()
returns the number of headerAttributes in this OldElvinEvent.


size

public int size()
returns the number of bodyAttributes in this OldElvinEvent.


clearBody

public void clearBody()
removes every body attribute from this OldElvinEvent.


clearHeader

public void clearHeader()
Removes every header attribute from this OldElvinEvent.


clearAll

public void clearAll()
Removes every attribute from this OldElvinEvent.


getBodyAttributeNamesIterator

public java.util.Iterator getBodyAttributeNamesIterator()
Returns an iterator for the set of attribute names of this OldElvinEvent body.


getHeaderAttributeNamesIterator

public java.util.Iterator getHeaderAttributeNamesIterator()
returns an iterator for the set of attribute names of this OldElvinEvent header.


toString

public java.lang.String toString()
Prints the structure of the evetn using a free notation.


toXML

public java.lang.String toXML()
Prints the XML hierarchy that represents the current event.


setXMLTextContent

public void setXMLTextContent(java.lang.String content)
Changes the content of this message. Replaces it with the XML content provided in the String provided

Specified by:
setXMLTextContent in interface MessageInterface
Parameters:
content - is the new XML format contnet in the form of a String

getXMLTextContent

public java.lang.String getXMLTextContent()
Specified by:
getXMLTextContent in interface MessageInterface
Returns:
the content of this message in the text form, as a string.

getDateCreated

public java.util.Date getDateCreated()
Specified by:
getDateCreated in interface MessageInterface
Returns:
the date the object was first created

getDateReceivedInServer

public java.util.Date getDateReceivedInServer()
Specified by:
getDateReceivedInServer in interface MessageInterface
Returns:
the date this object arrived in the server