Class CsnFactory
- java.lang.Object
-
- org.apache.directory.api.ldap.model.csn.CsnFactory
-
public class CsnFactory extends Object
Generates a newCsn.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description CsnFactory(int replicaId)Creates a new CsnFactory instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CsnnewInstance()Returns a newCsn.CsnnewInstance(long timestamp, int changeCount)Returns a newCsncreated from the given values.CsnnewPurgeCsn(long expirationDate)Generates a CSN used to purge data.voidsetReplicaId(int replicaId)Sets the replica ID
-
-
-
Method Detail
-
newInstance
public Csn newInstance()
Returns a newCsn. Generated CSN can be duplicate if user generates CSNs more than 2G times a milliseconds.- Returns:
- The new generated CSN
-
newInstance
public Csn newInstance(long timestamp, int changeCount)
Returns a newCsncreated from the given values. This method is not to be used except for test purposes.- Parameters:
timestamp- The timestamp to usechangeCount- The change count to use- Returns:
- The new generated CSN
-
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- Returns:
- The new generated CSN
-
setReplicaId
public void setReplicaId(int replicaId)
Sets the replica ID- Parameters:
replicaId- The replica ID
-
-