public class MemoryChangeLogStore extends Object implements TaggableChangeLogStore
Constructor and Description |
---|
MemoryChangeLogStore() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Save logs, tags and revision on disk, and clean everything in memory
|
org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> |
find()
Gets a Cursor over all the ChangeLogEvents within the system since
revision 0.
|
org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> |
find(long startRevision,
long endRevision)
Finds the ChangeLogEvents that occurred between a revision range inclusive.
|
org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> |
findAfter(long revision)
Finds the ChangeLogEvents that occurred after a revision exclusive.
|
org.apache.directory.api.ldap.model.cursor.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.
|
Tag |
getLatest()
Gets the latest tag if one was at all taken.
|
void |
init(DirectoryService service)
Initialize the store.
|
ChangeLogEvent |
log(LdapPrincipal principal,
org.apache.directory.api.ldap.model.ldif.LdifEntry forward,
org.apache.directory.api.ldap.model.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.api.ldap.model.ldif.LdifEntry forward,
List<org.apache.directory.api.ldap.model.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.
|
Tag |
removeTag(long revision)
Removes a Tag created for a given revision.
|
void |
sync()
Write the changes on disk
|
Tag |
tag()
Creates a snapshot of the server at the current revision.
|
Tag |
tag(long revision)
Creates a tag for a snapshot of the server in a specific state at a revision.
|
Tag |
tag(long revision,
String descrition)
Creates a tag with the given description for a snapshot of the server
in a specific state at a revision.
|
Tag |
tag(String description)
Creates a snapshot of the server at the current revision with a description
of the snapshot tag.
|
String |
toString() |
public MemoryChangeLogStore()
public Tag tag(long revision)
tag
in interface TaggableChangeLogStore
revision
- the revision to tag the snapshotpublic Tag tag()
tag
in interface TaggableChangeLogStore
public Tag tag(String description)
tag
in interface TaggableChangeLogStore
description
- a description of the state associate with the tagpublic void init(DirectoryService service) throws org.apache.directory.api.ldap.model.exception.LdapException
init
in interface ChangeLogStore
service
- The associated DirectoryServiceorg.apache.directory.api.ldap.model.exception.LdapException
- If the initialization failedpublic void sync() throws org.apache.directory.api.ldap.model.exception.LdapException
sync
in interface ChangeLogStore
org.apache.directory.api.ldap.model.exception.LdapException
- If the write failedpublic void destroy() throws org.apache.directory.api.ldap.model.exception.LdapException
destroy
in interface ChangeLogStore
org.apache.directory.api.ldap.model.exception.LdapException
- If we can't destroy the logspublic long getCurrentRevision()
getCurrentRevision
in interface ChangeLogStore
public ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.api.ldap.model.ldif.LdifEntry forward, org.apache.directory.api.ldap.model.ldif.LdifEntry reverse)
log
in interface ChangeLogStore
principal
- the authorized LDAP principal triggering the changeforward
- LDIF of the change going to the next statereverse
- LDIF (anti-operation): the change required to revert this changepublic ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.api.ldap.model.ldif.LdifEntry forward, List<org.apache.directory.api.ldap.model.ldif.LdifEntry> reverses)
log
in interface ChangeLogStore
principal
- the authorized LDAP principal triggering the changeforward
- LDIF of the change going to the next statereverses
- LDIF (anti-operation): the changes required to revert this changepublic ChangeLogEvent lookup(long revision)
lookup
in interface ChangeLogStore
revision
- to get a ChangeLogEvent forpublic org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> find()
find
in interface ChangeLogStore
public org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> findBefore(long revision)
findBefore
in interface ChangeLogStore
revision
- the revision number to get the ChangeLogEvents beforepublic org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> findAfter(long revision)
findAfter
in interface ChangeLogStore
revision
- the revision number to get the ChangeLogEvents afterpublic org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> find(long startRevision, long endRevision)
find
in interface ChangeLogStore
startRevision
- the revision number to start getting the ChangeLogEvents aboveendRevision
- the revision number to start getting the ChangeLogEvents belowpublic Tag getLatest()
getLatest
in interface TaggableChangeLogStore
public Tag removeTag(long revision)
removeTag
in interface TaggableChangeLogStore
revision
- the revision number that was taggedpublic Tag tag(long revision, String descrition)
tag
in interface TaggableChangeLogStore
revision
- the revision number that was taggeddescrition
- a description of the state associate with the tagpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.