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

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

public class DefaultJournal
extends java.lang.Object
implements Journal

The default journal implementation. It stores the operation and the associated status (acked or nacked) in a file which will be used to restore the server if it crashes.

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

Constructor Summary
DefaultJournal()
           
 
Method Summary
 void ack(long revision)
          Records a ack for a change
 void destroy()
          Destroy the journal service
 JournalStore getJournalStore()
          
 int getRotation()
           
 void init(DirectoryService directoryService)
          Initialize the Journal.
 boolean isEnabled()
          Checks whether or not the Journal has been enabled.
 void log(LdapPrincipal principal, long revision, org.apache.directory.shared.ldap.ldif.LdifEntry entry)
          Records a change as an LDIF entry.
 void nack(long revision)
          Records a nack for a change
 void setEnabled(boolean enabled)
          Enable or disable the Journal service
 void setJournalStore(JournalStore store)
          Set the underlying storage
 void setRotation(int rotation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultJournal

public DefaultJournal()
Method Detail

destroy

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

Specified by:
destroy in interface Journal
Throws:
java.lang.Exception - If something went wrong

getJournalStore

public JournalStore getJournalStore()

Specified by:
getJournalStore in interface Journal
Returns:
The underlying storage

init

public void init(DirectoryService directoryService)
          throws java.lang.Exception
Initialize the Journal.

Specified by:
init in interface Journal
Parameters:
directoryService - The associated DirectoryService
Throws:
java.lang.Exception - If something went wrong

isEnabled

public boolean isEnabled()
Checks whether or not the Journal has been enabled.

Specified by:
isEnabled in interface Journal
Returns:
true if the Journal is logging changes, false otherwise

log

public void log(LdapPrincipal principal,
                long revision,
                org.apache.directory.shared.ldap.ldif.LdifEntry entry)
         throws java.lang.Exception
Records a change as an LDIF entry.

Specified by:
log in interface Journal
Parameters:
principal - the authorized LDAP principal triggering the change
revision - the operation revision
Throws:
java.lang.Exception - if there are problems logging the change

ack

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

Specified by:
ack in interface Journal
Parameters:
revision - The change revision which is acked

nack

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

Specified by:
nack in interface Journal
Parameters:
revision - The change revision which is acked

getRotation

public int getRotation()
Specified by:
getRotation in interface Journal
Returns:
the rotation

setRotation

public void setRotation(int rotation)
Specified by:
setRotation in interface Journal
Parameters:
rotation - the rotation to set

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Journal
Enable or disable the Journal service

Specified by:
setEnabled in interface Journal
Parameters:
enabled - true to enable the service, false to disable it

setJournalStore

public void setJournalStore(JournalStore store)
Description copied from interface: Journal
Set the underlying storage

Specified by:
setJournalStore in interface Journal
Parameters:
store - The storage


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