org.opends.server.replication.protocol
Class ServerStartMessage

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

public class ServerStartMessage
extends StartMessage
implements java.io.Serializable

This message is used by LDAP server when they first connect. to a replication server to let them know who they are and what is their state (their RUV)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opends.server.replication.protocol.StartMessage
headerLength
 
Constructor Summary
ServerStartMessage(byte[] in)
          Creates a new ServerStartMessage from its encoded form.
ServerStartMessage(short serverId, DN baseDn, int maxReceiveDelay, int maxReceiveQueue, int maxSendDelay, int maxSendQueue, int windowSize, long heartbeatInterval, ServerState serverState, short protocolVersion, long generationId, boolean sslEncryption, boolean handshakeOnly)
          Creates a new ServerStartMessage.
 
Method Summary
 DN getBaseDn()
          Get the baseDn.
 byte[] getBytes()
          Return the byte[] representation of this message.
 long getHeartbeatInterval()
          Get the heartbeat interval requested by the ldap server that created the message.
 int getMaxReceiveDelay()
          Get the maxReceiveDelay.
 int getMaxReceiveQueue()
          Get the maxReceiveQueue.
 int getMaxSendDelay()
          Get the maxSendDelay.
 int getMaxSendQueue()
          Get the maxSendQueue.
 short getServerId()
          Get the ServerID from the message.
 ServerState getServerState()
          Get the ServerState.
 java.lang.String getServerURL()
          get the Server URL from the message.
 boolean getSSLEncryption()
          Get the SSL encryption value for the ldap server that created the message.
 int getWindowSize()
          Get the window size for the ldap server that created the message.
 boolean isHandshakeOnly()
          Get the SSL encryption value for the ldap server that created the message.
 
Methods inherited from class org.opends.server.replication.protocol.StartMessage
decodeHeader, encodeHeader, getGenerationId, getVersion
 
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, toString, wait, wait, wait
 

Constructor Detail

ServerStartMessage

public ServerStartMessage(short serverId,
                          DN baseDn,
                          int maxReceiveDelay,
                          int maxReceiveQueue,
                          int maxSendDelay,
                          int maxSendQueue,
                          int windowSize,
                          long heartbeatInterval,
                          ServerState serverState,
                          short protocolVersion,
                          long generationId,
                          boolean sslEncryption,
                          boolean handshakeOnly)
Creates a new ServerStartMessage. This message is to be sent by an LDAP Server after being connected to a replication server for a given replication domain.

Parameters:
serverId - The serverId of the server for which the ServerStartMessage is created.
baseDn - The base DN.
maxReceiveDelay - The max receive delay for this server.
maxReceiveQueue - The max receive Queue for this server.
maxSendDelay - The max Send Delay from this server.
maxSendQueue - The max send Queue from this server.
windowSize - The window size used by this server.
heartbeatInterval - The requested heartbeat interval.
serverState - The state of this server.
protocolVersion - The replication protocol version of the creator.
generationId - The generationId for this server.
sslEncryption - Whether to continue using SSL to encrypt messages after the start messages have been exchanged.
handshakeOnly - Whether this message is only to get an handshake with the server or not.

ServerStartMessage

public ServerStartMessage(byte[] in)
                   throws java.util.zip.DataFormatException
Creates a new ServerStartMessage from its encoded form.

Parameters:
in - The byte array containing the encoded form of the ServerStartMessage.
Throws:
java.util.zip.DataFormatException - If the byte array does not contain a valid encoded form of the ServerStartMessage.
Method Detail

getServerId

public short getServerId()
Get the ServerID from the message.

Returns:
the server ID

getServerURL

public java.lang.String getServerURL()
get the Server URL from the message.

Returns:
the server URL

getBaseDn

public DN getBaseDn()
Get the baseDn.

Returns:
Returns the baseDn.

getMaxReceiveDelay

public int getMaxReceiveDelay()
Get the maxReceiveDelay.

Returns:
Returns the maxReceiveDelay.

getMaxReceiveQueue

public int getMaxReceiveQueue()
Get the maxReceiveQueue.

Returns:
Returns the maxReceiveQueue.

getMaxSendDelay

public int getMaxSendDelay()
Get the maxSendDelay.

Returns:
Returns the maxSendDelay.

getMaxSendQueue

public int getMaxSendQueue()
Get the maxSendQueue.

Returns:
Returns the maxSendQueue.

getServerState

public ServerState getServerState()
Get the ServerState.

Returns:
The ServerState.

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.

getWindowSize

public int getWindowSize()
Get the window size for the ldap server that created the message.

Returns:
The window size for the ldap server that created the message.

getHeartbeatInterval

public long getHeartbeatInterval()
Get the heartbeat interval requested by the ldap server that created the message.

Returns:
The heartbeat interval requested by the ldap server that created the message.

getSSLEncryption

public boolean getSSLEncryption()
Get the SSL encryption value for the ldap server that created the message.

Returns:
The SSL encryption value for the ldap server that created the message.

isHandshakeOnly

public boolean isHandshakeOnly()
Get the SSL encryption value for the ldap server that created the message.

Returns:
The SSL encryption value for the ldap server that created the message.