/** * {@inheritDoc} */ @Override public long getCurrentRevision() throws LdapException { synchronized ( store ) { return store.getCurrentRevision(); } }
/** * {@inheritDoc} */ @Override public void destroy() throws LdapException { if ( enabled ) { store.destroy(); } storeInitialized = false; }
/** * {@inheritDoc} */ @Override public void sync() throws LdapException { if ( enabled ) { store.sync(); } }
if ( revision >= changeLog.getChangeLogStore().getCurrentRevision() ) Cursor<ChangeLogEvent> cursor = changeLog.getChangeLogStore().findAfter( revision );
/** * {@inheritDoc} */ @Override public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws LdapException { if ( !enabled ) { throw new IllegalStateException( I18n.err( I18n.ERR_236 ) ); } try { return store.log( principal, forward, reverse ); } catch ( Exception e ) { throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getMessage(), e ); } }
/** * Initialize the ChangeLog system. We will initialize the associated store. */ @Override public void init( DirectoryService service ) throws LdapException { if ( enabled ) { if ( store == null ) { // If no store has been defined, create an In Memory store store = new MemoryChangeLogStore(); } store.init( service ); if ( exposed && isTagSearchSupported() ) { TaggableSearchableChangeLogStore tmp = ( TaggableSearchableChangeLogStore ) store; tmp.createPartition( partitionSuffix, revContainerName, tagContainerName ); Partition partition = tmp.getPartition(); partition.initialize(); service.addPartition( partition ); } } // Flip the protection flag storeInitialized = true; }
/** * {@inheritDoc} */ @Override public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, List<LdifEntry> reverses ) throws LdapException { if ( !enabled ) { throw new IllegalStateException( I18n.err( I18n.ERR_236 ) ); } try { return store.log( principal, forward, reverses ); } catch ( Exception e ) { throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getMessage(), e ); } }
/** * {@inheritDoc} */ @Override public Tag tag( String description ) throws Exception { return tag( store.getCurrentRevision(), description ); }
/** * {@inheritDoc} */ @Override public Tag tag() throws Exception { return tag( store.getCurrentRevision(), null ); }
/** * {@inheritDoc} */ @Override public Tag tag( long revision, String description ) throws Exception { if ( revision < 0 ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_239 ) ); } if ( revision > store.getCurrentRevision() ) { throw new IllegalArgumentException( I18n.err( I18n.ERR_240 ) ); } if ( store instanceof TaggableChangeLogStore ) { latest = ( ( TaggableChangeLogStore ) store ).tag( revision ); return latest; } latest = new Tag( revision, description ); return latest; }