IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid
Class SessionHandleTransformer

java.lang.Object
  extended by com.ibm.websphere.objectgrid.SessionHandleTransformer

public final class SessionHandleTransformer
extends Object

A helper class to import and export SessionHandle instances in different formats.

Since:
WAS XD 6.1.0.4

Constructor Summary
SessionHandleTransformer()
           
 
Method Summary
static SessionHandle fromByteArray(byte[] serializedHandle)
          Converts the byte array representation of the handle back into instance form.
static SessionHandle fromString(String stringifiedHandle)
          Converts a stringified session handle back into a SessionHandle instance.
static SessionHandle readSessionHandle(DataInput oi)
          Reads and returns a SessionHandle instance from the contents of the input stream.
static byte[] toByteArray(SessionHandle sessionHandle)
          Converts the sessionHandle instance into a byte array.
static String toString(SessionHandle sessionHandle)
          Converts the sessionHandle instance into a small stringified representation.
static void writeSessionHandle(DataOutput oo, SessionHandle sessionHandle)
          Writes the SessionHandle contents into the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionHandleTransformer

public SessionHandleTransformer()
Method Detail

toByteArray

public static byte[] toByteArray(SessionHandle sessionHandle)
Converts the sessionHandle instance into a byte array.

Parameters:
sessionHandle - The instance to be converted into a byte array.
Returns:
The byte array holding the state of the session handle.

fromByteArray

public static SessionHandle fromByteArray(byte[] serializedHandle)
Converts the byte array representation of the handle back into instance form.

Parameters:
serializedHandle - The byte array that was derived from fromByteArray(byte[]).
Returns:
A new SessionHandle instance.

toString

public static String toString(SessionHandle sessionHandle)
Converts the sessionHandle instance into a small stringified representation.

Parameters:
sessionHandle - The instance to be stringified, this value should not be null.
Returns:
The string representation.

fromString

public static SessionHandle fromString(String stringifiedHandle)
Converts a stringified session handle back into a SessionHandle instance.

Parameters:
stringifiedHandle - A string version of the session handle which was derived from toString(SessionHandle).
Returns:
A new SessionHandle instance.

writeSessionHandle

public static void writeSessionHandle(DataOutput oo,
                                      SessionHandle sessionHandle)
                               throws IOException
Writes the SessionHandle contents into the output stream. This method may be used with ObjectOutput as well since it extends DataOutput.

Parameters:
oo - The DataOutput stream that the sessionHandle instance will be written into, must not be null.
sessionHandle - The session handle instance to write into the stream, must not be null.
Throws:
IOException

readSessionHandle

public static SessionHandle readSessionHandle(DataInput oi)
                                       throws IOException
Reads and returns a SessionHandle instance from the contents of the input stream. This method may be used with ObjectInput as well since it extends DataInput.

Parameters:
oi - The DataInput stream that the session handle instance will be read from, must not be null.
Returns:
A new SessionHandle instance instantiated up from the content of the stream.
Throws:
IOException

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.