org.livetribe.slp.spi.msg
Class Extension

java.lang.Object
  extended by org.livetribe.slp.spi.msg.BytesBlock
      extended by org.livetribe.slp.spi.msg.Extension
Direct Known Subclasses:
AttributeListExtension, IdentifierExtension

public abstract class Extension
extends BytesBlock

Version:
$Rev: 157 $ $Date: 2006-06-05 23:29:25 +0200 (Mon, 05 Jun 2006) $

Field Summary
static int ATTRIBUTE_LIST_EXTENSION_ID
           
static int ID_BYTES_LENGTH
           
static int IDENTIFIER_EXTENSION_ID
           
static int NEXT_EXTENSION_OFFSET_BYTES_LENGTH
           
 
Fields inherited from class org.livetribe.slp.spi.msg.BytesBlock
EMPTY_BYTES, EMPTY_STRINGS
 
Constructor Summary
Extension()
           
 
Method Summary
static Extension deserialize(byte[] extensionBytes)
          Returns an Extension subclass object obtained deserializing the given bytes, or null if the bytes contain an extension that is not understood.
protected abstract  void deserializeBody(byte[] bodyBytes)
           
abstract  int getId()
          Returns the extension id that identifies this extension.
 byte[] serialize()
           
protected abstract  byte[] serializeBody()
           
 
Methods inherited from class org.livetribe.slp.spi.msg.BytesBlock
escape, readInt, readString, readStringArray, stringToUTF8Bytes, unescape, utf8BytesToString, writeInt, writeString, writeStringArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_LIST_EXTENSION_ID

public static final int ATTRIBUTE_LIST_EXTENSION_ID
See Also:
Constant Field Values

IDENTIFIER_EXTENSION_ID

public static final int IDENTIFIER_EXTENSION_ID
See Also:
Constant Field Values

ID_BYTES_LENGTH

public static final int ID_BYTES_LENGTH
See Also:
Constant Field Values

NEXT_EXTENSION_OFFSET_BYTES_LENGTH

public static final int NEXT_EXTENSION_OFFSET_BYTES_LENGTH
See Also:
Constant Field Values
Constructor Detail

Extension

public Extension()
Method Detail

getId

public abstract int getId()
Returns the extension id that identifies this extension.


serialize

public byte[] serialize()
                 throws ServiceLocationException
Throws:
ServiceLocationException

serializeBody

protected abstract byte[] serializeBody()
                                 throws ServiceLocationException
Throws:
ServiceLocationException

deserializeBody

protected abstract void deserializeBody(byte[] bodyBytes)
                                 throws ServiceLocationException
Throws:
ServiceLocationException

deserialize

public static Extension deserialize(byte[] extensionBytes)
                             throws ServiceLocationException
Returns an Extension subclass object obtained deserializing the given bytes, or null if the bytes contain an extension that is not understood.

Parameters:
extensionBytes - The bytes to deserialize
Throws:
ServiceLocationException - If the deserialization fails


Copyright © 2006-2012 LiveTribe. All Rights Reserved.