directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r374226 - in /directory/trunks/apacheds/simple: ./ sar/ sar/src/ sar/src/main/ sar/src/main/java/ sar/src/main/java/org/ sar/src/main/java/org/apache/ sar/src/main/java/org/apache/directory/ sar/src/main/java/org/apache/directory/server/ sa...
Date Thu, 02 Feb 2006 02:41:05 GMT
Author: akarasulu
Date: Wed Feb  1 18:41:00 2006
New Revision: 374226

URL: http://svn.apache.org/viewcvs?rev=374226&view=rev
Log:
Inital commit of Simon Temple's jboss sar contribution with some cleanup.  I 
have not tried this yet - too busy patching the sar plugin for m2 to make it
not include every dependency imaginable.  Now it works though and has been
deployed to the mojo repo.  This was given as an attachment in DIREVE-309:

http://issues.apache.org/jira/browse/DIREVE-309

TODO:
 o the code in mbeans needs some cleanup and checks
 o this needs to be tested to make sure the generated sar actually works


Added:
    directory/trunks/apacheds/simple/sar/   (with props)
    directory/trunks/apacheds/simple/sar/pom.xml
    directory/trunks/apacheds/simple/sar/src/
    directory/trunks/apacheds/simple/sar/src/main/
    directory/trunks/apacheds/simple/sar/src/main/java/
    directory/trunks/apacheds/simple/sar/src/main/java/org/
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryService.java
    directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryServiceMBean.java
    directory/trunks/apacheds/simple/sar/src/main/resources/
    directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/
    directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/jboss-service.xml
Modified:
    directory/trunks/apacheds/simple/pom.xml

Modified: directory/trunks/apacheds/simple/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/pom.xml?rev=374226&r1=374225&r2=374226&view=diff
==============================================================================
--- directory/trunks/apacheds/simple/pom.xml (original)
+++ directory/trunks/apacheds/simple/pom.xml Wed Feb  1 18:41:00 2006
@@ -66,6 +66,7 @@
         <module>main</module>
         <module>ssl</module>
         <module>unit</module>
+        <module>sar</module>
         <module>installers</module>
       </modules>
     </profile>
@@ -79,6 +80,7 @@
         <module>jndi</module>
         <module>main</module>
         <module>unit</module>
+        <module>sar</module>
         <module>installers</module>
       </modules>
       <build>

Propchange: directory/trunks/apacheds/simple/sar/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Feb  1 18:41:00 2006
@@ -0,0 +1,6 @@
+.classpath
+.wtpmodules
+.settings
+.deployables
+.cdtproject
+.project

