Author: akarasulu Date: Wed Mar 23 19:39:31 2005 New Revision: 158873 URL: http://svn.apache.org/viewcvs?view=rev&rev=158873 Log: changes ...
o modified docos to make the JNDI properties more clear as was asked in this JIRA request: http://issues.apache.org/jira/browse/DIREVE-133 o some formating of code o cleaned up top level project file Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/AuthenticatorConfigBuilder.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/PartitionConfigBuilder.java directory/apacheds/trunk/project.xml directory/apacheds/trunk/xdocs/users/jndi.xml Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/AuthenticatorConfigBuilder.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/AuthenticatorConfigBuilder.java?view=diff&r1=158872&r2=158873 ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/AuthenticatorConfigBuilder.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/AuthenticatorConfigBuilder.java Wed Mar 23 19:39:31 2005 @@ -23,7 +23,6 @@ import org.apache.ldap.common.util.StringTools; import org.apache.ldap.server.auth.AuthenticatorConfig; -import org.apache.ldap.server.auth.AuthenticatorConfig; import javax.naming.NamingException; Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java?view=diff&r1=158872&r2=158873 ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/CoreContextFactory.java Wed Mar 23 19:39:31 2005 @@ -504,27 +504,37 @@ // create authenticator context AuthenticatorContext authenticatorContext = new AuthenticatorContext(); + authenticatorContext.setRootNexus( nexus ); + authenticatorContext.setAllowAnonymous( allowAnonymous ); try // initialize default authenticators { // create anonymous authenticator AuthenticatorConfig authenticatorConfig = new AuthenticatorConfig(); + authenticatorConfig.setAuthenticatorName( "none" ); + authenticatorConfig.setAuthenticatorContext( authenticatorContext ); AbstractAuthenticator authenticator = new AnonymousAuthenticator(); + authenticator.init( authenticatorConfig ); + authenticationService.register( authenticator ); // create simple authenticator authenticatorConfig = new AuthenticatorConfig(); + authenticatorConfig.setAuthenticatorName( "simple" ); + authenticatorConfig.setAuthenticatorContext( authenticatorContext ); authenticator = new SimpleAuthenticator(); + authenticator.init( authenticatorConfig ); + authenticationService.register( authenticator ); } catch ( Exception e ) @@ -533,8 +543,8 @@ } AuthenticatorConfig[] configs = null; - configs = AuthenticatorConfigBuilder - .getAuthenticatorConfigs( initialEnv ); + + configs = AuthenticatorConfigBuilder.getAuthenticatorConfigs( initialEnv ); for ( int ii = 0; ii < configs.length; ii++ ) { @@ -543,10 +553,13 @@ configs[ii].setAuthenticatorContext( authenticatorContext ); String authenticatorClass = configs[ii].getAuthenticatorClass(); + Class clazz = Class.forName( authenticatorClass ); + Constructor constructor = clazz.getConstructor( new Class[] { } ); AbstractAuthenticator authenticator = ( AbstractAuthenticator ) constructor.newInstance( new Object[] { } ); + authenticator.init( configs[ii] ); authenticationService.register( authenticator ); @@ -575,7 +588,7 @@ * Create and add the Authorization service interceptor to before * interceptor chain. */ - state = new InvocationStateEnum[]{InvocationStateEnum.PREINVOCATION}; + state = new InvocationStateEnum[] {InvocationStateEnum.PREINVOCATION}; ConcreteNameComponentNormalizer normalizer; @@ -591,8 +604,11 @@ * Create and add the Eve Exception service interceptor to both the * before and onError interceptor chains. */ - state = new InvocationStateEnum[]{ - InvocationStateEnum.PREINVOCATION, InvocationStateEnum.FAILUREHANDLING}; + state = new InvocationStateEnum[] + { + InvocationStateEnum.PREINVOCATION, + InvocationStateEnum.FAILUREHANDLING + }; interceptor = new ServerExceptionService( nexus ); @@ -601,7 +617,7 @@ /* * Create and add the Eve schema service interceptor to before chain. */ - state = new InvocationStateEnum[]{InvocationStateEnum.PREINVOCATION}; + state = new InvocationStateEnum[] {InvocationStateEnum.PREINVOCATION}; interceptor = new SchemaService( nexus, globalRegistries, filterService ); @@ -611,9 +627,11 @@ * Create and add the Eve operational attribute managment service * interceptor to both the before and after interceptor chains. */ - state = new InvocationStateEnum[]{ + state = new InvocationStateEnum[] + { InvocationStateEnum.PREINVOCATION, - InvocationStateEnum.POSTINVOCATION}; + InvocationStateEnum.POSTINVOCATION + }; interceptor = new OperationalAttributeService( nexus, globalRegistries, filterService ); @@ -646,6 +664,7 @@ MatchingRuleRegistry reg = globalRegistries.getMatchingRuleRegistry(); // start getting all the parameters from the initial environment + ContextPartitionConfig[] configs = null; configs = PartitionConfigBuilder.getContextPartitionConfigs( initialEnv ); Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/PartitionConfigBuilder.java URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/PartitionConfigBuilder.java?view=diff&r1=158872&r2=158873 ============================================================================== --- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/PartitionConfigBuilder.java (original) +++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/PartitionConfigBuilder.java Wed Mar 23 19:39:31 2005 @@ -56,7 +56,9 @@ throws NamingException { final StringBuffer buf = new StringBuffer(); + final ContextPartitionConfig config = new ContextPartitionConfig(); + final LockableAttributesImpl attrs = new LockableAttributesImpl(); // -------------------------------------------------------------------- @@ -64,8 +66,11 @@ // -------------------------------------------------------------------- config.setId( id ); + config.setAttributes( attrs ); + buf.append( EnvKeys.SUFFIX ).append( id ); + String suffix = ( String ) env.get( buf.toString() ); if ( suffix != null ) @@ -80,7 +85,9 @@ // -------------------------------------------------------------------- buf.setLength( 0 ); + buf.append( EnvKeys.PARTITION_CLASS ).append( id ); + String partitionClass = ( String ) env.get( buf.toString() ); if ( partitionClass != null ) @@ -93,7 +100,9 @@ // -------------------------------------------------------------------- buf.setLength( 0 ); + buf.append( EnvKeys.PARTITION_PROPERTIES ).append( id ); + String properties = ( String ) env.get( buf.toString() ); if ( properties != null ) @@ -106,7 +115,9 @@ // -------------------------------------------------------------------- buf.setLength( 0 ); + buf.append( EnvKeys.INDICES ).append( id ); + String indexList = ( ( String ) env.get( buf.toString() ) ); if ( indexList == null || indexList.trim().length() == 0 ) @@ -116,6 +127,7 @@ else { indexList = StringTools.deepTrim( indexList ); + config.setIndices( indexList.split( " " ) ); } @@ -124,6 +136,7 @@ // -------------------------------------------------------------------- buf.setLength( 0 ); + buf.append( EnvKeys.ATTRIBUTES ).append( id ); /* @@ -133,9 +146,11 @@ * wrestle with individual key value pairs. */ String keyBase = buf.toString(); + if ( env.containsKey( keyBase ) ) { config.setAttributes( ( Attributes ) env.get( keyBase ) ); + return config; } @@ -145,26 +160,31 @@ * '.' and go on to try and detect all the keys and their attributes. */ buf.append( "." ); + keyBase = buf.toString(); + for ( Enumeration list = env.keys(); list.hasMoreElements(); ) { String attrKey = ( String ) list.nextElement(); if ( attrKey.startsWith( keyBase ) ) { - LockableAttributeImpl attr = new LockableAttributeImpl( attrs, - attrKey.substring( keyBase.length() ) ) ; + LockableAttributeImpl attr = new LockableAttributeImpl( attrs, attrKey.substring( keyBase.length() ) ) ; + String valueList = ( String ) env.get( attrKey ); if ( valueList == null || valueList.trim().length() == 0 ) { // add the empty attribute attrs.put( attr ); + continue; } valueList = StringTools.deepTrim( valueList ); + String[] values = valueList.split( " " ); + for ( int ii = 0; ii < values.length; ii++ ) { attr.add( values[ii] ); Modified: directory/apacheds/trunk/project.xml URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/project.xml?view=diff&r1=158872&r2=158873 ============================================================================== --- directory/apacheds/trunk/project.xml (original) +++ directory/apacheds/trunk/project.xml Wed Mar 23 19:39:31 2005 @@ -2,22 +2,12 @@ <project> <groupId>directory</groupId> - <artifactId>apacheds</artifactId> - <name>Apache Directory Server</name> <currentVersion>0.9-SNAPSHOT</currentVersion> - - <organization> - <name>The Apache Incubator</name> - <url>http://directory.apache.org</url> - <logo>http://directory.apache.org/images/apache-directory-logo.png</logo> - </organization> - - <inceptionYear>2003</inceptionYear> - <package>org.apache.ldap.server</package> - + <name>Apache Directory Project</name> + <url>http://directory.apache.org</url> <logo>http://directory.apache.org/images/apache-directory-logo.png</logo> - <url>http://directory.apache.org/apacheds/</url> + <inceptionYear>2003</inceptionYear> <issueTrackingUrl>http://issues.apache.org/jira/browse/DIREVE</issueTrackingUrl> @@ -45,16 +35,14 @@ </developerConnection> </repository> - <shortDescription>Apache Directory Server</shortDescription> - <description> The Apache Directory Server (ApacheDS) is an embeddable LDAPv3 directory - server. It is designed to be completely pluggable in every aspect - including backends and frontend handlers making making it an ideal - experimentation platform for LDAP protocol testing, and for use - in building other tools like like meta directories, and virtual - directories. ApacheDS aims to introduces stored procedures, triggers, - views, and queues to the world of LDAP. + server with other protocol plugins such as kerberos. It is designed to + be completely pluggable in every aspect including backends and frontend + handlers making making it an ideal experimentation platform for LDAP + protocol testing, and for use in building other tools like like meta + directories, and virtual directories. ApacheDS aims to introduces + stored procedures, triggers, views, and queues to the world of LDAP. </description> <mailingLists> Modified: directory/apacheds/trunk/xdocs/users/jndi.xml URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/xdocs/users/jndi.xml?view=diff&r1=158872&r2=158873 ============================================================================== --- directory/apacheds/trunk/xdocs/users/jndi.xml (original) +++ directory/apacheds/trunk/xdocs/users/jndi.xml Wed Mar 23 19:39:31 2005 @@ -44,7 +44,12 @@ <td>true</td> <td> The file system folder the server will use to store database files - and other things. + and other things. You can set server.wkdir to an absolute path + or to a relative path like so: +<source> +server.wkdir=/opt/apacheds/work +server.wkdir=tmp/work +</source> </td> </tr> @@ -52,7 +57,18 @@ <td>server.schemas</td> <td>true</td> <td> - The schema configuration settings. + The schema configuration settings. A space separated list of fully + qualified class names. These classes must extend AbstractBootstrapSchema + in the <code>org.apache.ldap.server.schema.bootstrap</code> package. + Here's an example: +<source> +server.schemas = org.apache.ldap.server.schema.bootstrap.SystemSchema + org.apache.ldap.server.schema.bootstrap.ApacheSchema + org.apache.ldap.server.schema.bootstrap.CoreSchema + org.apache.ldap.server.schema.bootstrap.CosineSchema + org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema + org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema +</source> </td> </tr> @@ -60,7 +76,8 @@ <td>server.disable.anonymous</td> <td>true</td> <td> - If present disables anonymous binds. + If present at all this key disables anonymous binds. The value of + the property is disregarded. By default anonymous binds are allowed. </td> </tr> @@ -69,7 +86,8 @@ <td>true</td> <td> If present when requesting an InitialContext this property forces - all partitions to sync their buffers to disk if they cache writes. + all partitions to sync their buffers to disk if their implementation + contains a cache. The value of the property is disregarded. </td> </tr> @@ -77,20 +95,20 @@ <td>server.operation.shutdown</td> <td>true</td> <td> - If present when requesting an InitialContext this property - gracefully shutsdown the server. It returns a useless DeadContext - which throws exceptions when used. + If present when requesting an InitialContext this property gracefully + shuts down the server. The returned context is a useless DeadContext + which throws exceptions when used. The value of the property is + disregarded. </td> </tr> - - <tr> <td>server.net.disable.protocol</td> <td>true</td> <td> - Used when starting up the server to disable the networking frontend - that handles LDAP protocol requests. + Used when starting up the server to disable the networking frontend that + handles LDAP protocol requests. The value of the property is disregarded. + By default the LDAP protocol is enabled. </td> </tr> @@ -99,7 +117,8 @@ <td>true</td> <td> Used to pass an existing network frontend to the server rather - than having the server create its own instance. + than having the server create its own instance. The value of + this property is a MINA ServiceRegistry instance. </td> </tr> @@ -116,8 +135,9 @@ <td>server.net.ldaps.port</td> <td>true</td> <td> - The LDAP port to use for servicing secure LDAP protocol requests if - not on the standard secure LDAP port: 636. + <b>WARNING</b>: ONLY FOR JDK 1.5 AND HIGHER. Optionally specifies the + LDAP port to use for servicing secure LDAP protocol requests. Secure + LDAP port 636 is usually used. </td> </tr> @@ -125,33 +145,48 @@ <td>server.db.partitions</td> <td>true</td> <td> - The list of database partition identifiers. + The list of database partition identifiers. If this is not specified + the only partition in the server is the system partition hanging off + of the ou=system context. The value is a space separated list of + partition names like 'apache example xyz123'. </td> </tr> <tr> <td>server.db.partition.suffix.</td> - <td>false when adding partitions</td> + <td>maybe</td> <td> A key base for listing the suffixes of database partitions. The - identifier for the partition is appended to this base to form the - key for the suffix of that partition. + identifier for the partition in the property above is appended to + this base to form the key for the suffix of that partition. Here + are some examples: +<source> +server.db.partition.suffix.apache=dc=apache,dc=org +server.db.partition.suffix.example=dc=example,dc=com +server.db.partition.suffix.xyz123=ou=xyz123 +</source> </td> </tr> <tr> <td>server.db.partition.indices.</td> - <td>true</td> + <td>maybe</td> <td> A key base for listing the indices for database partitions. The identifier for the partition is appended to this base to form the - key for the suffix of that partition. + key for the suffix of that partition. The value is a space + separated list of attributeType names. +<source> +server.db.partition.indicies.apache=dc ou locale cn +server.db.partition.indicies.example=dc ou locale cn uid +server.db.partition.indicies.xyz123=ou cn +</source> </td> </tr> <tr> <td>server.db.partition.attributes.</td> - <td>false when adding partitions</td> + <td>maybe</td> <td> A key base for listing the attributes and values for the suffix entries of partitions. The identifier for the partition is @@ -159,10 +194,20 @@ form the key for the attribuet in the suffix of that partition. More information on setting up partitions with this and other properties is <a href="./partitions.html">here</a>... +<source> +server.db.partition.attributes.apache.dc=apache +server.db.partition.attributes.apache.objectClass=domain top +</source> </td> </tr> </table> + + <p> + Note that the optional columns of some rows were labeled as 'maybe'. If a + partition is created then the respective property with the base would be + required. It is only required when the respective partition is being defined. + </p> </section> <section name="Embedding the Apache Directory Server"> @@ -238,8 +283,8 @@ and creates a new application partition for Apache entries off of the <b>dc=apache,dc=org</b> naming context in addition to the system partition. If you look closely at /var/ldap you'll see a directory - names apache where you'll find even more database files. This is a - separate database partition for apache entries. + named apache where you'll find even more database files. These files + are the database files for the separate partition for apache.org entries. </p> </section> </body>
