Tabnine Logo
ChangeLog
Code IndexAdd Tabnine to your IDE (free)

How to use
ChangeLog
in
org.apache.directory.server.core.api.changelog

Best Java code snippets using org.apache.directory.server.core.api.changelog.ChangeLog (Showing top 20 results out of 315)

origin: org.apache.directory.server/apacheds-service-builder

/**
 * Read the configuration for the ChangeLog system
 * 
 * @param changeLogBean The Bean containing the ChangeLog configuration
 * @return The instantiated ChangeLog element
 */
public static ChangeLog createChangeLog( ChangeLogBean changeLogBean )
{
  if ( ( changeLogBean == null ) || changeLogBean.isDisabled() )
  {
    return null;
  }
  ChangeLog changeLog = new DefaultChangeLog();
  changeLog.setEnabled( changeLogBean.isEnabled() );
  changeLog.setExposed( changeLogBean.isChangeLogExposed() );
  return changeLog;
}
origin: org.apache.knox/gateway-test-ldap

public long revert() throws LdapException
{
 if ( changeLog == null || !changeLog.isEnabled() )
 {
  throw new IllegalStateException( I18n.err( I18n.ERR_310 ) );
 }
 Tag latest = changeLog.getLatest();
 if ( null != latest )
 {
  if ( latest.getRevision() < changeLog.getCurrentRevision() )
  {
   return revert( latest.getRevision() );
  }
  else
  {
   LOG.info( "Ignoring request to revert without changes since the latest tag." );
   return changeLog.getCurrentRevision();
  }
 }
 throw new IllegalStateException( I18n.err( I18n.ERR_311 ) );
}
origin: org.apache.knox/gateway-test-ldap

changeLog.sync();
changeLog.destroy();
origin: org.apache.directory.server/apacheds-test-framework

private long getCurrentRevision( DirectoryService dirService ) throws Exception
{
  if ( ( dirService != null ) && ( dirService.getChangeLog().isEnabled() ) )
  {
    long revision = dirService.getChangeLog().getCurrentRevision();
    LOG.debug( "Create revision {}", revision );
    return revision;
  }
  return 0;
}
origin: org.apache.directory.server/apacheds-test-framework

directoryService.getChangeLog().setEnabled( true );
origin: org.apache.directory.server/apacheds-interceptors-changelog

boolean isDelete = modification != null;
if ( !isDelete && ( changeLog.isEnabled() ) )
  || !changeLog.isEnabled()
  clientEntry );
modifyContext.setChangeLogEvent( changeLog.log( getPrincipal( modifyContext ), forward, reverse ) );
origin: org.apache.knox/gateway-test-ldap

if ( changeLog.isEnabled() )
 changeLog.init( this );
 if ( changeLog.isExposed() && changeLog.isTagSearchSupported() )
  String clSuffix = ( ( TaggableSearchableChangeLogStore ) changeLog.getChangeLogStore() ).getPartition()
    .getSuffixDn().getName();
  partitionNexus.getRootDse( null ).add( SchemaConstants.CHANGELOG_CONTEXT_AT, clSuffix );
origin: org.apache.knox/gateway-test-ldap

public long revert( long revision ) throws LdapException
 if ( changeLog == null || !changeLog.isEnabled() )
 if ( revision >= changeLog.getChangeLogStore().getCurrentRevision() )
 Cursor<ChangeLogEvent> cursor = changeLog.getChangeLogStore().findAfter( revision );
 return changeLog.getCurrentRevision();
origin: org.apache.directory.server/apacheds-test-framework

  @Override
  public void evaluate() throws Throwable
  {
    Tag tag = directoryService.getChangeLog().tag();
    DSAnnotationProcessor.applyLdifs( description, directoryService );
    LOG.debug( "Tagged change log: {}", tag );
    try
    {
      base.evaluate();
    }
    finally
    {
      if ( directoryService.getChangeLog().getCurrentRevision() > tag.getRevision() )
      {
        LOG.debug( "Reverting to tag: {}", tag );
        directoryService.revert( tag.getRevision() );
      }
      else
      {
        LOG.debug( "No changes made, nothing to revert" );
      }
    }
  }
};
origin: org.apache.directory.server/apacheds-test-framework

if ( directoryService != null && directoryService.getChangeLog().isEnabled() )
origin: com.github.jiayuhan-it/hadoop-minikdc

ds.setSystemPartition(systemPartition);
ds.getChangeLog().setEnabled(false);
ds.setDenormalizeOpAttrsEnabled(true);
ds.addLast(new KeyDerivationInterceptor());
origin: org.apache.directory.server/apacheds-interceptors-changelog

/**
 * {@inheritDoc}
 */
@Override
public void move( MoveOperationContext moveContext ) throws LdapException
{
  next( moveContext );
  if ( !changeLog.isEnabled() )
  {
    return;
  }
  LdifEntry forward = new LdifEntry();
  forward.setChangeType( ChangeType.ModDn );
  forward.setDn( moveContext.getDn() );
  forward.setNewSuperior( moveContext.getNewSuperior().getName() );
  LdifEntry reverse = LdifRevertor.reverseMove( moveContext.getNewSuperior(), moveContext.getDn() );
  moveContext.setChangeLogEvent( changeLog.log( getPrincipal( moveContext ), forward, reverse ) );
}
origin: org.apache.directory.server/apacheds-test-framework

