directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r558849 [5/6] - in /directory/triplesec/trunk: admin-api/ admin-api/src/test/java/org/apache/directory/triplesec/admin/ admin-api/src/test/resources/ guardian-api/src/main/java/org/apache/ guardian-api/src/main/java/org/apache/directory/ gu...
Date Mon, 23 Jul 2007 20:02:03 GMT
Added: directory/triplesec/trunk/integration/src/main/java/org/apache/directory/triplesec/integration/TriplesecIntegration.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/integration/src/main/java/org/apache/directory/triplesec/integration/TriplesecIntegration.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/integration/src/main/java/org/apache/directory/triplesec/integration/TriplesecIntegration.java (added)
+++ directory/triplesec/trunk/integration/src/main/java/org/apache/directory/triplesec/integration/TriplesecIntegration.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,425 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec.integration;
+
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.commons.io.FileUtils;
+import org.apache.directory.triplesec.Service;
+import org.apache.directory.triplesec.TriplesecInstallationLayout;
+import org.apache.mina.util.AvailablePortFinder;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Expand;
+
+
+/**
+ * A unit test case base class for implementing Triplesec Unit tests.  To
+ * use TriplesecUnit properly you must set two System properties.
+ * TrilpesecUnit builds a minimal install footprint to start up Triplesec
+ * and needs to know where this home directory should be created along with
+ * where to find configuration files which it copies over to the home
+ * directory.
+ *
+ * Generally one can create a src/test/resource directory for a project and
+ * point the org.apache.directory.triplesec.unit.resource.dir property to the absolute
+ * path for this directory.  Absolute paths must be used, however with Maven
+ * the ${basedir} macro can be used in the project.properties file to set this
+ * path in a position independent fashion.  Within an IDE the test run must
+ * have the absolute path specified as a jvm -D parameter before running the
+ * test.  Within this directory you put the server.xml file that is needed
+ * as well as any files ending in the ldif extention to be imported on server
+ * startup.  An optional log4j.properties can be put here as well however
+ * for Maven to use it the log4j.properties must be explicity specified within
+ * the resources section of the project.xml to be copied into the test-classes
+ * directory on test runs.
+ *
+ * At the present point in time the unit test must be run as root otherwise
+ * Triplesec cannot bind to the Kerberos port.  We will make this configurable
+ * so we can search for a free bindable port so tests can pass as non-root
+ * users.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class TriplesecIntegration extends TestCase
+{
+    /** the resources property to set */
+    public static final String RESOURCES_DIRECTORY = "org.apache.directory.triplesec.integration.resourcesDirectory";
+    /** a comma delimited list of web applications */
+    public static final String WEBAPPS_PROPERTY = "org.apache.directory.triplesec.integration.webapps";
+    /** the base property for a the path to a webapp war */
+    public static final String WEBAPPWARBASE_PROPERTY = "org.apache.directory.triplesec.integration.webappWarBase";
+    /** the SLF4J logger for this class */
+    private static final Logger log = LoggerFactory.getLogger( TriplesecIntegration.class );
+
+    /** a handle on the server's newly created "install" home directory */
+    private File serverHome;
+    /**
+     * The configuration directory is where TriplesecUnit searches for configuration 
+     * files to copy into the server home directory it will create.  Within this 
+     * directory where ever it may be, must reside a server.xml configuration file 
+     * for Triplesec Server.  Optional LDIF files can also be placed here for import 
+     * when the server starts up.
+     */
+    private File resourcesDirectory;
+    private Service server;
+    private int httpPort;
+    private int ldapPort;
+    private int ldapsPort;
+    private int krb5Port;
+    private int changepwPort;
+    private int ntpPort;
+
+
+    /**
+     * Creates a unit test case that sets up and runs the Triplesec server
+     * for each unit test with a fresh database.
+     *
+     * @param resourcesDirectory the directory containing triplesec resource files
+     * @throws Exception if there are configuration issues with the unit test
+     */
+    public TriplesecIntegration() throws Exception
+    {
+        init();
+    }
+
+
+    /**
+     * Creates a unit test case that sets up and runs the Triplesec server
+     * for each unit test with a fresh database.
+     *
+     * @param resourcesDirectory the directory containing triplesec resource files
+     * @param string the name of the unit test
+     * @throws Exception if there are configuration issues with the unit test
+     */
+    public TriplesecIntegration( String string ) throws Exception
+    {
+        super( string );
+        init();
+    }
+
+
+    /**
+     * Get's the LDAP port the server starts on.
+     *
+     * @return the LDAP port the server starts on
+     */
+    protected int getLdapPort()
+    {
+        return ldapPort;
+    }
+
+
+    /**
+     * Get's the HTTP port the server starts on.
+     *
+     * @return the HTTP port the server starts on
+     */
+    protected int getHttpPort()
+    {
+        return httpPort;
+    }
+
+
+    /**
+     * Get's the LDAPS port the server starts on.
+     *
+     * @return the LDAPS port the server starts on
+     */
+    protected int getLdapsPort()
+    {
+        return ldapsPort;
+    }
+
+
+    /**
+     * Gets the Kerberos port the server binds to.
+     *
+     * @return the Kerberos port the server binds to.
+     */
+    protected int getKerberosPort()
+    {
+        return krb5Port;
+    }
+
+
+    /**
+     * Gets the Changepw port the server binds to.
+     *
+     * @return the Changepw port the server binds to.
+     */
+    protected int getChangepwPort()
+    {
+        return changepwPort;
+    }
+
+
+    /**
+     * Gets the Ntp port the server binds to.
+     *
+     * @return the Ntp port the server binds to.
+     */
+    protected int getNtpPort()
+    {
+        return ntpPort;
+    }
+
+
+    /**
+     * Gets the file for the server home which is the directory containing the
+     * minimal install footprint for the Triplesec Server.
+     *
+     * @return the server home
+     */
+    protected File getServerHome()
+    {
+        return serverHome;
+    }
+
+
+    /**
+     * Gets a handle to the directory containing the configuration resources
+     * that were copied over to the server home directory.
+     *
+     * @return the handle to the configuration resources directory
+     */
+    protected File getConfigResourcesDir()
+    {
+        return resourcesDirectory;
+    }
+    
+    
+    private void initWebapps( File webappsDirectory ) throws IOException
+    {
+        String value = System.getProperties().getProperty( WEBAPPS_PROPERTY, null );
+        if ( value == null )
+        {
+            return;
+        }
+        
+        String[] webapps = value.split( "," );
+        for ( int ii = 0; ii < webapps.length; ii++ )
+        {
+            String warPath = System.getProperties().getProperty( WEBAPPWARBASE_PROPERTY + "." + webapps[ii], null );
+            if ( warPath == null )
+            {
+                log.warn( "Abandoning webapplication. No path for webapp's war: " + webapps[ii] );
+                continue;
+            }
+            
+            if ( ! new File( warPath ).exists() )
+            {
+                log.warn( "War for webapp " + webapps[ii] + " does not exist for path: " + warPath 
+                    + ".\nCheck that the war is present or rebuild that webapp module." );
+                continue;
+            }
+            
+            File explodedDirectory = new File( webappsDirectory, webapps[ii] );
+            explodedDirectory.mkdirs();
+            try
+            {
+                explodeWar( explodedDirectory, new File( warPath ) );
+            }
+            catch ( IOException e )
+            {
+                log.error( "Failed to explode war at " + warPath, e );
+            }
+        }
+    }
+
+
+    private void explodeWar( File explodedDirectory, File warFile ) throws IOException
+    {
+        log.info( "Exploding war " + warFile.getAbsolutePath() + " into directory " 
+            + explodedDirectory.getAbsolutePath()  );
+        Expand expand = new Expand();
+        expand.setProject( new Project() );
+        expand.setSrc( warFile );
+        expand.setOverwrite( true );
+        expand.setDest( explodedDirectory );
+        expand.execute();
+    }
+
+
+    /**
+     * Initializes TriplesecUnit once (not on every test run) by cleaning out
+     * the old server home if it exists and building it once again using the
+     * configuration files present within the configuration resources directory.
+     * This method does not start the server.  The server is started with a
+     * fresh new database for each run within the setUp() method.
+     *
+     * @throws Exception if there are problems with the T-unit configuration
+     */
+    private void init() throws Exception
+    {
+        this.resourcesDirectory = new File ( System.getProperties().getProperty( 
+            RESOURCES_DIRECTORY, "src/test/resources" ) );
+
+        if ( ! resourcesDirectory.exists() )
+        {
+            String msg = "The configuration resources directory '" +
+                    resourcesDirectory + "' does not exist will search classpath for resources";
+            fail( msg );
+        }
+
+        // --------------------------------------------------------------------
+        // Setup the serverHome directory
+        // --------------------------------------------------------------------
+
+        File targetDirectory = new File( "target" );
+        if ( ! targetDirectory.exists() )
+        {
+            targetDirectory.mkdirs();
+        }
+        
+        serverHome = new File( targetDirectory, "serverHome" );
+        if ( serverHome.exists() )
+        {
+            FileUtils.deleteDirectory( serverHome );
+        }
+
+        // --------------------------------------------------------------------
+        // Create minimal install footprint with configuration files
+        // --------------------------------------------------------------------
+
+        serverHome.mkdirs();
+        File logsDir = new File( serverHome, "logs" );
+        logsDir.mkdir();
+        File confDir = new File( serverHome, "conf" );
+        confDir.mkdir();
+        File webappsDir = new File( serverHome, "webapps" );
+        webappsDir.mkdir();
+        initWebapps( webappsDir );
+        
+        FileUtils.copyFileToDirectory( new File( resourcesDirectory, "server.xml" ), confDir );
+        File [] ldifFiles = resourcesDirectory.listFiles( new FileFilter()
+        {
+            public boolean accept( File file )
+            {
+                return file.getName().endsWith( "ldif" );
+            }
+        });
+        for ( int ii = 0; ii < ldifFiles.length; ii++ )
+        {
+            FileUtils.copyFileToDirectory( ldifFiles[ii], confDir );
+        }
+    }
+
+
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+
+        // must delete the contents under the partitions directory
+        File partitionDir = new File( serverHome, "var" );
+        partitionDir = new File( partitionDir, "partitions" );
+        if ( partitionDir.exists() )
+        {
+            FileUtils.forceDelete( partitionDir );
+        }
+        partitionDir.mkdir();
+
+        server = new Service();
+        server.setEnableShutdownHook( false );
+        
+        if ( ! AvailablePortFinder.available( 88 ) )
+        {
+            krb5Port = AvailablePortFinder.getNextAvailable( 1088 );
+            server.setKrb5PortOverride( krb5Port );
+        }
+        else
+        {
+            krb5Port = 88;
+        }
+
+        if ( ! AvailablePortFinder.available( 464 ) )
+        {
+            changepwPort = AvailablePortFinder.getNextAvailable( 1464 );
+            server.setChangepwPortOverride( changepwPort );
+        }
+        else
+        {
+            changepwPort = 464;
+        }
+
+        if ( ! AvailablePortFinder.available( 123 ) )
+        {
+            ntpPort = AvailablePortFinder.getNextAvailable( 1123 );
+            server.setNtpPortOverride( ntpPort );
+        }
+        else
+        {
+            ntpPort = 123;
+        }
+
+        if ( ! AvailablePortFinder.available( 10389 ) )
+        {
+            ldapPort = AvailablePortFinder.getNextAvailable( 10389 );
+            server.setLdapPortOverride( ldapPort );
+        }
+        else
+        {
+            ldapPort = 10389;
+        }
+
+        if ( ! AvailablePortFinder.available( 8383 ) )
+        {
+            httpPort = AvailablePortFinder.getNextAvailable( 8383 );
+            server.setHttpPortOverride( httpPort );
+        }
+        else
+        {
+            httpPort = 8383;
+        }
+
+        if ( ! AvailablePortFinder.available( 10636 ) )
+        {
+            ldapsPort = AvailablePortFinder.getNextAvailable( 10636 );
+            server.setLdapsPortOverride( ldapsPort );
+        }
+        else
+        {
+            ldapsPort = 10636;
+        }
+
+        String home = serverHome.getCanonicalPath();
+        log.debug( "server home used = " + home );
+        server.init( new TriplesecInstallationLayout( serverHome ), new String[] { home, "start" } );
+        log.info( "initialized Triplesec Server" );
+        server.start();
+        log.info( "started Triplesec Server" );
+    }
+
+
+    protected void tearDown() throws Exception
+    {
+        server.stop( null );
+        server.destroy();
+        server = null;
+        super.tearDown();
+    }
+}

