public class DefaultChangeLog extends Object implements ChangeLog
Constructor and Description |
---|
DefaultChangeLog() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy the changeLog
|
ChangeLogSearchEngine |
getChangeLogSearchEngine()
Gets the change log query engine which would be used to ask questions
about what changed, when, how and by whom.
|
ChangeLogStore |
getChangeLogStore() |
long |
getCurrentRevision()
Gets the current revision for the server.
|
Tag |
getLatest() |
TagSearchEngine |
getTagSearchEngine()
Gets the tag search engine used to query the snapshots taken.
|
void |
init(DirectoryService service)
Initialize the ChangeLog system.
|
boolean |
isEnabled()
Checks whether or not the change log has been enabled to track changes.
|
boolean |
isExposed() |
boolean |
isLogSearchSupported()
Returns whether or not this ChangeLogService supports searching for changes.
|
boolean |
isTagSearchSupported()
Returns whether or not this ChangeLogService supports searching for snapshot tags.
|
boolean |
isTagStorageSupported()
Returns whether or not this ChangeLogService stores snapshot tags.
|
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.
|
void |
setChangeLogStore(ChangeLogStore store)
Set the underlying storage
|
void |
setEnabled(boolean enabled)
Enable or disable the ChangeLog service
|
void |
setExposed(boolean exposed)
Exposes the contents of ChangeLog to clients if set to true.
|
void |
setPartitionSuffix(String suffix)
The prefix of the partition.
|
void |
setRevisionsContainerName(String revContainerName)
The name of the revisions container under the partition.
|
void |
setTagsContainerName(String tagContainerName)
The name of the tags container under the partition.
|
void |
sync()
Flush the changes to 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 description)
Creates a tag 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.
|
String |
toString() |
public DefaultChangeLog()
public ChangeLogStore getChangeLogStore()
getChangeLogStore
in interface ChangeLog
public void setChangeLogStore(ChangeLogStore store)
setChangeLogStore
in interface ChangeLog
store
- The storagepublic long getCurrentRevision() throws org.apache.directory.api.ldap.model.exception.LdapException
getCurrentRevision
in interface ChangeLog
org.apache.directory.api.ldap.model.exception.LdapException
- if there is a problem accessing this informationpublic ChangeLogEvent log(LdapPrincipal principal, org.apache.directory.api.ldap.model.ldif.LdifEntry forward, org.apache.directory.api.ldap.model.ldif.LdifEntry reverse) throws org.apache.directory.api.ldap.model.exception.LdapException
log
in interface ChangeLog
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 changeorg.apache.directory.api.ldap.model.exception.LdapException
- 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 org.apache.directory.api.ldap.model.exception.LdapException
log
in interface ChangeLog
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 changeorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems logging the changepublic boolean isLogSearchSupported()
isLogSearchSupported
in interface ChangeLog
public boolean isTagSearchSupported()
isTagSearchSupported
in interface ChangeLog
public boolean isTagStorageSupported()
isTagStorageSupported
in interface ChangeLog
public ChangeLogSearchEngine getChangeLogSearchEngine()
getChangeLogSearchEngine
in interface ChangeLog
public TagSearchEngine getTagSearchEngine()
getTagSearchEngine
in interface ChangeLog
public Tag tag(long revision, String description) throws Exception
tag
in interface ChangeLog
revision
- the revision to tag the snapshotdescription
- some information about what the snapshot tag representsException
- if there is a problem taking a tagIllegalArgumentException
- if the revision is out of range (less than 0
and greater than the current revision)public Tag tag(long revision) throws Exception
tag
in interface ChangeLog
revision
- the revision to tag the snapshotException
- if there is a problem taking a tagIllegalArgumentException
- if the revision is out of range (less than 0
and greater than the current revision)public Tag tag(String description) throws Exception
public void setEnabled(boolean enabled)
setEnabled
in interface ChangeLog
enabled
- true to enable the service, flase to disable itpublic boolean isEnabled()
public void init(DirectoryService service) throws org.apache.directory.api.ldap.model.exception.LdapException
public void sync() throws org.apache.directory.api.ldap.model.exception.LdapException
public void destroy() throws org.apache.directory.api.ldap.model.exception.LdapException
public boolean isExposed()
public void setExposed(boolean exposed)
setExposed
in interface ChangeLog
exposed
- true to expose the contents, false to not expose.public void setPartitionSuffix(String suffix)
setPartitionSuffix
in interface ChangeLog
suffix
- suffix value to be set for the changelog partitionpublic void setRevisionsContainerName(String revContainerName)
setRevisionsContainerName
in interface ChangeLog
revContainerName
- the name of the revisions containerpublic void setTagsContainerName(String tagContainerName)
setTagsContainerName
in interface ChangeLog
tagContainerName
- the name of the revisions containerpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.