directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1183537 [1/11] - in /directory/apacheds/trunk/interceptors: admin/ admin/.settings/ authn/ authn/.settings/ authz/.settings/ changelog/ changelog/src/ changelog/src/main/ changelog/src/main/java/ changelog/src/main/java/org/ changelog/src/...
Date Fri, 14 Oct 2011 22:36:15 GMT
Author: elecharny
Date: Fri Oct 14 22:36:08 2011
New Revision: 1183537

URL: http://svn.apache.org/viewvc?rev=1183537&view=rev
Log:
added the interceptors projects

Added:
    directory/apacheds/trunk/interceptors/changelog/   (with props)
    directory/apacheds/trunk/interceptors/changelog/pom.xml
    directory/apacheds/trunk/interceptors/changelog/src/
    directory/apacheds/trunk/interceptors/changelog/src/main/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/package-info.java
    directory/apacheds/trunk/interceptors/changelog/src/test/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/
    directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
    directory/apacheds/trunk/interceptors/collective/   (with props)
    directory/apacheds/trunk/interceptors/collective/pom.xml
    directory/apacheds/trunk/interceptors/collective/src/
    directory/apacheds/trunk/interceptors/collective/src/main/
    directory/apacheds/trunk/interceptors/collective/src/main/java/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/trunk/interceptors/collective/src/test/
    directory/apacheds/trunk/interceptors/collective/src/test/java/
    directory/apacheds/trunk/interceptors/event/   (with props)
    directory/apacheds/trunk/interceptors/event/pom.xml
    directory/apacheds/trunk/interceptors/event/src/
    directory/apacheds/trunk/interceptors/event/src/main/
    directory/apacheds/trunk/interceptors/event/src/main/java/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/DefaultEventService.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/ScopeEvaluator.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
    directory/apacheds/trunk/interceptors/exception/   (with props)
    directory/apacheds/trunk/interceptors/exception/pom.xml
    directory/apacheds/trunk/interceptors/exception/src/
    directory/apacheds/trunk/interceptors/exception/src/main/
    directory/apacheds/trunk/interceptors/exception/src/main/java/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/interceptors/exception/src/test/
    directory/apacheds/trunk/interceptors/exception/src/test/java/
    directory/apacheds/trunk/interceptors/hash/   (with props)
    directory/apacheds/trunk/interceptors/hash/pom.xml
    directory/apacheds/trunk/interceptors/hash/src/
    directory/apacheds/trunk/interceptors/hash/src/main/
    directory/apacheds/trunk/interceptors/hash/src/main/java/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/CryptPasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Md5PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha256PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha384PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Sha512PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/ShaPasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Smd5PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha256PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha384PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/Ssha512PasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/main/java/org/apache/directory/server/core/hash/SshaPasswordHashingInterceptor.java
    directory/apacheds/trunk/interceptors/hash/src/test/
    directory/apacheds/trunk/interceptors/hash/src/test/java/
    directory/apacheds/trunk/interceptors/journal/   (with props)
    directory/apacheds/trunk/interceptors/journal/pom.xml
    directory/apacheds/trunk/interceptors/journal/src/
    directory/apacheds/trunk/interceptors/journal/src/main/
    directory/apacheds/trunk/interceptors/journal/src/main/java/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/DefaultJournal.java
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
    directory/apacheds/trunk/interceptors/journal/src/test/
    directory/apacheds/trunk/interceptors/journal/src/test/java/
    directory/apacheds/trunk/interceptors/logger/   (with props)
    directory/apacheds/trunk/interceptors/logger/pom.xml
    directory/apacheds/trunk/interceptors/logger/src/
    directory/apacheds/trunk/interceptors/logger/src/main/
    directory/apacheds/trunk/interceptors/logger/src/main/java/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
    directory/apacheds/trunk/interceptors/logger/src/test/
    directory/apacheds/trunk/interceptors/logger/src/test/java/
    directory/apacheds/trunk/interceptors/normalization/   (with props)
    directory/apacheds/trunk/interceptors/normalization/pom.xml
    directory/apacheds/trunk/interceptors/normalization/src/
    directory/apacheds/trunk/interceptors/normalization/src/main/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/UndefinedFilterAttributeException.java
    directory/apacheds/trunk/interceptors/normalization/src/test/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/directory/server/core/normalization/
    directory/apacheds/trunk/interceptors/normalization/src/test/java/org/apache/directory/server/core/normalization/NormalizationVisitorTest.java
    directory/apacheds/trunk/interceptors/operational/   (with props)
    directory/apacheds/trunk/interceptors/operational/pom.xml
    directory/apacheds/trunk/interceptors/operational/src/
    directory/apacheds/trunk/interceptors/operational/src/main/
    directory/apacheds/trunk/interceptors/operational/src/main/java/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/
    directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/interceptors/operational/src/test/
    directory/apacheds/trunk/interceptors/operational/src/test/java/
    directory/apacheds/trunk/interceptors/operational/src/test/main/
    directory/apacheds/trunk/interceptors/referral/   (with props)
    directory/apacheds/trunk/interceptors/referral/pom.xml
    directory/apacheds/trunk/interceptors/referral/src/
    directory/apacheds/trunk/interceptors/referral/src/main/
    directory/apacheds/trunk/interceptors/referral/src/main/java/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/interceptors/referral/src/test/
    directory/apacheds/trunk/interceptors/referral/src/test/java/
    directory/apacheds/trunk/interceptors/schema/   (with props)
    directory/apacheds/trunk/interceptors/schema/pom.xml
    directory/apacheds/trunk/interceptors/schema/src/
    directory/apacheds/trunk/interceptors/schema/src/main/
    directory/apacheds/trunk/interceptors/schema/src/main/java/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/AttributesFactory.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaLdifToPartitionExtractor.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryManager.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/package-info.java
    directory/apacheds/trunk/interceptors/schema/src/test/
    directory/apacheds/trunk/interceptors/schema/src/test/java/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/directory/server/core/schema/
    directory/apacheds/trunk/interceptors/schema/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
    directory/apacheds/trunk/interceptors/subtree/   (with props)
    directory/apacheds/trunk/interceptors/subtree/pom.xml
    directory/apacheds/trunk/interceptors/subtree/src/
    directory/apacheds/trunk/interceptors/subtree/src/main/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/RefinementEvaluator.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluator.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/Subentry.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryCache.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubtreeEvaluator.java
    directory/apacheds/trunk/interceptors/subtree/src/test/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/core/subtree/
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/apacheds/trunk/interceptors/subtree/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/apacheds/trunk/interceptors/trigger/   (with props)
    directory/apacheds/trunk/interceptors/trigger/pom.xml
    directory/apacheds/trunk/interceptors/trigger/src/
    directory/apacheds/trunk/interceptors/trigger/src/main/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerExecutionAuthorizer.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/interceptors/trigger/src/test/
    directory/apacheds/trunk/interceptors/trigger/src/test/java/
Removed:
    directory/apacheds/trunk/interceptors/admin/.classpath
    directory/apacheds/trunk/interceptors/admin/.project
    directory/apacheds/trunk/interceptors/admin/.settings/
    directory/apacheds/trunk/interceptors/authn/.classpath
    directory/apacheds/trunk/interceptors/authn/.project
    directory/apacheds/trunk/interceptors/authn/.settings/
    directory/apacheds/trunk/interceptors/authz/.settings/

Propchange: directory/apacheds/trunk/interceptors/changelog/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 14 22:36:08 2011
@@ -0,0 +1,11 @@
+target
+.project
+.classpath
+.settings
+eclipse-classes
+*.log
+*.iml
+*.ipr
+dependency-reduced-pom.xml
+META-INF
+

Added: directory/apacheds/trunk/interceptors/changelog/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/pom.xml?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/pom.xml (added)
+++ directory/apacheds/trunk/interceptors/changelog/pom.xml Fri Oct 14 22:36:08 2011
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.server</groupId>
+    <artifactId>apacheds-interceptors</artifactId>
+    <version>2.0.0-M4-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>apacheds-interceptors-changelog</artifactId>
+  <name>ApacheDS ChangeLog Interceptor</name>
+  <packaging>jar</packaging>
+
+  <description>
+    ChangeLog interceptor
+  </description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.junit</groupId>
+      <artifactId>junit-addons</artifactId>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apacheds-i18n</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apacheds-core-api</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apacheds-core-api</artifactId>
+      <classifier>tests</classifier>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>apacheds-core-shared</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-client-api</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-i18n</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-codec-standalone</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-codec-core</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-extras-aci</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-extras-trigger</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-extras-util</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-model</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-schema-data</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-util</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>bouncycastle</groupId>
+      <artifactId>bcprov-jdk15</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>net.sf.ehcache</groupId>
+      <artifactId>ehcache-core</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.shared</groupId>
+      <artifactId>shared-ldap-extras-codec</artifactId>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration> 
+          <systemPropertyVariables>
+            <workingDirectory>${basedir}/target/server-work</workingDirectory>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-source-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-sources</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+        <excludes>
+          <exclude>**/*.gif</exclude>
+        </excludes>
+      </resource>
+    </resources>
+  </build>
+</project>
+

Added: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (added)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Fri Oct 14 22:36:08 2011
@@ -0,0 +1,383 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.directory.server.core.changelog;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.changelog.ChangeLog;
+import org.apache.directory.server.core.api.entry.ClonedServerEntry;
+import org.apache.directory.server.core.api.entry.ServerEntryUtils;
+import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
+import org.apache.directory.server.core.api.interceptor.NextInterceptor;
+import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.OperationContext;
+import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.api.partition.ByPassConstants;
+import org.apache.directory.server.core.shared.SchemaService;
+import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.entry.Modification;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.ldif.ChangeType;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.model.ldif.LdifRevertor;
+import org.apache.directory.shared.ldap.model.message.controls.ManageDsaITImpl;
+import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.schema.AttributeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * An interceptor which intercepts write operations to the directory and
+ * logs them with the server's ChangeLog service.
+ * Note: Adding/deleting a tag is not recorded as a change
+ */
+public class ChangeLogInterceptor extends BaseInterceptor
+{
+    /** for debugging */
+    private static final Logger LOG = LoggerFactory.getLogger( ChangeLogInterceptor.class );
+    
+    /** used to ignore modify operations to tombstone entries */
+    private AttributeType entryDeleted;
+    
+    /** the changelog service to log changes to */
+    private ChangeLog changeLog;
+    
+    /** OID of the 'rev' attribute used in changeLogEvent and tag objectclasses */
+    private static final String REV_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.47";
+    
+    // -----------------------------------------------------------------------
+    // Overridden init() and destroy() methods
+    // -----------------------------------------------------------------------
+
+
+    /**
+     * The init method will initialize the local variables and load the 
+     * entryDeleted AttributeType.
+     */
+    public void init( DirectoryService directoryService ) throws LdapException
+    {
+        super.init( directoryService );
+
+        changeLog = directoryService.getChangeLog();
+        entryDeleted = directoryService.getSchemaManager()
+                .getAttributeType( ApacheSchemaConstants.ENTRY_DELETED_AT_OID );
+    }
+
+
+    // -----------------------------------------------------------------------
+    // Overridden (only change inducing) intercepted methods
+    // -----------------------------------------------------------------------
+    public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
+    {
+        next.add( 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(), forward, reverse ) );
+    }
+
+
+    /**
+     * The delete operation has to be stored with a way to restore the deleted element.
+     * There is no way to do that but reading the entry and dump it into the LOG.
+     */
+    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    {
+        // @todo make sure we're not putting in operational attributes that cannot be user modified
+        // must save the entry if change log is enabled
+        Entry serverEntry = null;
+
+        if ( changeLog.isEnabled() )
+        {
+            serverEntry = getAttributes( deleteContext );
+        }
+
+        next.delete( deleteContext );
+
+        if ( !changeLog.isEnabled() )
+        {
+            return;
+        }
+
+        // we don't want to record deleting a tag as a change
+        if( serverEntry.get( REV_AT_OID ) != null )
+        {
+           return; 
+        }
+
+        LdifEntry forward = new LdifEntry();
+        forward.setChangeType( ChangeType.Delete );
+        forward.setDn( deleteContext.getDn() );
+        
+        Entry reverseEntry = new DefaultEntry( serverEntry.getDn() );
+        
+        boolean isCollectiveSubentry = serverEntry.hasObjectClass( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRY_OC );
+
+        for ( Attribute attribute : serverEntry )
+        {
+            // filter collective attributes, they can't be added by the revert operation
+            AttributeType at = schemaManager.lookupAttributeTypeRegistry( attribute.getId() );
+            
+            if ( !at.isCollective() || isCollectiveSubentry )
+            {
+                reverseEntry.add( attribute.clone() );
+            }
+        }
+
+        LdifEntry reverse = LdifRevertor.reverseDel( deleteContext.getDn(), reverseEntry );
+        deleteContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+    }
+
+
+    /**
+     * Gets attributes required for modifications.
+     *
+     * @param dn the dn of the entry to get
+     * @return the entry's attributes (may be immutable if the schema subentry)
+     * @throws Exception on error accessing the entry's attributes
+     */
+    private Entry getAttributes( OperationContext opContext ) throws LdapException
+    {
+        Dn dn = opContext.getDn();
+        Entry serverEntry;
+
+        // @todo make sure we're not putting in operational attributes that cannot be user modified
+        if ( dn.equals( ServerDNConstants.CN_SCHEMA_DN ) )
+        {
+            return SchemaService.getSubschemaEntryCloned( directoryService );
+        }
+        else
+        {
+            serverEntry = opContext.lookup( dn, ByPassConstants.LOOKUP_BYPASS, SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+        }
+
+        return serverEntry;
+    }
+
+
+    /**
+     * 
+     */
+    public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
+    {
+        Entry serverEntry = null;
+        Modification modification = ServerEntryUtils.getModificationItem( modifyContext.getModItems(), entryDeleted );
+        boolean isDelete = ( modification != null );
+
+        if ( !isDelete && ( changeLog.isEnabled() ) )
+        {
+            // @todo make sure we're not putting in operational attributes that cannot be user modified
+            serverEntry = getAttributes( modifyContext );
+        }
+        
+        // Duplicate modifications so that the reverse does not contain the operational attributes
+        List<Modification> clonedMods = new ArrayList<Modification>(); 
+
+        for ( Modification mod : modifyContext.getModItems() )
+        {
+            clonedMods.add( mod.clone() );
+        }
+
+        // Call the next interceptor
+        next.modify( modifyContext );
+
+        // @TODO: needs big consideration!!!
+        // NOTE: perhaps we need to log this as a system operation that cannot and should not be reapplied?
+        if ( 
+            isDelete ||   
+            ! changeLog.isEnabled() || 
+            
+         // if there are no modifications due to stripping out bogus non-
+         // existing attributes then we will have no modification items and
+         // should ignore not this without registering it with the changelog
+         
+            modifyContext.getModItems().size() == 0 )  
+        {
+            if ( isDelete )
+            {
+                LOG.debug( "Bypassing changelog on modify of entryDeleted attribute." );
+            }
+            
+            return;
+        }
+
+        LdifEntry forward = new LdifEntry();
+        forward.setChangeType( ChangeType.Modify );
+        forward.setDn( modifyContext.getDn() );
+        
+        List<Modification> mods = new ArrayList<Modification>( clonedMods.size() );
+        
+        for ( Modification modItem : clonedMods )
+        {
+            // TODO: handle correctly http://issues.apache.org/jira/browse/DIRSERVER-1198
+            mods.add( modItem );
+            
+            forward.addModification( modItem );
+        }
+        
+        Entry clientEntry = new DefaultEntry( serverEntry.getDn() );
+        
+        for ( Attribute attribute:serverEntry )
+        {
+            clientEntry.add( attribute.clone() );
+        }
+
+        LdifEntry reverse = LdifRevertor.reverseModify( 
+            modifyContext.getDn(), 
+            mods, 
+            clientEntry );
+        
+        modifyContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverse ) );
+    }
+
+
+    // -----------------------------------------------------------------------
+    // Though part left as an exercise (Not Any More!)
+    // -----------------------------------------------------------------------
+
+
+    public void rename ( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
+    {
+        Entry serverEntry = null;
+        
+        if ( renameContext.getEntry() != null )
+        {
+            serverEntry = ((ClonedServerEntry)renameContext.getEntry()).getOriginalEntry();
+        }
+        
+        next.rename( renameContext );
+        
+        // After this point, the entry has been modified. The cloned entry contains
+        // the modified entry, the originalEntry has changed
+
+        if ( !changeLog.isEnabled() )
+        {
+            return;
+        }
+
+        LdifEntry forward = new LdifEntry();
+        forward.setChangeType( ChangeType.ModRdn );
+        forward.setDn( renameContext.getDn() );
+        forward.setNewRdn( renameContext.getNewRdn().getName() );
+        forward.setDeleteOldRdn( renameContext.getDeleteOldRdn() );
+
+        List<LdifEntry> reverses = LdifRevertor.reverseRename( 
+            serverEntry, renameContext.getNewRdn(), renameContext.getDeleteOldRdn() );
+        
+        renameContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );
+    }
+
+
+    public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
+        throws LdapException
+    {
+        Entry serverEntry = null;
+        
+        if ( changeLog.isEnabled() )
+        {
+            // @todo make sure we're not putting in operational attributes that cannot be user modified
+            serverEntry = moveAndRenameContext.getOriginalEntry();
+        }
+
+        next.moveAndRename( moveAndRenameContext );
+
+        if ( !changeLog.isEnabled() )
+        {
+            return;
+        }
+
+        LdifEntry forward = new LdifEntry();
+        forward.setChangeType( ChangeType.ModDn );
+        forward.setDn( moveAndRenameContext.getDn() );
+        forward.setDeleteOldRdn( moveAndRenameContext.getDeleteOldRdn() );
+        forward.setNewRdn( moveAndRenameContext.getNewRdn().getName() );
+        forward.setNewSuperior( moveAndRenameContext.getNewSuperiorDn().getName() );
+        
+        List<LdifEntry> reverses = LdifRevertor.reverseMoveAndRename(  
+            serverEntry, moveAndRenameContext.getNewSuperiorDn(), moveAndRenameContext.getNewRdn(), false );
+        
+        if ( moveAndRenameContext.isReferralIgnored() )
+        {
+            forward.addControl( new ManageDsaITImpl() );
+            LdifEntry reversedEntry = reverses.get( 0 );
+            reversedEntry.addControl( new ManageDsaITImpl() );
+        }
+        
+        moveAndRenameContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    {
+        next.move( 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(), forward, reverse ) );
+    }
+}

Added: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java (added)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java Fri Oct 14 22:36:08 2011
@@ -0,0 +1,435 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.directory.server.core.changelog;
+
+
+import java.util.List;
+
+import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.changelog.ChangeLog;
+import org.apache.directory.server.core.api.changelog.ChangeLogEvent;
+import org.apache.directory.server.core.api.changelog.ChangeLogSearchEngine;
+import org.apache.directory.server.core.api.changelog.ChangeLogStore;
+import org.apache.directory.server.core.api.changelog.SearchableChangeLogStore;
+import org.apache.directory.server.core.api.changelog.Tag;
+import org.apache.directory.server.core.api.changelog.TagSearchEngine;
+import org.apache.directory.server.core.api.changelog.TaggableChangeLogStore;
+import org.apache.directory.server.core.api.changelog.TaggableSearchableChangeLogStore;
+import org.apache.directory.server.core.api.partition.Partition;
+import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapUnwillingToPerformException;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The default ChangeLog service implementation. It stores operations 
+ * in memory.
+ * 
+ * Entries are stored into a dedicated partition, named ou=changelog, under which
+ * we have two other sub-entries : ou=tags and ou= revisions :
+ * 
+ *  ou=changelog
+ *    |
+ *    +-- ou=revisions
+ *    |
+ *    +-- ou=tags
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DefaultChangeLog implements ChangeLog
+{
+    /** The class logger */
+    private static final Logger LOG = LoggerFactory.getLogger( DefaultChangeLog.class );
+
+    /** Tells if the service is activated or not */ 
+    private boolean enabled;
+    
+    /** The latest tag set */
+    private Tag latest;
+    
+    /** 
+     * The default store is a InMemory store.
+     **/
+    private ChangeLogStore store;
+    
+    /** A volatile flag used to avoid store switching when in use */
+    private volatile boolean storeInitialized = false;
+
+    /** A flag used to tell if the changeLog system is visible by the clients */
+    private boolean exposed;
+
+    // default values for ChangeLogStorePartition containers
+    private static final String DEFAULT_PARTITION_SUFFIX = "ou=changelog";
+    private static final String DEFAULT_REV_CONTAINER_NAME = "ou=revisions";
+    private static final String DEFAULT_TAG_CONTAINER_NAME = "ou=tags";
+
+    // default values for ChangeLogStorePartition containers
+    private String partitionSuffix = DEFAULT_PARTITION_SUFFIX;
+    private String revContainerName = DEFAULT_REV_CONTAINER_NAME;
+    private String tagContainerName = DEFAULT_TAG_CONTAINER_NAME;
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public ChangeLogStore getChangeLogStore()
+    {
+        return store;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * 
+     * If there is an existing changeLog store, we don't switch it 
+     */
+    public void setChangeLogStore( ChangeLogStore store )
+    {
+        if ( storeInitialized )
+        {
+            LOG.error( I18n.err( I18n.ERR_29 ) );
+        }
+        else
+        {
+            this.store = store;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public long getCurrentRevision() throws LdapException
+    {
+        synchronized( store )
+        {
+            return store.getCurrentRevision();
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws LdapException
+    {
+        if ( !enabled )
+        {
+            throw new IllegalStateException( I18n.err( I18n.ERR_236 ) );
+        }
+
+        try
+        {
+            ChangeLogEvent event = store.log( principal, forward, reverse );
+            
+            return event;
+        }
+        catch ( Exception e )
+        {
+            throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM, e.getMessage(), e );
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    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}
+     */
+    public boolean isLogSearchSupported()
+    {
+        return store instanceof SearchableChangeLogStore;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isTagSearchSupported()
+    {
+        return store instanceof TaggableSearchableChangeLogStore;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isTagStorageSupported()
+    {
+        return store instanceof TaggableChangeLogStore;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ChangeLogSearchEngine getChangeLogSearchEngine()
+    {
+        if ( isLogSearchSupported() )
+        {
+            return ( ( SearchableChangeLogStore ) store ).getChangeLogSearchEngine();
+        }
+
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_237 ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public TagSearchEngine getTagSearchEngine()
+    {
+        if ( isTagSearchSupported() )
+        {
+            return ( ( TaggableSearchableChangeLogStore ) store ).getTagSearchEngine();
+        }
+
+        throw new UnsupportedOperationException( I18n.err( I18n.ERR_238 ) );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    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 )
+        {
+            return latest = ( ( TaggableChangeLogStore ) store ).tag( revision );
+        }
+
+        return latest = new Tag( revision, description );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag tag( long revision ) throws Exception
+    {
+        return tag( revision, null );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag tag( String description ) throws Exception
+    {
+        return tag( store.getCurrentRevision(), description );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag tag() throws Exception
+    {
+        return tag( store.getCurrentRevision(), null );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setEnabled( boolean enabled )
+    {
+        this.enabled = enabled;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isEnabled()
+    {
+        return enabled;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag getLatest() throws LdapException
+    {
+        if ( latest != null )
+        {
+            return latest;
+        }
+
+        if ( store instanceof TaggableChangeLogStore )
+        {
+            return latest = ( ( TaggableChangeLogStore ) store ).getLatest();
+        }
+
+        return null;
+    }
+
+
+    /**
+     * Initialize the ChangeLog system. We will initialize the associated store.
+     */
+    public void init( DirectoryService service ) throws Exception
+    {
+        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}
+     */
+    public void sync() throws Exception
+    {
+        if ( enabled )
+        {
+            store.sync();
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void destroy() throws Exception
+    {
+        if ( enabled )
+        {
+            store.destroy();
+        }
+        
+        storeInitialized = false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isExposed()
+    {
+        return exposed;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setExposed( boolean exposed )
+    {
+        this.exposed = exposed;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setPartitionSuffix( String suffix )
+    {
+        this.partitionSuffix = suffix;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRevisionsContainerName( String revContainerName )
+    {
+        this.revContainerName = revContainerName;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTagsContainerName( String tagContainerName )
+    {
+        this.tagContainerName = tagContainerName;
+    }
+
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "ChangeLog tag[" ).append( latest ).append( "]\n" );
+        sb.append( "    store : \n" ).append( store );
+        
+        return sb.toString();
+    }
+}

Added: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java (added)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java Fri Oct 14 22:36:08 2011
@@ -0,0 +1,595 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.directory.server.core.changelog;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.changelog.ChangeLogEvent;
+import org.apache.directory.server.core.api.changelog.ChangeLogEventSerializer;
+import org.apache.directory.server.core.api.changelog.Tag;
+import org.apache.directory.server.core.api.changelog.TaggableChangeLogStore;
+import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.cursor.ListCursor;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+import org.apache.directory.shared.util.DateUtils;
+
+
+/**
+ * A change log store that keeps it's information in memory.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class MemoryChangeLogStore implements TaggableChangeLogStore
+{
+    
+    private static final String REV_FILE = "revision";
+    private static final String TAG_FILE = "tags";
+    private static final String CHANGELOG_FILE = "changelog.dat";
+
+    /** An incremental number giving the current revision */
+    private long currentRevision;
+    
+    /** The latest tag */
+    private Tag latest;
+    
+    /** A Map of tags and revisions */
+    private final Map<Long,Tag> tags = new HashMap<Long,Tag>( 100 );
+    
+    private final List<ChangeLogEvent> events = new ArrayList<ChangeLogEvent>();
+    private File workingDirectory;
+    
+    /** The DirectoryService */
+    private DirectoryService directoryService;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag tag( long revision ) throws Exception
+    {
+        if ( tags.containsKey( revision ) )
+        {
+            return tags.get( revision );
+        }
+
+        latest = new Tag( revision, null );
+        tags.put( revision, latest );
+        return latest;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Tag tag() throws Exception
+    {
+        if ( ( latest != null) && ( latest.getRevision() == currentRevision ) )
+        {
+            return latest;
+        }
+
+        latest = new Tag( currentRevision, null );
+        tags.put( currentRevision, latest );
+        return latest;
+    }
+
+
+    public Tag tag( String description ) throws Exception
+    {
+        if ( ( latest != null ) && ( latest.getRevision() == currentRevision ) )
+        {
+            return latest;
+        }
+
+        latest = new Tag( currentRevision, description );
+        tags.put( currentRevision, latest );
+        return latest;
+    }
+
+
+    public void init( DirectoryService service ) throws Exception
+    {
+        workingDirectory = service.getInstanceLayout().getLogDirectory();
+        this.directoryService = service;
+        loadRevision();
+        loadTags();
+        loadChangeLog();
+    }
+
+
+    // This will suppress PMD.EmptyCatchBlock warnings in this method
+    @SuppressWarnings("PMD.EmptyCatchBlock")
+    private void loadRevision() throws Exception
+    {
+        File revFile = new File( workingDirectory, REV_FILE );
+        
+        if ( revFile.exists() )
+        {
+            BufferedReader reader = null;
+            
+            try
+            {
+                reader = new BufferedReader( new FileReader( revFile ) );
+                String line = reader.readLine();
+                currentRevision = Long.valueOf( line );
+            }
+            catch ( IOException e )
+            {
+                throw e;
+            }
+            finally
+            {
+                if ( reader != null )
+                {
+                    //noinspection EmptyCatchBlock
+                    try
+                    {
+                        reader.close();
+                    }
+                    catch ( IOException e )
+                    {
+                    }
+                }
+            }
+        }
+    }
+
+
+    private void saveRevision() throws Exception
+    {
+        File revFile = new File( workingDirectory, REV_FILE );
+        
+        if ( revFile.exists() )
+        {
+            if( !revFile.delete() )
+            {
+                throw new IOException( I18n.err( I18n.ERR_726_FILE_UNDELETABLE, revFile.getAbsolutePath() ) );
+            }
+        }
+
+        PrintWriter out = null;
+        
+        try
+        {
+            out = new PrintWriter( new FileWriter( revFile ) );
+            out.println( currentRevision );
+            out.flush();
+        }
+        catch ( IOException e )
+        {
+            throw e;
+        }
+        finally
+        {
+            if ( out != null )
+            {
+                out.close();
+            }
+        }
+    }
+
+
+    // This will suppress PMD.EmptyCatchBlock warnings in this method
+    @SuppressWarnings("PMD.EmptyCatchBlock")
+    private void saveTags() throws Exception
+    {
+        File tagFile = new File( workingDirectory, TAG_FILE );
+        
+        if ( tagFile.exists() )
+        {
+            if( !tagFile.delete() )
+            {
+                throw new IOException( I18n.err( I18n.ERR_726_FILE_UNDELETABLE, tagFile.getAbsolutePath() ) );
+            }
+        }
+
+        FileOutputStream out = null;
+        
+        try
+        {
+            out = new FileOutputStream( tagFile );
+
+            Properties props = new Properties();
+            
+            for ( Tag tag : tags.values() )
+            {
+                String key = String.valueOf( tag.getRevision() );
+                
+                if ( tag.getDescription() == null )
+                {
+                    props.setProperty( key, "null" );
+                }
+                else
+                {
+                    props.setProperty( key, tag.getDescription() );
+                }
+            }
+
+            props.store( out, null );
+            out.flush();
+        }
+        catch ( IOException e )
+        {
+            throw e;
+        }
+        finally
+        {
+            if ( out != null )
+            {
+                //noinspection EmptyCatchBlock
+                try
+                {
+                    out.close();
+                }
+                catch ( IOException e )
+                {
+                }
+            }
+        }
+    }
+
+
+    // This will suppress PMD.EmptyCatchBlock warnings in this method
+    @SuppressWarnings("PMD.EmptyCatchBlock")
+    private void loadTags() throws Exception
+    {
+        File revFile = new File( workingDirectory, REV_FILE );
+        
+        if ( revFile.exists() )
+        {
+            Properties props = new Properties();
+            FileInputStream in = null;
+            
+            try
+            {
+                in = new FileInputStream( revFile );
+                props.load( in );
+                ArrayList<Long> revList = new ArrayList<Long>();
+                
+                for ( Object key : props.keySet() )
+                {
+                    revList.add( Long.valueOf( ( String ) key ) );
+                }
+
+                Collections.sort( revList );
+                Tag tag = null;
+
+                // @todo need some serious syncrhoization here on tags
+                tags.clear();
+                
+                for ( Long lkey : revList )
+                {
+                    String rev = String.valueOf( lkey );
+                    String desc = props.getProperty( rev );
+
+                    if ( desc != null && desc.equals( "null" ) )
+                    {
+                        tag = new Tag( lkey, null );
+                    }
+                    else
+                    {
+                        tag = new Tag( lkey, desc );
+                    }
+
+                    tags.put( lkey, tag );
+                }
+
+                latest = tag;
+            }
+            catch ( IOException e )
+            {
+                throw e;
+            }
+            finally
+            {
+                if ( in != null )
+                {
+                    //noinspection EmptyCatchBlock
+                    try
+                    {
+                        in.close();
+                    }
+                    catch ( IOException e )
+                    {
+                    }
+                }
+            }
+        }
+    }
+
+
+    // This will suppress PMD.EmptyCatchBlock warnings in this method
+    @SuppressWarnings("PMD.EmptyCatchBlock")
+    private void loadChangeLog() throws Exception
+    {
+        File file = new File( workingDirectory, CHANGELOG_FILE );
+        
+        if ( file.exists() )
+        {
+            ObjectInputStream in = null;
+
+            try
+            {
+                in = new ObjectInputStream( new FileInputStream( file ) );
+                int size = in.readInt();
+                
+                ArrayList<ChangeLogEvent> changeLogEvents = new ArrayList<ChangeLogEvent>( size );
+
+                for ( int i = 0; i < size; i++ )
+                {
+                    ChangeLogEvent event = ChangeLogEventSerializer.deserialize( directoryService.getSchemaManager(), in );
+                    event.getCommitterPrincipal().setSchemaManager( directoryService.getSchemaManager() );
+                    changeLogEvents.add( event );
+                }
+
+                // @todo man o man we need some synchronization later after getting this to work
+                this.events.clear();
+                this.events.addAll( changeLogEvents );
+            }
+            catch ( Exception e )
+            {
+                throw e;
+            }
+            finally
+            {
+                if ( in != null )
+                {
+                    //noinspection EmptyCatchBlock
+                    try
+                    {
+                        in.close();
+                    }
+                    catch ( IOException e )
+                    {
+                    }
+                }
+            }
+        }
+    }
+
+
+    // This will suppress PMD.EmptyCatchBlock warnings in this method
+    @SuppressWarnings("PMD.EmptyCatchBlock")
+    private void saveChangeLog() throws Exception
+    {
+        File file = new File( workingDirectory, CHANGELOG_FILE );
+        
+        if ( file.exists() )
+        {
+            if( !file.delete() )
+            {
+                throw new IOException( I18n.err( I18n.ERR_726_FILE_UNDELETABLE, file.getAbsolutePath() ) );
+            }
+        }
+
+        try
+        {
+            file.createNewFile();
+        }
+        catch ( IOException e )
+        {
+            throw e;
+        }
+
+        ObjectOutputStream out = null;
+
+        try
+        {
+            out = new ObjectOutputStream( new FileOutputStream( file ) );
+
+            out.writeInt( events.size() );
+            
+            for ( ChangeLogEvent event : events )
+            {
+                ChangeLogEventSerializer.serialize( event, out  );
+            }
+
+            out.flush();
+        }
+        catch ( Exception e )
+        {
+            throw e;
+        }
+        finally
+        {
+            if ( out != null )
+            {
+                //noinspection EmptyCatchBlock
+                try
+                {
+                    out.close();
+                }
+                catch ( IOException e )
+                {
+                }
+            }
+        }
+    }
+
+
+    public void sync() throws Exception
+    {
+        saveRevision();
+        saveTags();
+        saveChangeLog();
+    }
+
+
+    /**
+     * Save logs, tags and revision on disk, and clean everything in memory
+     */
+    public void destroy() throws Exception
+    {
+        saveRevision();
+        saveTags();
+        saveChangeLog();
+    }
+
+
+    public long getCurrentRevision()
+    {
+        return currentRevision;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse ) throws Exception
+    {
+        currentRevision++;
+        ChangeLogEvent event = new ChangeLogEvent( currentRevision, DateUtils.getGeneralizedTime(), 
+                principal, forward, reverse );
+        events.add( event );
+        return event;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, List<LdifEntry> reverses ) throws Exception
+    {
+        currentRevision++;
+        ChangeLogEvent event = new ChangeLogEvent( currentRevision, DateUtils.getGeneralizedTime(),
+                principal, forward, reverses );
+        events.add( event );
+        return event;
+    }
+
+
+    public ChangeLogEvent lookup( long revision ) throws Exception
+    {
+        if ( revision < 0 )
+        {
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_239 ) );
+        }
+
+        if ( revision > getCurrentRevision() )
+        {
+            throw new IllegalArgumentException( I18n.err( I18n.ERR_240 ) );
+        }
+
+        return events.get( ( int ) revision );
+    }
+
+
+    public Cursor<ChangeLogEvent> find() throws Exception
+    {
+        return new ListCursor<ChangeLogEvent>( events );
+    }
+
+
+    public Cursor<ChangeLogEvent> findBefore( long revision ) throws Exception
+    {
+        return new ListCursor<ChangeLogEvent>( events, ( int ) revision );
+    }
+
+
+    public Cursor<ChangeLogEvent> findAfter( long revision ) throws LdapException
+    {
+        return new ListCursor<ChangeLogEvent>( ( int ) revision, events );
+    }
+
+
+    public Cursor<ChangeLogEvent> find( long startRevision, long endRevision ) throws Exception
+    {
+        return new ListCursor<ChangeLogEvent>( ( int ) startRevision, events, ( int ) ( endRevision + 1 ) );
+    }
+
+
+    public Tag getLatest() throws LdapException
+    {
+        return latest;
+    }
+
+
+    /**
+     * @see TaggableChangeLogStore#removeTag(long)
+     */
+    public Tag removeTag( long revision ) throws Exception
+    {
+        return tags.remove( revision );
+    }
+
+
+    /**
+     * @see TaggableChangeLogStore#tag(long, String)
+     */
+    public Tag tag( long revision, String descrition ) throws Exception
+    {
+        if ( tags.containsKey( revision ) )
+        {
+            return tags.get( revision );
+        }
+
+        latest = new Tag( revision, descrition );
+        tags.put( revision, latest );
+        return latest;
+    }
+    
+    
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( "MemoryChangeLog\n" );
+        sb.append( "latest tag : " ).append( latest ).append( '\n' );
+        
+        if ( events != null )
+        {
+            sb.append( "Nb of events : " ).append( events.size() ).append( '\n' );
+            
+            int i = 0;
+            
+            for ( ChangeLogEvent event:events )
+            {
+                sb.append( "event[" ).append( i++ ).append( "] : " );
+                sb.append( "\n---------------------------------------\n" );
+                sb.append( event );
+                sb.append( "\n---------------------------------------\n" );
+            }
+        }
+        
+        
+        return sb.toString();
+    }
+}

Added: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/package-info.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/package-info.java?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/package-info.java (added)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/package-info.java Fri Oct 14 22:36:08 2011
@@ -0,0 +1,55 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+
+/**
+ * <pre>
+ * <h1>Ideas</h1>
+ * <p>
+ * Use AdminModel to control what goes into the changelog ?  Or use admin model to identify 
+ * scopes/concerns which are put into different channels in the changelog?  Cool idea perhaps,
+ * perhaps not.  To some degree the Dn does the scope thingy for us.  There really is no point
+ * to having an additional scope parameter.
+ * </p><p>
+ * Perhaps we can also inject a new revisions (multi-valued) operational attribute into 
+ * entries to track the revisions of changes in the changeLog to that entry.  This can
+ * be used to ask the server for a log of changes that have been performed on a specific 
+ * entry.  Whoa that's really hot for auditing!
+ * </p><p>
+ * We could try to do the same thing (meaning having a tags operational attribute) with revisions.
+ * However this is pointless since the tag revision would already be in the revisions attribute.  Also
+ * a tag would select entries dynamically: all entries with revisions below the tag revision would be
+ * selected in the tag.  This leads to a neat idea: you can easily regenerate not only the revision 
+ * history of an entry, you can do it for an entire subtree, and furthermore you might even be able
+ * to conduct search operations based on a tag and the state of the server in the past.  This would be
+ * pretty wild.
+ * </p><p>
+ * Another neat thing that could be done is to request an attribute by revision using the protocol 
+ * based tagging mechanism in LDAP.  For example we have language based tags like cn;lang-en so why
+ * not have version based tags like cn;revision-23.  When requested in this mannar the server can 
+ * reconstruct the state of the attribute at a specific revision and return it to the user.  This is
+ * an incredible capability when storing the configurations of systems in LDAP.  Being able to rollback
+ * to a previous configuration or just inquire about a previous state is a powerful feature to have.
+ * </p>
+ * </pre>
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+
+package org.apache.directory.server.core.changelog;

Added: directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java?rev=1183537&view=auto
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java (added)
+++ directory/apacheds/trunk/interceptors/changelog/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java Fri Oct 14 22:36:08 2011
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.directory.server.core.changelog;
+
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.assertNull;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.changelog.ChangeLogEvent;
+import org.apache.directory.server.core.api.changelog.ChangeLogEventSerializer;
+import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
+import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.ldif.ChangeType;
+import org.apache.directory.shared.ldap.model.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.model.ldif.LdifRevertor;
+import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.ldap.model.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.DateUtils;
+import org.apache.directory.shared.util.Strings;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.mycila.junit.concurrent.Concurrency;
+import com.mycila.junit.concurrent.ConcurrentJunitRunner;
+
+
+/**
+ * Tests the MemoryChangeLogStore.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith(ConcurrentJunitRunner.class)
+@Concurrency()
+public class MemoryChangeLogStoreTest
+{
+    private static MemoryChangeLogStore store;
+
+    private static SchemaManager schemaManager;
+    
+    @BeforeClass
+    public static void setUp() throws Exception
+    {
+        schemaManager = new DefaultSchemaManager();
+
+        store = new MemoryChangeLogStore();
+    }
+
+
+    @AfterClass
+    public static void tearDown() throws Exception
+    {
+        store = null;
+    }
+
+
+    @Test
+    public void testLogCheckRevision() throws Exception
+    {
+        assertEquals( "first revision is always 0", 0, store.getCurrentRevision() );
+
+        LdifEntry forward = new LdifEntry();
+        forward.setDn( "ou=system" );
+        forward.setChangeType( ChangeType.Add );
+        forward.putAttribute( "objectClass", "organizationalUnit" );
+        forward.putAttribute( "ou", "system" );
+
+        LdifEntry reverse = LdifRevertor.reverseAdd( forward.getDn() );
+        assertEquals( 1, store.log( new LdapPrincipal( schemaManager ), forward, reverse ).getRevision() );
+        assertEquals( 1, store.getCurrentRevision() );
+    }
+    
+    
+    @Test
+    public void testChangeLogSerialization() throws LdapException, IOException, ClassNotFoundException
+    {
+        Dn systemDn = new Dn( schemaManager, "ou=system" );
+        systemDn.apply( schemaManager );
+        
+        Dn adminDn = new Dn( schemaManager, "uid=admin, ou=system" );
+        adminDn.apply( schemaManager );
+
+        LdifEntry forward = new LdifEntry();
+        forward.setDn( systemDn );
+        forward.setChangeType( ChangeType.Add );
+        forward.putAttribute( "objectClass", "organizationalUnit" );
+        forward.putAttribute( "ou", "system" );
+        
+        Dn reverseDn = forward.getDn();
+        reverseDn.apply( schemaManager );
+
+        LdifEntry reverse = LdifRevertor.reverseAdd( reverseDn );
+
+        String zuluTime = DateUtils.getGeneralizedTime();
+        long revision = 1L;
+        
+        LdapPrincipal principal = new LdapPrincipal( schemaManager, adminDn, AuthenticationLevel.SIMPLE, Strings.getBytesUtf8("secret") );
+        ChangeLogEvent event = new ChangeLogEvent( revision, zuluTime, principal, forward, reverse );
+        
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream( baos );
+
+        ChangeLogEventSerializer.serialize( event, out );
+        
+        byte[] data = baos.toByteArray();
+        ObjectInputStream in = new ObjectInputStream( new ByteArrayInputStream( data ) );
+        
+        ChangeLogEvent read = ChangeLogEventSerializer.deserialize( schemaManager, in ); 
+        
+        // The read event should not be equal to the written event, as
+        // the principal's password has not been stored
+        assertNotSame( event, read );
+        
+        LdapPrincipal readPrincipal = read.getCommitterPrincipal();
+        
+        assertEquals( principal.getAuthenticationLevel(), readPrincipal.getAuthenticationLevel() );
+        assertEquals( principal.getName(), readPrincipal.getName() );
+        assertEquals( principal.getDn(), readPrincipal.getDn() );
+        assertNull( readPrincipal.getUserPassword() );
+        
+        assertEquals( zuluTime, read.getZuluTime() );
+        assertEquals( revision, read.getRevision() );
+        assertEquals( forward, read.getForwardLdif() );
+        assertEquals( reverse, read.getReverseLdifs().get( 0 ) );
+    }
+}

Propchange: directory/apacheds/trunk/interceptors/collective/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct 14 22:36:08 2011
@@ -0,0 +1,11 @@
+target
+.project
+.classpath
+.settings
+eclipse-classes
+*.log
+*.iml
+*.ipr
+dependency-reduced-pom.xml
+META-INF
+



Mime
View raw message