org.opends.server.replication.plugin
Class RemotePendingChanges

java.lang.Object
  extended by org.opends.server.replication.plugin.RemotePendingChanges

public class RemotePendingChanges
extends java.lang.Object

This class is used to store the list of remote changes received from a replication server and taht are either currently being replayed or that are waiting for being replayed. It is used to know when the ServerState must be updated and to conpute the dependencies between operations. One of this object is instanciated for each ReplicationDomain.


Constructor Summary
RemotePendingChanges(ChangeNumberGenerator changeNumberGenerator, ServerState state)
          Creates a new RemotePendingChanges using the provided ServerState.
 
Method Summary
 boolean checkDependencies(AddOperation op)
          Check if the given AddOperation has some dependencies on any currently running previous operation.
 boolean checkDependencies(DeleteOperation op)
          Check if the given DeleteOperation has some dependencies on any currently running previous operation.
 boolean checkDependencies(ModifyDNMsg msg)
          Check if the given ModifyDNMsg has some dependencies on any currently running previous operation.
 boolean checkDependencies(ModifyOperation op)
          Check if the given ModifyOperation has some dependencies on any currently running previous operation.
 void commit(ChangeNumber changeNumber)
          Mark an update message as committed.
 UpdateMessage getNextUpdate()
          Get the first update in the list that have some dependencies cleared.
 void putRemoteUpdate(UpdateMessage update)
          Add a new UpdateMessage that was received from the replication server to the pendingList.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemotePendingChanges

public RemotePendingChanges(ChangeNumberGenerator changeNumberGenerator,
                            ServerState state)
Creates a new RemotePendingChanges using the provided ServerState.

Parameters:
changeNumberGenerator - The ChangeNumberGenerator that should be adjusted when changes are received.
state - The ServerState that will be updated when UpdateMessage have been fully replayed.
Method Detail

putRemoteUpdate

public void putRemoteUpdate(UpdateMessage update)
Add a new UpdateMessage that was received from the replication server to the pendingList.

Parameters:
update - The UpdateMessage that was received from the replication server and that will be added to the pending list.

commit

public void commit(ChangeNumber changeNumber)
Mark an update message as committed.

Parameters:
changeNumber - The ChangeNumber of the update message that must be set as committed.

getNextUpdate

public UpdateMessage getNextUpdate()
Get the first update in the list that have some dependencies cleared.

Returns:
The UpdateMessage to be handled.

checkDependencies

public boolean checkDependencies(AddOperation op)
Check if the given AddOperation has some dependencies on any currently running previous operation. Update the dependency list in the associated PendingChange if there are some dependencies. AddOperation depends on - DeleteOperation done on the same DN - ModifyDnOperation with the same target DN as the ADD DN - ModifyDnOperation with new DN equals to the ADD DN parent - AddOperation done on the parent DN of the ADD DN

Parameters:
op - The AddOperation to be checked.
Returns:
A boolean indicating if this operation has some dependencies.

checkDependencies

public boolean checkDependencies(ModifyOperation op)
Check if the given ModifyOperation has some dependencies on any currently running previous operation. Update the dependency list in the associated PendingChange if there are some dependencies. ModifyOperation depends on - AddOperation done on the same DN

Parameters:
op - The ModifyOperation to be checked.
Returns:
A boolean indicating if this operation has some dependencies.

checkDependencies

public boolean checkDependencies(ModifyDNMsg msg)
Check if the given ModifyDNMsg has some dependencies on any currently running previous operation. Update the dependency list in the associated PendingChange if there are some dependencies. Modify DN Operation depends on - AddOperation done on the same DN as the target DN of the MODDN operation - AddOperation done on the new parent of the MODDN operation - DeleteOperation done on the new DN of the MODDN operation - ModifyDNOperation done from the new DN of the MODDN operation

Parameters:
msg - The ModifyDNMsg to be checked.
Returns:
A boolean indicating if this operation has some dependencies.

checkDependencies

public boolean checkDependencies(DeleteOperation op)
Check if the given DeleteOperation has some dependencies on any currently running previous operation. Update the dependency list in the associated PendingChange if there are some dependencies. DeleteOperation depends on - DeleteOperation done on children DN - ModifyDnOperation with target DN that are children of the DEL DN - AddOperation done on the same DN

Parameters:
op - The DeleteOperation to be checked.
Returns:
A boolean indicating if this operation has some dependencies.