public class DefaultJournalStore extends Object implements JournalStore
Constructor and Description |
---|
DefaultJournalStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
ack(long revision)
Records a ack for a change
|
void |
destroy()
Destroy the logs.
|
long |
getCurrentRevision()
Gets the current revision of the server (a.k.a.
|
String |
getFileName() |
void |
init(DirectoryService service)
Initialize the interceptor
|
boolean |
log(LdapPrincipal principal,
long revision,
org.apache.directory.api.ldap.model.ldif.LdifEntry forward)
Stores an event into the journal.
|
boolean |
nack(long revision)
Records a nack for a change
|
void |
setFileName(String fileName)
The file name to use as the journal file.
|
void |
setWorkingDirectory(String workingDirectoryName)
The working directory on which the journal file will be stored.
|
void |
sync()
Write the changes on disk
|
public DefaultJournalStore()
public void destroy() throws IOException
destroy
in interface JournalStore
IOException
- If we can't destroy the logspublic void init(DirectoryService service) throws IOException
init
in interface JournalStore
service
- The associated DirectoryServiceIOException
- If the initialization failedpublic boolean log(LdapPrincipal principal, long revision, org.apache.directory.api.ldap.model.ldif.LdifEntry forward)
log
in interface JournalStore
principal
- The principal who is logging the changerevision
- The operation revisionforward
- The change to logtrue
if the entry has been writtenpublic boolean ack(long revision)
ack
in interface JournalStore
revision
- The change revision which is ackedtrue
if the ack has been writtenpublic boolean nack(long revision)
nack
in interface JournalStore
revision
- The change revision which is nackedtrue
if the nack has been writtenpublic void sync() throws IOException
JournalStore
sync
in interface JournalStore
IOException
- If the write failedpublic long getCurrentRevision()
JournalStore
getCurrentRevision
in interface JournalStore
public String getFileName()
public void setFileName(String fileName)
JournalStore
setFileName
in interface JournalStore
fileName
- the fileName to setpublic void setWorkingDirectory(String workingDirectoryName)
setWorkingDirectory
in interface JournalStore
workingDirectoryName
- The working directory in which the journal file
will be storedCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.