public class ReplicaEventLog extends java.lang.Object implements java.lang.Comparable<ReplicaEventLog>
| Modifier and Type | Field and Description |
|---|---|
private org.apache.directory.api.ldap.model.name.Dn |
consumerEntryDn
the DN of the entry where this event log details are stored
|
static int |
DEFAULT_MAX_IDLE_PERIOD
The max delay for an idle replication log with no activity, by default the logs have no idle time period
|
static int |
DEFAULT_PURGE_THRESHOLD_COUNT |
private boolean |
dirty
A flag used to indicate that the consumer is not up to date
|
private java.lang.String |
hostName
hostname of the syncrepl consumer
|
private JdbmTable<java.lang.String,ReplicaEventMessage> |
journal
The Journal of modifications
|
private java.io.File |
journalFile
the underlying file
|
private java.lang.String |
lastSentCsn
the csn that was sent to the client during the last sync session
|
private static org.slf4j.Logger |
LOG
The logger
|
private long |
maxIdlePeriod
the duration(in seconds) of consumer inactivity after which this log will be deleted.
|
private SyncReplSearchListener |
persistentListener
the persistent listener
|
private static org.slf4j.Logger |
PROVIDER_LOG
A logger for the replication provider
|
private int |
purgeThresholdCount
the minimum number of entries to be present for beginning purging entries older than the last sent CSN.
|
private jdbm.RecordManager |
recman
The record manager
|
private boolean |
refreshNPersist
flag indicating refreshAndPersist mode
|
static java.lang.String |
REPLICA_EVENT_LOG_NAME_PREFIX |
private int |
replicaId
the replica id
|
private NotificationCriteria |
searchCriteria
notification criteria used by the persistent search
|
private java.lang.String |
searchFilter
the unmodified search filter as it was when received from the client
|
| Constructor and Description |
|---|
ReplicaEventLog(DirectoryService directoryService,
int replicaId)
Creates a new instance of EventLog for a replica
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ReplicaEventLog o) |
long |
count() |
boolean |
equals(java.lang.Object obj) |
org.apache.directory.api.ldap.model.name.Dn |
getConsumerEntryDn() |
ReplicaJournalCursor |
getCursor(java.lang.String consumerCsn) |
java.lang.String |
getHostName() |
int |
getId() |
java.lang.String |
getLastSentCsn() |
long |
getMaxIdlePeriod() |
java.lang.String |
getName() |
SyncReplSearchListener |
getPersistentListener() |
int |
getPurgeThresholdCount() |
java.lang.String |
getQueueName() |
NotificationCriteria |
getSearchCriteria() |
java.lang.String |
getSearchFilter() |
int |
hashCode() |
boolean |
isDirty() |
boolean |
isRefreshNPersist() |
void |
log(ReplicaEventMessage message)
Stores the given message in the queue
|
void |
recreate()
Re-create the queue
|
void |
setConsumerEntryDn(org.apache.directory.api.ldap.model.name.Dn consumerEntryDn) |
void |
setDirty(boolean dirty)
Set the dirty flag
|
void |
setHostName(java.lang.String hostName)
Set the consumer hostname
|
void |
setLastSentCsn(java.lang.String lastSentCsn)
Update the last Sent CSN.
|
void |
setMaxIdlePeriod(long maxIdlePeriod) |
void |
setPersistentListener(SyncReplSearchListener persistentListener)
Set the listener
|
void |
setPurgeThresholdCount(int purgeThresholdCount) |
void |
setRefreshNPersist(boolean refreshNPersist) |
void |
setSearchCriteria(NotificationCriteria searchCriteria)
Stores the search criteria
|
void |
setSearchFilter(java.lang.String searchFilter)
Set the searchFilter
|
void |
stop()
Stop the EventLog
|
java.lang.String |
toString() |
void |
truncate()
Deletes the queue (to remove the log) and recreates a new queue instance
with the same queue name.
|
private static final org.slf4j.Logger LOG
private static final org.slf4j.Logger PROVIDER_LOG
private java.lang.String hostName
private java.lang.String searchFilter
private java.lang.String lastSentCsn
private SyncReplSearchListener persistentListener
private NotificationCriteria searchCriteria
private int replicaId
private boolean refreshNPersist
private long maxIdlePeriod
private int purgeThresholdCount
private JdbmTable<java.lang.String,ReplicaEventMessage> journal
private java.io.File journalFile
private jdbm.RecordManager recman
private volatile boolean dirty
private org.apache.directory.api.ldap.model.name.Dn consumerEntryDn
public static final java.lang.String REPLICA_EVENT_LOG_NAME_PREFIX
public static final int DEFAULT_PURGE_THRESHOLD_COUNT
public static final int DEFAULT_MAX_IDLE_PERIOD
public ReplicaEventLog(DirectoryService directoryService, int replicaId) throws java.io.IOException
directoryService - The DirectoryService instancereplicaId - The replica IDjava.io.IOExceptionpublic void log(ReplicaEventMessage message)
message - The message to storepublic void truncate()
throws java.lang.Exception
java.lang.Exception - If the queue can't be deletedpublic void recreate()
throws java.lang.Exception
java.lang.Exception - If the creation has failedpublic void stop()
throws java.lang.Exception
java.lang.Exception - If the stop failedpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(ReplicaEventLog o)
compareTo in interface java.lang.Comparable<ReplicaEventLog>public SyncReplSearchListener getPersistentListener()
public void setPersistentListener(SyncReplSearchListener persistentListener)
persistentListener - The listenerpublic NotificationCriteria getSearchCriteria()
public void setSearchCriteria(NotificationCriteria searchCriteria)
searchCriteria - The search criteriapublic boolean isRefreshNPersist()
public void setRefreshNPersist(boolean refreshNPersist)
refreshNPersist - if true, set the EventLog in Refresh and Persist modepublic int getId()
public java.lang.String getLastSentCsn()
public void setLastSentCsn(java.lang.String lastSentCsn)
lastSentCsn - The new Sent CSNpublic java.lang.String getHostName()
public void setHostName(java.lang.String hostName)
hostName - The consumer hostnamepublic java.lang.String getSearchFilter()
public void setSearchFilter(java.lang.String searchFilter)
searchFilter - The searchFilterpublic boolean isDirty()
public void setDirty(boolean dirty)
dirty - The current consumer statuspublic java.lang.String getQueueName()
public ReplicaJournalCursor getCursor(java.lang.String consumerCsn) throws java.lang.Exception
consumerCsn - the consumer's CSN extracted from cookiejava.lang.Exception - If the cursor can't be createdpublic java.lang.String getName()
public long count()
public long getMaxIdlePeriod()
public void setMaxIdlePeriod(long maxIdlePeriod)
public int getPurgeThresholdCount()
public void setPurgeThresholdCount(int purgeThresholdCount)
public org.apache.directory.api.ldap.model.name.Dn getConsumerEntryDn()
public void setConsumerEntryDn(org.apache.directory.api.ldap.model.name.Dn consumerEntryDn)
public java.lang.String toString()
toString in class java.lang.Object