|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.replication.protocol.ReplicationMessage
public abstract class ReplicationMessage
Abstract class that must be used when defining messages that can be sent for replication purpose between servers. When extending this class one should also create a new MSG_TYPE and should update the generateMsg() method.
Constructor Summary | |
---|---|
ReplicationMessage()
|
Method Summary | |
---|---|
protected int |
addByteArray(byte[] tail,
byte[] resultByteArray,
int pos)
Concatenate the tail byte array into the resultByteArray. |
static ReplicationMessage |
generateMsg(byte[] buffer)
Generates a ReplicationMessage from its encoded form. |
abstract byte[] |
getBytes()
Return the byte[] representation of this message. |
protected int |
getNextLength(byte[] in,
int pos)
Get the length of the next String encoded in the in byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReplicationMessage()
Method Detail |
---|
public abstract byte[] getBytes() throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
- When the encoding of the message
failed because the UTF-8 encoding is not supported.public static ReplicationMessage generateMsg(byte[] buffer) throws java.util.zip.DataFormatException, java.io.UnsupportedEncodingException
buffer
- The encode form of the ReplicationMessage.
java.util.zip.DataFormatException
- if the encoded form was not a valid msg.
java.io.UnsupportedEncodingException
- if UTF8 is not supported.protected int addByteArray(byte[] tail, byte[] resultByteArray, int pos)
tail
- the byte array to concatenate.resultByteArray
- The byte array to concatenate to.pos
- the position where to concatenate.
protected int getNextLength(byte[] in, int pos) throws java.util.zip.DataFormatException
in
- the byte array where to calculate the string.pos
- the position whre to start from in the byte array.
java.util.zip.DataFormatException
- If the byte array does not end with null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |