directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r648932 [7/7] - in /directory/sandbox/akarasulu/bigbang/apacheds: ./ apacheds-xbean-spring/ benchmarks/ bootstrap-extract/ bootstrap-partition/ bootstrap-plugin/ btree-base/ core-constants/ core-constants/src/main/java/org/apache/directory/...
Date Thu, 17 Apr 2008 02:55:58 GMT
Modified: directory/sandbox/akarasulu/bigbang/apacheds/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/pom.xml Wed Apr 16 19:55:38 2008
@@ -25,15 +25,20 @@
   <parent>
     <groupId>org.apache.directory.project</groupId>
     <artifactId>project</artifactId>
-    <version>10-SNAPSHOT</version>
+    <version>10</version>
   </parent>
 
   <groupId>org.apache.directory.server</groupId>
   <artifactId>apacheds-parent</artifactId>
-  <version>1.5.2-SNAPSHOT</version>
+  <version>1.5.3-SNAPSHOT</version>
   <name>ApacheDS</name>
   <packaging>pom</packaging>
 
+  <properties>
+    <projectName>Apache Directory Server</projectName>
+    <!--<siteId>apacheds</siteId>-->
+  </properties>
+
   <url>http://directory.apache.org/apacheds/1.5</url>
 
   <dependencyManagement>
@@ -42,25 +47,31 @@
       <dependency>
         <groupId>org.apache.directory.shared</groupId>
         <artifactId>shared-asn1-codec</artifactId>
-        <version>0.9.9-SNAPSHOT</version>
+        <version>0.9.11-SNAPSHOT</version>
       </dependency>
 
       <dependency>
         <groupId>org.apache.directory.shared</groupId>
         <artifactId>shared-ldap</artifactId>
-        <version>0.9.9-SNAPSHOT</version>
+        <version>0.9.11-SNAPSHOT</version>
       </dependency>
 
       <dependency>
         <groupId>org.apache.directory.shared</groupId>
         <artifactId>shared-ldap-constants</artifactId>
-        <version>0.9.9-SNAPSHOT</version>
+        <version>0.9.11-SNAPSHOT</version>
+      </dependency>
+
+      <dependency>
+        <groupId>org.apache.directory.shared</groupId>
+        <artifactId>shared-bouncycastle-reduced</artifactId>
+        <version>0.9.11-SNAPSHOT</version>
       </dependency>
 
       <dependency>
         <groupId>org.apache.directory.daemon</groupId>
         <artifactId>daemon-bootstrappers</artifactId>
-        <version>1.1.2-SNAPSHOT</version>
+        <version>1.1.4-SNAPSHOT</version>
       </dependency>
 
       <dependency>
@@ -190,6 +201,12 @@
       </dependency>
 
       <dependency>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>xbean-spring</artifactId>
+        <version>3.3</version>
+      </dependency>
+
+      <dependency>
         <groupId>org.springframework</groupId>
         <artifactId>spring-core</artifactId>
         <version>2.0.6</version>
@@ -327,7 +344,6 @@
     <module>xdbm-search</module>
     <module>xdbm-tools</module>
     <module>core</module>
-    <!-- module>core-jndi</module -->
     <module>core-constants</module>
     <module>core-shared</module>
     <module>core-plugin</module>
@@ -359,7 +375,7 @@
     <module>interceptor-kerberos</module>
     <module>mitosis</module>
     <module>server-replication</module>
-    <module>apacheds-xbean-spring</module>
+    <module>xbean-spring</module>
   </modules>
 
   <build>
@@ -401,28 +417,6 @@
       </plugins>
     </pluginManagement>
 
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-release-plugin</artifactId>
-        <configuration>
-          <tagBase>https://svn.apache.org/repos/asf/directory/apacheds/releases</tagBase>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-source-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-    </plugins>
   </build>
 
   <reporting>
@@ -535,95 +529,10 @@
     </plugins>
   </reporting>
 
-  <profiles>
-    <profile>
-      <id>release</id>
-      <modules>
-        <module>bootstrap-extract</module>
-        <module>bootstrap-partition</module>
-        <module>bootstrap-plugin</module>
-        <module>schema-extras</module>
-        <module>schema-bootstrap</module>
-        <module>utils</module>
-        <module>schema-registries</module>
-        <module>jdbm-store</module>
-        <module>constants</module>
-        <module>btree-base</module>
-        <module>xdbm-search</module>
-        <module>xdbm-tools</module>
-        <module>core</module>
-        <module>core-shared</module>
-        <module>core-plugin</module>
-        <module>core-unit</module>
-        <module>core-entry</module>
-        <module>core-splay</module>
-        <module>core-avl</module>
-        <module>protocol-shared</module>
-        <module>protocol-ntp</module>
-        <module>protocol-ldap</module>
-        <module>protocol-kerberos</module>
-        <module>protocol-dhcp</module>
-        <module>protocol-dns</module>
-        <module>protocol-changepw</module>
-        <module>server-tools</module>
-
-        <!-- breaks the build on first try
-        <module>sar-plugin</module>
-        <module>server-sar</module>
-        -->
-
-        <module>server-xml</module>
-        <module>server-unit</module>
-        <module>server-jndi</module>
-        <module>kerberos-shared</module>
-        <module>mitosis</module>
-        <module>server-replication</module>
-      </modules>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-source-plugin</artifactId>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-javadocs</id>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
   <scm>
-    <connection>
-      scm:svn:http://svn.apache.org/repos/asf/directory/apacheds/branches/bigbang
-    </connection>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/directory/apacheds/branches/bigbang</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/directory/apacheds/branches/bigbang</developerConnection>
+    <url>http://svn.apache.org/viewvc/directory/project/tags/10/apacheds-parent</url>
   </scm>
 
   <repositories>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-changepw/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-changepw/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-changepw/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-changepw/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-changepw</artifactId>
   <name>ApacheDS Protocol Change Password</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-dhcp/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-dhcp/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-dhcp/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-dhcp/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-dhcp</artifactId>
   <name>ApacheDS Protocol Dhcp</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-dns/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-dns/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-dns/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-dns/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-dns</artifactId>
   <name>ApacheDS Protocol Dns</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-kerberos/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-kerberos/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-kerberos/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-kerberos/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-kerberos</artifactId>
   <name>ApacheDS Protocol Kerberos</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-ldap/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-ldap/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-ldap/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-ldap/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-ldap</artifactId>
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-ntp/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-ntp/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-ntp/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-ntp/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-protocol-ntp</artifactId>
   <name>ApacheDS Protocol Ntp</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/protocol-shared/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/protocol-shared/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/protocol-shared/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/protocol-shared/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <groupId>org.apache.directory.server</groupId>
   <artifactId>apacheds-protocol-shared</artifactId>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-schema-bootstrap</artifactId>
   <name>ApacheDS Bootstrap Schemas</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/src/main/schema/core.schema
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/src/main/schema/core.schema?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/src/main/schema/core.schema (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-bootstrap/src/main/schema/core.schema Wed Apr 16 19:55:38 2008
@@ -378,7 +378,7 @@
 		teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $
 		facsimileTelephoneNumber $ preferredDeliveryMethod $ street $
 		postOfficeBox $ postalCode $ postalAddress $
-		physicalDeliveryOfficeName $ st $ l ) )
+		physicalDeliveryOfficeName $ st ) )
 
 objectclass ( 2.5.6.11 NAME 'applicationProcess'
 	DESC 'RFC2256: an application process'

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-schema-extras</artifactId>
   <name>ApacheDS Extra Schemas</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/autofs.schema
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/autofs.schema?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/autofs.schema (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/autofs.schema Wed Apr 16 19:55:38 2008
@@ -8,13 +8,13 @@
 
 # Attribute Type Definitions
 
-attributetype ( 1.3.6.1.1.1.1.25 NAME 'automountInformation'
+attributetype ( 1.3.6.1.4.1.2312.4.1.2 NAME 'automountInformation'
 	DESC 'Information used by the autofs automounter'
-	EQUALITY caseExactIA5Match
+	EQUALITY caseExactMatch
 	SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
 
 # malformed: superior top and class type STRUCTURAL were in front of DESC
-objectclass ( 1.3.6.1.1.1.1.13 NAME 'automount'
+objectclass ( 1.3.6.1.4.1.2312.4.2.3 NAME 'automount'
 	DESC 'An entry in an automounter map'
 	SUP top STRUCTURAL
 	MUST ( cn $ automountInformation )

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/nis.schema
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/nis.schema?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/nis.schema (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-extras/src/main/schema/nis.schema Wed Apr 16 19:55:38 2008
@@ -1,4 +1,17 @@
-# $OpenLDAP: pkg/ldap/servers/slapd/schema/nis.schema,v 1.8 2001/12/07 23:36:11 kurt Exp $
+# $OpenLDAP: /servers/slapd/schema/nis.schema,v 1.15.2.3 2008/02/11 23:26:49 kurt Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2008 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+
 # Definitions from RFC2307 (Experimental)
 #	An Approach for Using LDAP as a Network Information Service
 
@@ -143,14 +156,12 @@
 
 # Object Class Definitions
 
-# malformed: SUP and AUXILIARY were before DESC
 objectclass ( 1.3.6.1.1.1.2.0 NAME 'posixAccount'
 	DESC 'Abstraction of an account with POSIX attributes'
 	SUP top AUXILIARY
 	MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory )
 	MAY ( userPassword $ loginShell $ gecos $ description ) )
 
-# malformed: SUP and AUXILIARY were before DESC
 objectclass ( 1.3.6.1.1.1.2.1 NAME 'shadowAccount'
 	DESC 'Additional attributes for shadow passwords'
 	SUP top AUXILIARY
@@ -159,76 +170,65 @@
 	      shadowMax $ shadowWarning $ shadowInactive $
 	      shadowExpire $ shadowFlag $ description ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.2 NAME 'posixGroup'
 	DESC 'Abstraction of a group of accounts'
 	SUP top STRUCTURAL
 	MUST ( cn $ gidNumber )
 	MAY ( userPassword $ memberUid $ description ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.3 NAME 'ipService'
 	DESC 'Abstraction an Internet Protocol service'
 	SUP top STRUCTURAL
 	MUST ( cn $ ipServicePort $ ipServiceProtocol )
 	MAY ( description ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.4 NAME 'ipProtocol'
 	DESC 'Abstraction of an IP protocol'
-    SUP top STRUCTURAL
-	MUST ( cn $ ipProtocolNumber $ description )
+	SUP top STRUCTURAL
+	MUST ( cn $ ipProtocolNumber )
 	MAY description )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.5 NAME 'oncRpc'
 	DESC 'Abstraction of an ONC/RPC binding'
-    SUP top STRUCTURAL
-	MUST ( cn $ oncRpcNumber $ description )
+	SUP top STRUCTURAL
+	MUST ( cn $ oncRpcNumber )
 	MAY description )
 
-# malformed: SUP top AUXILIARY was before DESC
 objectclass ( 1.3.6.1.1.1.2.6 NAME 'ipHost'
 	DESC 'Abstraction of a host, an IP device'
 	SUP top AUXILIARY
 	MUST ( cn $ ipHostNumber )
 	MAY ( l $ description $ manager ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.7 NAME 'ipNetwork'
 	DESC 'Abstraction of an IP network'
 	SUP top STRUCTURAL
 	MUST ( cn $ ipNetworkNumber )
 	MAY ( ipNetmaskNumber $ l $ description $ manager ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup'
 	DESC 'Abstraction of a netgroup'
 	SUP top STRUCTURAL
 	MUST cn
 	MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.9 NAME 'nisMap'
 	DESC 'A generic abstraction of a NIS map'
 	SUP top STRUCTURAL
 	MUST nisMapName
 	MAY description )
 
-# malformed: SUP top STRUCTURAL was before DESC
 objectclass ( 1.3.6.1.1.1.2.10 NAME 'nisObject'
 	DESC 'An entry in a NIS map'
 	SUP top STRUCTURAL
 	MUST ( cn $ nisMapEntry $ nisMapName )
 	MAY description )
 
-# malformed: SUP top AUXILIARY was before DESC
 objectclass ( 1.3.6.1.1.1.2.11 NAME 'ieee802Device'
 	DESC 'A device with a MAC address'
 	SUP top AUXILIARY
 	MAY macAddress )
 
-# malformed: SUP top AUXILIARY was before DESC
 objectclass ( 1.3.6.1.1.1.2.12 NAME 'bootableDevice'
 	DESC 'A device with boot parameters'
 	SUP top AUXILIARY

Modified: directory/sandbox/akarasulu/bigbang/apacheds/schema-registries/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/schema-registries/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/schema-registries/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/schema-registries/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-schema-registries</artifactId>
   <name>ApacheDS Schema Registries</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-jndi</artifactId>
   <name>ApacheDS Server JNDI</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Wed Apr 16 19:55:38 2008
@@ -43,6 +43,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
+
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
@@ -59,30 +60,47 @@
  */
 public class ApacheDS
 {
-    private static final String WINDOWSFILE_ATTR = "windowsFilePath";
-    private static final String UNIXFILE_ATTR = "unixFilePath";
     private static final Logger LOG = LoggerFactory.getLogger( ApacheDS.class.getName() );
-    private static final String LDIF_FILES_DN = "ou=loadedLdifFiles,ou=configuration,ou=system";
+    
+    /** Default delay between two flushes to the backend */
     private static final long DEFAULT_SYNC_PERIOD_MILLIS = 20000;
 
+    /** Wainting period between two flushes to the backend */
     private long synchPeriodMillis = DEFAULT_SYNC_PERIOD_MILLIS;
 
+    /** Directory where are stored the LDIF files to be loaded at startup */
     private File ldifDirectory;
+    
     private final List<LdifLoadFilter> ldifFilters = new ArrayList<LdifLoadFilter>();
 
+    /** The LDAP server protocol handler */
     private final LdapServer ldapServer;
+    
+    /** The LDAPS server protocol handler */
     private final LdapServer ldapsServer;
+    
+    /** The directory service */
     private final DirectoryService directoryService;
 
 
+    /**
+     * Creates a new instance of the ApacheDS server
+     *  
+     * @param directoryService 
+     * @param ldapServer
+     * @param ldapsServer
+     */
     public ApacheDS( DirectoryService directoryService, LdapServer ldapServer, LdapServer ldapsServer )
     {
         LOG.info(  "Starting the Apache Directory Server" );
-        this.directoryService = directoryService;
-        
-        if ( this.directoryService == null )
+
+        if ( directoryService == null )
         {
-            directoryService = new DefaultDirectoryService();
+            this.directoryService = new DefaultDirectoryService();
+        }
+		else
+		{        
+        	this.directoryService = directoryService;
         }
         
         this.ldapServer = ldapServer;
@@ -92,25 +110,44 @@
     }
 
 
+    /**
+     * Start the server :
+     *  <li>initialize the DirectoryService</li>
+     *  <li>start the LDAP server</li>
+     *  <li>start the LDAPS server</li>
+     *  
+     * @throws NamingException If the server cannot be started
+     * @throws IOException If an IO error occured while reading some file
+     */
     public void startup() throws NamingException, IOException
     {
-
+        LOG.debug( "Starting the server" );
+        
+        // Start the directory service if not started yet
         if ( ! directoryService.isStarted() )
         {
+            LOG.debug( "1. Starting the DirectoryService" );
             directoryService.startup();
         }
 
+        // Load the LDIF files - if any - into the server
         loadLdifs();
 
+        // Start the LDAP server
         if ( ldapServer != null && ! ldapServer.isStarted() )
         {
+            LOG.debug( "3. Starting the LDAP server" );
             ldapServer.start();
         }
 
+        // Start the LDAPS  server
         if ( ldapsServer != null && ! ldapsServer.isStarted() )
         {
+            LOG.debug(  "4. Starting the LDAPS server" );
             ldapsServer.start();
         }
+        
+        LOG.debug( "Server successfully started" );
     }
 
 
@@ -172,21 +209,14 @@
         this.synchPeriodMillis = synchPeriodMillis;
     }
 
-
+    
+    /**
+     * Get the directory where 
+     * @return
+     */
     public File getLdifDirectory()
     {
-        if ( ldifDirectory == null )
-        {
-            return null;
-        }
-        else if ( ldifDirectory.isAbsolute() )
-        {
-            return this.ldifDirectory;
-        }
-        else
-        {
-            return new File( directoryService.getWorkingDirectory().getParent() , ldifDirectory.toString() );
-        }
+        return ldifDirectory;
     }
 
 
@@ -213,31 +243,8 @@
         LOG.info( "The LDIF directory file is {}", ldifDirectory.getAbsolutePath() );
         this.ldifDirectory = ldifDirectory;
     }
-
-
-    public List<LdifLoadFilter> getLdifFilters()
-    {
-        return new ArrayList<LdifLoadFilter>( ldifFilters );
-    }
-
-
-    public void setLdifFilters( List<LdifLoadFilter> filters )
-    {
-        if ( LOG.isInfoEnabled() )
-        {
-            LOG.info( "Set the ldif filters :" );
-            
-            for ( LdifLoadFilter filter:filters )
-            {
-                LOG.info( "    Ldif Filter {}", filter );
-            }
-        }
-        
-        ldifFilters.clear();
-        ldifFilters.addAll( filters );
-    }
-
-
+    
+    
     // ----------------------------------------------------------------------
     // From CoreContextFactory: presently in intermediate step but these
     // methods will be moved to the appropriate protocol service eventually.
@@ -246,6 +253,13 @@
     // ----------------------------------------------------------------------
 
 
+    /**
+     * Check that the entry where are stored the loaded Ldif files is created.
+     * 
+     * If not, create it.
+     * 
+     * The files are stored in ou=loadedLdifFiles,ou=configuration,ou=system
+     */
     private void ensureLdifFileBase( DirContext root )
     {
         Attributes entry = new AttributesImpl( SchemaConstants.OU_AT, "loadedLdifFiles", true );
@@ -254,35 +268,40 @@
 
         try
         {
-            root.createSubcontext( LDIF_FILES_DN, entry );
-            LOG.info( "Creating " + LDIF_FILES_DN );
+            root.createSubcontext( ServerDNConstants.LDIF_FILES_DN, entry );
+            LOG.info( "Creating " + ServerDNConstants.LDIF_FILES_DN );
         }
         catch ( NamingException e )
         {
-            LOG.info( LDIF_FILES_DN + " exists" );
+            LOG.info( ServerDNConstants.LDIF_FILES_DN + " exists" );
         }
     }
 
 
+    /**
+     * Create a string containing a hex dump of the loaded ldif file name.
+     * 
+     * It is associated with the attributeType wrt to the underlying system.
+     */
     private String buildProtectedFileEntry( File ldif )
     {
-        StringBuffer buf = new StringBuffer();
-
-        buf.append( File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR );
-        buf.append( "=" );
-
-        buf.append( StringTools.dumpHexPairs( StringTools.getBytesUtf8( getCanonical( ldif ) ) ) );
-
-        buf.append( "," );
-        buf.append( LDIF_FILES_DN );
-
-        return buf.toString();
+        String fileSep = File.separatorChar == '\\' ? 
+                ApacheSchemaConstants.WINDOWS_FILE_AT : 
+                ApacheSchemaConstants.UNIX_FILE_AT;
+
+        return  fileSep + 
+                "=" + 
+                StringTools.dumpHexPairs( StringTools.getBytesUtf8( getCanonical( ldif ) ) ) +
+                "," + 
+                ServerDNConstants.LDIF_FILES_DN; 
     }
 
     
     private void addFileEntry( DirContext root, File ldif ) throws NamingException
     {
-		String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
+        String rdnAttr = File.separatorChar == '\\' ? 
+            ApacheSchemaConstants.WINDOWS_FILE_AT : 
+            ApacheSchemaConstants.UNIX_FILE_AT;
         String oc = File.separatorChar == '\\' ? ApacheSchemaConstants.WINDOWS_FILE_OC : ApacheSchemaConstants.UNIX_FILE_OC;
 
         Attributes entry = new AttributesImpl( rdnAttr, getCanonical( ldif ), true );
@@ -292,6 +311,12 @@
     }
 
 
+    /**
+     * 
+     * @param root
+     * @param ldif
+     * @return
+     */
     private Attributes getLdifFileEntry( DirContext root, File ldif )
     {
         try
@@ -324,7 +349,37 @@
     }
 
 
-    private void loadLdifs() throws NamingException
+    /**
+     * Load a ldif into the directory.
+     *  
+     * @param root The context in which we will inject the entries
+     * @param ldifFile The ldif file to read
+     * @throws NamingException If something went wrong while loading the entries
+     */
+    private void loadLdif( DirContext root, File ldifFile ) throws NamingException
+    {
+        Attributes fileEntry = getLdifFileEntry( root, ldifFile );
+
+        if ( fileEntry != null )
+        {
+            String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
+            LOG.info( "Load of LDIF file '" + getCanonical( ldifFile )
+                    + "' skipped.  It has already been loaded on " + time + "." );
+        }
+        else
+        {
+            LdifFileLoader loader = new LdifFileLoader( root, ldifFile, ldifFilters );
+            int count = loader.execute();
+            LOG.info( "Loaded " + count + " entries from LDIF file '" + getCanonical( ldifFile ) + "'" );
+            addFileEntry( root, ldifFile );
+        }
+    }
+    
+    
+    /**
+     * Load the ldif files if there are some
+     */
+    public void loadLdifs() throws NamingException
     {
         // LOG and bail if property not set
         if ( ldifDirectory == null )
@@ -336,17 +391,17 @@
         // LOG and bail if LDIF directory does not exists
         if ( ! ldifDirectory.exists() )
         {
-            LOG.warn( "LDIF load directory '" + getCanonical( ldifDirectory )
-                + "' does not exist.  No LDIF files will be loaded." );
+            LOG.warn( "LDIF load directory '{}' does not exist.  No LDIF files will be loaded.",
+                getCanonical( ldifDirectory ) );
             return;
         }
 
 
         LdapDN dn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
         
-        // Must normailize the dn or - IllegalStateException!
+        // Must normalize the dn or - IllegalStateException!
         AttributeTypeRegistry reg = directoryService.getRegistries().getAttributeTypeRegistry();
-            dn.normalize( reg.getNormalizerMapping() );
+        dn.normalize( reg.getNormalizerMapping() );
         
         LdapPrincipal admin = new LdapPrincipal( dn, AuthenticationLevel.STRONG );
         
@@ -355,71 +410,66 @@
         ensureLdifFileBase( root );
 
         // if ldif directory is a file try to load it
-        if ( ! ldifDirectory.isDirectory() )
+        if ( ldifDirectory.isFile() )
         {
             if ( LOG.isInfoEnabled() )
             {
-                LOG.info( "LDIF load directory '" + getCanonical( ldifDirectory )
-                    + "' is a file.  Will attempt to load as LDIF." );
+                LOG.info( "LDIF load directory '{}' is a file. Will attempt to load as LDIF.",
+                    getCanonical( ldifDirectory ) );
             }
 
-            Attributes fileEntry = getLdifFileEntry( root, ldifDirectory );
-
-            if ( fileEntry != null )
+            try
             {
-                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
-
-                if ( LOG.isInfoEnabled() )
-                {
-                    LOG.info( "Load of LDIF file '" + getCanonical( ldifDirectory )
-                        + "' skipped.  It has already been loaded on " + time + "." );
-                }
-
-                return;
+                loadLdif( root, ldifDirectory );
             }
-
-            LdifFileLoader loader = new LdifFileLoader( root, ldifDirectory, ldifFilters );
-            loader.execute();
-
-            addFileEntry( root, ldifDirectory );
-            return;
-        }
-
-        // get all the ldif files within the directory (should be sorted alphabetically)
-        File[] ldifFiles = ldifDirectory.listFiles( new FileFilter()
-        {
-            public boolean accept( File pathname )
+            catch ( NamingException ne )
             {
-                boolean isLdif = pathname.getName().toLowerCase().endsWith( ".ldif" );
-                return pathname.isFile() && pathname.canRead() && isLdif;
+                // If the file can't be read, log the error, and stop
+                // loading LDIFs.
+                LOG.error( "Cannot load the ldif file '{}', error : ",
+                    ldifDirectory.getAbsolutePath(), 
+                    ne.getMessage() );
+                throw ne;
             }
-        } );
-
-        // LOG and bail if we could not find any LDIF files
-        if ( ldifFiles == null || ldifFiles.length == 0 )
-        {
-            LOG.warn( "LDIF load directory '" + getCanonical( ldifDirectory )
-                + "' does not contain any LDIF files.  No LDIF files will be loaded." );
-            return;
         }
-
-        // load all the ldif files and load each one that is loaded
-        for ( File ldifFile : ldifFiles )
+        else
         {
-            Attributes fileEntry = getLdifFileEntry( root, ldifFile );
-
-            if ( fileEntry != null )
+            // get all the ldif files within the directory (should be sorted alphabetically)
+            File[] ldifFiles = ldifDirectory.listFiles( new FileFilter()
             {
-                String time = ( String ) fileEntry.get( SchemaConstants.CREATE_TIMESTAMP_AT ).get();
-                LOG.info( "Load of LDIF file '" + getCanonical( ldifFile )
-                        + "' skipped.  It has already been loaded on " + time + "." );
-                continue;
+                public boolean accept( File pathname )
+                {
+                    boolean isLdif = pathname.getName().toLowerCase().endsWith( ".ldif" );
+                    return pathname.isFile() && pathname.canRead() && isLdif;
+                }
+            } );
+    
+            // LOG and bail if we could not find any LDIF files
+            if ( ( ldifFiles == null ) || ( ldifFiles.length == 0 ) )
+            {
+                LOG.warn( "LDIF load directory '{}' does not contain any LDIF files. No LDIF files will be loaded.", 
+                    getCanonical( ldifDirectory ) );
+                return;
+            }
+    
+            // load all the ldif files and load each one that is loaded
+            for ( File ldifFile : ldifFiles )
+            {
+                try
+                {
+                    LOG.info(  "Loading LDIF file '{}'", ldifFile.getName() );
+                    loadLdif( root, ldifFile );
+                }
+                catch ( NamingException ne )
+                {
+                    // If the file can't be read, log the error, and stop
+                    // loading LDIFs.
+                    LOG.error( "Cannot load the ldif file '{}', error : {}", 
+                        ldifFile.getAbsolutePath(), 
+                        ne.getMessage() );
+                    throw ne;
+                }
             }
-
-            LdifFileLoader loader = new LdifFileLoader( root, ldifFile, ldifFilters );
-            int count = loader.execute();
-            LOG.info( "Loaded " + count + " entries from LDIF file '" + getCanonical( ldifFile ) + "'" );
-            addFileEntry( root, ldifFile );
         }
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-replication/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-replication/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-replication/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-replication/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-replication</artifactId>
   <name>ApacheDS Server Replication Service</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-sar/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-sar/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-sar/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-sar/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.1-SNAPSHOT</version>
+    <version>1.5.2-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-sar</artifactId>
   <name>ApacheDS Server Sar (JBoss 3.x)</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-tools</artifactId>
   <name>ApacheDS Server Tools</name>
@@ -53,6 +53,11 @@
       <groupId>org.apache.directory.server</groupId>
       <artifactId>apacheds-server-jndi</artifactId>
       <version>${pom.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.xbean</groupId>
+      <artifactId>xbean-spring</artifactId>
     </dependency>
 
     <dependency>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java Wed Apr 16 19:55:38 2008
@@ -21,15 +21,13 @@
 
 
 import java.io.IOException;
+import java.net.URL;
 import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
-import org.apache.directory.server.tools.execution.BaseToolCommandExecutor;
-import org.apache.directory.server.tools.listeners.ExceptionListener;
-import org.apache.directory.server.tools.listeners.SysErrListener;
-import org.apache.directory.server.tools.listeners.SysOutListener;
-import org.apache.directory.server.tools.request.BaseToolCommandCL;
-import org.apache.directory.server.tools.util.ListenerParameter;
+import org.apache.directory.server.configuration.ApacheDS;
+import org.springframework.context.ApplicationContext;
+import org.apache.xbean.spring.context.FileSystemXmlApplicationContext;
 
 
 /**
@@ -40,22 +38,9 @@
  */
 public class ApachedsTools
 {
-    public static void main( String[] args )
+    public static void main( String[] args ) throws Exception
     {
-        ToolCommandListener outputListener = new SysOutListener();
-        ToolCommandListener errorListener = new SysErrListener();
-        ToolCommandListener exceptionListener = new ExceptionListener();
-
-        BaseCommand tools = null;
-        try
-        {
-            tools = getInstance();
-        }
-        catch ( Exception e )
-        {
-            System.err.println( "An error has occurred. Apache DS Tools must quit." + "\nError: " + e.getMessage() );
-            System.exit( 1 );
-        }
+        BaseCommand tools = getInstance();
 
         if ( !BaseCommand.hasBannerOption( args ) )
         {
@@ -90,7 +75,7 @@
             System.exit( 0 );
         }
 
-        BaseToolCommandCL cmd = ( BaseToolCommandCL ) tools.getCommands().get( command );
+        ToolCommand cmd = ( ToolCommand ) tools.getCommands().get( command );
         if ( cmd == null )
         {
             System.err.println( "Unknown command: " + args[0] );
@@ -110,25 +95,25 @@
         cmd.setDebugEnabled( cmdline.hasOption( 'd' ) );
         cmd.setVerboseEnabled( cmdline.hasOption( 'v' ) );
         cmd.setVersion( tools.getProductVersion() );
-
-        if ( cmdline.hasOption( 'c' ) && ( cmdline.getOptionValue( 'i' ) == null ) )
-        {
-            System.err.println( "forced configuration load (-c) requires the -i option" );
-            System.exit( 1 );
-        }
-
-        try
+        if ( cmdline.getOptionValue( 'i' ) != null )
         {
-            cmd.execute( cmdline, new ListenerParameter[]
-                { new ListenerParameter( BaseToolCommandExecutor.OUTPUTLISTENER_PARAMETER, outputListener ),
-                    new ListenerParameter( BaseToolCommandExecutor.ERRORLISTENER_PARAMETER, errorListener ),
-                    new ListenerParameter( BaseToolCommandExecutor.EXCEPTIONLISTENER_PARAMETER, exceptionListener ) } );
+            cmd.setLayout( cmdline.getOptionValue( 'i' ) );
+            if ( !cmd.isQuietEnabled() )
+            {
+                System.out.println( "loading settings from: " + cmd.getLayout().getConfigurationFile() );
+            }
+            ApplicationContext factory = null;
+            URL configUrl = cmd.getLayout().getConfigurationFile().toURL();
+            factory = new FileSystemXmlApplicationContext( configUrl.toString() );
+            cmd.setApacheDS( ( ApacheDS ) factory.getBean( "apacheDS" ) );
         }
-        catch ( Exception e )
+        else if ( cmdline.hasOption( 'c' ) )
         {
-            System.err.println( "An error has occurred. Apache DS Tools must quit." + "\nError: " + e.getMessage() );
+            System.err.println( "forced configuration load (-c) requires the -i option" );
             System.exit( 1 );
         }
+
+        cmd.execute( cmdline );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java Wed Apr 16 19:55:38 2008
@@ -37,14 +37,6 @@
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.cli.PosixParser;
 import org.apache.commons.cli.UnrecognizedOptionException;
-import org.apache.directory.server.tools.commands.diagnosticcmd.DiagnosticCommandCL;
-import org.apache.directory.server.tools.commands.disconnectnotificationcmd.DisconnectNotificationCommandCL;
-import org.apache.directory.server.tools.commands.dumpcmd.DumpCommandCL;
-import org.apache.directory.server.tools.commands.exportcmd.ExportCommandCL;
-import org.apache.directory.server.tools.commands.gracefulshutdowncmd.GracefulShutdownCommandCL;
-import org.apache.directory.server.tools.commands.importcmd.ImportCommandCL;
-import org.apache.directory.server.tools.commands.storedprocedurecmd.StoredProcedureCommandCL;
-import org.apache.directory.server.tools.request.BaseToolCommandCL;
 
 
 /**
@@ -55,9 +47,9 @@
  */
 public class BaseCommand
 {
-    private Map<String, ToolCommand> commands = new HashMap<String, ToolCommand>();
+    private Map commands = new HashMap();
 
-    private List<String> commandsOrdered = new ArrayList<String>();
+    private List commandsOrdered = new ArrayList();
 
     private Options global = new Options();
 
@@ -80,37 +72,33 @@
 
     protected void init()
     {
-        BaseToolCommandCL command;
- 
-        command = new DiagnosticCommandCL();
-        commands.put( command.getName(), command );
-        commandsOrdered.add( command.getName() );
+        ToolCommand command;
 
-        command = new DumpCommandCL();
+        command = new DiagnosticCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
-        command = new GracefulShutdownCommandCL();
+        command = new DisconnectNotificationCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
-        command = new ImportCommandCL();
+        command = new DumpCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
-        command = new DisconnectNotificationCommandCL();
+        command = new CapacityTestCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
-        command = new ExportCommandCL();
+        command = new GracefulShutdownCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
-        
-        command = new StoredProcedureCommandCL();
+
+        command = new ImportCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
-//        command = new CapacityTestCommand();
+        command = new IndexCommand();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );
 
@@ -195,7 +183,7 @@
         }
 
         Options all = new Options();
-        BaseToolCommandCL cmd = ( BaseToolCommandCL ) getCommands().get( command );
+        ToolCommand cmd = ( ToolCommand ) getCommands().get( command );
 
         for ( Iterator ii = getGlobal().getOptions().iterator(); ii.hasNext(); )
         {
@@ -240,7 +228,7 @@
 
         if ( getCommands().containsKey( command ) )
         {
-            BaseToolCommandCL cmd = ( BaseToolCommandCL ) getCommands().get( command );
+            ToolCommand cmd = ( ToolCommand ) getCommands().get( command );
             HelpFormatter formatter = new HelpFormatter();
             formatter.printHelp( getProductCommand() + " " + cmd + " [options]", cmd.getOptions() );
         }
@@ -345,7 +333,7 @@
     }
 
 
-    public void setCommands( Map<String, ToolCommand> commands )
+    public void setCommands( Map commands )
     {
         this.commands = commands;
     }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java Wed Apr 16 19:55:38 2008
@@ -24,6 +24,8 @@
 import java.io.PrintWriter;
 import java.util.Hashtable;
 
+import javax.naming.NameAlreadyBoundException;
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.ldap.InitialLdapContext;
@@ -34,13 +36,9 @@
 import org.apache.commons.cli.Options;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.directory.daemon.AvailablePortFinder;
-import org.apache.directory.server.constants.ServerDNConstants;
-import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
-import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
-
 /**
  * A capacity testing tool.  This command will generate bogus user
  * entries and add them under a base DN.  It will output a table 
@@ -50,27 +48,27 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class CapacityTestCommand extends BaseToolCommand
+public class CapacityTestCommand extends ToolCommand
 {
     public static final String PORT_RANGE = "(" + AvailablePortFinder.MIN_PORT_NUMBER + ", "
         + AvailablePortFinder.MAX_PORT_NUMBER + ")";
 
-    private static final String baseDn = ServerDNConstants.USER_EXAMPLE_COM_DN;
-    
-    
+    private int port = 10389;
+    private String host = "localhost";
+    private String password = "secret";
+    private String baseDn = "ou=users,dc=example,dc=com";
+
+
     public CapacityTestCommand()
     {
         super( "capacity" );
-        port = DEFAULT_PORT;
-        host = DEFAULT_HOST;
-        password = DEFAULT_PASSWORD;
     }
 
 
     public void execute( CommandLine cmdline ) throws Exception
     {
         processOptions( cmdline );
-//        getLayout().verifyInstallation();
+        getLayout().verifyInstallation();
         String outputFile = cmdline.getOptionValue( 'f' );
         PrintWriter out = null;
 
@@ -82,7 +80,7 @@
         {
             out = new PrintWriter( new FileWriter( outputFile ) );
         }
-        
+
         if ( isDebugEnabled() )
         {
             out.println( "Parameters for capacity extended request:" );
@@ -91,15 +89,18 @@
             out.println( "password = " + password );
         }
 
-        Hashtable<String, Object> env = new Hashtable<String, Object>();
-        env.put( JndiPropertyConstants.JNDI_FACTORY_INITIAL, "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( JndiPropertyConstants.JNDI_PROVIDER_URL, "ldap://" + host + ":" + port );
-        env.put( "java.naming.security.principal", ServerDNConstants.ADMIN_SYSTEM_DN );
-        env.put( JndiPropertyConstants.JNDI_SECURITY_CREDENTIALS, password );
-        env.put( JndiPropertyConstants.JNDI_SECURITY_AUTHENTICATION, "simple" );
+        Hashtable env = new Hashtable();
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+        env.put( "java.naming.security.credentials", password );
+        env.put( "java.naming.security.authentication", "simple" );
 
         LdapContext ctx = new InitialLdapContext( env, null );
 
+        // create the base dn if it does not exist
+        createBase( ctx );
+
         StringBuffer dnBuf = new StringBuffer();
         StringBuffer outBuf = new StringBuffer();
         int counter = 0;
@@ -112,25 +113,42 @@
         {
             end = Integer.parseInt( cmdline.getOptionValue( 'e' ) );
         }
-        
+
         while ( counter < end )
         {
             counter++;
             Attributes attrs = generateLdif( counter );
             dnBuf.setLength( 0 );
             dnBuf.append( "uid=user." ).append( counter ).append( "," ).append( baseDn );
-            
+
             long startTime = System.currentTimeMillis();
             ctx.createSubcontext( dnBuf.toString(), attrs );
-            
+
             outBuf.setLength( 0 );
             outBuf.append( counter ).append( " " ).append( System.currentTimeMillis() - startTime );
             out.println( outBuf.toString() );
             out.flush();
         }
     }
-    
-    
+
+
+    private boolean createBase( LdapContext ctx ) throws NamingException
+    {
+        Attributes attrs = new AttributesImpl( "objectClass", "organizationalUnit", true );
+        attrs.put( "ou", "users" );
+
+        try
+        {
+            ctx.createSubcontext( "ou=users,dc=example,dc=com", attrs );
+            return true;
+        }
+        catch ( NameAlreadyBoundException e )
+        {
+            return false;
+        }
+    }
+
+
     private Attributes generateLdif( int counter )
     {
         Attributes attrs = new AttributesImpl( "objectClass", "top", true );
@@ -138,13 +156,13 @@
         oc.add( "person" );
         oc.add( "organizationalPerson" );
         oc.add( "inetOrgPerson" );
-        
+
         attrs.put( "givenName", RandomStringUtils.randomAlphabetic( 6 ) );
         attrs.put( "sn", RandomStringUtils.randomAlphabetic( 9 ) );
         attrs.put( "cn", RandomStringUtils.randomAlphabetic( 15 ) );
         attrs.put( "initials", RandomStringUtils.randomAlphabetic( 2 ) );
         attrs.put( "mail", RandomStringUtils.randomAlphabetic( 15 ) );
-        attrs.put( SchemaConstants.USER_PASSWORD_AT, "password" );
+        attrs.put( "userPassword", "password" );
         attrs.put( "telephoneNumber", RandomStringUtils.randomNumeric( 10 ) );
         attrs.put( "homePhone", RandomStringUtils.randomNumeric( 10 ) );
         attrs.put( "pager", RandomStringUtils.randomNumeric( 10 ) );
@@ -158,7 +176,7 @@
         attrs.put( "description", RandomStringUtils.randomAlphabetic( 20 ) );
         return attrs;
     }
-    
+
 
     private void processOptions( CommandLine cmd )
     {
@@ -202,15 +220,15 @@
                 System.out.println( "port overriden by -p option: " + port );
             }
         }
-//        else if ( getConfiguration() != null )
-//        {
-//            port = getConfiguration().getLdapPort();
-//
-//            if ( isDebugEnabled() )
-//            {
-//                System.out.println( "port overriden by server.xml configuration: " + port );
-//            }
-//        }
+        else if ( getApacheDS() != null )
+        {
+            port = getApacheDS().getLdapServer().getIpPort();
+
+            if ( isDebugEnabled() )
+            {
+                System.out.println( "port overriden by server.xml configuration: " + port );
+            }
+        }
         else if ( isDebugEnabled() )
         {
             System.out.println( "port set to default: " + port );
@@ -273,7 +291,6 @@
         op.setRequired( false );
         opts.addOption( op );
 
-        
         op = new Option( "s", "start", true, "start on id: number to start on (user.start)" );
         op.setRequired( false );
         opts.addOption( op );

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java Wed Apr 16 19:55:38 2008
@@ -19,18 +19,136 @@
  */
 package org.apache.directory.server.tools;
 
-import org.apache.directory.server.constants.ServerDNConstants;
+
+import java.io.File;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.Options;
+import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.server.configuration.ApacheDS;
 
 
 /**
- * Interface that must be extended by every type of command.
+ * Simple base class for tool commands.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
  */
-public interface ToolCommand
+public abstract class ToolCommand
 {
-    // Default values
-    public final static int DEFAULT_PORT = 10389;
-    public final static String DEFAULT_HOST = "localhost";
-    public final static String DEFAULT_PASSWORD = "secret";
-    public final static String DEFAULT_USER = ServerDNConstants.ADMIN_SYSTEM_DN;
-    public final static String DEFAULT_AUTH = "simple";
+    private final String name;
+    private boolean debugEnabled = false;
+    private boolean verboseEnabled = false;
+    private boolean quietEnabled = false;
+    private String version;
+    private InstallationLayout layout;
+    private ApacheDS apacheDS;
+
+
+    protected ToolCommand( String name )
+    {
+        this.name = name;
+    }
+
+
+    public abstract void execute( CommandLine cmd ) throws Exception;
+
+
+    public abstract Options getOptions();
+
+
+    public String getName()
+    {
+        return this.name;
+    }
+
+
+    public void setLayout( File installationDirectory )
+    {
+        this.layout = new InstallationLayout( installationDirectory );
+    }
+
+
+    public void setLayout( String installationPath )
+    {
+        this.layout = new InstallationLayout( installationPath );
+    }
+
+
+    public void setLayout( InstallationLayout layout )
+    {
+        this.layout = layout;
+    }
+
+
+    public InstallationLayout getLayout()
+    {
+        return layout;
+    }
+
+
+    public void setApacheDS( ApacheDS apacheDS )
+    {
+        this.apacheDS = apacheDS;
+    }
+
+
+    public ApacheDS getApacheDS()
+    {
+        return apacheDS;
+    }
+
+
+    public void setVersion( String version )
+    {
+        this.version = version;
+    }
+
+
+    public String getVersion()
+    {
+        return version;
+    }
+
+
+    public String toString()
+    {
+        return getName();
+    }
+
+
+    public void setDebugEnabled( boolean debugEnabled )
+    {
+        this.debugEnabled = debugEnabled;
+    }
+
+
+    public boolean isDebugEnabled()
+    {
+        return debugEnabled;
+    }
+
+
+    public void setVerboseEnabled( boolean verboseEnabled )
+    {
+        this.verboseEnabled = verboseEnabled;
+    }
+
+
+    public boolean isVerboseEnabled()
+    {
+        return verboseEnabled;
+    }
+
+
+    public void setQuietEnabled( boolean quietEnabled )
+    {
+        this.quietEnabled = quietEnabled;
+    }
+
+
+    public boolean isQuietEnabled()
+    {
+        return quietEnabled;
+    }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/manifest/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/manifest/MANIFEST.MF?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/manifest/MANIFEST.MF (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-tools/src/main/manifest/MANIFEST.MF Wed Apr 16 19:55:38 2008
@@ -2,38 +2,44 @@
 Main-Class: org.apache.directory.server.tools.ApachedsTools
 Class-Path: ../lib/logger.jar ../lib/daemon.jar ../lib/bootstrapper.jar 
  ../lib/antlr-2.7.6.jar 
- ../lib/apacheds-kerberos-shared-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-changepw-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-shared-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-kerberos-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-ldap-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-ntp-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-protocol-dns-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-core-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-core-shared-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-jdbm-store-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-btree-base-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-server-jndi-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-server-main-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-schema-registries-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-schema-bootstrap-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-bootstrap-partition-1.5.2-SNAPSHOT.jar 
- ../lib/apacheds-bootstrap-extract-1.5.2-SNAPSHOT.jar 
+ ../lib/apacheds-kerberos-shared-1.5.2.jar 
+ ../lib/apacheds-protocol-changepw-1.5.2.jar 
+ ../lib/apacheds-protocol-shared-1.5.2.jar 
+ ../lib/apacheds-protocol-kerberos-1.5.2.jar 
+ ../lib/apacheds-protocol-ldap-1.5.2.jar 
+ ../lib/apacheds-protocol-ntp-1.5.2.jar 
+ ../lib/apacheds-protocol-dns-1.5.2.jar 
+ ../lib/apacheds-core-1.5.2.jar 
+ ../lib/apacheds-core-constants-1.5.2.jar 
+ ../lib/apacheds-core-entry-1.5.2.jar 
+ ../lib/apacheds-core-shared-1.5.2.jar 
+ ../lib/apacheds-jdbm-store-1.5.2.jar 
+ ../lib/apacheds-btree-base-1.5.2.jar 
+ ../lib/apacheds-server-jndi-1.5.2.jar 
+ ../lib/apacheds-xbean-spring-1.5.2.jar 
+ ../lib/apacheds-server-main-1.5.2.jar 
+ ../lib/apacheds-schema-registries-1.5.2.jar 
+ ../lib/apacheds-schema-bootstrap-1.5.2.jar 
+ ../lib/apacheds-bootstrap-partition-1.5.2.jar 
+ ../lib/apacheds-bootstrap-extract-1.5.2.jar 
+ ../lib/shared-asn1-codec-0.9.10.jar 
+ ../lib/shared-asn1-0.9.10.jar 
+ ../lib/shared-ldap-0.9.10.jar 
+ ../lib/mina-core-1.1.6.jar 
+ ../lib/mina-filter-ssl-1.1.6.jar 
  ../lib/commons-collections-3.2.jar 
  ../lib/commons-lang-2.3.jar 
- ../lib/jcl104-over-slf4j-1.4.3.jar
-  ../lib/nlog4j-1.2.25.jar
-  ../lib/slf4j-api-1.4.3.jar 
  ../lib/commons-cli-1.1.jar 
  ../lib/jdbm-1.0.jar 
- ../lib/mina-core-1.1.6.jar 
- ../lib/shared-asn1-codec-0.9.9-SNAPSHOT.jar 
- ../lib/mina-filter-ssl-1.1.6.jar 
- ../lib/shared-asn1-0.9.9-SNAPSHOT.jar 
- ../lib/shared-ldap-0.9.9-SNAPSHOT.jar 
  ../lib/antlr-2.7.7.jar 
+ ../lib/xbean-spring-3.3.jar 
  ../lib/spring-beans-2.0.6.jar 
  ../lib/spring-context-2.0.6.jar 
  ../lib/spring-core-2.0.6.jar 
+ ../lib/jcl104-over-slf4j-1.4.3.jar 
+ ../lib/slf4j-api-1.4.3.jar 
+ ../lib/slf4j-log4j12-1.4.3.jar 
+ ../lib/log4j-1.2.14.jar 
+ ../lib/nlog4j-1.2.25.jar
 Specification-Title: apacheds-tools
 Specification-Version: 1.0

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-unit/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-unit/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-unit/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-unit/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-unit</artifactId>
   <name>ApacheDS Server Unit</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Wed Apr 16 19:55:38 2008
@@ -105,7 +105,23 @@
      */
     protected List<LdifEntry> loadTestLdif( boolean verifyEntries ) throws NamingException
     {
-        InputStream in = getClass().getResourceAsStream( getClass().getSimpleName() + ".ldif" );
+        return loadLdif( getClass().getResourceAsStream( getClass().getSimpleName() + ".ldif" ), verifyEntries );
+    }
+
+
+    /**
+     * Loads an LDIF from an input stream and adds the entries it contains to 
+     * the server.  It appears as though the administrator added these entries
+     * to the server.
+     *
+     * @param in the input stream containing the LDIF entries to load
+     * @param verifyEntries whether or not all entry additions are checked
+     * to see if they were in fact correctly added to the server
+     * @return a list of entries added to the server in the order they were added
+     * @throws NamingException of the load fails
+     */
+    protected List<LdifEntry> loadLdif( InputStream in, boolean verifyEntries ) throws NamingException
+    {
         if ( in == null )
         {
             return EMPTY_LIST;

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java Wed Apr 16 19:55:38 2008
@@ -29,6 +29,7 @@
 import javax.naming.directory.DirContext;
 import javax.naming.directory.InvalidAttributeIdentifierException;
 import javax.naming.directory.InvalidAttributeValueException;
+import javax.naming.directory.ModificationItem;
 import javax.naming.directory.NoSuchAttributeException;
 import javax.naming.directory.SchemaViolationException;
 import javax.naming.directory.SearchControls;
@@ -140,6 +141,49 @@
         assertNotNull( ctx );
         DirContext tori = ( DirContext ) ctx.lookup( RDN );
         assertNotNull( tori );
+    }
+
+
+    /**
+     * Remove an attribute which does not exist in an attribute making sure 
+     * it does not remove other values in that attribute.  Tests if the 
+     * following JIRA issue is still valid:
+     * 
+     *    https://issues.apache.org/jira/browse/DIRSERVER-1149
+     * 
+     * @throws NamingException
+     */
+    public void testRemoveAttemptWithoutChange() throws NamingException
+    {
+        // Get the attributes and check the contents
+        Attributes tori = ctx.getAttributes( RDN );
+        assertNotNull( tori.get( "objectClass" ) );
+        assertNotNull( tori.get( "cn" ) );
+        assertEquals( 1, tori.get( "cn" ).size() );
+        assertEquals( "Tori Amos", tori.get( "cn" ).get() );
+        assertNotNull( tori.get( "sn" ) );
+        
+        // Test an add operation first
+        ModificationItem mod = new ModificationItem( DirContext.ADD_ATTRIBUTE, new AttributeImpl( "cn", "foo" ) );
+        ctx.modifyAttributes( RDN, new ModificationItem[] { mod } );
+        tori = ctx.getAttributes( RDN );
+        assertNotNull( tori.get( "objectClass" ) );
+        assertNotNull( tori.get( "cn" ) );
+        assertEquals( 2, tori.get( "cn" ).size() );
+        assertEquals( "Tori Amos", tori.get( "cn" ).get( 0 ) );
+        assertEquals( "foo", tori.get( "cn" ).get( 1 ) );
+        assertNotNull( tori.get( "sn" ) );
+        
+        // Now test remove of value ( bar ) that does not exist in cn
+        mod = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, new AttributeImpl( "cn", "bar" ) );
+        ctx.modifyAttributes( RDN, new ModificationItem[] { mod } );
+        tori = ctx.getAttributes( RDN );
+        assertNotNull( tori.get( "objectClass" ) );
+        assertNotNull( tori.get( "cn" ) );
+        assertEquals( 2, tori.get( "cn" ).size() );
+        assertEquals( "Tori Amos", tori.get( "cn" ).get( 0 ) );
+        assertEquals( "foo", tori.get( "cn" ).get( 1 ) );
+        assertNotNull( tori.get( "sn" ) );
     }
 
 

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/ModifyReplaceITest.java Wed Apr 16 19:55:38 2008
@@ -20,22 +20,18 @@
 package org.apache.directory.server;
 
 
-import java.util.Hashtable;
-
-import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.unit.AbstractServerTest;
-import org.apache.directory.shared.ldap.message.AttributeImpl;
-import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 
 
 /**
@@ -46,69 +42,74 @@
  */
 public class ModifyReplaceITest extends AbstractServerTest
 {
-    DirContext ctx = null;
-
-
-    protected Attributes getPersonAttributes( String sn, String cn )
+    protected Attributes getPersonAttributes( String sn, String cn ) 
     {
-        Attributes attrs = new AttributesImpl();
-        Attribute ocls = new AttributeImpl( "objectClass" );
-        ocls.add( "top" );
-        ocls.add( "person" );
-        attrs.put( ocls );
-        attrs.put( "cn", cn );
-        attrs.put( "sn", sn );
+        Attributes attrs = new BasicAttributes();
+        Attribute ocls = new BasicAttribute("objectClass");
+        ocls.add("top");
+        ocls.add("person");
+        attrs.put(ocls);
+        attrs.put("cn", cn);
+        attrs.put("sn", sn);
 
         return attrs;
     }
 
-
-    protected void setUp() throws Exception
+    
+    /**
+     * Create a person entry and try to remove a not present attribute
+     */
+    public void testReplaceNotPresentAttribute() throws NamingException 
     {
-        super.setUp();
-        
-        Hashtable<String, Object> env = new Hashtable<String, Object>();
-        env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( Context.PROVIDER_URL, "ldap://localhost:" + super.port + "/ou=system" );
-        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
-        env.put( Context.SECURITY_CREDENTIALS, "secret" );
-        env.put( Context.SECURITY_AUTHENTICATION, "simple" );
+        Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
+        String rdn = "cn=Kate Bush";
+        sysRoot.createSubcontext( rdn, attrs );
 
-        ctx = new InitialDirContext( env );
-    }
+        Attribute attr = new BasicAttribute( "description" );
+        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
 
+        sysRoot.modifyAttributes( rdn, new ModificationItem[] { item } );
 
-    protected void tearDown() throws Exception
-    {
-        ctx.close();
-        super.tearDown();
-    }
+        SearchControls sctls = new SearchControls();
+        sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        String filter = "(sn=Bush)";
+        String base = "";
 
+        NamingEnumeration enm = sysRoot.search( base, filter, sctls );
+        while ( enm.hasMore() ) 
+        {
+            SearchResult sr = ( SearchResult ) enm.next();
+            attrs = sr.getAttributes();
+            Attribute cn = sr.getAttributes().get( "cn" );
+            assertNotNull( cn );
+            assertTrue( cn.contains("Kate Bush") );
+        }
+
+        sysRoot.destroySubcontext( rdn );
+    }
 
+    
     /**
-     * Create a person entry and try to remove a not present attribute
-     * 
-     * @throws NamingException 
+     * Create a person entry and try to remove a non existing attribute
      */
-    public void testReplaceNotPresentAttribute() throws NamingException
+    public void testReplaceNonExistingAttribute() throws NamingException 
     {
         Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
         String rdn = "cn=Kate Bush";
-        ctx.createSubcontext( rdn, attrs );
+        sysRoot.createSubcontext( rdn, attrs );
 
-        Attribute attr = new AttributeImpl( "description" );
-        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new BasicAttribute( "numberOfOctaves" );
+        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
 
-        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
-            { item } );
+        sysRoot.modifyAttributes(rdn, new ModificationItem[] { item });
 
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
 
-        NamingEnumeration enm = ctx.search( base, filter, sctls );
-        while ( enm.hasMore() )
+        NamingEnumeration enm = sysRoot.search( base, filter, sctls );
+        while ( enm.hasMore() ) 
         {
             SearchResult sr = ( SearchResult ) enm.next();
             attrs = sr.getAttributes();
@@ -117,34 +118,33 @@
             assertTrue( cn.contains( "Kate Bush" ) );
         }
 
-        ctx.destroySubcontext( rdn );
+        sysRoot.destroySubcontext( rdn );
     }
 
 
     /**
      * Create a person entry and try to remove a non existing attribute
-     * 
-     * @throws NamingException 
      */
-    public void testReplaceNonExistingAttribute() throws NamingException
+    public void testReplaceNonExistingAttributeManyMods() throws NamingException 
     {
         Attributes attrs = getPersonAttributes( "Bush", "Kate Bush" );
         String rdn = "cn=Kate Bush";
-        ctx.createSubcontext( rdn, attrs );
+        sysRoot.createSubcontext( rdn, attrs );
 
-        Attribute attr = new AttributeImpl( "l" );
-        ModificationItemImpl item = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr = new BasicAttribute( "numberOfOctaves" );
+        ModificationItem item = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
+        Attribute attr2 = new BasicAttribute( "description", "blah blah blah" );
+        ModificationItem item2 = new ModificationItem( DirContext.ADD_ATTRIBUTE, attr2 );
 
-        ctx.modifyAttributes( rdn, new ModificationItemImpl[]
-            { item } );
+        sysRoot.modifyAttributes(rdn, new ModificationItem[] { item, item2 });
 
         SearchControls sctls = new SearchControls();
         sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
         String filter = "(sn=Bush)";
         String base = "";
 
-        NamingEnumeration enm = ctx.search( base, filter, sctls );
-        while ( enm.hasMore() )
+        NamingEnumeration enm = sysRoot.search( base, filter, sctls );
+        while ( enm.hasMore() ) 
         {
             SearchResult sr = ( SearchResult ) enm.next();
             attrs = sr.getAttributes();
@@ -153,6 +153,6 @@
             assertTrue( cn.contains( "Kate Bush" ) );
         }
 
-        ctx.destroySubcontext( rdn );
+        sysRoot.destroySubcontext( rdn );
     }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/SchemaSearchITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/SchemaSearchITest.java?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/SchemaSearchITest.java (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-unit/src/test/java/org/apache/directory/server/SchemaSearchITest.java Wed Apr 16 19:55:38 2008
@@ -25,12 +25,14 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.unit.AbstractServerTest;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
 
 
 /**
@@ -148,4 +150,48 @@
         result.close();
     }
 
+    
+    /**
+     * Test case for DIRSERVER-1083: Search on an custom attribute added to 
+     * the dynamic schema fails when no result is found. 
+     */
+    public void testSearchingNewSchemaElements() throws Exception
+    {
+        // load the bogus active directory schema from the issue
+        super.loadLdif( getClass().getResourceAsStream( "active-directory.ldif" ), false );
+        
+        // create an entry with the schema objectClass personActiveDirectory
+        AttributesImpl person = new AttributesImpl( "objectClass", "top", true );
+        person.get( "objectClass" ).add( "person" );
+        person.get( "objectClass" ).add( "personActiveDirectory" );
+        person.put( "cn", "foobar" );
+        person.put( "sn", "bar" );
+        person.put( "pwdLastSet", "3" );
+        person.put( "SourceAD", "blah" );
+        person.put( "useraccountcontrol", "7" );
+        person.put( "sAMAccountName", "foobar" );
+        ctx.createSubcontext( "cn=foobar,ou=system", person );
+        
+        // Confirm creation with a lookup
+        Attributes read = ctx.getAttributes( "cn=foobar,ou=system" );
+        assertNotNull( read );
+        assertEquals( "3", read.get( "pwdLastSet" ).get() );
+        
+        // Now search for foobar with pwdLastSet value of 3
+        SearchControls searchControls = new SearchControls();
+        searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+        NamingEnumeration results = ctx.search( "ou=system", "(pwdLastSet=3)", searchControls );
+        assertTrue( results.hasMore() );
+        SearchResult result = ( SearchResult ) results.next();
+        assertNotNull( result );
+        assertEquals( "cn=foobar", result.getName() );
+        Attributes attributes = result.getAttributes();
+        assertEquals( "3", attributes.get( "pwdLastSet" ).get() );
+        results.close();
+        
+        // Now search with bogus value for pwdLastSet
+        results = ctx.search( "ou=system", "(pwdLastSet=300)", searchControls );
+        assertFalse( results.hasMore() );
+        results.close();
+    }
 }

Modified: directory/sandbox/akarasulu/bigbang/apacheds/server-xml/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/server-xml/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/server-xml/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/server-xml/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-server-xml</artifactId>
   <name>ApacheDS Server XML File</name>

Modified: directory/sandbox/akarasulu/bigbang/apacheds/utils/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/bigbang/apacheds/utils/pom.xml?rev=648932&r1=648931&r2=648932&view=diff
==============================================================================
--- directory/sandbox/akarasulu/bigbang/apacheds/utils/pom.xml (original)
+++ directory/sandbox/akarasulu/bigbang/apacheds/utils/pom.xml Wed Apr 16 19:55:38 2008
@@ -24,7 +24,7 @@
   <parent>
     <groupId>org.apache.directory.server</groupId>
     <artifactId>apacheds-parent</artifactId>
-    <version>1.5.2-SNAPSHOT</version>
+    <version>1.5.3-SNAPSHOT</version>
   </parent>
   <artifactId>apacheds-utils</artifactId>
   <name>ApacheDS Utils</name>

Propchange: directory/sandbox/akarasulu/bigbang/apacheds/xbean-spring/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Apr 16 19:55:38 2008
@@ -0,0 +1,6 @@
+target
+*.ipr
+*.iws
+.classpath
+.project
+.settings



Mime
View raw message