org.opends.server.replication.protocol
Class MonitorMessage

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.MonitorMessage
All Implemented Interfaces:
java.io.Serializable

public class MonitorMessage
extends RoutableMessage
implements java.io.Serializable

This message is part of the replication protocol. RS1 sends a MonitorRequestMessage to RS2 to requests its monitoring informations. When RS2 receives a MonitorRequestMessage from RS1, RS2 responds with a MonitorMessage.

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
MonitorMessage(byte[] in)
          Creates a new EntryMessage from its encoded form.
MonitorMessage(short sender, short destination)
          Creates a new EntryMessage.
 
Method Summary
 byte[] getBytes()
          Return the byte[] representation of this message.
 java.lang.Long getLDAPApproxFirstMissingDate(short serverId)
          Get the approximation of the date of the older missing change for the LDAP Server with the provided server Id.
 ServerState getLDAPServerState(short serverId)
          Get the server state for the LDAP server with the provided serverId.
 ServerState getReplServerDbState()
          Get the state of the replication server that sent this message.
 java.lang.Long getRSApproxFirstMissingDate(short serverId)
          Get the approximation of the date of the older missing change for the RS Server with the provided server Id.
 ServerState getRSServerState(short serverId)
          Get the server state for the RS server with the provided serverId.
 java.util.Iterator<java.lang.Short> ldapIterator()
          Returns an iterator on the serverId of the connected LDAP servers.
 java.util.Iterator<java.lang.Short> rsIterator()
          Returns an iterator on the serverId of the connected RS servers.
 void setReplServerDbState(ServerState state)
          Sets the state of the replication server.
 void setServerState(short serverId, ServerState state, java.lang.Long approxFirstMissingDate, boolean isLDAP)
          Sets the informations of an LDAP server.
 java.lang.String toString()
          Returns a string representation of the message.
 
Methods inherited from class org.opends.server.replication.protocol.RoutableMessage
getDestination, getsenderID
 
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

MonitorMessage

public MonitorMessage(short sender,
                      short destination)
Creates a new EntryMessage.

Parameters:
sender - The sender of this message.
destination - The destination of this message.

MonitorMessage

public MonitorMessage(byte[] in)
               throws java.util.zip.DataFormatException
Creates a new EntryMessage 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 ServerStartMessage.
Method Detail

setReplServerDbState

public void setReplServerDbState(ServerState state)
Sets the state of the replication server.

Parameters:
state - The state.

setServerState

public void setServerState(short serverId,
                           ServerState state,
                           java.lang.Long approxFirstMissingDate,
                           boolean isLDAP)
Sets the informations of an LDAP server.

Parameters:
serverId - The serverID.
state - The server state.
approxFirstMissingDate - The approximation of the date of the older missing change. null when none.
isLDAP - Specifies whether the server is a LS or a RS

getLDAPServerState

public ServerState getLDAPServerState(short serverId)
Get the server state for the LDAP server with the provided serverId.

Parameters:
serverId - The provided serverId.
Returns:
The state.

getRSServerState

public ServerState getRSServerState(short serverId)
Get the server state for the RS server with the provided serverId.

Parameters:
serverId - The provided serverId.
Returns:
The state.

getLDAPApproxFirstMissingDate

public java.lang.Long getLDAPApproxFirstMissingDate(short serverId)
Get the approximation of the date of the older missing change for the LDAP Server with the provided server Id.

Parameters:
serverId - The provided serverId.
Returns:
The approximated state.

getRSApproxFirstMissingDate

public java.lang.Long getRSApproxFirstMissingDate(short serverId)
Get the approximation of the date of the older missing change for the RS Server with the provided server Id.

Parameters:
serverId - The provided serverId.
Returns:
The approximated state.

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.

getReplServerDbState

public ServerState getReplServerDbState()
Get the state of the replication server that sent this message.

Returns:
The state.

ldapIterator

public java.util.Iterator<java.lang.Short> ldapIterator()
Returns an iterator on the serverId of the connected LDAP servers.

Returns:
The iterator.

rsIterator

public java.util.Iterator<java.lang.Short> rsIterator()
Returns an iterator on the serverId of the connected RS servers.

Returns:
The iterator.

toString

public java.lang.String toString()
Returns a string representation of the message.

Overrides:
toString in class RoutableMessage
Returns:
the string representation of this message.