|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.pastry.socket.SocketBuffer
public class SocketBuffer
Holds 1 serialized message for receiving or sending. Has specialized code for RouteMessage, Liveness Message, and byte arrays.
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
DESCRIBE THE FIELD |
static byte[] |
ZERO
DESCRIBE THE FIELD |
Constructor Summary | |
---|---|
SocketBuffer(byte[] output)
Constructor for SocketBuffer. |
|
SocketBuffer(byte[] input,
SocketPastryNode spn)
Constructor for SocketBuffer. |
|
SocketBuffer(EpochInetSocketAddress address,
SourceRoute path)
For a quick write. |
|
SocketBuffer(EpochInetSocketAddress address,
SourceRoute path,
PRawMessage msg)
Constructor for SocketBuffer. |
|
SocketBuffer(MessageDeserializer defaultDeserializer,
NodeHandleFactory nhf)
Main Constructor |
|
SocketBuffer(PRawMessage rm)
For quick write |
|
SocketBuffer(SourceRoute path,
int appId)
Used to initialize the sourceroute path. |
Method Summary | |
---|---|
Message |
deserialize(MessageDeserializer md)
DESCRIBE THE METHOD |
int |
getAddress()
Gets the Address attribute of the SocketBuffer object |
java.nio.ByteBuffer |
getBuffer()
Gets the Buffer attribute of the SocketBuffer object |
int |
getInnermostAddress()
Gets the InnermostAddress attribute of the SocketBuffer object |
short |
getInnermostType()
Gets the InnermostType attribute of the SocketBuffer object |
SendOptions |
getOptions()
Gets the Options attribute of the SocketBuffer object |
RouteMessage |
getRouteMessage()
Gets the RouteMessage attribute of the SocketBuffer object |
short |
getType()
Gets the Type attribute of the SocketBuffer object |
protected void |
initialize(int size)
DESCRIBE THE METHOD |
boolean |
isRouteMessage()
Gets the RouteMessage attribute of the SocketBuffer object |
void |
serialize(PRawMessage msg,
boolean reset)
Will grow the buffer as needed |
void |
setType(short type)
Sets the Type attribute of the SocketBuffer object |
java.lang.String |
toString()
Converts to a String representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_BUFFER_SIZE
public static final byte[] ZERO
Constructor Detail |
---|
public SocketBuffer(byte[] output)
output
- DESCRIBE THE PARAMETERpublic SocketBuffer(byte[] input, SocketPastryNode spn) throws java.io.IOException
input
- DESCRIBE THE PARAMETERspn
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic SocketBuffer(PRawMessage rm) throws java.io.IOException
rm
-
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic SocketBuffer(EpochInetSocketAddress address, SourceRoute path) throws java.io.IOException
address
- DESCRIBE THE PARAMETERpath
- DESCRIBE THE PARAMETER
java.io.IOException
public SocketBuffer(EpochInetSocketAddress address, SourceRoute path, PRawMessage msg) throws java.io.IOException
address
- DESCRIBE THE PARAMETERpath
- DESCRIBE THE PARAMETERmsg
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic SocketBuffer(SourceRoute path, int appId) throws java.io.IOException
path
- appId
-
java.io.IOException
public SocketBuffer(MessageDeserializer defaultDeserializer, NodeHandleFactory nhf)
defaultDeserializer
- nhf
- DESCRIBE THE PARAMETERMethod Detail |
---|
public boolean isRouteMessage()
public SendOptions getOptions()
public RouteMessage getRouteMessage()
public java.nio.ByteBuffer getBuffer()
public int getAddress()
getAddress
in interface RawMessageDelivery
public short getInnermostType()
public int getInnermostAddress()
public short getType()
public void setType(short type)
type
- The new Type valueprotected void initialize(int size)
size
- DESCRIBE THE PARAMETERpublic void serialize(PRawMessage msg, boolean reset) throws java.io.IOException
msg
- reset
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic Message deserialize(MessageDeserializer md) throws java.io.IOException
deserialize
in interface RawMessageDelivery
md
- DESCRIBE THE PARAMETER
java.io.IOException
- DESCRIBE THE EXCEPTIONpublic java.lang.String toString()
toString
in class java.lang.Object
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |