org.opends.server.replication.protocol
Class InitializeTargetMessage

java.lang.Object
  extended by org.opends.server.replication.protocol.ReplicationMessage
      extended by org.opends.server.replication.protocol.RoutableMessage
          extended by org.opends.server.replication.protocol.InitializeTargetMessage
All Implemented Interfaces:
java.io.Serializable

public class InitializeTargetMessage
extends RoutableMessage
implements java.io.Serializable

This message is part of the replication protocol. This message is sent by a server to one or several servers as the first message of an export, before sending the entries.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opends.server.replication.protocol.RoutableMessage
ALL_SERVERS, destination, senderID, THE_CLOSEST_SERVER, UNKNOWN_SERVER
 
Constructor Summary
InitializeTargetMessage(byte[] in)
          Creates an InitializeTargetMessage by decoding the provided byte array.
InitializeTargetMessage(DN baseDN, short senderID, short destination, short requestorID, long entryCount)
          Creates a InitializeDestinationMessage.
 
Method Summary
 DN getBaseDN()
          Get the base DN of the domain.
 byte[] getBytes()
          Return the byte[] representation of this message.
 long getEntryCount()
          Get the number of entries expected to be sent during the export.
 long getRequestorID()
          Get the serverID of the server that initiated the export.
 
Methods inherited from class org.opends.server.replication.protocol.RoutableMessage
getDestination, getsenderID, toString
 
Methods inherited from class org.opends.server.replication.protocol.ReplicationMessage
addByteArray, generateMsg, getNextLength
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitializeTargetMessage

public InitializeTargetMessage(DN baseDN,
                               short senderID,
                               short destination,
                               short requestorID,
                               long entryCount)
Creates a InitializeDestinationMessage.

Parameters:
baseDN - The base DN for which the InitializeMessage is created.
senderID - The serverID of the server that sends this message.
destination - The destination of this message.
requestorID - The server that initiates this export.
entryCount - The count of entries that will be sent.

InitializeTargetMessage

public InitializeTargetMessage(byte[] in)
                        throws java.util.zip.DataFormatException
Creates an InitializeTargetMessage by decoding the provided byte array.

Parameters:
in - A byte array containing the encoded information for the Message
Throws:
java.util.zip.DataFormatException - If the in does not contain a properly encoded InitializeMessage.
Method Detail

getEntryCount

public long getEntryCount()
Get the number of entries expected to be sent during the export.

Returns:
the entry count

getRequestorID

public long getRequestorID()
Get the serverID of the server that initiated the export.

Returns:
the serverID

getBaseDN

public DN getBaseDN()
Get the base DN of the domain.

Returns:
the base DN

getBytes

public byte[] getBytes()
Return the byte[] representation of this message. Depending on the message type, the first byte of the byte[] must be. MSG_TYPE_MODIFY_REQUEST MSG_TYPE_ADD_REQUEST MSG_TYPE_DELETE_REQUEST MSG_TYPE_MODIFY_DN_REQUEST MSG_TYPE_ACK MSG_TYPE_SERVER_START MSG_TYPE_REPL_SERVER_START MSG_TYPE_WINDOW MSG_TYPE_HEARTBEAT MSG_TYPE_INITIALIZE MSG_TYPE_INITIALIZE_TARGET MSG_TYPE_ENTRY MSG_TYPE_DONE MSG_TYPE_ERROR MSG_TYPE_WINDOW_PROBE MSG_TYPE_REPL_SERVER_INFO MSG_TYPE_RESET_GENERATION_ID MSG_TYPE_REPL_SERVER_MONITOR_REQUEST MSG_TYPE_REPL_SERVER_MONITOR

Specified by:
getBytes in class ReplicationMessage
Returns:
the byte[] representation of this message.