org.opends.server.replication.protocol
Class ReplServerInfoMessage

java.lang.Object
  extended by org.opends.server.replication.protocol.ReplicationMessage
      extended by org.opends.server.replication.protocol.ReplServerInfoMessage

public class ReplServerInfoMessage
extends ReplicationMessage

This class defines a message that is sent by a replication server to the other replication servers in the topology containing the list of LDAP servers directly connected to it. A replication server sends a ReplServerInfoMessage when an LDAP server connects or disconnects. Exchanging these messages allows to have each replication server knowing the complete list of LDAP servers in the topology and their associated replication server and thus take the appropriate decision to route a message to an LDAP server.


Constructor Summary
ReplServerInfoMessage(byte[] in)
          Creates a new changelogInfo message from its encoded form.
ReplServerInfoMessage(java.util.List<java.lang.String> connectedServers, long generationId)
          Creates a new ReplServerInfo message from a list of the currently connected servers.
 
Method Summary
 byte[] getBytes()
          Return the byte[] representation of this message.
 java.util.List<java.lang.String> getConnectedServers()
          Get the list of servers currently connected to the Changelog server that generated this message.
 long getGenerationId()
          Get the generationId from this message.
 java.lang.String 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

ReplServerInfoMessage

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

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

ReplServerInfoMessage

public ReplServerInfoMessage(java.util.List<java.lang.String> connectedServers,
                             long generationId)
Creates a new ReplServerInfo message from a list of the currently connected servers.

Parameters:
connectedServers - The list of currently connected servers ID.
generationId - The generationId currently associated with this domain.
Method Detail

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.

getConnectedServers

public java.util.List<java.lang.String> getConnectedServers()
Get the list of servers currently connected to the Changelog server that generated this message.

Returns:
A collection of the servers currently connected to the Changelog server that generated this message.

getGenerationId

public long getGenerationId()
Get the generationId from this message.

Returns:
The generationId.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object