com.sleepycat.je.rep.utilint
Class BinaryProtocol.SimpleMessage

java.lang.Object
  extended by com.sleepycat.je.rep.utilint.BinaryProtocol.Message
      extended by com.sleepycat.je.rep.utilint.BinaryProtocol.SimpleMessage
All Implemented Interfaces:
BinaryProtocol.WireFormatable
Direct Known Subclasses:
BinaryNodeStateProtocol.BinaryNodeStateRequest, BinaryNodeStateProtocol.BinaryNodeStateResponse, BinaryProtocol.ProtocolVersion, BinaryProtocol.RejectMessage, Protocol.BlockInfo, Protocol.BlockListEnd, Protocol.BlockListStart, Protocol.DbBlocks, Protocol.DiffAreaEnd, Protocol.DiffAreaStart, Protocol.Done, Protocol.Done, Protocol.EnvDiff, Protocol.EnvInfo, Protocol.FeederInfoReq, Protocol.FeederInfoResp, Protocol.FileListReq, Protocol.FileListResp, Protocol.FileReq, Protocol.FileStart, Protocol.HandshakeMessage, Protocol.RemoteDiffRequest, Protocol.RemoteRecord, Protocol.RestoreResponse, Protocol.ShutdownRequest
Enclosing class:
BinaryProtocol

protected abstract class BinaryProtocol.SimpleMessage
extends BinaryProtocol.Message

Base class for simple messages. Ones where performance is not of the utmost importance and reflection can be used to simplify message serialization and de-serialization.


Constructor Summary
protected BinaryProtocol.SimpleMessage()
           
 
Method Summary
protected  boolean getBoolean(ByteBuffer buffer)
           
protected  byte[] getByteArray(ByteBuffer buffer)
           
protected  Double getDouble(ByteBuffer buffer)
           
protected
<T extends Enum<T>>
T
getEnum(Class<T> enumType, ByteBuffer buffer)
           
protected  NameIdPair getNameIdPair(ByteBuffer buffer)
           
protected  RepNodeImpl[] getRepNodeImplArray(ByteBuffer buffer)
           
protected  String[] getStringArray(ByteBuffer buffer)
          Reconstitutes an array of strings.
protected  VLSN getVLSN(ByteBuffer buffer)
           
protected  ByteBuffer wireFormat(Object... arguments)
          Assembles a sequence of arguments into its byte based wire format.
 
Methods inherited from class com.sleepycat.je.rep.utilint.BinaryProtocol.Message
allocateInitializedBuffer, getOp, match, toString, wireFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryProtocol.SimpleMessage

protected BinaryProtocol.SimpleMessage()
Method Detail

wireFormat

protected ByteBuffer wireFormat(Object... arguments)
Assembles a sequence of arguments into its byte based wire format. The method does the serialization in two steps. In step 1, it calculates the length of the buffer. In step 2, it assembles the bytes into the allocated buffer. The interpretive approach used here is suitable for the low performance requirements of the handshake protocol, but not for the core data stream itself. It's for this reason that the method is associated with the Handshake message class and not the Message class.

Parameters:
opId - the operation indicated by the message
arguments - the arguments to be passed in the message
Returns:
a byte buffer containing the serialized form of the message

getRepNodeImplArray

protected RepNodeImpl[] getRepNodeImplArray(ByteBuffer buffer)

getStringArray

protected String[] getStringArray(ByteBuffer buffer)
Reconstitutes an array of strings.

Parameters:
buffer -
Returns:

getByteArray

protected byte[] getByteArray(ByteBuffer buffer)

getBoolean

protected boolean getBoolean(ByteBuffer buffer)

getVLSN

protected VLSN getVLSN(ByteBuffer buffer)

getEnum

protected <T extends Enum<T>> T getEnum(Class<T> enumType,
                                        ByteBuffer buffer)

getDouble

protected Double getDouble(ByteBuffer buffer)

getNameIdPair

protected NameIdPair getNameIdPair(ByteBuffer buffer)


Copyright (c) 2004-2012 Oracle. All rights reserved.