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 Tag tag(long revision) throws Exception
tag in interface TaggableChangeLogStorerevision - the revision to tag the snapshotException - if there is a problem taking a tag, or if
the revision does not existpublic Tag tag() throws Exception
tag in interface TaggableChangeLogStoreException - if there is a problem taking a tagpublic Tag tag(String description) throws Exception
TaggableChangeLogStoretag in interface TaggableChangeLogStoredescription - a description of the state associate with the tagException - if there is a problem taking a tagpublic void init(DirectoryService service) throws Exception
ChangeLogStoreinit in interface ChangeLogStoreservice - The associated DirectoryServiceException - If the initialization failedpublic void sync()
throws Exception
ChangeLogStoresync in interface ChangeLogStoreException - If the write failedpublic void destroy()
throws Exception
destroy in interface ChangeLogStoreException - If we can't destroy the logspublic long getCurrentRevision()
ChangeLogStoregetCurrentRevision in interface ChangeLogStorepublic ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.api.ldap.model.ldif.LdifEntry forward, org.apache.directory.api.ldap.model.ldif.LdifEntry reverse) throws Exception
log in interface ChangeLogStoreprincipal - 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 changeException - if there are problems logging the changepublic ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.api.ldap.model.ldif.LdifEntry forward, List<org.apache.directory.api.ldap.model.ldif.LdifEntry> reverses) throws Exception
log in interface ChangeLogStoreprincipal - 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 changeException - if there are problems logging the changepublic ChangeLogEvent lookup(long revision) throws Exception
ChangeLogStorelookup in interface ChangeLogStorerevision - to get a ChangeLogEvent forException - if there are failures accessing the storeIllegalArgumentException - if the revision is out of range (less than 0
and greater than the current revision)public org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> find() throws Exception
ChangeLogStorefind in interface ChangeLogStoreException - if there are failures accessing the storepublic org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> findBefore(long revision) throws Exception
ChangeLogStorefindBefore in interface ChangeLogStorerevision - the revision number to get the ChangeLogEvents beforeException - if there are failures accessing the storeIllegalArgumentException - if the revision is out of range (less than 0
and greater than the current revision)public org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> findAfter(long revision) throws org.apache.directory.api.ldap.model.exception.LdapException
ChangeLogStorefindAfter in interface ChangeLogStorerevision - the revision number to get the ChangeLogEvents afterorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic org.apache.directory.api.ldap.model.cursor.Cursor<ChangeLogEvent> find(long startRevision, long endRevision) throws Exception
ChangeLogStorefind in interface ChangeLogStorestartRevision - the revision number to start getting the ChangeLogEvents aboveendRevision - the revision number to start getting the ChangeLogEvents belowException - if there are failures accessing the storeIllegalArgumentException - if the start and end revisions are out of range
(less than 0 and greater than the current revision), or if startRevision > endRevisionpublic Tag getLatest() throws org.apache.directory.api.ldap.model.exception.LdapException
TaggableChangeLogStoregetLatest in interface TaggableChangeLogStoreorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic Tag removeTag(long revision) throws Exception
TaggableChangeLogStoreremoveTag in interface TaggableChangeLogStorerevision - the revision number that was taggedException - on failures to access the tag storeTaggableChangeLogStore.removeTag(long)public Tag tag(long revision, String descrition) throws Exception
TaggableChangeLogStoretag in interface TaggableChangeLogStorerevision - the revision number that was taggeddescrition - a description of the state associate with the tagException - on failures to access the tag storeTaggableChangeLogStore.tag(long, String)public String toString()
toString in class ObjectObject.toString()Copyright © 2021. All rights reserved.