You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/06/10 18:25:37 UTC

svn commit: r189981 - in /directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server: AbstractCoreTest.java configuration/StartupConfiguration.java prefs/ServerSystemPreferenceException.java prefs/ServerSystemPreferences.java

Author: trustin
Date: Fri Jun 10 09:25:36 2005
New Revision: 189981

URL: http://svn.apache.org/viewcvs?rev=189981&view=rev
Log:
* Fixed: StartupConfiguration.allowAnonymousAccess is incorrect.
* Fixed: ServerSystemPreferences doesn't throw exceptions.
* Added ServerSystemPreferenceException

Added:
    directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java   (with props)
Modified:
    directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/AbstractCoreTest.java
    directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
    directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java

Modified: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/AbstractCoreTest.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/AbstractCoreTest.java?rev=189981&r1=189980&r2=189981&view=diff
==============================================================================
--- directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/AbstractCoreTest.java (original)
+++ directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/AbstractCoreTest.java Fri Jun 10 09:25:36 2005
@@ -294,5 +294,7 @@
         loadClass = null;
         
         configuration = new MutableStartupConfiguration();
+        
+        doDelete( configuration.getWorkingDirectory() );
     }
 }

Modified: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java?rev=189981&r1=189980&r2=189981&view=diff
==============================================================================
--- directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java (original)
+++ directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/configuration/StartupConfiguration.java Fri Jun 10 09:25:36 2005
@@ -50,7 +50,7 @@
     private static final long serialVersionUID = 4826762196566871677L;
 
     protected File workingDirectory = new File( "server-work" );
-    protected boolean allowAnonymousAccess;
+    protected boolean allowAnonymousAccess = true; // allow by default
     protected Set authenticatorConfigurations; // Set<AuthenticatorConfiguration>
     protected InterceptorChain interceptors = InterceptorChain.newDefaultChain();
     protected ServiceRegistry minaServiceRegistry = new SimpleServiceRegistry();

Added: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java?rev=189981&view=auto
==============================================================================
--- directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java (added)
+++ directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java Fri Jun 10 09:25:36 2005
@@ -0,0 +1,52 @@
+/*
+ *   @(#) $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.ldap.server.prefs;
+
+
+/**
+ * A {@link RuntimeException} that is thrown when accessing
+ * {@link org.apache.ldap.server.prefs.ServerSystemPreferences} failed.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ServerSystemPreferenceException extends RuntimeException
+{
+    private static final long serialVersionUID = -2042269063779317751L;
+
+    public ServerSystemPreferenceException()
+    {
+        super();
+    }
+
+    public ServerSystemPreferenceException( String message )
+    {
+        super( message );
+    }
+
+    public ServerSystemPreferenceException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+    public ServerSystemPreferenceException( Throwable cause )
+    {
+        super( cause );
+    }
+}

Propchange: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferenceException.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java?rev=189981&r1=189980&r2=189981&view=diff
==============================================================================
--- directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/branches/direve-158/core/src/main/java/org/apache/ldap/server/prefs/ServerSystemPreferences.java Fri Jun 10 09:25:36 2005
@@ -82,19 +82,18 @@
 
         MutableStartupConfiguration cfg = new MutableStartupConfiguration();
         cfg.setAllowAnonymousAccess( true );
+        
         Hashtable env = new Hashtable( cfg.toJndiEnvironment() );
-
         env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );
-
         env.put( Context.PROVIDER_URL, PreferencesUtils.SYSPREF_BASE );
 
         try
         {
             ctx = new InitialLdapContext( env, null );
         }
-        catch ( NamingException e )
+        catch ( Exception e )
         {
-            e.printStackTrace();
+            throw new ServerSystemPreferenceException( "Failed to initialize InitialLdapContext.", e );
         }
     }
 
@@ -125,9 +124,9 @@
             {
                 setUpNode( name );
             }
-            catch ( NamingException e )
+            catch ( Exception e )
             {
-                e.printStackTrace();
+                throw new ServerSystemPreferenceException( "Failed to set up node.", e );
             }
         }
     }
@@ -402,9 +401,9 @@
 
             value = ( String ) attr.get();
         }
-        catch ( NamingException e )
+        catch ( Exception e )
         {
-            e.printStackTrace();
+            throw new ServerSystemPreferenceException( "Failed to get SPI.", e );
         }
 
         return value;