org.apache.directory.mitosis.store
Interface ReplicationStore

All Known Implementing Classes:
DerbyReplicationStore

public interface ReplicationStore

Provides an abstract storage that stores data required to perform replication, such as UUID-LdapDN mapping and LDAP Operations. It also calculates the Update Vector (UV) and the Purge Vector (PV) of a replica.

Version:
$Rev$, $Date#
Author:
The Apache Directory Project (dev@directory.apache.org)

Method Summary
 void close()
          Closes this storage and releases the resources allocated when it's opened.
 javax.naming.Name getDN(java.util.UUID uuid)
          Finds the Name of an entry with the specified UUID.
 java.util.Set<java.lang.String> getKnownReplicaIds()
          Returns the set of ReplicaIds of the ReplicaIds that belongs to the same cluster.
 ReplicationLogIterator getLogs(CSN fromCSN, boolean inclusive)
          Queries all operations that is greater than the specified CSN.
 ReplicationLogIterator getLogs(CSNVector updateVector, boolean inclusive)
          Queries all operations that is greater than the specified CSNVector.
 int getLogSize()
          Returns the number of Operations logged in this storage.
 int getLogSize(java.lang.String replicaId)
          Returns the number of Operations logged by the ReplicaId with the specified ReplicaId in this storage .
 CSNVector getPurgeVector()
          Calculates the Purge Vector (PV) from this storage.
 java.lang.String getReplicaId()
          Returns the ReplicaId of the ReplicaId that this storage is associated with.
 CSNVector getUpdateVector()
          Calculates the Update Vector (UV) from this storage.
 void open(DirectoryService directoryService, ReplicationConfiguration cfg)
          Opens this storage.
 void putLog(Operation operation)
          Puts the specified operation into this storage.
 boolean putUUID(java.util.UUID uuid, javax.naming.Name dn)
          Associates the specified name and UUID so a user can find an entry's name from a UUID.
 int removeLogs(CSN toCSN, boolean inclusive)
          Removes all operations that is less than the specified CSN.
 boolean removeUUID(java.util.UUID uuid)
          Removed the specified UUID mapping from this storage.
 

Method Detail

open

void open(DirectoryService directoryService,
          ReplicationConfiguration cfg)
Opens this storage.


close

void close()
Closes this storage and releases the resources allocated when it's opened.


getReplicaId

java.lang.String getReplicaId()
Returns the ReplicaId of the ReplicaId that this storage is associated with.


getKnownReplicaIds

java.util.Set<java.lang.String> getKnownReplicaIds()
Returns the set of ReplicaIds of the ReplicaIds that belongs to the same cluster.


getDN

javax.naming.Name getDN(java.util.UUID uuid)
Finds the Name of an entry with the specified UUID.


putUUID

boolean putUUID(java.util.UUID uuid,
                javax.naming.Name dn)
Associates the specified name and UUID so a user can find an entry's name from a UUID.


removeUUID

boolean removeUUID(java.util.UUID uuid)
Removed the specified UUID mapping from this storage.

Returns:
true if and only if the mapping has been removed

putLog

void putLog(Operation operation)
Puts the specified operation into this storage.


getLogs

ReplicationLogIterator getLogs(CSN fromCSN,
                               boolean inclusive)
Queries all operations that is greater than the specified CSN.

Parameters:
inclusive - true if you want to include fromCSN itself in the result set.

getLogs

ReplicationLogIterator getLogs(CSNVector updateVector,
                               boolean inclusive)
Queries all operations that is greater than the specified CSNVector.

Parameters:
inclusive - true if you want to include updateVector itself in the result set.

removeLogs

int removeLogs(CSN toCSN,
               boolean inclusive)
Removes all operations that is less than the specified CSN.

Parameters:
inclusive - true if you want to delete the toCSN itself, too.
Returns:
the number of deleted Operations

getLogSize

int getLogSize()
Returns the number of Operations logged in this storage.


getLogSize

int getLogSize(java.lang.String replicaId)
Returns the number of Operations logged by the ReplicaId with the specified ReplicaId in this storage .


getUpdateVector

CSNVector getUpdateVector()
Calculates the Update Vector (UV) from this storage.


getPurgeVector

CSNVector getPurgeVector()
Calculates the Purge Vector (PV) from this storage.



Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.