Added: directory/triplesec/trunk/integration/src/test/java/org/apache/directory/triplesec/integration/TriplesecIntegrationITest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/integration/src/test/java/org/apache/directory/triplesec/integration/TriplesecIntegrationITest.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/integration/src/test/java/org/apache/directory/triplesec/integration/TriplesecIntegrationITest.java (added)
+++ directory/triplesec/trunk/integration/src/test/java/org/apache/directory/triplesec/integration/TriplesecIntegrationITest.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec.integration;
+
+
+import org.apache.directory.triplesec.integration.TriplesecIntegration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+
+/**
+ * Test case to make sure the TriplesecUnit is working correctly.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class TriplesecIntegrationITest extends TriplesecIntegration
+{
+    private static Logger log = LoggerFactory.getLogger( TriplesecIntegrationITest.class );
+
+
+    public TriplesecIntegrationITest() throws Exception
+    {
+        super();
+    }
+
+
+    /**
+     * Checks to see that init has done it's job
+     */
+    public void testInit()
+    {
+        log.info( "entered testInit()" );
+        assertTrue( getServerHome().exists() );
+        assertTrue( new File( getServerHome(), "logs" ).exists() );
+        assertTrue( new File( getServerHome(), "conf" ).exists() );
+        assertTrue( new File( getServerHome(), "var" ).exists() );
+
+        File confDir = new File( getServerHome(), "conf" );
+        assertTrue( new File( confDir, "server.xml" ).exists() );
+    }
+}

Modified: directory/triplesec/trunk/integration/src/test/resources/server.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/integration/src/test/resources/server.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/integration/src/test/resources/server.xml (original)
+++ directory/triplesec/trunk/integration/src/test/resources/server.xml Mon Jul 23 13:01:54 2007
@@ -11,8 +11,8 @@
         <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
         <prop key="java.naming.security.credentials">secret</prop>
         <prop key="java.naming.provider.url">dc=example,dc=com</prop>
-        <prop key="java.naming.factory.state">org.safehaus.triplesec.store.ProfileStateFactory</prop>
-        <prop key="java.naming.factory.object">org.safehaus.triplesec.store.ProfileObjectFactory</prop>
+        <prop key="java.naming.factory.state">org.apache.directory.triplesec.store.ProfileStateFactory</prop>
+        <prop key="java.naming.factory.object">org.apache.directory.triplesec.store.ProfileObjectFactory</prop>
 
         <prop key="kdc.primary.realm">EXAMPLE.COM</prop>
         <prop key="kdc.principal">krbtgt/EXAMPLE.COM@EXAMPLE.COM</prop>
@@ -37,7 +37,7 @@
 
         <prop key="safehaus.entry.basedn">ou=Users,dc=example,dc=com</prop>
         <prop key="safehaus.load.testdata">true</prop>
-        <prop key="kerberos.sam.type.7">org.safehaus.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
+        <prop key="kerberos.sam.type.7">org.apache.directory.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
       </props>
     </property>
   </bean>
@@ -122,7 +122,7 @@
         <bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
-        <bean class="org.safehaus.triplesec.store.schema.SafehausSchema"/>
+        <bean class="org.apache.directory.triplesec.store.schema.SafehausSchema"/>
       </set>
     </property>
     
@@ -204,7 +204,7 @@
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
           <property name="name"><value>policyProtectionService</value></property>
           <property name="interceptor">
-            <bean class="org.safehaus.triplesec.store.interceptor.PolicyProtectionInterceptor" />
+            <bean class="org.apache.directory.triplesec.store.interceptor.PolicyProtectionInterceptor" />
           </property>
         </bean>
       </list>

