org.apache.directory.server.core.changelog
Interface ChangeLogStore

All Known Subinterfaces:
SearchableChangeLogStore, TaggableChangeLogStore, TaggableSearchableChangeLogStore
All Known Implementing Classes:
MemoryChangeLogStore

public interface ChangeLogStore

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

Method Summary
 void destroy()
           
 Cursor<ChangeLogEvent> find()
          Gets a Cursor over all the ChangeLogEvents within the system since revision 0.
 Cursor<ChangeLogEvent> find(long startRevision, long endRevision)
          Finds the ChangeLogEvents that occurred between a revision range inclusive.
 Cursor<ChangeLogEvent> findAfter(long revision)
          Finds the ChangeLogEvents that occurred after a revision exclusive.
 Cursor<ChangeLogEvent> findBefore(long revision)
          Gets a Cursor over the ChangeLogEvents that occurred before a revision exclusive.
 long getCurrentRevision()
          Gets the current revision of the server (a.k.a.
 void init(DirectoryService service)
           
 ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.shared.ldap.ldif.LdifEntry forward, org.apache.directory.shared.ldap.ldif.LdifEntry reverse)
          Records a change as a forward LDIF, a reverse change to revert the change and the authorized principal triggering the revertable change event.
 ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.shared.ldap.ldif.LdifEntry forward, java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> reverses)
          Records a change as a forward LDIF, some reverse changes to revert the change and the authorized principal triggering the revertable change event.
 ChangeLogEvent lookup(long revision)
          Looks up the ChangeLogEvent for a revision.
 void sync()
           
 

Method Detail

init

void init(DirectoryService service)
          throws java.lang.Exception
Throws:
java.lang.Exception

sync

void sync()
          throws java.lang.Exception
Throws:
java.lang.Exception

destroy

void destroy()
             throws java.lang.Exception
Throws:
java.lang.Exception

getCurrentRevision

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

Returns:
the current revision of the server

log

ChangeLogEvent log(LdapPrincipal principal,
                   org.apache.directory.shared.ldap.ldif.LdifEntry forward,
                   org.apache.directory.shared.ldap.ldif.LdifEntry reverse)
                   throws java.lang.Exception
Records a change as a forward LDIF, a reverse change to revert the change and the authorized principal triggering the revertable change event.

Parameters:
principal - the authorized LDAP principal triggering the change
forward - LDIF of the change going to the next state
reverse - LDIF (anti-operation): the change required to revert this change
Returns:
the new revision reached after having applied the forward LDIF
Throws:
java.lang.Exception - if there are problems logging the change

log

ChangeLogEvent log(LdapPrincipal principal,
                   org.apache.directory.shared.ldap.ldif.LdifEntry forward,
                   java.util.List<org.apache.directory.shared.ldap.ldif.LdifEntry> reverses)
                   throws java.lang.Exception
Records a change as a forward LDIF, some reverse changes to revert the change and the authorized principal triggering the revertable change event.

Parameters:
principal - the authorized LDAP principal triggering the change
forward - LDIF of the change going to the next state
reverses - LDIF (anti-operation): the changes required to revert this change
Returns:
the new revision reached after having applied the forward LDIF
Throws:
java.lang.Exception - if there are problems logging the change

lookup

ChangeLogEvent lookup(long revision)
                      throws java.lang.Exception
Looks up the ChangeLogEvent for a revision.

Parameters:
revision - to get a ChangeLogEvent for
Returns:
the ChangeLogEvent associated with the revision
Throws:
java.lang.Exception - if there are failures accessing the store
java.lang.IllegalArgumentException - if the revision is out of range (less than 0 and greater than the current revision)

find

Cursor<ChangeLogEvent> find()
                            throws java.lang.Exception
Gets a Cursor over all the ChangeLogEvents within the system since revision 0. This method should exhibit isolation characteristics: meaning if the request is initiated at revision 100, then any subsequent log entries increasing the revision should not be seen.

Returns:
a Cursor over all the ChangeLogEvents
Throws:
java.lang.Exception - if there are failures accessing the store

findBefore

Cursor<ChangeLogEvent> findBefore(long revision)
                                  throws java.lang.Exception
Gets a Cursor over the ChangeLogEvents that occurred before a revision exclusive.

Parameters:
revision - the revision number to get the ChangeLogEvents before
Returns:
a Cursor over the ChangeLogEvents before a revision
Throws:
java.lang.Exception - if there are failures accessing the store
java.lang.IllegalArgumentException - if the revision is out of range (less than 0 and greater than the current revision)

findAfter

Cursor<ChangeLogEvent> findAfter(long revision)
                                 throws java.lang.Exception
Finds the ChangeLogEvents that occurred after a revision exclusive. This method should exhibit isolation characteristics: meaning if the request is initiated at revision 100 then any subsequent log entries increasing the revision should not be seen.

Parameters:
revision - the revision number to get the ChangeLogEvents after
Returns:
a Cursor of all the ChangeLogEvents after and including the revision
Throws:
java.lang.Exception - if there are failures accessing the store
java.lang.IllegalArgumentException - if the revision is out of range (less than 0 and greater than the current revision)

find

Cursor<ChangeLogEvent> find(long startRevision,
                            long endRevision)
                            throws java.lang.Exception
Finds the ChangeLogEvents that occurred between a revision range inclusive.

Parameters:
startRevision - the revision number to start getting the ChangeLogEvents above
endRevision - the revision number to start getting the ChangeLogEvents below
Returns:
an enumeration of all the ChangeLogEvents within some revision range inclusive
Throws:
java.lang.Exception - if there are failures accessing the store
java.lang.IllegalArgumentException - if the start and end revisions are out of range (less than 0 and greater than the current revision), or if startRevision > endRevision


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