org.opends.server.replication.plugin
Class PendingChange

java.lang.Object
  extended by org.opends.server.replication.plugin.PendingChange
All Implemented Interfaces:
java.lang.Comparable<PendingChange>

public class PendingChange
extends java.lang.Object
implements java.lang.Comparable<PendingChange>

This class is use to store an operation currently in progress and not yet committed in the database.


Constructor Summary
PendingChange(ChangeNumber changeNumber, PluginOperation op, UpdateMessage msg)
          Construct a new PendingChange.
 
Method Summary
 void addDependency(ChangeNumber changeNumber)
          Add the given ChangeNumber in the list of dependencies of this PendingChange.
 int compareTo(PendingChange o)
          
 boolean dependenciesIsCovered(ServerState state)
          Check if the given ServerState covers the dependencies of this PendingChange.
 ChangeNumber getChangeNumber()
          Get the ChangeNumber associated to this PendingChange.
 UpdateMessage getMsg()
          Get the message associated to this PendingChange.
 PluginOperation getOp()
          Get the operation associated to the PendingChange.
 DN getTargetDN()
          Get the Target DN of this message.
 boolean isCommitted()
          Check if a Change is already committed to the database.
 void setCommitted(boolean committed)
          Set the committed status of a Pending Change.
 void setMsg(UpdateMessage msg)
          Set the message associated to the PendingChange.
 void setOp(PluginOperation op)
          Set the operation asociated to this PendingChange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PendingChange

public PendingChange(ChangeNumber changeNumber,
                     PluginOperation op,
                     UpdateMessage msg)
Construct a new PendingChange.

Parameters:
changeNumber - the ChangeNumber of use
op - the operation to use
msg - the message to use (can be null for local operations)
Method Detail

isCommitted

public boolean isCommitted()
Check if a Change is already committed to the database.

Returns:
true if change is already committed to the database.

setCommitted

public void setCommitted(boolean committed)
Set the committed status of a Pending Change.

Parameters:
committed - status that must be set

getChangeNumber

public ChangeNumber getChangeNumber()
Get the ChangeNumber associated to this PendingChange.

Returns:
the ChangeNumber

getMsg

public UpdateMessage getMsg()
Get the message associated to this PendingChange.

Returns:
the message if operation was a replication operation null if the operation was a local operation

setMsg

public void setMsg(UpdateMessage msg)
Set the message associated to the PendingChange.

Parameters:
msg - the message

getOp

public PluginOperation getOp()
Get the operation associated to the PendingChange.

Returns:
the operation

setOp

public void setOp(PluginOperation op)
Set the operation asociated to this PendingChange.

Parameters:
op - The operation associated to this PendingChange.

addDependency

public void addDependency(ChangeNumber changeNumber)
Add the given ChangeNumber in the list of dependencies of this PendingChange.

Parameters:
changeNumber - The ChangeNumber to add in the list of dependencies of this PendingChange.

dependenciesIsCovered

public boolean dependenciesIsCovered(ServerState state)
Check if the given ServerState covers the dependencies of this PendingChange.

Parameters:
state - The ServerState for which dependencies must be checked,
Returns:
A boolean indicating if the given ServerState covers the dependencies of this PendingChange.

getTargetDN

public DN getTargetDN()
Get the Target DN of this message.

Returns:
The target DN of this message.

compareTo

public int compareTo(PendingChange o)

Specified by:
compareTo in interface java.lang.Comparable<PendingChange>