directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r193116 - /directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/
Date Thu, 23 Jun 2005 09:09:02 GMT
Author: trustin
Date: Thu Jun 23 02:08:59 2005
New Revision: 193116

URL: http://svn.apache.org/viewcvs?rev=193116&view=rev
Log:
* Revised JavaDoc for configuration package.
* Removed SyncConfiguration.getInstance(); I intentionally avoided singleton pattern here
because we might need to pass something when we shut down.

Modified:
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AttributesPropertyEditor.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AuthenticatorConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/Configuration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ContextPartitionConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/InterceptorConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableAuthenticatorConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableInterceptorConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AttributesPropertyEditor.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AttributesPropertyEditor.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AttributesPropertyEditor.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AttributesPropertyEditor.java
Thu Jun 23 02:08:59 2005
@@ -1,5 +1,24 @@
+/*
+ *   @(#) $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.configuration;
 
+import java.beans.PropertyEditor;
 import java.beans.PropertyEditorSupport;
 import java.util.Collection;
 import java.util.Map;
@@ -18,24 +37,43 @@
 import org.apache.ldap.common.ldif.LdifParserImpl;
 import org.apache.ldap.common.util.MultiMap;
 
+/**
+ * A JavaBeans {@link PropertyEditor} that can convert {@link Attributes}
+ * to LDIF string and vice versa.  This class is useful when you're going
+ * to configure a context factory with 3rd party containers such as
+ * <a href="http://www.springframework.org/">Spring Framework</a>.
+ *
+ * @author The Apache Directory Project
+ * @version $Rev$, $Date$
+ */
 public class AttributesPropertyEditor extends PropertyEditorSupport
 {
 
+    /**
+     * Creates a new instance.
+     */
     public AttributesPropertyEditor()
     {
         super();
     }
 
+    /**
+     * Creates a new instance with source object.
+     */
     public AttributesPropertyEditor( Object source )
     {
         super( source );
     }
 
+    /**
+     * Returns LDIF string of {@link Attributes} object.
+     */
     public String getAsText()
     {
         LdifComposer composer = new LdifComposerImpl();
         MultiMap map = new MultiMap()
         {
+            // FIXME Stop forking commons-collections.
             private final MultiHashMap map = new MultiHashMap();
 
             public Object remove( Object arg0, Object arg1 )
@@ -127,6 +165,9 @@
         }
     }
 
+    /**
+     * Converts the specified LDIF string into {@link Attributes}.
+     */
     public void setAsText( String text ) throws IllegalArgumentException
     {
         if( text == null )

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AuthenticatorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AuthenticatorConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AuthenticatorConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/AuthenticatorConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -31,30 +31,51 @@
     private String name;
     private Authenticator authenticator;
 
+    /**
+     * Creates a new instance.
+     */
     protected AuthenticatorConfiguration()
     {
     }
 
+    /**
+     * Returns the {@link Authenticator} this configuration is configuring.
+     */
     public Authenticator getAuthenticator()
     {
         return authenticator;
     }
 
+    /**
+     * Sets the {@link Authenticator} to configure.
+     */
     protected void setAuthenticator( Authenticator authenticator )
     {
         this.authenticator = authenticator;
     }
 
+    /**
+     * Returns the user-defined name of the {@link Authenticator} that
+     * this configuration configures..
+     */
     public String getName()
     {
         return name;
     }
 
+    /**
+     * Sets the user-defined name of the {@link Authenticator} that
+     * this configuration configures.
+     */
     protected void setName( String name )
     {
         this.name = name.trim();
     }
 
+    /**
+     * Validates all properties of this configuration.
+     * @throws ConfigurationException if this configuration is not valid. 
+     */
     public void validate()
     {
         if( name == null )

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/Configuration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/Configuration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/Configuration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/Configuration.java
Thu Jun 23 02:08:59 2005
@@ -23,7 +23,7 @@
 
 /**
  * A configuration that provides required, optional, or default properties
- * to configure ApacheDS.
+ * to configure context factory.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -54,9 +54,8 @@
     }
 
     /**
-     * Valids this configuration.
-     * 
-     * @throws ConfigurationException if this configuration is invalid
+     * Validates this configuration.
+     * @throws ConfigurationException if this configuration is not valid
      */
     public void validate()
     {
@@ -73,7 +72,7 @@
         env.put( JNDI_KEY, this );
         return env;
     }
-    
+
     public Object clone()
     {
         try

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ConfigurationUtil.java
Thu Jun 23 02:08:59 2005
@@ -111,6 +111,10 @@
         return newSet;
     }
 
+    /**
+     * Throws a {@link ConfigurationException} if the specified port number
+     * is out of range.
+     */
     static void validatePortNumber( int port )
     {
         if( port < 0 || port > 65535 )

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ContextPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ContextPartitionConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ContextPartitionConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/ContextPartitionConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -59,11 +59,19 @@
     {
     }
     
+    /**
+     * Returns user-defined name of the {@link ContextPartition} that
+     * this configuration configures.
+     */
     public String getName()
     {
         return name;
     }
     
+    /**
+     * Sets user-defined name of the {@link ContextPartition} that
+     * this configuration configures.
+     */
     protected void setName( String name )
     {
         // TODO name can be a directory name.
@@ -71,11 +79,17 @@
         this.name = name;
     }
 
+    /**
+     * Returns the set of attribute type strings to create an index on.
+     */
     public Set getIndexedAttributes()
     {
         return ConfigurationUtil.getClonedSet( indexedAttributes );
     }
     
+    /**
+     * Sets the set of attribute type strings to create an index on.
+     */
     protected void setIndexedAttributes( Set indexedAttributes )
     {
         Set newIndexedAttributes = ConfigurationUtil.getTypeSafeSet(
@@ -91,11 +105,17 @@
         this.indexedAttributes = newIndexedAttributes;
     }
     
+    /**
+     * Returns the {@link ContextPartition} that this configuration configures.
+     */
     public ContextPartition getContextPartition()
     {
         return contextPartition;
     }
     
+    /**
+     * Sets the {@link ContextPartition} that this configuration configures.
+     */
     protected void setContextPartition( ContextPartition partition )
     {
         if( partition == null )
@@ -105,31 +125,51 @@
         this.contextPartition = partition;
     }
     
+    /**
+     * Returns root entry that will be added to the {@link ContextPartition}
+     * after it is initialized.
+     */
     public Attributes getContextEntry()
     {
         return ( Attributes ) contextEntry.clone();
     }
     
+    /**
+     * Sets root entry that will be added to the {@link ContextPartition}
+     * after it is initialized.
+     */
     protected void setContextEntry( Attributes rootEntry )
     {
         this.contextEntry = ( Attributes ) rootEntry.clone();
     }
     
+    /**
+     * Returns the suffix of the {@link ContextPartition}.
+     */
     public String getSuffix()
     {
         return suffix;
     }
     
+    /**
+     * Returns the normalized suffix of the {@link ContextPartition}.
+     */
     public Name getNormalizedSuffix( MatchingRuleRegistry matchingRuleRegistry ) throws NamingException
     {
         return getNormalizedSuffix( matchingRuleRegistry.lookup( "distinguishedNameMatch"
).getNormalizer() );
     }
     
+    /**
+     * Returns the normalized suffix of the {@link ContextPartition}.
+     */
     public Name getNormalizedSuffix( Normalizer normalizer ) throws NamingException
     {
         return new LdapName( normalizer.normalize( suffix ).toString() );
     }
     
+    /**
+     * Sets the suffix of the {@link ContextPartition}.
+     */
     protected void setSuffix( String suffix )
     {
         suffix = suffix.trim();

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/InterceptorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/InterceptorConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/InterceptorConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/InterceptorConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -31,30 +31,52 @@
     private String name;
     private Interceptor interceptor;
 
+    /**
+     * Creates a new instance.
+     */
     protected InterceptorConfiguration()
     {
     }
 
+    /**
+     * Returns the {@link Interceptor} that this configuration
+     * configures.
+     */
     public Interceptor getInterceptor()
     {
         return interceptor;
     }
 
+    /**
+     * Sets the {@link Interceptor} that this configuration
+     * configures.
+     */
     protected void setInterceptor( Interceptor authenticator )
     {
         this.interceptor = authenticator;
     }
 
+    /**
+     * Returns the name of the {@link Interceptor}.
+     */
     public String getName()
     {
         return name;
     }
 
+    /**
+     * Sets the name of the {@link Interceptor}.
+     */
     protected void setName( String name )
     {
         this.name = name.trim();
     }
 
+    /**
+     * Validates this configuration.
+     *
+     * @throws ConfigurationException if this configuration is not valid.
+     */
     public void validate()
     {
         if( name == null )

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableAuthenticatorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableAuthenticatorConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableAuthenticatorConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableAuthenticatorConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -30,6 +30,9 @@
         AuthenticatorConfiguration
 {
 
+    /**
+     * Creates a new instance.
+     */
     public MutableAuthenticatorConfiguration()
     {
     }

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableInterceptorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableInterceptorConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableInterceptorConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableInterceptorConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -30,6 +30,9 @@
         InterceptorConfiguration
 {
 
+    /**
+     * Creates a new instance.
+     */
     public MutableInterceptorConfiguration()
     {
     }

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/MutableStartupConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -32,6 +32,9 @@
 {
     private static final long serialVersionUID = -987437370955222007L;
 
+    /**
+     * Creates a new instance.
+     */
     public MutableStartupConfiguration()
     {
     }

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java?rev=193116&r1=193115&r2=193116&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
(original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
Thu Jun 23 02:08:59 2005
@@ -18,16 +18,19 @@
  */
 package org.apache.ldap.server.configuration;
 
+import org.apache.ldap.server.partition.ContextPartition;
+import org.apache.ldap.server.partition.ContextPartitionNexus;
+
 /**
- * A {@link Configuration} that syncs ApacheDS backend storage with disk.
+ * A {@link Configuration} that makes context factory to call
+ * {@link ContextPartition#sync()} for all partitions that are registered
+ * to {@link ContextPartitionNexus}. 
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
 public class SyncConfiguration extends Configuration
 {
-    private static SyncConfiguration instance = new SyncConfiguration();
-
     private static final long serialVersionUID = -3260859085299322327L;
 
     /**
@@ -35,26 +38,5 @@
      */
     public SyncConfiguration()
     {
-        if ( instance == null )
-        {
-            instance = this;
-        }
-    }
-
-
-    /**
-     * Returns existing static instance or creates a new one if
-     * it does not exist.
-     *
-     * @return a reusable static instance
-     */
-    public static SyncConfiguration getInstance()
-    {
-        if ( instance == null )
-        {
-            instance = new SyncConfiguration();
-        }
-
-        return instance;
     }
 }



Mime
View raw message