Class ErrorMsg
- java.lang.Object
-
- org.opends.server.replication.protocol.ReplicationMsg
-
- org.opends.server.replication.protocol.InitializationMsg
-
- org.opends.server.replication.protocol.ErrorMsg
-
public final class ErrorMsg extends InitializationMsg
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.
-
-
Field Summary
-
Fields inherited from class org.opends.server.replication.protocol.InitializationMsg
destination, senderId
-
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
COMPACT_MASK, COMPACT_TYPE_ADD, COMPACT_TYPE_DELETE, COMPACT_TYPE_MODIFY, COMPACT_TYPE_MODIFY_DN, COMPACT_TYPE_REPLICA_OFFLINE, MSG_TYPE_DISK_ENCODING
-
-
Constructor Summary
Constructors Constructor Description ErrorMsg(ServerId<?> sender, ReplicaId destination, LocalizableMessage details)
Creates an ErrorMsg providing the destination server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes(short protocolVersion)
Serializes the PDU using the provided replication protocol version.long
getCreationTime()
Get the creation time of this message.LocalizableMessage
getDetails()
Get the details from this message.String
getMsgID()
Get the msgID from this message.boolean
shouldRetryInitialize()
Returns if reinitialization should be retried.String
toString()
Returns a string representation of the message.-
Methods inherited from class org.opends.server.replication.protocol.InitializationMsg
getDestination, getSenderID
-
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
decodeMsg, isRetryable
-
-
-
-
Constructor Detail
-
ErrorMsg
public ErrorMsg(ServerId<?> sender, ReplicaId destination, LocalizableMessage details)
Creates an ErrorMsg providing the destination server.Both a replica and a replication server can send an error message, so
sender
must be able to represent either aReplicaId
or aReplicationServerId
.- 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.
-
-
Method Detail
-
shouldRetryInitialize
public boolean shouldRetryInitialize()
Returns if reinitialization should be retried.Currently reinitialization will be retried when the message is about the source server is not connected to the topology.
- Returns:
- if reinitialization should be retried.
-
getDetails
public LocalizableMessage getDetails()
Get the details from this message.- Returns:
- the details from this message.
-
getMsgID
public String getMsgID()
Get the msgID from this message.- Returns:
- the msgID from this message.
-
getBytes
public byte[] getBytes(short protocolVersion)
Description copied from class:ReplicationMsg
Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.- Specified by:
getBytes
in classReplicationMsg
- Parameters:
protocolVersion
- The protocol version to use for serialization. The version should normally be older than the current one.- Returns:
- The encoded PDU, or
null
if the message isn't supported in that protocol version.
-
toString
public String toString()
Returns a string representation of the message.- Overrides:
toString
in classInitializationMsg
- Returns:
- the string representation of this message.
-
getCreationTime
public long getCreationTime()
Get the creation time of this message. When several attempts of initialization are done sequentially, it helps sorting the good ones, from the ones that relate to ended initialization when they are received.- Returns:
- the creation time of this message.
-
-