private void revert( DirectoryService dirService, long revision ) throws Exception
{
  if ( dirService == null )
  {
    return;
  }
  ChangeLog cl = dirService.getChangeLog();
  if ( cl.isEnabled() && ( revision < cl.getCurrentRevision() ) )
  {
    LOG.debug( "Revert revision {}", revision );
    dirService.revert( revision );
  }
}
origin: io.hops/hadoop-minikdc

ds.setSystemPartition(systemPartition);
ds.getChangeLog().setEnabled(false);
ds.setDenormalizeOpAttrsEnabled(true);
ds.addLast(new KeyDerivationInterceptor());
origin: org.apache.directory.server/apacheds-interceptors-changelog

if ( changeLog.isEnabled() )
if ( !changeLog.isEnabled() )
deleteContext.setChangeLogEvent( changeLog.log( getPrincipal( deleteContext ), forward, reverse ) );
origin: apache/hadoop-common

ds.setSystemPartition(systemPartition);
ds.getChangeLog().setEnabled(false);
ds.setDenormalizeOpAttrsEnabled(true);
ds.addLast(new KeyDerivationInterceptor());
origin: org.apache.directory.server/apacheds-interceptors-changelog

if ( changeLog.isEnabled() )
if ( !changeLog.isEnabled() )
  .setChangeLogEvent( changeLog.log( getPrincipal( moveAndRenameContext ), forward, reverses ) );
origin: hopshadoop/hops

ds.setSystemPartition(systemPartition);
ds.getChangeLog().setEnabled(false);
ds.setDenormalizeOpAttrsEnabled(true);
ds.addLast(new KeyDerivationInterceptor());
origin: org.apache.directory.server/apacheds-interceptors-changelog

/**
 * {@inheritDoc}
 */
@Override
public void add( AddOperationContext addContext ) throws LdapException
{
  next( addContext );
  if ( !changeLog.isEnabled() )
  {
    return;
  }
  Entry addEntry = addContext.getEntry();
  // we don't want to record addition of a tag as a change
  if ( addEntry.get( REV_AT_OID ) != null )
  {
    return;
  }
  LdifEntry forward = new LdifEntry();
  forward.setChangeType( ChangeType.Add );
  forward.setDn( addContext.getDn() );
  for ( Attribute attribute : addEntry.getAttributes() )
  {
    AttributeType attributeType = attribute.getAttributeType();
    forward.addAttribute( addEntry.get( attributeType ).clone() );
  }
  LdifEntry reverse = LdifRevertor.reverseAdd( addContext.getDn() );
  addContext.setChangeLogEvent( changeLog.log( getPrincipal( addContext ), forward, reverse ) );
}
origin: org.sonarsource.ldap/server

private ApacheDS startDirectoryService(String workDirStr) throws Exception {
 DefaultDirectoryServiceFactory factory = new DefaultDirectoryServiceFactory();
 factory.init(realm);
 directoryService = factory.getDirectoryService();
 directoryService.getChangeLog().setEnabled(false);
 directoryService.setShutdownHookEnabled(false);
 directoryService.setAllowAnonymousAccess(true);
 File workDir = new File(workDirStr);
 if (workDir.exists()) {
  FileUtils.deleteDirectory(workDir);
 }
 InstanceLayout instanceLayout = new InstanceLayout(workDir);
 directoryService.setInstanceLayout(instanceLayout);
 AvlPartition partition = new AvlPartition(directoryService.getSchemaManager());
 partition.setId("Test");
 partition.setSuffixDn(new Dn(directoryService.getSchemaManager(), baseDn));
 partition.addIndexedAttributes(
  new AvlIndex<>("ou"),
  new AvlIndex<>("uid"),
  new AvlIndex<>("dc"),
  new AvlIndex<>("objectClass"));
 partition.initialize();
 directoryService.addPartition(partition);
 directoryService.addLast(new KeyDerivationInterceptor());
 directoryService.shutdown();
 directoryService.startup();
 return this;
}
org.apache.directory.server.core.api.changelogChangeLog

Javadoc

A facade for the change log subsystem. It exposes the functionality needed to interact with the facility to query for changes, take snapshots, and revert the server to an earlier revision.

Most used methods

  • setEnabled
    Enable or disable the ChangeLog service
  • isEnabled
    Checks whether or not the change log has been enabled to track changes.
  • getCurrentRevision
    Gets the current revision for the server.
  • destroy
    Destroy the changeLog
  • getChangeLogStore
  • getLatest
  • init
    Initialize the ChangeLog system.
  • isExposed
  • isTagSearchSupported
    Returns whether or not this ChangeLogService supports searching for snapshot tags.
  • log
    Records a change as a forward LDIF, a reverse change to revert the change and the authorized princip
  • setExposed
    Exposes the contents of ChangeLog to clients if set to true. Default setting is false.
  • sync
    Flush the changes to disk
  • setExposed,
  • sync,
  • tag

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now