Modified: directory/triplesec/trunk/main/conf/server.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/conf/server.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/main/conf/server.xml (original)
+++ directory/triplesec/trunk/main/conf/server.xml Mon Jul 23 13:01:54 2007
@@ -11,8 +11,8 @@
         <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
         <prop key="java.naming.security.credentials">secret</prop>
         <prop key="java.naming.provider.url">dc=example,dc=com</prop>
-        <prop key="java.naming.factory.state">org.safehaus.triplesec.store.ProfileStateFactory</prop>
-        <prop key="java.naming.factory.object">org.safehaus.triplesec.store.ProfileObjectFactory</prop>
+        <prop key="java.naming.factory.state">org.apache.directory.triplesec.store.ProfileStateFactory</prop>
+        <prop key="java.naming.factory.object">org.apache.directory.triplesec.store.ProfileObjectFactory</prop>
 
         <prop key="kdc.primary.realm">EXAMPLE.COM</prop>
         <prop key="kdc.principal">krbtgt/EXAMPLE.COM@EXAMPLE.COM</prop>
@@ -37,7 +37,7 @@
 
         <prop key="safehaus.entry.basedn">ou=Users,dc=example,dc=com</prop>
         <prop key="safehaus.load.testdata">true</prop>
-        <prop key="kerberos.sam.type.7">org.safehaus.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
+        <prop key="kerberos.sam.type.7">org.apache.directory.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
       </props>
     </property>
   </bean>
@@ -121,7 +121,7 @@
         <bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
-        <bean class="org.safehaus.triplesec.store.schema.SafehausSchema"/>
+        <bean class="org.apache.directory.triplesec.store.schema.SafehausSchema"/>
       </set>
     </property>
     
@@ -203,7 +203,7 @@
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
           <property name="name"><value>policyProtectionService</value></property>
           <property name="interceptor">
