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

java.lang.Object
  extended by gr.uoa.di.madgik.grs.events.BufferEvent
All Implemented Interfaces:
IPumpable
Direct Known Subclasses:
KeyValueEvent, ObjectEvent

public abstract class BufferEvent
extends java.lang.Object
implements IPumpable

This is the base class that all events that can be emitted and received through the IBuffer must extend. All extenders of it must declare a default no arguments constructor

Author:
gpapanikos

Nested Class Summary
static class BufferEvent.EventSource
          The source of the event
 
Constructor Summary
BufferEvent()
           
 
Method Summary
 void deflate(java.io.DataOutput out)
          Deflates the state and data of the implementor in a from capable of reconstructing the exact same instance
abstract  void extendDeflate(java.io.DataOutput out)
          This method is implemented by BufferEvent extenders to deflate the additional information they handle
abstract  void extendFromXML(org.w3c.dom.Element element)
           
abstract  void extendInflate(java.io.DataInput in)
          This method is implemented by BufferEvent extenders to inflate the additional information they handle
abstract  void extendToXML(org.w3c.dom.Document doc, org.w3c.dom.Element element)
           
 void fromXML(org.w3c.dom.Element element)
           
 BufferEvent.EventSource getSource()
          Retrieves the source of the event
 void inflate(java.io.DataInput in)
          Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput)
 void inflate(java.io.DataInput in, boolean reset)
          Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput)
 void setSource(BufferEvent.EventSource source)
          Sets the event source
 org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferEvent

public BufferEvent()
Method Detail

getSource

public BufferEvent.EventSource getSource()
Retrieves the source of the event

Returns:
the event source

setSource

public void setSource(BufferEvent.EventSource source)
Sets the event source

Parameters:
source - the event source

deflate

public void deflate(java.io.DataOutput out)
             throws GRS2RecordSerializationException
Deflates the state and data of the implementor in a from capable of reconstructing the exact same instance

Specified by:
deflate in interface IPumpable
Parameters:
out - the stream to write to
Throws:
GRS2RecordSerializationException - the deflate could not be completed
See Also:
IPumpable.deflate(java.io.DataOutput)

extendDeflate

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

Parameters:
out - the stream to deflate to
Throws:
GRS2RecordSerializationException - there was a problem deflating the event

inflate

public void inflate(java.io.DataInput in)
             throws GRS2RecordSerializationException
Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput)

Specified by:
inflate in interface IPumpable
Parameters:
in - the stream to inflate from
Throws:
GRS2RecordSerializationException - the inflate could not be completed
See Also:
IPumpable.inflate(java.io.DataInput)

inflate

public void inflate(java.io.DataInput in,
                    boolean reset)
             throws GRS2RecordSerializationException
Inflate the state and data of the implementor as was previously deflated using IPumpable.deflate(DataOutput)

Specified by:
inflate in interface IPumpable
Parameters:
in - the stream to inflate from
reset - if the implementor keeps some state over actions previously taken and this is true, this state must be reset
Throws:
GRS2RecordSerializationException - the inflate could not be completed
See Also:
IPumpable.inflate(java.io.DataInput, boolean)

extendInflate

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

Parameters:
in - the stream to inflate from
Throws:
GRS2RecordSerializationException - there was a problem inflating the event

toXML

public org.w3c.dom.Element toXML(org.w3c.dom.Document doc)
                          throws GRS2RecordSerializationException,
                                 GRS2RecordDefinitionException,
                                 org.w3c.dom.DOMException
Specified by:
toXML in interface IPumpable
Throws:
GRS2RecordSerializationException
GRS2RecordDefinitionException
org.w3c.dom.DOMException

fromXML

public void fromXML(org.w3c.dom.Element element)
             throws GRS2RecordSerializationException,
                    GRS2RecordDefinitionException,
                    org.w3c.dom.DOMException
Specified by:
fromXML in interface IPumpable
Throws:
GRS2RecordSerializationException
GRS2RecordDefinitionException
org.w3c.dom.DOMException

extendToXML

public abstract void extendToXML(org.w3c.dom.Document doc,
                                 org.w3c.dom.Element element)
                          throws GRS2RecordSerializationException
Throws:
GRS2RecordSerializationException

extendFromXML

public abstract void extendFromXML(org.w3c.dom.Element element)
                            throws GRS2RecordSerializationException
Throws:
GRS2RecordSerializationException