solar.impl
Class SerializedEvent

java.lang.Object
  |
  +--solar.impl.AbstractAttributeRecord
        |
        +--solar.impl.SerializedEvent
All Implemented Interfaces:
Adu, AttributeRecord, Event, java.io.Serializable, SolarConstants
Direct Known Subclasses:
AckEvent, PackEvent, PingEvent, PipePushEvent, PubEvent, ReplyEvent, RequestEvent, RoutingEvent, SubscribeEvent, TaskFinishEvent

public class SerializedEvent
extends AbstractAttributeRecord
implements Event

SerializedEvent containts attributes whose value are arbituary objects and will be serialized into byte array before transmission.

Version:
$Id: SerializedEvent.java,v 1.6 2003/09/23 14:03:57 glchen Exp $
Author:
Guanling Chen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class solar.impl.AbstractAttributeRecord
_attributes
 
Fields inherited from interface solar.api.Event
EVENT_PLAIN, EVENT_SERIALIZED
 
Fields inherited from interface solar.SolarConstants
ADVERTISEMENT_SVID, ATTRIBUTE_RECORD_SVID, ATTRIBUTE_SVID, FILTER_CONFIG_SVID, FILTER_SPEC_SVID, GRAPH_SPEC_SVID, GUID_SVID, HEADER_SVID, ID_SVID, NAME_RECORD_SVID, PACK_POLICY_SVID, PIPE_SPEC_SVID, REQUEST_SVID, RPCACK_SVID
 
Constructor Summary
SerializedEvent(byte[] cnt)
          Constructs an event by parsing an encoded byte array.
SerializedEvent(byte[] cnt, int offset, int len)
          Constructs an event by parsing an encoded byte array.
SerializedEvent(Event aEvent)
          Constructs an event by copying from another one.
SerializedEvent(java.util.List aList)
          Constructs an event with a list of attributes.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determine whether two objects are equal.
 int getEncoding()
          Return the encoding type.
private  java.util.List parseSerializedEvent(byte[] cnt, int offset, int len)
           
 byte[] toBytes()
          Return the byte array format of this ADU.
 java.lang.String toString()
          Return the string format of this ADU.
 
Methods inherited from class solar.impl.AbstractAttributeRecord
getAttribute, getAttributes, getAttributes, getKeys, getValue, getValues, getValues
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface solar.api.AttributeRecord
getAttribute, getAttributes, getAttributes, getKeys, getValue, getValues, getValues
 

Constructor Detail

SerializedEvent

public SerializedEvent(java.util.List aList)
Constructs an event with a list of attributes.


SerializedEvent

public SerializedEvent(Event aEvent)
Constructs an event by copying from another one.


SerializedEvent

public SerializedEvent(byte[] cnt)
                throws ParsingException
Constructs an event by parsing an encoded byte array.


SerializedEvent

public SerializedEvent(byte[] cnt,
                       int offset,
                       int len)
                throws ParsingException
Constructs an event by parsing an encoded byte array.

Method Detail

parseSerializedEvent

private java.util.List parseSerializedEvent(byte[] cnt,
                                            int offset,
                                            int len)
                                     throws ParsingException
ParsingException

getEncoding

public int getEncoding()
Description copied from interface: Event
Return the encoding type.

Specified by:
getEncoding in interface Event

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: AttributeRecord
Determine whether two objects are equal.

Specified by:
equals in interface AttributeRecord
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Description copied from interface: Adu
Return the string format of this ADU.

Specified by:
toString in interface Adu
Overrides:
toString in class java.lang.Object

toBytes

public byte[] toBytes()
Description copied from interface: Adu
Return the byte array format of this ADU.

Specified by:
toBytes in interface Adu