org.apache.directory.mitosis.store.derby
Class DerbyReplicationStore

java.lang.Object
  extended by org.apache.directory.mitosis.store.derby.DerbyReplicationStore
All Implemented Interfaces:
ReplicationStore

public class DerbyReplicationStore
extends java.lang.Object
implements ReplicationStore


Constructor Summary
DerbyReplicationStore()
           
 
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.
 java.lang.String getTablePrefix()
           
 CSNVector getUpdateVector()
          Calculates the Update Vector (UV) from this storage.
 void open(DirectoryService serviceCfg, ReplicationConfiguration cfg)
          Opens this storage.
 void putLog(Operation op)
          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.
 void setTablePrefix(java.lang.String tablePrefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyReplicationStore

public DerbyReplicationStore()
Method Detail

getTablePrefix

public java.lang.String getTablePrefix()

setTablePrefix

public void setTablePrefix(java.lang.String tablePrefix)

open

public void open(DirectoryService serviceCfg,
                 ReplicationConfiguration cfg)
Description copied from interface: ReplicationStore
Opens this storage.

Specified by:
open in interface ReplicationStore

close

public void close()
Description copied from interface: ReplicationStore
Closes this storage and releases the resources allocated when it's opened.

Specified by:
close in interface ReplicationStore

getReplicaId

public java.lang.String getReplicaId()
Description copied from interface: ReplicationStore
Returns the ReplicaId of the ReplicaId that this storage is associated with.

Specified by:
getReplicaId in interface ReplicationStore

getKnownReplicaIds

public java.util.Set<java.lang.String> getKnownReplicaIds()
Description copied from interface: ReplicationStore
Returns the set of ReplicaIds of the ReplicaIds that belongs to the same cluster.

Specified by:
getKnownReplicaIds in interface ReplicationStore

getDN

public javax.naming.Name getDN(java.util.UUID uuid)
Description copied from interface: ReplicationStore
Finds the Name of an entry with the specified UUID.

Specified by:
getDN in interface ReplicationStore

putUUID

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

Specified by:
putUUID in interface ReplicationStore

removeUUID

public boolean removeUUID(java.util.UUID uuid)
Description copied from interface: ReplicationStore
Removed the specified UUID mapping from this storage.

Specified by:
removeUUID in interface ReplicationStore
Returns:
true if and only if the mapping has been removed

putLog

public void putLog(Operation op)
Description copied from interface: ReplicationStore
Puts the specified operation into this storage.

Specified by:
putLog in interface ReplicationStore

getLogs

public ReplicationLogIterator getLogs(CSNVector updateVector,
                                      boolean inclusive)
Description copied from interface: ReplicationStore
Queries all operations that is greater than the specified CSNVector.

Specified by:
getLogs in interface ReplicationStore
inclusive - true if you want to include updateVector itself in the result set.

getLogs

public ReplicationLogIterator getLogs(CSN fromCSN,
                                      boolean inclusive)
Description copied from interface: ReplicationStore
Queries all operations that is greater than the specified CSN.

Specified by:
getLogs in interface ReplicationStore
inclusive - true if you want to include fromCSN itself in the result set.

removeLogs

public int removeLogs(CSN toCSN,
                      boolean inclusive)
Description copied from interface: ReplicationStore
Removes all operations that is less than the specified CSN.

Specified by:
removeLogs in interface ReplicationStore
inclusive - true if you want to delete the toCSN itself, too.
Returns:
the number of deleted Operations

getLogSize

public int getLogSize()
Description copied from interface: ReplicationStore
Returns the number of Operations logged in this storage.

Specified by:
getLogSize in interface ReplicationStore

getLogSize

public int getLogSize(java.lang.String replicaId)
Description copied from interface: ReplicationStore
Returns the number of Operations logged by the ReplicaId with the specified ReplicaId in this storage .

Specified by:
getLogSize in interface ReplicationStore

getUpdateVector

public CSNVector getUpdateVector()
Description copied from interface: ReplicationStore
Calculates the Update Vector (UV) from this storage.

Specified by:
getUpdateVector in interface ReplicationStore

getPurgeVector

public CSNVector getPurgeVector()
Description copied from interface: ReplicationStore
Calculates the Purge Vector (PV) from this storage.

Specified by:
getPurgeVector in interface ReplicationStore


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