gr.uoa.di.madgik.grs.events
Class KeyValueEvent

java.lang.Object
  extended by gr.uoa.di.madgik.grs.events.BufferEvent
      extended by gr.uoa.di.madgik.grs.events.KeyValueEvent
All Implemented Interfaces:
IPumpable

public class KeyValueEvent
extends BufferEvent

BufferEvent extender that propagates a simple string based key value pair as the event payload

Author:
gpapanikos

Nested Class Summary
 
Nested classes/interfaces inherited from class gr.uoa.di.madgik.grs.events.BufferEvent
BufferEvent.EventSource
 
Constructor Summary
KeyValueEvent()
          Create a new instance
KeyValueEvent(java.lang.String key, java.lang.String value)
          Create a new instance
 
Method Summary
 void extendDeflate(java.io.DataOutput out)
          This method is implemented by BufferEvent extenders to deflate the additional information they handle
 void extendFromXML(org.w3c.dom.Element element)
           
 void extendInflate(java.io.DataInput in)
          This method is implemented by BufferEvent extenders to inflate the additional information they handle
 void extendToXML(org.w3c.dom.Document doc, org.w3c.dom.Element element)
           
 java.lang.String getKey()
          Retrieves the payload key
 java.lang.String getValue()
          Retrieves the payload value
 void setKey(java.lang.String key)
          Sets the payload key
 void setValue(java.lang.String value)
          Sets the payload value
 
Methods inherited from class gr.uoa.di.madgik.grs.events.BufferEvent
deflate, fromXML, getSource, inflate, inflate, setSource, toXML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyValueEvent

public KeyValueEvent()
Create a new instance


KeyValueEvent

public KeyValueEvent(java.lang.String key,
                     java.lang.String value)
Create a new instance

Parameters:
key - the key of the payload
value - the value of the payload
Method Detail

getKey

public java.lang.String getKey()
Retrieves the payload key

Returns:
the payload key

setKey

public void setKey(java.lang.String key)
Sets the payload key

Parameters:
key - the payload key

getValue

public java.lang.String getValue()
Retrieves the payload value

Returns:
the payload value

setValue

public void setValue(java.lang.String value)
Sets the payload value

Parameters:
value - the payload value

extendToXML

public void extendToXML(org.w3c.dom.Document doc,
                        org.w3c.dom.Element element)
                 throws GRS2RecordSerializationException
Specified by:
extendToXML in class BufferEvent
Throws:
GRS2RecordSerializationException

extendFromXML

public void extendFromXML(org.w3c.dom.Element element)
                   throws GRS2RecordSerializationException
Specified by:
extendFromXML in class BufferEvent
Throws:
GRS2RecordSerializationException

extendDeflate

public void extendDeflate(java.io.DataOutput out)
                   throws GRS2RecordSerializationException
This method is implemented by BufferEvent extenders to deflate the additional information they handle

Specified by:
extendDeflate in class BufferEvent
Parameters:
out - the stream to deflate to
Throws:
GRS2RecordSerializationException - there was a problem deflating the event
See Also:
BufferEvent.extendDeflate(java.io.DataOutput)

extendInflate

public void extendInflate(java.io.DataInput in)
                   throws GRS2RecordSerializationException
This method is implemented by BufferEvent extenders to inflate the additional information they handle

Specified by:
extendInflate in class BufferEvent
Parameters:
in - the stream to inflate from
Throws:
GRS2RecordSerializationException - there was a problem inflating the event
See Also:
BufferEvent.extendInflate(java.io.DataInput)