-            <bean class="org.safehaus.triplesec.store.interceptor.PolicyProtectionInterceptor" />
+            <bean class="org.apache.directory.triplesec.store.interceptor.PolicyProtectionInterceptor" />
           </property>
         </bean>
       </list>

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingHotpMonitor.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingHotpMonitor.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingHotpMonitor.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingHotpMonitor.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,140 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.safehaus.triplesec.verifier.hotp.HotpMonitor;
+import org.safehaus.profile.ServerProfile;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.directory.triplesec.otp.ResynchParameters;
+
+
+/**
+ * A Log4J based logging HOTP verifier monitor.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LoggingHotpMonitor implements HotpMonitor
+{
+    /** underlying logger to use for logging events */
+    private final Log log;
+
+
+    public LoggingHotpMonitor( Log log )
+    {
+        if ( log == null )
+        {
+            this.log = LogFactory.getLog( "HotpMonitor" );
+
+            return;
+        }
+
+        this.log = log;
+    }
+
+
+    public LoggingHotpMonitor()
+    {
+        this.log = LogFactory.getLog( "HotpMonitor" );
+    }
+
+
+    public void verificationFailed( ServerProfile p, ResynchParameters params )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "verification failed for " + p + " with " + params );
+        }
+    }
+
+
+    public void initiatingResynch( ServerProfile p, ResynchParameters params )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "resynch initiated for " + p + " with " + params );
+        }
+    }
+
+
+    public void checkingLookahead( ServerProfile p, ResynchParameters params )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "checking lookahead for " + p + " with " + params );
+        }
+    }
+
+
+    public void integrityCheckFailed( ServerProfile p )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "integrity check failed for " + p );
+        }
+    }
+
+
+    public void resynchCompleted( ServerProfile p, ResynchParameters params )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "resynch completed for " + p + " with " + params );
+        }
+    }
+
+
+    public void resynchInProgress( ServerProfile p, ResynchParameters params )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "resynch in progress for " + p + " with " + params );
+        }
+    }
+
+
+    public void integrityCheckPassed( ServerProfile p )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "verification passed for " + p );
+        }
+    }
+
+
+    public void accountLocked( ServerProfile p, ResynchParameters params )
+    {
+        log.warn( "account locked for " + p + " with " + params );
+    }
+
+
+    public void verifying( KerberosPrincipal principal )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "attempting verification for " + principal );
+        }
+    }
+}

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingStoreMonitor.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingStoreMonitor.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingStoreMonitor.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/LoggingStoreMonitor.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,200 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+
+import javax.naming.directory.Attributes;
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.safehaus.profile.ServerProfile;
+import org.safehaus.triplesec.store.ServerProfileStore;
+import org.safehaus.triplesec.store.StoreMonitorAdapter;
+
+
+/**
+ * A log4j based logging StoreMonitor.
+ *
+ * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LoggingStoreMonitor extends StoreMonitorAdapter
+{
+    /** underlying logger used for logging store events */
+    private final Log log;
+
+
+    public LoggingStoreMonitor( Log log )
+    {
+        if ( log == null )
+        {
+            this.log = LogFactory.getLog( "StoreMonitor" );
+
+            return;
+        }
+
+        this.log = log;
+    }
+
+
+    public LoggingStoreMonitor()
+    {
+        this.log = LogFactory.getLog( "StoreMonitor" );
+    }
+
+
+    // ------------------------------------------------------------------------
+    // Callbacks
+    // ------------------------------------------------------------------------
+
+
+    public void profileAdded( ServerProfileStore store, ServerProfile profile )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "store added profile " + profile.getUserId() + " to realm " + profile.getRealm() );
+        }
+    }
+
+
+    public void info( ServerProfileStore store, String s )
+    {
+        log.info( s );
+    }
+
+
+    public void profileImported( ServerProfileStore store, String dn, Attributes attributes )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "store imported profile - " + dn + " with attributes " + attributes );
+        }
+    }
+
+
+    public void profileNotImported( ServerProfileStore store, String dn, Attributes attributes )
+    {
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "store did not imported profile - " + dn + " because it already existed" );
+        }
+    }
+
+
+    /*
+    public void profileDeleted( ServerProfileStore store, KerberosPrincipal principal, ServerProfile profile )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "store deleted profile " + profile.getUserId() + " from realm " + profile.getRealm() );
+        }
+    }
+
+
+    public void profileAccessed( ServerProfileStore store, KerberosPrincipal principal, ServerProfile profile )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( "store accessed profile " + profile.getUserId() + " in realm " + profile.getRealm() );
+        }
+    }
+
+
+    public void profileUpdated( ServerProfileStore store, ServerProfile profile, ModificationItem[] mods )
+    {
+        String report = getModificationReport( mods );
+
+        log.info( "store updated profile " + profile.getUserId() + " in realm " + profile.getRealm() + ": " + report );
+    }
+
+
+    private String getModificationType( ModificationItem item )
+    {
+        switch( item.getModificationOp() )
+        {
+            case( DirContext.REMOVE_ATTRIBUTE ):
+
+                return "remove";
+
+            case( DirContext.REPLACE_ATTRIBUTE ):
+
+                return "replace";
+
+            case( DirContext.ADD_ATTRIBUTE ):
+
+                return "add";
+
+            default:
+                throw new IllegalArgumentException( "unknown mod type" );
+        }
+    }
+
+
+    private String getModificationReport( ModificationItem[] mods )
+    {
+        StringBuffer buf = new StringBuffer();
+
+        for ( int ii = 0; ii < mods.length; ii++ )
+        {
+            buf.append( "modop: " ).append( getModificationType( mods[ii] ) );
+
+            buf.append( "attribute: " ).append( mods[ii].getAttribute() );
+        }
+
+        return buf.toString();
+    }
+    */
+
+    public void storeInitialized( ServerProfileStore store )
+    {
+        log.info( "store initialized" );
+    }
+
+
+    public void storeFailure( ServerProfileStore store )
+    {
+        log.error( "store failed - no further info available" );
+    }
+
+
+    public void storeFailure( ServerProfileStore store, Throwable t )
+    {
+        log.error( "store failed - " + t.getMessage(), t );
+    }
+
+
+    public void storeFailure( ServerProfileStore store, KerberosPrincipal principal )
+    {
+        log.error( "store failed - operation for principal " + principal.getName() );
+    }
+
+
+    public void storeFailure( ServerProfileStore store, KerberosPrincipal principal, Throwable t )
+    {
+        log.error( "store failed - on principal " + principal.getName() + " - " + t.getMessage(), t );
+    }
+
+
+    public void storeFailure( ServerProfileStore store, KerberosPrincipal principal, String s )
+    {
+        log.error( "store failed - on principal " + principal.getName() + " - " + s );
+    }
+}

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/Service.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/Service.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/Service.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/Service.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,597 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.directory.daemon.DaemonApplication;
+import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.server.core.configuration.ShutdownConfiguration;
+import org.apache.directory.server.core.configuration.SyncConfiguration;
+import org.apache.directory.server.kerberos.sam.SamSubsystem;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.util.PropertiesUtils;
+import org.apache.directory.triplesec.configuration.MutableTriplesecStartupConfiguration;
+
+import org.mortbay.http.SocketListener;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.WebApplicationContext;
+
+import org.safehaus.profile.BaseServerProfileModifier;
+import org.safehaus.profile.ProfileTestData;
+import org.safehaus.profile.ServerProfile;
+import org.safehaus.triplesec.store.DefaultServerProfileStore;
+import org.safehaus.triplesec.store.ServerProfileStore;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+
+
+/**
+ * The Triplesec service launched by daemons.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class Service implements DaemonApplication
+{
+    /** this is the value the port override members have when they are not defined */
+    private static final int UNDEFINED_PORT_OVERRIDE = -2;
+    /** The period in milliseconds to wait before flushing db buffer cache */
+    private static final int SYNCPERIOD_MILLIS = 20000;
+    /** THe default port for the HTTP service */
+    private static final String HTTP_PORT_DEFAULT = "8383";
+
+    /** Setup a logger */
+    private static Logger log = LoggerFactory.getLogger( TriplesecUberjarMain.class );
+
+    /** The environment setting used to start the server */
+    private Properties env;
+    /** the time the server was started */
+    private long startTime;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int httpPortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int ldapPortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int ldapsPortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int krb5PortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int changepwPortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** a possible override port to use instead of what is present within the configuration */
+    private int ntpPortOverride = UNDEFINED_PORT_OVERRIDE;
+    /** embedded Jetty httpService */
+    private Server httpService;
+    /** setting to disable the shutdown hook for test cases: enabled by default */
+    private boolean enableShutdownHook = true;
+	/** setting to disable embedded HTTP web service: enabled by default */
+	private boolean enableHttpService = true;
+
+    private TriplesecInstallationLayout layout;
+    private Thread workerThread = null;
+    private SynchWorker worker = new SynchWorker();
+    private boolean startNoWait = false;
+    
+    
+    /**
+     * Sets the override port for the HTTP server.  If this value is set then the value is
+     * used for the HTTP server port instead of what is set within the configuration.
+     *
+     * @param httpPortOverride the HTTP port to use
+     */
+    public void setHttpPortOverride( int httpPortOverride )
+    {
+        this.httpPortOverride = httpPortOverride;
+    }
+
+
+    /**
+     * Sets the override port for the LDAP server.  If this value is set then the value is
+     * used for the LDAP server port instead of what is set within the configuration.
+     *
+     * @param ldapPortOverride the LDAP port to use
+     */
+    public void setLdapPortOverride( int ldapPortOverride )
+    {
+        this.ldapPortOverride = ldapPortOverride;
+    }
+
+
+    /**
+     * Sets the override port for the LDAPS server.  If this value is set then the value is
+     * used for the LDAPS server port instead of what is set within the configuration.
+     *
+     * @param ldapsPortOverride the LDAP port to use
+     */
+    public void setLdapsPortOverride( int ldapsPortOverride )
+    {
+        this.ldapsPortOverride = ldapsPortOverride;
+    }
+
+
+    /**
+     * Sets the override port for the Kerberos KDC.  If this value is set then the value is
+     * used for the KDC server port instead of what is set within the configuration.
+     *
+     * @param krb5PortOverride the Kerberos port to use
+     */
+    public void setKrb5PortOverride( int krb5PortOverride )
+    {
+        this.krb5PortOverride = krb5PortOverride;
+    }
+
+
+    /**
+     * Sets the override port for the Changepw Server.  If this value is set then the value is
+     * used for the Changepw server port instead of what is set within the configuration.
+     *
+     * @param changepwPortOverride the Changepw port to use
+     */
+    public void setChangepwPortOverride( int changepwPortOverride )
+    {
+        this.changepwPortOverride = changepwPortOverride;
+    }
+
+
+    /**
+     * Sets the override port for the NTP server.  If this value is set then the value is
+     * used for the NTP server port instead of what is set within the configuration.
+     *
+     * @param ntpPortOverride the NTP port to use
+     */
+    public void setNtpPortOverride( int ntpPortOverride )
+    {
+        this.ntpPortOverride = ntpPortOverride;
+    }
+
+    
+    private void configure( TriplesecInstallationLayout layout ) throws Exception
+    {
+        File configWebapp = new File( layout.getWebappsDirectory(), "config" );
+        File configured = new File( configWebapp, "configured" );
+        
+        // if the configuration application is not present then don't bother
+        if ( ! configWebapp.exists() )
+        {
+            return;
+        }
+
+        // if config app is present along with configured file inside then we exit too
+        if ( configured.exists() )
+        {
+            return;
+        }
+
+        // below here the server has not been configured and has the config app
+        httpService = new Server();
+        SocketListener listener = new SocketListener();
+        listener.setPort( Integer.parseInt( HTTP_PORT_DEFAULT ) );
+        httpService.addListener( listener );
+        httpService.addWebApplication( "config", configWebapp.getCanonicalPath() );
+        httpService.start();
+
+        // warn to let user know server is waiting and to make sure user sees the message
+        if ( log.isWarnEnabled() )
+        {
+            log.warn( "Waiting for admin to configure the server on port " + HTTP_PORT_DEFAULT );
+        }
+        
+        // waits until the webapp places a 'configured' file after the user completes configuration
+        while ( ! configured.exists() )
+        {
+            // check every second and a half for the directory's presence
+            Thread.sleep( 1500 );
+        }
+        
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "Configuration stage completed ... starting normal initialization" );
+        }
+
+        httpService.stop();
+        httpService.destroy();
+        httpService = null;
+    }
+    
+
+    public void init( InstallationLayout installationLayout, String[] args ) throws Exception
+    {
+        MutableTriplesecStartupConfiguration cfg;
+
+        log.debug( "init(InstallationLayout,String[]) called" );
+        
+        if ( ! ( installationLayout instanceof TriplesecInstallationLayout ) )
+        {
+            layout = new TriplesecInstallationLayout ( installationLayout.getBaseDirectory() );
+        }
+        else
+        {
+            layout = ( TriplesecInstallationLayout ) installationLayout;
+        }
+
+        configure( layout );
+        startTime = System.currentTimeMillis();
+        
+        if ( layout != null )
+        {
+            log.info( "server: loading settings from ", layout.getConfigurationFile() );
+            ApplicationContext factory = null;
+            factory = new FileSystemXmlApplicationContext( layout.getConfigurationFile().toURL().toString() );
+            cfg = ( MutableTriplesecStartupConfiguration ) factory.getBean( "configuration" );
+            env = ( Properties ) factory.getBean( "environment" );
+        }
+        else if ( args.length > 0 && new File( args[0] ).exists() ) // hack that takes server.xml file argument
+        {
+            log.info( "server: loading settings from ", args[0] );
+            ApplicationContext factory = null;
+            factory = new FileSystemXmlApplicationContext( new File( args[0] ).toURL().toString() );
+            cfg = ( MutableTriplesecStartupConfiguration ) factory.getBean( "configuration" );
+            env = ( Properties ) factory.getBean( "environment" );
+        }
+        else
+        {
+            throw new Exception( "Can't figure out where to fine my installation." ); 
+        }
+
+        cfg.setShutdownHookEnabled( enableShutdownHook );
+		cfg.setEnableHttp( enableHttpService );
+        cfg.setLdifDirectory( layout.getConfigurationDirectory().getAbsoluteFile() );
+
+        if ( httpPortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setHttpPort( httpPortOverride );
+        }
+
+        if ( ldapPortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setLdapPort( ldapPortOverride );
+        }
+
+        if ( ldapsPortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setLdapsPort( ldapsPortOverride );
+        }
+
+        if ( layout != null )
+        {
+            cfg.setWorkingDirectory( layout.getPartitionsDirectory() );
+        }
+
+        env.setProperty( Context.PROVIDER_URL, "ou=system" );
+        env.setProperty( Context.INITIAL_CONTEXT_FACTORY, TriplsecContextFactory.class.getName() );
+        env.putAll( cfg.toJndiEnvironment() );
+
+        if ( krb5PortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setEnableKerberos( true );
+            env.put( "kdc.ipPort", Integer.toString( krb5PortOverride ) );
+            env.put( "kdc.ipPort", Integer.toString( krb5PortOverride ) );
+        }
+
+        if ( changepwPortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setEnableChangePassword( true );
+            env.put( "changepw.ipPort", Integer.toString( changepwPortOverride ) );
+            env.put( "changepw.ipPort", Integer.toString( changepwPortOverride ) );
+        }
+
+        if ( ntpPortOverride != UNDEFINED_PORT_OVERRIDE )
+        {
+            cfg.setEnableNtp( true );
+            env.put( "ntp.ipPort", Integer.toString( ntpPortOverride ) );
+            env.put( "ntp.ipPort", Integer.toString( ntpPortOverride ) );
+        }
+
+        // -------------------------------------------------------------------
+        // Get and/or create the userContext where profiles are subordinates
+        // -------------------------------------------------------------------
+
+        DirContext userContext = null;
+        try
+        {
+            LdapDN dn = new LdapDN( env.getProperty( "safehaus.entry.basedn" ) );
+            dn.remove( dn.size() - 1 );
+            env.setProperty( Context.PROVIDER_URL, dn.toString() );
+            userContext = new InitialDirContext( env );
+        }
+        catch ( NamingException e )
+        {
+            e.printStackTrace();
+            System.exit( -5 );
+        }
+
+        // set the user context for the sam subsystem
+        SamSubsystem.getInstance().setUserContext( userContext, "ou=users" );
+
+        // setup demo profiles
+        try
+        {
+            if ( PropertiesUtils.get( env, "safehaus.load.testdata", true ) )
+            {
+                ServerProfileStore store;
+                store = new DefaultServerProfileStore( ( DirContext ) userContext.lookup( "ou=Users" ) );
+                addDemoProfiles( store, env.getProperty( "kdc.primary.realm" ) );
+            }
+        }
+        catch ( NamingException e )
+        {
+            e.printStackTrace();
+            System.exit( -7 );
+        }
+        
+        try
+        {
+            if ( cfg.isEnableHttp() )
+            {
+                setupHttpService( cfg.getHttpPort() );
+            }
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+            System.exit( -8 );
+        }
+
+        workerThread = new Thread( worker, "SynchWorkerThread" );
+
+        if ( log.isInfoEnabled() )
+        {
+            log.info( "server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
+        }
+    }
+    
+    
+    public void setupHttpService( int port ) throws Exception
+    {
+        httpService = new Server();
+        httpService.setStatsOn( true );
+        httpService.setTrace( true );
+        
+        log.warn( "Setting trace and stats to on for Jetty" );
+        
+        SocketListener listener = new SocketListener();
+        listener.setPort( port );
+        httpService.addListener( listener );
+        
+        File webappsDir = new File( layout.getBaseDirectory(), "webapps" );
+        File[] webapps = webappsDir.listFiles( new FileFilter() {
+            public boolean accept( File dir ) { return dir.isDirectory(); }
+        } );
+        
+        if ( webapps == null )
+        {
+            return;
+        }
+        
+        for ( int ii = 0; ii < webapps.length; ii++ )
+        {
+            WebApplicationContext appContext = null;
+            
+            if ( webapps[ii].getName().equals( "ROOT" ) )
+            {
+                appContext = httpService.addWebApplication( "/", webapps[ii].getCanonicalPath() );
+            }
+            else if ( webapps[ii].getName().equals( "config" ) )
+            {
+            	continue;
+            }
+            else
+            {
+                appContext = httpService.addWebApplication( webapps[ii].getName(), webapps[ii].getCanonicalPath() );
+            }
+            
+            appContext.setExtractWAR( true );
+            appContext.setMimeMapping( "jar", "application/java-archive" );
+            appContext.setMimeMapping( "jad", "text/vnd.sun.j2me.app-descriptor" );
+            appContext.setMimeMapping( "cod", "application/vnd.rim.cod"  );
+            appContext.setMimeMapping( "wml", "text/vnd.wap.wml" );
+            appContext.setMimeMapping( "wmls", "text/vnd.wap.wmlscript"  );
+            appContext.setMimeMapping( "wbxml", "application/vnd.wap.wbxml"  );
+            appContext.setMimeMapping( "wmlc", "application/vnd.wap.wmlc" );
+            appContext.setMimeMapping( "wmlsc", "application/vnd.wap.wmlscriptc" );
+        }
+        
+        //httpService.start();
+    }
+
+
+    public void destroy()
+    {
+        log.debug( "destroy() called" );
+    }
+
+
+    public void start()
+    {
+        try
+        {
+			if ( httpService != null )
+			{
+				httpService.start();
+			}
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+            System.exit( -8 );
+        }
+        workerThread.start();
+        return;
+    }
+
+
+    public void stop( String[] args ) throws Exception
+    {
+
+        try
+        {
+			if ( httpService != null )
+			{
+				httpService.stop();
+				httpService.destroy();
+				httpService = null;
+			}
+        }
+        catch ( Exception e )
+        {
+            e.printStackTrace();
+        }
+		worker.stop = true;
+        synchronized ( worker.lock )
+        {
+            worker.lock.notify();
+        }
+
+        while ( startNoWait && workerThread.isAlive() )
+        {
+            log.info( "Waiting for SynchWorkerThread to die." );
+            workerThread.join( 500 );
+        }
+
+        env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
+        new InitialDirContext( env );
+    }
+
+
+    /**
+     * Adds profile test/demo data which is also setup on the client
+     * application.
+     *
+     * @param store the store to add the test data to
+     * @throws NamingException on failures while adding test profiles
+     */
+    private static void addDemoProfiles( ServerProfileStore store, String realm ) throws NamingException
+    {
+        for ( int ii = 0; ii < ProfileTestData.PROFILES.length; ii++ )
+        {
+            ServerProfile profile = ProfileTestData.PROFILES[ii];
+            BaseServerProfileModifier modifier = new BaseServerProfileModifier();
+            modifier.setActivationKey( profile.getActivationKey() );
+            modifier.setFactor( profile.getFactor() );
+            modifier.setFailuresInEpoch( profile.getFailuresInEpoch() );
+            modifier.setInfo( profile.getInfo() );
+            modifier.setLabel( profile.getLabel() );
+            modifier.setPassword( profile.getPassword() );
+            modifier.setRealm( realm );
+            modifier.setResynchCount( profile.getResynchCount() );
+            modifier.setSecret( profile.getSecret() );
+            modifier.setTokenPin( profile.getTokenPin() );
+            modifier.setUserId( profile.getUserId() );
+            profile = modifier.getServerProfile();
+            String name = profile.getUserId() + "@" + realm;
+            KerberosPrincipal principal = new KerberosPrincipal( name );
+
+            if ( ! store.hasProfile( principal ) )
+            {
+                store.add( profile );
+            }
+        }
+    }
+
+
+    public void synch() throws Exception
+    {
+        env.putAll( new SyncConfiguration().toJndiEnvironment() );
+        new InitialDirContext( env );
+    }
+
+
+    class SynchWorker implements Runnable
+    {
+        Object lock = new Object();
+        boolean stop = false;
+
+
+        public void run()
+        {
+            while ( !stop )
+            {
+                synchronized ( lock )
+                {
+                    try
+                    {
+                        lock.wait( SYNCPERIOD_MILLIS );
+                    }
+                    catch ( InterruptedException e )
+                    {
+                        log.warn( "SynchWorker failed to wait on lock.", e );
+                    }
+                }
+
+                try
+                {
+                    synch();
+                }
+                catch ( Exception e )
+                {
+                    log.error( "SynchWorker failed to synch directory.", e );
+                }
+            }
+        }
+    }
+
+    public static final String BANNER = "           _                     _          ____  ____   \n"
+        + "          / \\   _ __   __ _  ___| |__   ___|  _ \\/ ___|  \n"
+        + "         / _ \\ | '_ \\ / _` |/ __| '_ \\ / _ \\ | | \\___ \\   \n"
+        + "        / ___ \\| |_) | (_| | (__| | | |  __/ |_| |___) |  \n"
+        + "       /_/   \\_\\ .__/ \\__,_|\\___|_| |_|\\___|____/|____/   \n"
+        + "               |_|                                                               \n";
+
+
+    public static void printBanner()
+    {
+        System.out.println( BANNER );
+    }
+
+
+    public void setEnableShutdownHook( boolean enableShutdownHook )
+    {
+        this.enableShutdownHook = enableShutdownHook;
+    }
+
+
+    public boolean isEnableShutdownHook()
+    {
+        return enableShutdownHook;
+    }
+
+	public void setEnableHttpService( boolean enableHttpService )
+	{
+		this.enableHttpService = enableHttpService;
+	}
+
+	public boolean isEnableHttpService()
+	{
+		return enableHttpService;
+	}
+}

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecInstallationLayout.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecInstallationLayout.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecInstallationLayout.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecInstallationLayout.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,58 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+import java.io.File;
+
+import org.apache.directory.daemon.InstallationLayout;
+
+
+public class TriplesecInstallationLayout extends InstallationLayout
+{
+    public TriplesecInstallationLayout( File installBase )
+    {
+        super( installBase );
+    }
+
+
+    public TriplesecInstallationLayout( String installBase )
+    {
+        super( installBase );
+    }
+
+
+    public File getWebappsDirectory()
+    {
+        return getWebappsDirectory( "webapps" );
+    }
+
+
+    public File getWebappsDirectory( String webappsPath )
+    {
+        return new File( super.baseDirectory, webappsPath );
+    }
+
+
+    public void mkdirs()
+    {
+        super.mkdirs();
+        getWebappsDirectory().mkdirs();
+    }
+}

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecUberjarMain.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecUberjarMain.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecUberjarMain.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplesecUberjarMain.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+import java.io.File;
+
+
+
+/**
+ * The main application entry point for Triplesec as a java application.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class TriplesecUberjarMain
+{
+    /**
+     * Takes a single argument, the path to the installation home, which contains 
+     * the configuration to load with server startup settings.
+     *
+     * @param args the arguments
+     */
+    public static void main( String[] args ) throws Exception
+    {
+        Service server = new Service();
+
+        if ( args.length > 0 && new File( args[0] ).isDirectory() )
+        {
+            server.init( new TriplesecInstallationLayout( args[0] ), null );
+            server.start();
+        }
+        else if ( args.length > 0 && new File( args[0] ).isFile() )
+        {
+            server.init( null, args );
+            server.start();
+        }
+        else
+        {
+            server.init( null, null );
+            server.start();
+        }
+    }
+}
+