Added: directory/trunks/apacheds/simple/sar/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/sar/pom.xml?rev=374226&view=auto
==============================================================================
--- directory/trunks/apacheds/simple/sar/pom.xml (added)
+++ directory/trunks/apacheds/simple/sar/pom.xml Wed Feb  1 18:41:00 2006
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.server.standalone.simple</groupId>
+    <artifactId>build</artifactId>
+    <version>0.9.4-SNAPSHOT</version>
+  </parent>
+  <artifactId>apacheds-sar</artifactId>
+  <name>Apache Directory Server Sar for JBoss 3.x</name>
+  <packaging>sar</packaging>  
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.directory.server.standalone.simple</groupId>
+      <artifactId>org.apache.ldap.server.standalone.simple.jndi</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+    </dependency>  
+    <dependency>
+      <groupId>org.apache.directory.daemon</groupId>
+      <artifactId>daemon-bootstrappers</artifactId>
+      <version>0.9.4-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-system</artifactId>
+      <version>3.2.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <version>1.2.19</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-core</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-beans</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+  </dependencies>
+  <repositories>
+    <repository>
+      <id>mojo.snapshots</id>
+      <name>Codehaus Snapshot Repository</name>
+      <url>http://snapshots.maven.codehaus.org/maven2</url>
+    </repository>
+  </repositories>
+  <build>
+    <plugins>
+      <plugin>
+        <extensions>true</extensions>
+        <groupId>org.codehaus.mojo</groupId>
+      	<artifactId>jboss-sar-maven-plugin</artifactId>
+        <configuration>
+          <excludes>
+            <exclude>
+aopalliance:aopalliance
+            </exclude>
+            <exclude>
+jasperreports:jasperreports
+            </exclude>
+            <exclude>
+asm:asm-util
+            </exclude>
+            <exclude>
+freemarker:freemarker
+            </exclude>
+            <exclude>
+asm:asm
+            </exclude>
+            <exclude>
+com.jamonapi:jamon
+            </exclude>
+            <exclude>
+velocity:velocity-dep
+            </exclude>
+            <exclude>
+commons-attributes:commons-attributes-compiler
+            </exclude>
+            <exclude>
+commons-attributes:commons-attributes-api
+            </exclude>
+            <exclude>
+cglib:cglib
+            </exclude>
+            <exclude>
+qdox:qdox
+            </exclude>
+            <exclude>
+org.springframework:spring-aop
+            </exclude>
+            <exclude>
+velocity:velocity
+            </exclude>
+            <exclude>
+aspectwerkz:aspectwerkz-core
+            </exclude>
+            <exclude>
+xml-apis:xml-apis
+            </exclude>
+            <exclude>
+commons-pool:commons-pool
+            </exclude>
+            <exclude>
+xerces:xerces
+            </exclude>
+            <exclude>
+ant:ant
+            </exclude>
+            <exclude>
+jboss:jboss-system
+            </exclude>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryService.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryService.java?rev=374226&view=auto
==============================================================================
--- directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryService.java (added)
+++ directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryService.java Wed Feb  1 18:41:00 2006
@@ -0,0 +1,844 @@
+/*
+ *   @(#) $Id:  $
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.directory.server.jmx;
+
+
+import org.apache.ldap.server.configuration.Configuration;
+import org.apache.ldap.server.configuration.MutableDirectoryPartitionConfiguration;
+import org.apache.ldap.server.configuration.MutableServerStartupConfiguration;
+import org.apache.ldap.server.configuration.ShutdownConfiguration;
+import org.apache.ldap.server.configuration.SyncConfiguration;
+import org.apache.ldap.server.jndi.ServerContextFactory;
+
+import org.apache.mina.registry.ServiceRegistry;
+import org.apache.mina.registry.SimpleServiceRegistry;
+
+import org.jboss.system.ServiceMBeanSupport;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.File;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.management.MBeanRegistration;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+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;
+
+
+/**
+ * JBoss 3.x Mbean for embedded and remote directory server support
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory
+ *         Project</a>
+ * @version $Rev:  $, $Date:  $
+ */
+public class DirectoryService extends ServiceMBeanSupport
+    implements DirectoryServiceMBean, MBeanRegistration
+{
+    //~ Static fields/initializers ---------------------------------------------
+
+    private static final Logger LOG = LoggerFactory.getLogger( DirectoryService.class );
+    private static final ServiceRegistry DEFAULT_MINA_REGISTRY = new SimpleServiceRegistry();
+
+    /** Default LDAP Listen Port */
+    public static final int DEFAULT_LDAP_PORT = 389;
+
+    /** Default LDAPS (SSL) Port */
+    public static final int DEFAULT_LDAPS_PORT = 636;
+
+    //~ Instance fields --------------------------------------------------------
+
+    private boolean embeddedServerEnabled = true;
+    private String wkDir = ".";
+    private String ldifDir = "./ldif";
+    private int ldapPort = DEFAULT_LDAP_PORT;
+    private int ldapsPort = DEFAULT_LDAPS_PORT;
+    private String customRootPartitionName = "com";
+    private String contextProviderURL = "uid=admin,ou=system";
+    private String securityAuthentication = "simple";
+    private String securityCredentials = "secret";
+    private String securityPrincipal = "uid=admin,ou=system";
+    private boolean anonymousAccess = false;
+    private boolean ldapNetworkingSupport = false;
+    private String contextFactory = ServerContextFactory.class.getName(  );
+    private Element additionalEnv = null;
+    private Element customSchema = null;
+    private Element ldifFilters = null;
+    private boolean accessControlEnabled = false;
+    private boolean enableNtp = false;
+    private boolean enableKerberos = false;
+    private boolean enableChangePassword = false;
+
+    //~ Methods ----------------------------------------------------------------
+
+    protected void startService(  ) throws Exception
+    {
+        // Build the properties from bean attributes
+        Hashtable env = createContextEnv(  );
+
+        if ( embeddedServerEnabled )
+        {
+            if ( LOG.isInfoEnabled(  ) )
+            {
+                LOG.info( "Starting Embedded Directory Server..." );
+            }
+
+            // Create the baseline configuration
+            MutableServerStartupConfiguration cfg = new MutableServerStartupConfiguration();
+
+            /* *************** Update the baseline configuration ***************** */
+            // Access Control
+            cfg.setAccessControlEnabled( this.accessControlEnabled );
+            cfg.setAllowAnonymousAccess( this.anonymousAccess );
+
+            // Wire protocols
+            cfg.setMinaServiceRegistry( DEFAULT_MINA_REGISTRY );
+
+            cfg.setEnableNetworking( this.ldapNetworkingSupport );
+            cfg.setLdapPort( this.ldapPort );
+            cfg.setLdapsPort( this.ldapsPort );
+
+            cfg.setEnableNtp( enableNtp );
+            cfg.setEnableKerberos( enableKerberos );
+            cfg.setEnableChangePassword( enableChangePassword );
+
+            // Work folder
+            cfg.setWorkingDirectory( new File( this.wkDir ) );
+
+            // LDIF import 
+            cfg.setLdifDirectory( new File( this.ldifDir ) );
+            cfg.setLdifFilters( addCustomLdifFilters(  ) );
+
+            // Addditional bootstrap schema 
+            cfg.setBootstrapSchemas( addCustomBootstrapSchema( 
+                    cfg.getBootstrapSchemas(  ) ) );
+
+            // Single custom partition
+            if ( ( null != this.customRootPartitionName ) &&
+                    ( this.customRootPartitionName.length(  ) > 0 ) )
+            {
+                if ( LOG.isDebugEnabled(  ) )
+                {
+                    LOG.debug( "Adding custom root partition name: " +
+                        this.customRootPartitionName );
+                }
+
+                Set pcfgs = addCustomPartition(  );
+                cfg.setContextPartitionConfigurations( pcfgs );
+            }
+
+            // Put the configuration instruction to the environment variable.
+            env.putAll( cfg.toJndiEnvironment(  ) );
+
+            new InitialDirContext( env );
+        }
+        else
+        {
+            if ( LOG.isWarnEnabled(  ) )
+            {
+                LOG.warn( 
+                    "No Embedded directory server requested.  All directory access will be via remote LDAP interface." );
+            }
+        }
+
+        if ( LOG.isDebugEnabled(  ) )
+        {
+            LOG.debug( "Directory Environment:" );
+
+            Enumeration en = env.keys(  );
+
+            while ( en.hasMoreElements(  ) )
+            {
+                Object key = en.nextElement(  );
+                LOG.debug( "    " + key + ":" + env.get( key ) );
+            }
+        }
+    }
+
+    private List addCustomLdifFilters(  )
+    {
+        List filters = new ArrayList(  );
+
+        Hashtable ht = getPropertiesFromElement( ldifFilters );
+        Enumeration en = ht.elements(  );
+        Class clazz = null;
+
+        while ( en.hasMoreElements(  ) )
+        {
+            try
+            {
+                clazz = Class.forName( ( String ) en.nextElement(  ) );
+                filters.add( clazz.newInstance(  ) );
+            }
+            catch ( Exception e )
+            {
+                if ( LOG.isErrorEnabled(  ) )
+                {
+                    LOG.error( e.toString(  ) );
+                }
+            }
+        }
+
+        return filters;
+    }
+
+    private Set addCustomBootstrapSchema( Set schema )
+    {
+        Hashtable ht = getPropertiesFromElement( customSchema );
+        Enumeration en = ht.elements(  );
+        Class clazz = null;
+
+        while ( en.hasMoreElements(  ) )
+        {
+            try
+            {
+                clazz = Class.forName( ( String ) en.nextElement(  ) );
+                schema.add( clazz.newInstance(  ) );
+            }
+            catch ( Exception e )
+            {
+                if ( LOG.isErrorEnabled(  ) )
+                {
+                    LOG.error( e.toString(  ) );
+                }
+            }
+        }
+
+        return schema;
+    }
+
+    private void addAdditionalEnv( Hashtable env )
+    {
+        Hashtable ht = getPropertiesFromElement( additionalEnv );
+        Enumeration en = ht.keys(  );
+        String key = null;
+
+        while ( en.hasMoreElements(  ) )
+        {
+            key = ( String ) en.nextElement(  );
+            env.put( key, ( String ) ht.get( key ) );
+        }
+    }
+
+    private Hashtable createContextEnv(  )
+    {
+        Hashtable env = new Properties(  );
+
+        addAdditionalEnv( env );
+
+        env.put( Context.PROVIDER_URL, this.contextProviderURL );
+        env.put( Context.INITIAL_CONTEXT_FACTORY, this.contextFactory );
+
+        env.put( Context.SECURITY_AUTHENTICATION, this.securityAuthentication );
+        env.put( Context.SECURITY_PRINCIPAL, this.securityPrincipal );
+        env.put( Context.SECURITY_CREDENTIALS, this.securityCredentials );
+
+        if ( this.isEmbeddedServerEnabled(  ) )
+        {
+            // This is bug-or-wierdness workaround for in-VM access to the DirContext of ApacheDS
+            env.put( Configuration.JNDI_KEY, new SyncConfiguration(  ) );
+        }
+
+        return env;
+    }
+
+    private Set addCustomPartition(  )
+    {
+        BasicAttributes attrs;
+        Set indexedAttrs;
+        BasicAttribute attr;
+        Set pcfgs = new HashSet(  );
+        MutableDirectoryPartitionConfiguration pcfg;
+        pcfg = new MutableDirectoryPartitionConfiguration(  );
+
+        pcfg.setName( this.customRootPartitionName );
+        pcfg.setSuffix( "dc=" + this.customRootPartitionName );
+
+        indexedAttrs = new HashSet(  );
+        indexedAttrs.add( "ou" );
+        indexedAttrs.add( "dc" );
+        indexedAttrs.add( "objectClass" );
+        pcfg.setIndexedAttributes( indexedAttrs );
+
+        attrs = new BasicAttributes( true );
+
+        attr = new BasicAttribute( "objectClass" );
+        attr.add( "top" );
+        attr.add( "domain" );
+        attr.add( "extensibleObject" );
+        attrs.put( attr );
+
+        attr = new BasicAttribute( "dc" );
+        attr.add( this.customRootPartitionName );
+        attrs.put( attr );
+
+        pcfg.setContextEntry( attrs );
+
+        pcfgs.add( pcfg );
+
+        return pcfgs;
+    }
+
+    protected void stopService(  ) throws Exception
+    {
+        if ( embeddedServerEnabled )
+        {
+            if ( LOG.isInfoEnabled(  ) )
+            {
+                LOG.info( "Stopping Embedded Directory Server..." );
+            }
+
+            // Create a configuration instruction.
+            ShutdownConfiguration cfg = new ShutdownConfiguration(  );
+
+            // Build the properties from bean attributes
+            Hashtable env = createContextEnv(  );
+
+            // Put the configuration instruction to the environment variable.
+            env.putAll( cfg.toJndiEnvironment(  ) );
+
+            new InitialDirContext( env );
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getContextProviderURL()
+     */
+    public String getContextProviderURL(  )
+    {
+        return this.contextProviderURL;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getContextSecurityAuthentication()
+     */
+    public String getContextSecurityAuthentication(  )
+    {
+        return this.securityAuthentication;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getContextSecurityCredentials()
+     */
+    public String getContextSecurityCredentials(  )
+    {
+        return this.securityCredentials;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getContextSecurityPrincipal()
+     */
+    public String getContextSecurityPrincipal(  )
+    {
+        return this.securityPrincipal;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedCustomRootPartitionName()
+     */
+    public String getEmbeddedCustomRootPartitionName(  )
+    {
+        return this.customRootPartitionName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedLDAPPort()
+     */
+    public int getEmbeddedLDAPPort(  )
+    {
+        return this.ldapPort;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedLDAPSPort()
+     */
+    public int getEmbeddedLDAPSPort(  )
+    {
+        return this.ldapsPort;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedLDIFdir()
+     */
+    public String getEmbeddedLDIFdir(  )
+    {
+        return this.ldifDir;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedWkdir()
+     */
+    public String getEmbeddedWkdir(  )
+    {
+        return this.wkDir;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedAnonymousAccess()
+     */
+    public boolean isEmbeddedAnonymousAccess(  )
+    {
+        return this.anonymousAccess;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedLDAPNetworkingSupport()
+     */
+    public boolean isEmbeddedLDAPNetworkingSupport(  )
+    {
+        return this.ldapNetworkingSupport;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedServerEnabled()
+     */
+    public boolean isEmbeddedServerEnabled(  )
+    {
+        return this.embeddedServerEnabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#openDirContext()
+     */
+    public DirContext openDirContext(  ) throws NamingException
+    {
+        Hashtable env = createContextEnv(  );
+
+        return new InitialDirContext( env );
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setContextProviderURL(java.lang.String)
+     */
+    public void setContextProviderURL( String providerURL )
+    {
+        this.contextProviderURL = providerURL;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setContextSecurityAuthentication(java.lang.String)
+     */
+    public void setContextSecurityAuthentication( String securityAuthentication )
+    {
+        this.securityAuthentication = securityAuthentication;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setContextSecurityCredentials(java.lang.String)
+     */
+    public void setContextSecurityCredentials( String securityCredentials )
+    {
+        this.securityCredentials = securityCredentials;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setContextSecurityprincipal(java.lang.String)
+     */
+    public void setContextSecurityPrincipal( String securityPrincipal )
+    {
+        this.securityPrincipal = securityPrincipal;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedAnonymousAccess(boolean)
+     */
+    public void setEmbeddedAnonymousAccess( boolean anonymousAccess )
+    {
+        this.anonymousAccess = anonymousAccess;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedCustomRootPartitionName(java.lang.String)
+     */
+    public void setEmbeddedCustomRootPartitionName( String rootPartitianName )
+    {
+        this.customRootPartitionName = rootPartitianName;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedLDAPNetworkingSupport(boolean)
+     */
+    public void setEmbeddedLDAPNetworkingSupport( boolean ldapNetworkingSupport )
+    {
+        this.ldapNetworkingSupport = ldapNetworkingSupport;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedLDAPPort(int)
+     */
+    public void setEmbeddedLDAPPort( int ldapPort )
+    {
+        this.ldapPort = ldapPort;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedLDAPSPort(int)
+     */
+    public void setEmbeddedLDAPSPort( int ldapsPort )
+    {
+        this.ldapsPort = ldapsPort;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedLDIFdir(java.lang.String)
+     */
+    public void setEmbeddedLDIFdir( String LDIFdir )
+    {
+        this.ldifDir = LDIFdir;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedServerEnabled(boolean)
+     */
+    public void setEmbeddedServerEnabled( boolean enabled )
+    {
+        this.embeddedServerEnabled = enabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedWkdir(java.lang.String)
+     */
+    public void setEmbeddedWkdir( String wkdir )
+    {
+        this.wkDir = wkdir;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getContextFactory()
+     */
+    public String getContextFactory(  )
+    {
+        return this.contextFactory;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setContextFactory(java.lang.String)
+     */
+    public void setContextFactory( String factoryClass )
+    {
+        this.contextFactory = factoryClass;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#changedEmbeddedAdminPassword(java.lang.String, java.lang.String)
+     */
+    public String changedEmbeddedAdminPassword( String oldPassword,
+        String newPassword )
+    {
+        if ( embeddedServerEnabled )
+        {
+            if ( this.securityCredentials.equals( oldPassword ) )
+            {
+                ModificationItem[] mods = new ModificationItem[ 1 ];
+                Attribute password = new BasicAttribute( "userpassword",
+                        newPassword );
+                mods[ 0 ] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE,
+                        password );
+
+                try
+                {
+                    DirContext dc = openDirContext(  );
+
+                    dc.modifyAttributes( "", mods );
+                    dc.close(  );
+                }
+                catch ( NamingException e )
+                {
+                    String msg = "Failed modifying directory password attribute: " +
+                        e;
+
+                    if ( LOG.isErrorEnabled(  ) )
+                    {
+                        LOG.error( msg );
+                    }
+
+                    return msg;
+                }
+
+                this.securityCredentials = newPassword;
+
+                return "Password change successful.";
+            }
+            else
+            {
+                return "Invalid oldPassword given.";
+            }
+        }
+        else
+        {
+            String msg = "Unable to change password as embedded server is not enabled.";
+
+            if ( LOG.isWarnEnabled(  ) )
+            {
+                LOG.warn( msg );
+            }
+
+            return msg;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#flushEmbeddedServerData()
+     */
+    public boolean flushEmbeddedServerData(  )
+    {
+        if ( embeddedServerEnabled )
+        {
+            try
+            {
+                if ( LOG.isInfoEnabled(  ) )
+                {
+                    LOG.info( "Syncing Embedded Directory Server..." );
+                }
+
+                // Create a configuration instruction.
+                SyncConfiguration cfg = new SyncConfiguration(  );
+
+                // Build the properties from bean attributes
+                Hashtable env = createContextEnv(  );
+
+                // Put the configuration instruction to the environment variable.
+                env.putAll( cfg.toJndiEnvironment(  ) );
+
+                if ( LOG.isDebugEnabled(  ) )
+                {
+                    LOG.info( "Directory Properties:" );
+
+                    Enumeration en = env.keys(  );
+
+                    while ( en.hasMoreElements(  ) )
+                    {
+                        Object key = en.nextElement(  );
+                        LOG.debug( "    " + key + ":" + env.get( key ) );
+                    }
+                }
+
+                new InitialDirContext( env );
+
+                return true;
+            }
+            catch ( NamingException e )
+            {
+                if ( LOG.isErrorEnabled(  ) )
+                {
+                    LOG.error( e.toString(  ) );
+                }
+            }
+        }
+        else
+        {
+            if ( LOG.isWarnEnabled(  ) )
+            {
+                LOG.warn( "Unable to flush as embedded server is not enabled." );
+            }
+        }
+
+        return false;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedAdditionalEnvProperties()
+     */
+    public Element getEmbeddedAdditionalEnvProperties(  )
+    {
+        return this.additionalEnv;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedCustomBootstrapSchemas()
+     */
+    public Element getEmbeddedCustomBootstrapSchema(  )
+    {
+        return this.customSchema;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedAdditionalEnvProperties(java.util.Properties)
+     */
+    public void setEmbeddedAdditionalEnvProperties( Element env )
+    {
+        this.additionalEnv = env;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedCustomBootstrapSchemas(java.util.Properties)
+     */
+    public void setEmbeddedCustomBootstrapSchema( Element cfg )
+    {
+        this.customSchema = cfg;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedAccessControlEnabled()
+     */
+    public boolean isEmbeddedAccessControlEnabled(  )
+    {
+        return this.accessControlEnabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedEnableChangePassword()
+     */
+    public boolean isEmbeddedEnableChangePassword(  )
+    {
+        return this.enableChangePassword;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedEnableKerberos()
+     */
+    public boolean isEmbeddedEnableKerberos(  )
+    {
+        return this.enableKerberos;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#isEmbeddedEnableNtp()
+     */
+    public boolean isEmbeddedEnableNtp(  )
+    {
+        return this.enableNtp;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedAccessControlEnabled(boolean)
+     */
+    public void setEmbeddedAccessControlEnabled( boolean enabled )
+    {
+        this.accessControlEnabled = enabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedEnableChangePassword(boolean)
+     */
+    public void setEmbeddedEnableChangePassword( boolean enabled )
+    {
+        this.enableChangePassword = enabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedEnableKerberos(boolean)
+     */
+    public void setEmbeddedEnableKerberos( boolean enabled )
+    {
+        this.enableKerberos = enabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedEnableNtp(boolean)
+     */
+    public void setEmbeddedEnableNtp( boolean enabled )
+    {
+        this.enableNtp = enabled;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#getEmbeddedLDIFFilters()
+     */
+    public Element getEmbeddedLDIFFilters(  )
+    {
+        return this.ldifFilters;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.ldap.server.jmx.DirectoryServiceMBean#setEmbeddedLDIFFilters(org.w3c.dom.Element)
+     */
+    public void setEmbeddedLDIFFilters( Element fil )
+    {
+        this.ldifFilters = fil;
+    }
+
+    // Embedded lists inside the Mbean service definition are made available as DOM elements
+    // and are parsed into a java collection before use
+    private Hashtable getPropertiesFromElement( Element element )
+    {
+        Hashtable ht = new Hashtable(  );
+
+        if ( null != element )
+        {
+            if ( LOG.isInfoEnabled(  ) )
+            {
+                LOG.info( "Adding custom configuration elements:" );
+            }
+
+            NodeList nl = element.getChildNodes(  );
+            Node el = null;
+
+            for ( int ii = 0; ii < nl.getLength(  ); ii++ )
+            {
+                el = nl.item( ii );
+
+                String val = null;
+                String name = null;
+
+                if ( el.getNodeType(  ) == Node.ELEMENT_NODE )
+                {
+                    name = el.getAttributes(  ).getNamedItem( "name" )
+                             .getNodeValue(  );
+
+                    NodeList vnl = el.getChildNodes(  );
+
+                    for ( int jj = 0; jj < vnl.getLength(  ); jj++ )
+                    {
+                        el = vnl.item( jj );
+
+                        if ( el.getNodeType(  ) == Node.TEXT_NODE )
+                        {
+                            val = el.getNodeValue(  );
+
+                            break;
+                        }
+                    }
+
+                    if ( ( null != name ) && ( null != val ) )
+                    {
+                        if ( LOG.isInfoEnabled(  ) )
+                        {
+                            LOG.info( "    " + name + ": " + val );
+                        }
+
+                        ht.put( name, val );
+
+                        break;
+                    }
+                }
+            }
+        }
+
+        return ht;
+    }
+}

Added: directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryServiceMBean.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryServiceMBean.java?rev=374226&view=auto
==============================================================================
--- directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryServiceMBean.java (added)
+++ directory/trunks/apacheds/simple/sar/src/main/java/org/apache/directory/server/jmx/DirectoryServiceMBean.java Wed Feb  1 18:41:00 2006
@@ -0,0 +1,359 @@
+/*
+ *   @(#) $Id:  $
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.directory.server.jmx;
+
+import org.w3c.dom.Element;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+
+/**
+ * JBoss 3.x Mbean interface for embedded and remote directory server support
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory
+ *         Project</a>
+ * @version $Rev:  $, $Date:  $
+ */
+public interface DirectoryServiceMBean extends org.jboss.system.ServiceMBean
+{
+    //~ Methods ----------------------------------------------------------------
+
+    /**
+     * Gets the root element of the XML properties list of defined LDIF filters
+     *
+     * @return The root DOM element
+     */
+    public Element getEmbeddedLDIFFilters(  );
+
+    /**
+     * Sets the root element of the XML properties list of defined LDIF filters
+     *
+     * @param fil The root DOM element
+     */
+    public void setEmbeddedLDIFFilters( Element fil );
+
+    /**
+     * Gets the root element of the XML properties list of additional
+     * environment properties
+     *
+     * @return The root DOM element
+     */
+    public Element getEmbeddedAdditionalEnvProperties(  );
+
+    /**
+     * Sets the root element of the XML properties list of additional
+     * environment properties
+     *
+     * @param env The root DOM element
+     */
+    public void setEmbeddedAdditionalEnvProperties( Element env );
+
+    /**
+     * Gets the root element of the XML properties list of custom bootstrap
+     * schema properties
+     *
+     * @return The root DOM element
+     */
+    public Element getEmbeddedCustomBootstrapSchema(  );
+
+    /**
+     * Sets the root element of the XML properties list of custom bootstrap
+     * schema properties
+     *
+     * @param cfg The root DOM element
+     */
+    public void setEmbeddedCustomBootstrapSchema( Element cfg );
+
+    /**
+     * Test to see if the directory service to use is embedded in this VM
+     *
+     * @return True if embedded else false
+     */
+    public boolean isEmbeddedServerEnabled(  );
+
+    /**
+     * Set if the directory service to use is embedded in this VM
+     *
+     * @param enabled True if embedded else false
+     */
+    public void setEmbeddedServerEnabled( boolean enabled );
+
+    /**
+     * Gets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY
+     *
+     * @return Context.INITIAL_CONTEXT_FACTORY
+     */
+    public String getContextFactory(  );
+
+    /**
+     * Sets the name-to-object binding for Context INITIAL_CONTEXT_FACTORY
+     *
+     * @param factoryClass Context.INITIAL_CONTEXT_FACTORY value
+     */
+    public void setContextFactory( String factoryClass );
+
+    /**
+     * Gets the name-to-object binding for Context PROVIDER_URL
+     *
+     * @return Context.PROVIDER_URL
+     */
+    public String getContextProviderURL(  );
+
+    /**
+     * Sets the name-to-object binding for Context PROVIDER_URL
+     *
+     * @param providerURL Context.PROVIDER_URL value
+     */
+    public void setContextProviderURL( String providerURL );
+
+    /**
+     * Gets the name-to-object binding for Context SECURITY_AUTHENTICATION
+     *
+     * @return Context.SECURITY_AUTHENTICATION
+     */
+    public String getContextSecurityAuthentication(  );
+
+    /**
+     * Sets the name-to-object binding for Context SECURITY_AUTHENTICATION
+     *
+     * @param securityAuthentication Context.SECURITY_AUTHENTICATION value
+     */
+    public void setContextSecurityAuthentication( String securityAuthentication );
+
+    /**
+     * Gets the name-to-object binding for Context SECURITY_PRINCIPAL
+     *
+     * @return Context.SECURITY_PRINCIPAL
+     */
+    public String getContextSecurityPrincipal(  );
+
+    /**
+     * Sets the name-to-object binding for Context SECURITY_PRINCIPAL
+     *
+     * @param securityPrincipal Context.SECURITY_PRINCIPAL value
+     */
+    public void setContextSecurityPrincipal( String securityPrincipal );
+
+    /**
+     * Gets the name-to-object binding for Context SECURITY_CREDENTIALS
+     *
+     * @return Context.SECURITY_CREDENTIALS
+     */
+    public String getContextSecurityCredentials(  );
+
+    /**
+     * Sets the name-to-object binding for Context SECURITY_CREDENTIALS
+     *
+     * @param securityCredentials Context.SECURITY_CREDENTIALS value
+     */
+    public void setContextSecurityCredentials( String securityCredentials );
+
+    /**
+     * Opens a directory context based on the currently assigned name-to-object
+     * bindings
+     *
+     * @return A valid directory context or null on error
+     */
+    public DirContext openDirContext(  ) throws NamingException;
+
+    /**
+     * Embedded server only - Flushes out any I/O buffer or write cache
+     *
+     * @return True if flush succeeded else false
+     */
+    public boolean flushEmbeddedServerData(  );
+
+    /**
+     * Embedded server only - Changes the current password of the uid=admin
+     * user
+     *
+     * @param oldPassword Old password for verification
+     * @param newPassword New password to use
+     *
+     * @return Confirmation message for UI display
+     */
+    public String changedEmbeddedAdminPassword( String oldPassword,
+        String newPassword );
+
+    /**
+     * Embedded server only - tests if anonymous access is permitted
+     *
+     * @return True if permitted else false
+     */
+    public boolean isEmbeddedAnonymousAccess(  );
+
+    /**
+     * Embedded server only - sests if anonymous access is permitted
+     *
+     * @param anonymousAccess True to allow else false
+     */
+    public void setEmbeddedAnonymousAccess( boolean anonymousAccess );
+
+    /**
+     * Embedded server only - tests if LDAP wire protocol handler is to be
+     * started
+     *
+     * @return True if LDAP wire protocol in use else false
+     */
+    public boolean isEmbeddedLDAPNetworkingSupport(  );
+
+    /**
+     * Embedded server only - sests if LDAP wire protocol handler is to be
+     * started
+     *
+     * @param ldapNetworkingSupport True to install LDAP support else false
+     */
+    public void setEmbeddedLDAPNetworkingSupport( boolean ldapNetworkingSupport );
+
+    /**
+     * Embedded server only - gets the LDAP listen port
+     *
+     * @return LDAP listen port
+     */
+    public int getEmbeddedLDAPPort(  );
+
+    /**
+     * Embedded server only - sets the LDAP listen port
+     *
+     * @param ldapPort The LDAP port listened on
+     */
+    public void setEmbeddedLDAPPort( int ldapPort );
+
+    /**
+     * Embedded server only - gets the LDAPSSL) listen port (!NOT YET
+     * SUPPORTED!)
+     *
+     * @return LDAPS listen port
+     */
+    public int getEmbeddedLDAPSPort(  );
+
+    /**
+     * Embedded server only - sets the LDAPS (SSL) listen port (!NOT YET
+     * SUPPORTED!)
+     *
+     * @param ldapsPort The LDAPS port listened on
+     */
+    public void setEmbeddedLDAPSPort( int ldapsPort );
+
+    /**
+     * Embedded server only - Gets the name of the root partion which was
+     * automatically created on server startup
+     *
+     * @return The name of the custom root partition (null for no custom
+     *         partition)
+     */
+    public String getEmbeddedCustomRootPartitionName(  );
+
+    /**
+     * Embedded server only - Sets the name of the root partion which is
+     * automatically created on server startup
+     *
+     * @param rootPartitianName The name of the custom root partition (null for
+     *        no partition)
+     */
+    public void setEmbeddedCustomRootPartitionName( String rootPartitianName );
+
+    /**
+     * Embedded server only - Gets the name of the workfile folder used by the
+     * server
+     *
+     * @return Folder name
+     */
+    public String getEmbeddedWkdir(  );
+
+    /**
+     * Embedded server only - Sets the name of the workfile folder used by the
+     * server
+     *
+     * @param wkdir Folder name
+     */
+    public void setEmbeddedWkdir( String wkdir );
+
+    /**
+     * Embedded server only - Gets the name of the LDIF import folder used by
+     * the server
+     *
+     * @return LDIF import folder
+     */
+    public String getEmbeddedLDIFdir(  );
+
+    /**
+     * Embedded server only - Sets the name of the LDIF import folder used by
+     * the server
+     *
+     * @param LDIFdir LDIF import folder
+     */
+    public void setEmbeddedLDIFdir( String LDIFdir );
+
+    /**
+     * Embedded server only - test if access control is enabled
+     *
+     * @return True is enabled else false
+     */
+    public boolean isEmbeddedAccessControlEnabled(  );
+
+    /**
+     * Embedded server only - Set if access control is enabled
+     *
+     * @param enabled True to enable else false
+     */
+    public void setEmbeddedAccessControlEnabled( boolean enabled );
+
+    /**
+     * Embedded server only - test if NTP wire protocol is enabled
+     *
+     * @return True is enabled else false
+     */
+    public boolean isEmbeddedEnableNtp(  );
+
+    /**
+     * Embedded server only - set if NTP wire protocol is enabled
+     *
+     * @param enabled True to enable else false
+     */
+    public void setEmbeddedEnableNtp( boolean enabled );
+
+    /**
+     * Embedded server only - test if Kerberos wire protocol is enabled
+     *
+     * @return True is enabled else false
+     */
+    public boolean isEmbeddedEnableKerberos(  );
+
+    /**
+     * Embedded server only - set if Kerberos wire protocol is enabled
+     *
+     * @param enabled True to enable else false
+     */
+    public void setEmbeddedEnableKerberos( boolean enabled );
+
+    /**
+     * Embedded server only - test if Change Password wire protocol is enabled
+     *
+     * @return True is enabled else false
+     */
+    public boolean isEmbeddedEnableChangePassword(  );
+
+    /**
+     * Embedded server only - set if Change Password wire protocol is enabled
+     *
+     * @param enabled True to enable else false
+     */
+    public void setEmbeddedEnableChangePassword( boolean enabled );
+}

Added: directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/jboss-service.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/jboss-service.xml?rev=374226&view=auto
==============================================================================
--- directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/jboss-service.xml (added)
+++ directory/trunks/apacheds/simple/sar/src/main/resources/META-INF/jboss-service.xml Wed Feb  1 18:41:00 2006
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE server>
+
+<server>
+
+  <mbean code="org.apache.ldap.server.jmx.DirectoryService" 
+        name="apacheds.system:service=Directory" >
+
+    <attribute name="EmbeddedServerEnabled">true</attribute>
+    <attribute name="ContextFactory">org.apache.ldap.server.jndi.ServerContextFactory</attribute>
+    <attribute name="ContextProviderURL">uid=admin,ou=system</attribute>
+    <attribute name="ContextSecurityAuthentication">simple</attribute>
+    <attribute name="ContextSecurityCredentials">secret</attribute>
+    <attribute name="ContextSecurityPrincipal">uid=admin,ou=system</attribute>
+		     
+    <!-- ###################################################################
+	  Embedded Apache Directory
+         ################################################################### -->
+		     
+    <attribute name="EmbeddedWkdir">${reims.jboss.dir}/conf/apacheds-store</attribute>
+		
+    <attribute name="EmbeddedLDIFdir">${reims.jboss.dir}/conf/apacheds-ldif</attribute>
+
+    <attribute name="EmbeddedLDIFFilters">
+    	<!--
+         Entries will optionally be filtered using LdifLoadFilters in the
+         order specified.  The example included Krb5KdcEntryFilter will filter
+         kerberos principals creating keys for them using their
+         userPassword attribute if present.
+	    -->
+	<xml-properties>
+	  <config-property name="Krb5KdcEntryFilter">org.apache.protocol.common.store.Krb5KdcEntryFilter</config-property>
+	</xml-properties>
+  </attribute>
+		
+  <!-- Access control                    -->
+		
+  <attribute name="EmbeddedAccessControlEnabled">false</attribute>
+  <attribute name="EmbeddedAnonymousAccess">false</attribute>
+		
+  <!-- Wire protocols                    -->
+  <attribute name="EmbeddedEnableNtp">false</attribute>
+  <attribute name="EmbeddedEnableKerberos">false</attribute>
+  <attribute name="EmbeddedEnableChangePassword">false</attribute>
+  <attribute name="EmbeddedLDAPNetworkingSupport">true</attribute>
+  <attribute name="EmbeddedLDAPPort">389</attribute>
+  <attribute name="EmbeddedLDAPSPort">636</attribute>
+
+  <attribute name="EmbeddedCustomBootstrapSchema">
+<xml-properties>
+	<config-property name="VcsServiceElementSchema">org.apache.ldap.server.schema.bootstrap.VcsServiceElementSchema</config-property>
+			</xml-properties>
+	    </attribute>
+
+		<!-- Multiple additional JNDI properties -->
+
+	    <attribute name="EmbeddedAdditionalEnvProperties">
+			<xml-properties>
+				<config-property name="java.naming.ldap.attributes.binary">photo personalSignature audio jpegPhoto javaSerializedData userPassword userCertificate cACertificate authorityRevocationList certificateRevocationList crossCertificatePair x500UniqueIdentifier krb5Key</config-property>
+				
+				<config-property name="asn.1.berlib.provider">org.apache.ldap.common.berlib.asn1.SnickersProvider</config-property>
+				<!-- <config-property name="asn.1.berlib.provider">org.apache.asn1new.ldap.TwixProvider</config-property> -->
+				
+				<!--
+				config-property name="kdc.entryBaseDn">ou=users,dc=example,dc=com</config-property>
+				<config-property name="kdc.java.naming.security.credentials">secret</config-property>
+				<config-property name="changepw.entryBaseDn">ou=users,dc=example,dc=com</config-property>
+				<config-property name="changepw.java.naming.security.credentials">secret</config-property>
+				-->
+			</xml-properties>
+	    </attribute>
+  </mbean>
+</server>
+  



Mime
View raw message