org.apache.directory.shared.ldap.csn
Class CsnFactory

java.lang.Object
  extended by org.apache.directory.shared.ldap.csn.CsnFactory

public class CsnFactory
extends java.lang.Object

Generates a new Csn.

Author:
Apache Directory Project

Constructor Summary
CsnFactory(int replicaId)
           
 
Method Summary
 Csn newInstance()
          Returns a new Csn.
 Csn newInstance(long timestamp, int changeCount)
          Returns a new Csn created from the given values.
 Csn newPurgeCsn(long expirationDate)
          Generates a CSN used to purge data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsnFactory

public CsnFactory(int replicaId)
Method Detail

newInstance

public Csn newInstance()
Returns a new Csn. Generated CSN can be duplicate if user generates CSNs more than 2G times a milliseconds.


newInstance

public Csn newInstance(long timestamp,
                       int changeCount)
Returns a new Csn created from the given values. This method is not to be used except for test purposes.

Parameters:
timestamp - The timestamp to use
replicaId - Replica ID. ReplicaID must be 1-3 digit value
changeCount - The change count to use

newPurgeCsn

public Csn newPurgeCsn(long expirationDate)
Generates a CSN used to purge data. Its replicaID is not associated to a server.

Parameters:
expirationDate - The time up to the first CSN we want to keep


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