Added: directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplsecContextFactory.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplsecContextFactory.java?view=auto&rev=558849
==============================================================================
--- directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplsecContextFactory.java (added)
+++ directory/triplesec/trunk/main/src/main/java/org/apache/directory/triplesec/TriplsecContextFactory.java Mon Jul 23 13:01:54 2007
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.triplesec;
+
+
+import org.apache.directory.server.jndi.ServerContextFactory;
+import org.apache.directory.server.core.DirectoryService;
+
+import javax.naming.NamingException;
+
+
+/**
+ * Nothing for now.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class TriplsecContextFactory extends ServerContextFactory
+{
+
+    public void afterStartup( DirectoryService service ) throws NamingException
+    {
+        super.afterStartup( service );
+    }
+
+
+    public void afterShutdown( DirectoryService service )
+    {
+        super.afterShutdown( service );
+    }
+}

Modified: directory/triplesec/trunk/swing-admin/pom.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/pom.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/pom.xml (original)
+++ directory/triplesec/trunk/swing-admin/pom.xml Mon Jul 23 13:01:54 2007
@@ -144,7 +144,7 @@
                   <value>${basedir}/target/settingsFile</value>
                 </property>
                 <property>
-                  <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+                  <name>org.apache.directory.triplesec.integration.resourcesDirectory</name>
                   <value>${basedir}/src/test/resources</value>
                 </property>
               </systemProperties>
@@ -173,7 +173,7 @@
               </argLine>
               <systemProperties>
                 <property>
-                  <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+                  <name>org.apache.directory.triplesec.integration.resourcesDirectory</name>
                   <value>${basedir}/src/test/resources</value>
                 </property>
                 <property>

Modified: directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/AdminFrame.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/AdminFrame.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/AdminFrame.java (original)
+++ directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/AdminFrame.java Mon Jul 23 13:01:54 2007
@@ -50,9 +50,9 @@
 import org.apache.directory.triplesec.admin.Profile;
 import org.apache.directory.triplesec.admin.Role;
 import org.apache.directory.triplesec.admin.User;
-import org.safehaus.triplesec.TriplesecInstallationLayout;
-import org.safehaus.triplesec.guardian.ApplicationPolicy;
-import org.safehaus.triplesec.guardian.ApplicationPolicyFactory;
+import org.apache.directory.triplesec.guardian.ApplicationPolicy;
+import org.apache.directory.triplesec.guardian.ApplicationPolicyFactory;
+import org.apache.directory.triplesec.TriplesecInstallationLayout;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -977,7 +977,7 @@
 
             try
             {
-                Class.forName( "org.safehaus.triplesec.guardian.ldap.LdapConnectionDriver" );
+                Class.forName( "org.apache.directory.triplesec.guardian.ldap.LdapConnectionDriver" );
             }
             catch ( ClassNotFoundException e1 )
             {

Modified: directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConfigurationFileManager.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConfigurationFileManager.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConfigurationFileManager.java (original)
+++ directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConfigurationFileManager.java Mon Jul 23 13:01:54 2007
@@ -37,7 +37,7 @@
 import javax.swing.filechooser.FileFilter;
 
 import org.apache.directory.triplesec.configuration.MutableTriplesecStartupConfiguration;
-import org.safehaus.triplesec.TriplesecInstallationLayout;
+import org.apache.directory.triplesec.TriplesecInstallationLayout;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConnectionManager.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConnectionManager.java (original)
+++ directory/triplesec/trunk/swing-admin/src/main/java/org/safehaus/triplesec/admin/swing/ConnectionManager.java Mon Jul 23 13:01:54 2007
@@ -39,13 +39,13 @@
 import org.apache.directory.triplesec.admin.TriplesecAdmin;
 import org.apache.directory.triplesec.admin.dao.ldap.LdapDaoFactory;
 import org.apache.directory.triplesec.configuration.TriplesecStartupConfiguration;
-import org.safehaus.triplesec.guardian.ApplicationPolicy;
-import org.safehaus.triplesec.guardian.Profile;
-import org.safehaus.triplesec.jaas.PasscodeCallback;
-import org.safehaus.triplesec.jaas.PolicyCallback;
-import org.safehaus.triplesec.jaas.RealmCallback;
-import org.safehaus.triplesec.jaas.SafehausLoginModule;
-import org.safehaus.triplesec.jaas.SafehausPrincipal;
+import org.apache.directory.triplesec.guardian.ApplicationPolicy;
+import org.apache.directory.triplesec.guardian.Profile;
+import org.apache.directory.triplesec.jaas.PasscodeCallback;
+import org.apache.directory.triplesec.jaas.PolicyCallback;
+import org.apache.directory.triplesec.jaas.RealmCallback;
+import org.apache.directory.triplesec.jaas.SafehausLoginModule;
+import org.apache.directory.triplesec.jaas.SafehausPrincipal;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: directory/triplesec/trunk/swing-admin/src/test/java/org/safehaus/triplesec/admin/swing/LaunchAdminFrame.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/src/test/java/org/safehaus/triplesec/admin/swing/LaunchAdminFrame.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/src/test/java/org/safehaus/triplesec/admin/swing/LaunchAdminFrame.java (original)
+++ directory/triplesec/trunk/swing-admin/src/test/java/org/safehaus/triplesec/admin/swing/LaunchAdminFrame.java Mon Jul 23 13:01:54 2007
@@ -22,10 +22,10 @@
 
 import java.util.Properties;
 
-import org.safehaus.triplesec.TriplesecInstallationLayout;
-import org.safehaus.triplesec.guardian.ApplicationPolicy;
-import org.safehaus.triplesec.guardian.ApplicationPolicyFactory;
-import org.safehaus.triplesec.integration.TriplesecIntegration;
+import org.apache.directory.triplesec.guardian.ApplicationPolicy;
+import org.apache.directory.triplesec.guardian.ApplicationPolicyFactory;
+import org.apache.directory.triplesec.integration.TriplesecIntegration;
+import org.apache.directory.triplesec.TriplesecInstallationLayout;
 
 
 public class LaunchAdminFrame extends TriplesecIntegration
@@ -67,7 +67,7 @@
 
         try
         {
-            Class.forName( "org.safehaus.triplesec.guardian.ldap.LdapConnectionDriver" );
+            Class.forName( "org.apache.directory.triplesec.guardian.ldap.LdapConnectionDriver" );
         }
         catch ( ClassNotFoundException e1 )
         {

Modified: directory/triplesec/trunk/swing-admin/src/test/resources/server.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-admin/src/test/resources/server.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-admin/src/test/resources/server.xml (original)
+++ directory/triplesec/trunk/swing-admin/src/test/resources/server.xml Mon Jul 23 13:01:54 2007
@@ -11,8 +11,8 @@
         <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
         <prop key="java.naming.security.credentials">secret</prop>
         <prop key="java.naming.provider.url">dc=example,dc=com</prop>
-        <prop key="java.naming.factory.state">org.safehaus.triplesec.store.ProfileStateFactory</prop>
-        <prop key="java.naming.factory.object">org.safehaus.triplesec.store.ProfileObjectFactory</prop>
+        <prop key="java.naming.factory.state">org.apache.directory.triplesec.store.ProfileStateFactory</prop>
+        <prop key="java.naming.factory.object">org.apache.directory.triplesec.store.ProfileObjectFactory</prop>
 
         <prop key="kdc.primary.realm">EXAMPLE.COM</prop>
         <prop key="kdc.principal">krbtgt/EXAMPLE.COM@EXAMPLE.COM</prop>
@@ -37,7 +37,7 @@
 
         <prop key="safehaus.entry.basedn">ou=Users,dc=example,dc=com</prop>
         <prop key="safehaus.load.testdata">true</prop>
-        <prop key="kerberos.sam.type.7">org.safehaus.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
+        <prop key="kerberos.sam.type.7">org.apache.directory.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
       </props>
     </property>
   </bean>
@@ -121,7 +121,7 @@
         <bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
-        <bean class="org.safehaus.triplesec.store.schema.SafehausSchema"/>
+        <bean class="org.apache.directory.triplesec.store.schema.SafehausSchema"/>
       </set>
     </property>
     
@@ -203,7 +203,7 @@
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
           <property name="name"><value>policyProtectionService</value></property>
           <property name="interceptor">
-            <bean class="org.safehaus.triplesec.store.interceptor.PolicyProtectionInterceptor" />
+            <bean class="org.apache.directory.triplesec.store.interceptor.PolicyProtectionInterceptor" />
           </property>
         </bean>
       </list>

Modified: directory/triplesec/trunk/swing-demo/pom.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/pom.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/pom.xml (original)
+++ directory/triplesec/trunk/swing-demo/pom.xml Mon Jul 23 13:01:54 2007
@@ -61,7 +61,7 @@
         <configuration>
           <systemProperties>
             <property>
-              <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+              <name>org.apache.directory.triplesec.integration.resourcesDirectory</name>
               <value>${basedir}/src/test/resources</value>
             </property>
           </systemProperties>
@@ -73,7 +73,7 @@
       	<configuration>
       	  <archive>
       	    <manifest>
-      	      <mainClass>org.safehaus.triplesec.guardian.demo.DemoFrame</mainClass>
+      	      <mainClass>org.apache.directory.triplesec.guardian.demo.DemoFrame</mainClass>
       	    </manifest>
       	  </archive>
       	</configuration>
@@ -84,7 +84,7 @@
       	<configuration>
       	  <archive>
       	    <manifest>
-      	      <mainClass>org.safehaus.triplesec.guardian.demo.DemoFrame</mainClass>
+      	      <mainClass>org.apache.directory.triplesec.guardian.demo.DemoFrame</mainClass>
       	    </manifest> 
       	  </archive>
           <descriptor>src/main/assembly/demo.xml</descriptor>
@@ -140,7 +140,7 @@
                   <value>${basedir}/target/settingsFile</value>
                 </property>
                 <property>
-                  <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+                  <name>org.apache.directory.triplesec.integration.resourcesDirectory</name>
                   <value>${basedir}/src/test/resources</value>
                 </property>
               </systemProperties>
@@ -165,7 +165,7 @@
             <configuration>
               <systemProperties>
                 <property>
-                  <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+                  <name>org.apache.directory.triplesec.integration.resourcesDirectory</name>
                   <value>${basedir}/src/test/resources</value>
                 </property>
                 <property>

Modified: directory/triplesec/trunk/swing-demo/sample.properties
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/sample.properties?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/sample.properties (original)
+++ directory/triplesec/trunk/swing-demo/sample.properties Mon Jul 23 13:01:54 2007
@@ -2,4 +2,4 @@
 connectionUrl=ldap://localhost:10389/dc=example,dc=com
 applicationCredentials=secret
 applicationPrincipalDn=appname=demo,ou=Applications,dc=example,dc=com
-driver=org.safehaus.triplesec.guardian.ldap.LdapConnectionDriver
+driver=org.apache.directory.triplesec.guardian.ldap.LdapConnectionDriver

Modified: directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/DemoFrame.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/DemoFrame.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/DemoFrame.java (original)
+++ directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/DemoFrame.java Mon Jul 23 13:01:54 2007
@@ -38,13 +38,15 @@
 import javax.swing.JScrollPane;
 import javax.swing.JTextPane;
 
-import org.safehaus.triplesec.guardian.ApplicationPolicy;
-import org.safehaus.triplesec.guardian.ApplicationPolicyFactory;
-import org.safehaus.triplesec.guardian.ChangeType;
-import org.safehaus.triplesec.guardian.Permission;
-import org.safehaus.triplesec.guardian.PolicyChangeListener;
-import org.safehaus.triplesec.guardian.Profile;
-import org.safehaus.triplesec.guardian.Role;
+import org.apache.directory.triplesec.guardian.ApplicationPolicy;
+import org.apache.directory.triplesec.guardian.ApplicationPolicyFactory;
+import org.apache.directory.triplesec.guardian.ChangeType;
+import org.safehaus.triplesec.guardian.demo.LoginCommand;
+import org.safehaus.triplesec.guardian.demo.LoginDialog;
+import org.apache.directory.triplesec.guardian.Permission;
+import org.apache.directory.triplesec.guardian.PolicyChangeListener;
+import org.apache.directory.triplesec.guardian.Profile;
+import org.apache.directory.triplesec.guardian.Role;
 
 
 public class DemoFrame extends JFrame
@@ -71,7 +73,7 @@
     private JTextPane jTextPane = null;
 
     static ApplicationPolicy policy = null;
-    static String driver = "org.safehaus.triplesec.guardian.ldap.LdapConnectionDriver";
+    static String driver = "org.apache.directory.triplesec.guardian.ldap.LdapConnectionDriver";
     static String connectionUrl = "ldap://localhost:10389/dc=example,dc=com";
     static String applicationPrincipalDn = "appname=demo,ou=Applications,dc=example,dc=com";
     static String applicationCredentials = "secret";

Modified: directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/LoginCommand.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/LoginCommand.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/LoginCommand.java (original)
+++ directory/triplesec/trunk/swing-demo/src/main/java/org/safehaus/triplesec/guardian/demo/LoginCommand.java Mon Jul 23 13:01:54 2007
@@ -29,12 +29,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.safehaus.triplesec.guardian.ApplicationPolicy;
-import org.safehaus.triplesec.jaas.PasscodeCallback;
-import org.safehaus.triplesec.jaas.PolicyCallback;
-import org.safehaus.triplesec.jaas.RealmCallback;
-import org.safehaus.triplesec.jaas.SafehausLoginModule;
-import org.safehaus.triplesec.jaas.SafehausPrincipal;
+import org.apache.directory.triplesec.guardian.ApplicationPolicy;
+import org.apache.directory.triplesec.jaas.PasscodeCallback;
+import org.apache.directory.triplesec.jaas.PolicyCallback;
+import org.apache.directory.triplesec.jaas.RealmCallback;
+import org.apache.directory.triplesec.jaas.SafehausLoginModule;
+import org.apache.directory.triplesec.jaas.SafehausPrincipal;
 
 
 /**

Modified: directory/triplesec/trunk/swing-demo/src/test/java/org/safehaus/triplesec/guardian/demo/LaunchDemoFrame.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/src/test/java/org/safehaus/triplesec/guardian/demo/LaunchDemoFrame.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/src/test/java/org/safehaus/triplesec/guardian/demo/LaunchDemoFrame.java (original)
+++ directory/triplesec/trunk/swing-demo/src/test/java/org/safehaus/triplesec/guardian/demo/LaunchDemoFrame.java Mon Jul 23 13:01:54 2007
@@ -20,7 +20,7 @@
 package org.safehaus.triplesec.guardian.demo;
 
 
-import org.safehaus.triplesec.integration.TriplesecIntegration;
+import org.apache.directory.triplesec.integration.TriplesecIntegration;
 
 
 public class LaunchDemoFrame extends TriplesecIntegration

Modified: directory/triplesec/trunk/swing-demo/src/test/resources/server.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/swing-demo/src/test/resources/server.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/swing-demo/src/test/resources/server.xml (original)
+++ directory/triplesec/trunk/swing-demo/src/test/resources/server.xml Mon Jul 23 13:01:54 2007
@@ -11,8 +11,8 @@
         <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
         <prop key="java.naming.security.credentials">secret</prop>
         <prop key="java.naming.provider.url">dc=example,dc=com</prop>
-        <prop key="java.naming.factory.state">org.safehaus.triplesec.store.ProfileStateFactory</prop>
-        <prop key="java.naming.factory.object">org.safehaus.triplesec.store.ProfileObjectFactory</prop>
+        <prop key="java.naming.factory.state">org.apache.directory.triplesec.store.ProfileStateFactory</prop>
+        <prop key="java.naming.factory.object">org.apache.directory.triplesec.store.ProfileObjectFactory</prop>
 
         <prop key="kdc.primary.realm">EXAMPLE.COM</prop>
         <prop key="kdc.principal">krbtgt/EXAMPLE.COM@EXAMPLE.COM</prop>
@@ -37,7 +37,7 @@
 
         <prop key="safehaus.entry.basedn">ou=Users,dc=example,dc=com</prop>
         <prop key="safehaus.load.testdata">true</prop>
-        <prop key="kerberos.sam.type.7">org.safehaus.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
+        <prop key="kerberos.sam.type.7">org.apache.directory.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
       </props>
     </property>
   </bean>
@@ -121,7 +121,7 @@
         <bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
         <bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
-        <bean class="org.safehaus.triplesec.store.schema.SafehausSchema"/>
+        <bean class="org.apache.directory.triplesec.store.schema.SafehausSchema"/>
       </set>
     </property>
     
@@ -203,7 +203,7 @@
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
           <property name="name"><value>policyProtectionService</value></property>
           <property name="interceptor">
-            <bean class="org.safehaus.triplesec.store.interceptor.PolicyProtectionInterceptor" />
+            <bean class="org.apache.directory.triplesec.store.interceptor.PolicyProtectionInterceptor" />
           </property>
         </bean>
       </list>

Modified: directory/triplesec/trunk/tools/pom.xml
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/tools/pom.xml?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/tools/pom.xml (original)
+++ directory/triplesec/trunk/tools/pom.xml Mon Jul 23 13:01:54 2007
@@ -54,7 +54,7 @@
           <archive>
             <manifestFile>src/main/manifest/MANIFEST.MF</manifestFile>
             <manifest>
-              <mainClass>org.safehaus.triplesec.tools.Tools</mainClass>
+              <mainClass>org.apache.directory.triplesec.tools.Tools</mainClass>
             </manifest>
           </archive>
         </configuration>

Modified: directory/triplesec/trunk/utils-hauskeys/src/test/java/org/safehaus/triplesec/utils/hauskeys/HauskeysMidletBuilderTest.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/utils-hauskeys/src/test/java/org/safehaus/triplesec/utils/hauskeys/HauskeysMidletBuilderTest.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/utils-hauskeys/src/test/java/org/safehaus/triplesec/utils/hauskeys/HauskeysMidletBuilderTest.java (original)
+++ directory/triplesec/trunk/utils-hauskeys/src/test/java/org/safehaus/triplesec/utils/hauskeys/HauskeysMidletBuilderTest.java Mon Jul 23 13:01:54 2007
@@ -22,8 +22,8 @@
 
 import java.io.File;
 
-import org.safehaus.otp.HotpAttributes;
-import org.safehaus.otp.HotpAttributesCipher;
+import org.apache.directory.triplesec.otp.HotpAttributes;
+import org.apache.directory.triplesec.otp.HotpAttributesCipher;
 import org.safehaus.profile.ProfileTestData;
 import org.safehaus.profile.ServerProfile;
 

Modified: directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountDisabledException.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountDisabledException.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountDisabledException.java (original)
+++ directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountDisabledException.java Mon Jul 23 13:01:54 2007
@@ -20,7 +20,7 @@
 package org.safehaus.triplesec.verifier.hotp;
 
 
-import org.safehaus.otp.HotpErrorConstants;
+import org.apache.directory.triplesec.otp.HotpErrorConstants;
 
 
 /**

Modified: directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountInactiveException.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountInactiveException.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountInactiveException.java (original)
+++ directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountInactiveException.java Mon Jul 23 13:01:54 2007
@@ -20,7 +20,7 @@
 package org.safehaus.triplesec.verifier.hotp;
 
 
-import org.safehaus.otp.HotpErrorConstants;
+import org.apache.directory.triplesec.otp.HotpErrorConstants;
 
 
 /**

Modified: directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountLockedOutException.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountLockedOutException.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountLockedOutException.java (original)
+++ directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/AccountLockedOutException.java Mon Jul 23 13:01:54 2007
@@ -20,7 +20,7 @@
 package org.safehaus.triplesec.verifier.hotp;
 
 
-import org.safehaus.otp.HotpErrorConstants;
+import org.apache.directory.triplesec.otp.HotpErrorConstants;
 
 
 /**

Modified: directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/DefaultHotpSamVerifier.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/DefaultHotpSamVerifier.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/DefaultHotpSamVerifier.java (original)
+++ directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/DefaultHotpSamVerifier.java Mon Jul 23 13:01:54 2007
@@ -28,9 +28,9 @@
 import org.apache.directory.server.kerberos.shared.messages.value.SamType;
 import org.apache.directory.server.kerberos.sam.KeyIntegrityChecker;
 import org.apache.directory.server.kerberos.sam.SamException;
+import org.apache.directory.triplesec.otp.Hotp;
+import org.apache.directory.triplesec.otp.ResynchParameters;
 
-import org.safehaus.otp.Hotp;
-import org.safehaus.otp.ResynchParameters;
 import org.safehaus.profile.ServerProfile;
 import org.safehaus.profile.BaseServerProfileModifier;
 import org.safehaus.triplesec.store.ServerProfileStore;

Modified: directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/HotpException.java
URL: http://svn.apache.org/viewvc/directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/HotpException.java?view=diff&rev=558849&r1=558848&r2=558849
==============================================================================
--- directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/HotpException.java (original)
+++ directory/triplesec/trunk/verifier/src/main/java/org/safehaus/triplesec/verifier/hotp/HotpException.java Mon Jul 23 13:01:54 2007
@@ -22,8 +22,8 @@
 
 import org.apache.directory.server.kerberos.shared.messages.value.SamType;
 import org.apache.directory.server.kerberos.sam.SamException;
+import org.apache.directory.triplesec.otp.HotpErrorConstants;
 
-import org.safehaus.otp.HotpErrorConstants;
 
 
 /**



Mime
View raw message