org.apache.directory.server.core.journal
Interface JournalStore

All Known Implementing Classes:
DefaultJournalStore

public interface JournalStore

A store for change events on the directory which exposes methods for managing, querying and in general performing legal operations on the log.

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

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.
 void init(DirectoryService service)
          Initialize the store.
 boolean log(LdapPrincipal principal, long revision, org.apache.directory.shared.ldap.ldif.LdifEntry forward)
          Records a change as a forward LDIF and the authorized principal
 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 workingDirectory)
          The working directory on which the journal file will be stored.
 void sync()
          Write the changes on disk
 

Method Detail

init

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

Parameters:
service - The associated DirectoryService
Throws:
java.lang.Exception - If the initialization failed

sync

void sync()
          throws java.lang.Exception
Write the changes on disk

Throws:
java.lang.Exception - If the write failed

destroy

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

Throws:
java.lang.Exception - If we can't destroy the logs

getCurrentRevision

long getCurrentRevision()
Gets the current revision of the server (a.k.a. the HEAD revision).

Returns:
the current revision of the server

log

boolean log(LdapPrincipal principal,
            long revision,
            org.apache.directory.shared.ldap.ldif.LdifEntry forward)
Records a change as a forward LDIF and the authorized principal

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

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

Parameters:
revision - The change revision which is acked
Returns:
true if the ack has been written

nack

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

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

setFileName

void setFileName(java.lang.String fileName)
The file name to use as the journal file. Default to 'journal.ldif'

Parameters:
fileName - the fileName to set

setWorkingDirectory

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

Parameters:
workingDirectory - The working directory in which the journal file will be stored


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