org.opends.server.replication.protocol
Class ErrorMessage

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

public class ErrorMessage
extends RoutableMessage
implements java.io.Serializable

This message is part of the replication protocol. This message is sent by a server or a replication server when an error is detected in the context of a total update.

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
ErrorMessage(byte[] in)
          Creates a new ErrorMessage by decoding the provided byte array.
ErrorMessage(short destination, Message details)
          Creates an ErrorMessage.
ErrorMessage(short sender, short destination, Message details)
          Creates an ErrorMessage providing the destination server.
 
Method Summary
 byte[] getBytes()
          Return the byte[] representation of this message.
 Message getDetails()
          Get the base DN from this InitializeMessage.
 int getMsgID()
          Get the base DN from this InitializeMessage.
 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

ErrorMessage

public ErrorMessage(short sender,
                    short destination,
                    Message details)
Creates an ErrorMessage providing the destination server.

Parameters:
sender - The server ID of the server that send this message.
destination - The destination server or servers of this message.
details - The message containing the details of the error.

ErrorMessage

public ErrorMessage(short destination,
                    Message details)
Creates an ErrorMessage.

Parameters:
destination - replication server id
details - details of the error

ErrorMessage

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

getDetails

public Message getDetails()
Get the base DN from this InitializeMessage.

Returns:
the base DN from this InitializeMessage.

getMsgID

public int getMsgID()
Get the base DN from this InitializeMessage.

Returns:
the base DN from this InitializeMessage.

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.

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.