org.apache.directory.server.core.journal
Class DefaultJournalStore

java.lang.Object
  extended by org.apache.directory.server.core.journal.DefaultJournalStore
All Implemented Interfaces:
JournalStore

public class DefaultJournalStore
extends java.lang.Object
implements JournalStore

Version:
$Rev$, $Date$
Author:
Apache Directory Project
XBean

Constructor Summary
DefaultJournalStore()
           
 
Method Summary
 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.
 java.lang.String getFileName()
           
 void init(DirectoryService service)
          Initialize the interceptor
 boolean log(LdapPrincipal principal, long revision, org.apache.directory.shared.ldap.ldif.LdifEntry forward)
          Stores an event into the journal.
 boolean nack(long revision)
          Records a nack for a change
 void setFileName(java.lang.String fileName)
          The file name to use as the journal file.
 void setWorkingDirectory(java.lang.String workingDirectoryName)
          The working directory on which the journal file will be stored.
 void sync()
          Write the changes on disk
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJournalStore

public DefaultJournalStore()
Method Detail

destroy

public void destroy()
             throws java.lang.Exception
Destroy the logs.

Specified by:
destroy in interface JournalStore
Throws:
java.lang.Exception - If we can't destroy the logs

init

public void init(DirectoryService service)
          throws java.lang.Exception
Initialize the interceptor

Specified by:
init in interface JournalStore
Parameters:
service - The associated DirectoryService
Throws:
java.lang.Exception - If the initialization failed

log

public boolean log(LdapPrincipal principal,
                   long revision,
                   org.apache.directory.shared.ldap.ldif.LdifEntry forward)
Stores an event into the journal.

Specified by:
log in interface JournalStore
Parameters:
principal - The principal who is logging the change
revision - The operation revision
forward - The change to log
Returns:
true if the entry has been written

ack

public boolean ack(long revision)
Records a ack for a change

Specified by:
ack in interface JournalStore
Parameters:
revision - The change revision which is acked
Returns:
true if the ack has been written
Throws:
java.lang.Exception - if there are problems logging the ack

nack

public boolean nack(long revision)
Records a nack for a change

Specified by:
nack in interface JournalStore
Parameters:
revision - The change revision which is nacked
Returns:
true if the nack has been written
Throws:
java.lang.Exception - if there are problems logging the nack

sync

public void sync()
          throws java.lang.Exception
Description copied from interface: JournalStore
Write the changes on disk

Specified by:
sync in interface JournalStore
Throws:
java.lang.Exception - If the write failed

getCurrentRevision

public long getCurrentRevision()
Description copied from interface: JournalStore
Gets the current revision of the server (a.k.a. the HEAD revision).

Specified by:
getCurrentRevision in interface JournalStore
Returns:
the current revision of the server

getFileName

public java.lang.String getFileName()
Returns:
the fileName

setFileName

public void setFileName(java.lang.String fileName)
Description copied from interface: JournalStore
The file name to use as the journal file. Default to 'journal.ldif'

Specified by:
setFileName in interface JournalStore
Parameters:
fileName - the fileName to set

setWorkingDirectory

public void setWorkingDirectory(java.lang.String workingDirectoryName)
The working directory on which the journal file will be stored. Default to 'server-work'

Specified by:
setWorkingDirectory in interface JournalStore
Parameters:
workingDirectoryName - The working directory in which the journal file will be stored


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