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 Csn
newInstance()
Returns a newCsn
.Csn
newInstance(long timestamp, int changeCount)
Returns a newCsn
created from the given values.Csn
newPurgeCsn(long expirationDate)
Generates a CSN used to purge data.void
setReplicaId(int replicaId)
Sets the replica ID
-
-
-
Constructor Detail
-
CsnFactory
public CsnFactory(int replicaId)
Creates a new CsnFactory instance- Parameters:
replicaId
- 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 newCsn
created 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
-
-