You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/11/17 18:34:49 UTC
svn commit: r881393 [2/3] - in
/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema:
./ normalizers/ registries/
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableComparatorRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableComparatorRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableComparatorRegistry.java Tue Nov 17 17:34:44 2009
@@ -27,6 +27,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.LdapComparator;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -82,9 +83,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableComparatorRegistry clone() throws CloneNotSupportedException
+ public ImmutableComparatorRegistry copy()
{
- return (ImmutableComparatorRegistry)immutableComparatorRegistry.clone();
+ return (ImmutableComparatorRegistry)immutableComparatorRegistry.copy();
}
@@ -176,4 +177,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableComparatorRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITContentRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITContentRuleRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITContentRuleRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITContentRuleRegistry.java Tue Nov 17 17:34:44 2009
@@ -27,6 +27,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.DITContentRule;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -55,9 +56,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableDITContentRuleRegistry clone() throws CloneNotSupportedException
+ public ImmutableDITContentRuleRegistry copy()
{
- return (ImmutableDITContentRuleRegistry)immutableDITContentRuleRegistry.clone();
+ return (ImmutableDITContentRuleRegistry)immutableDITContentRuleRegistry.copy();
}
@@ -176,4 +177,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableDITContentRuleRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITStructureRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITStructureRuleRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITStructureRuleRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableDITStructureRuleRegistry.java Tue Nov 17 17:34:44 2009
@@ -27,6 +27,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.DITStructureRule;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -135,9 +136,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableDITStructureRuleRegistry clone() throws CloneNotSupportedException
+ public ImmutableDITStructureRuleRegistry copy()
{
- return (ImmutableDITStructureRuleRegistry)immutableDITStructureRuleRegistry.clone();
+ return (ImmutableDITStructureRuleRegistry)immutableDITStructureRuleRegistry.copy();
}
@@ -220,4 +221,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableDITStructureRuleRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableLdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableLdapSyntaxRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableLdapSyntaxRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableLdapSyntaxRegistry.java Tue Nov 17 17:34:44 2009
@@ -26,6 +26,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.LdapSyntax;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -54,9 +55,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableLdapSyntaxRegistry clone() throws CloneNotSupportedException
+ public ImmutableLdapSyntaxRegistry copy()
{
- return (ImmutableLdapSyntaxRegistry)immutableLdapSyntaxRegistry.clone();
+ return (ImmutableLdapSyntaxRegistry)immutableLdapSyntaxRegistry.copy();
}
@@ -175,4 +176,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the LdapSyntaxRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableLdapSyntaxRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleRegistry.java Tue Nov 17 17:34:44 2009
@@ -26,6 +26,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.MatchingRule;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -56,9 +57,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableMatchingRuleRegistry clone() throws CloneNotSupportedException
+ public ImmutableMatchingRuleRegistry copy()
{
- return (ImmutableMatchingRuleRegistry)immutableMatchingRuleRegistry.clone();
+ return (ImmutableMatchingRuleRegistry)immutableMatchingRuleRegistry.copy();
}
@@ -177,4 +178,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the MatchingRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableMatchingRuleRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleUseRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleUseRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableMatchingRuleUseRegistry.java Tue Nov 17 17:34:44 2009
@@ -27,6 +27,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.MatchingRuleUse;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -55,9 +56,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableMatchingRuleUseRegistry clone() throws CloneNotSupportedException
+ public ImmutableMatchingRuleUseRegistry copy()
{
- return (ImmutableMatchingRuleUseRegistry)immutableMatchingRuleUseRegistry.clone();
+ return (ImmutableMatchingRuleUseRegistry)immutableMatchingRuleUseRegistry.copy();
}
@@ -176,4 +177,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the MatchingRuleUseRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableMatchingRuleUseRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNameFormRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNameFormRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNameFormRegistry.java Tue Nov 17 17:34:44 2009
@@ -26,6 +26,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.NameForm;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -56,9 +57,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableNameFormRegistry clone() throws CloneNotSupportedException
+ public ImmutableNameFormRegistry copy()
{
- return (ImmutableNameFormRegistry)immutableNameFormRegistry.clone();
+ return (ImmutableNameFormRegistry)immutableNameFormRegistry.copy();
}
@@ -177,4 +178,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the NameFormRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableNameFormRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableNormalizerRegistry.java Tue Nov 17 17:34:44 2009
@@ -27,6 +27,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -83,9 +84,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableNormalizerRegistry clone() throws CloneNotSupportedException
+ public ImmutableNormalizerRegistry copy()
{
- return (ImmutableNormalizerRegistry)immutableNormalizerRegistry.clone();
+ return (ImmutableNormalizerRegistry)immutableNormalizerRegistry.copy();
}
@@ -177,4 +178,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the NormalizerRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableNormalizerRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableObjectClassRegistry.java Tue Nov 17 17:34:44 2009
@@ -28,6 +28,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.schema.ObjectClass;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
@@ -112,9 +113,9 @@
/**
* Clone the ObjectClassRegistry
*/
- public ImmutableObjectClassRegistry clone() throws CloneNotSupportedException
+ public ImmutableObjectClassRegistry copy()
{
- return (ImmutableObjectClassRegistry)immutableObjectClassRegistry.clone();
+ return (ImmutableObjectClassRegistry)immutableObjectClassRegistry.copy();
}
@@ -215,4 +216,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the ObjectClassRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableObjectClassRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableSyntaxCheckerRegistry.java Tue Nov 17 17:34:44 2009
@@ -26,6 +26,7 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
import org.apache.directory.shared.ldap.schema.SyntaxChecker;
@@ -82,9 +83,9 @@
/**
* {@inheritDoc}
*/
- public ImmutableSyntaxCheckerRegistry clone() throws CloneNotSupportedException
+ public ImmutableSyntaxCheckerRegistry copy()
{
- return (ImmutableSyntaxCheckerRegistry)immutableSyntaxCheckerRegistry.clone();
+ return (ImmutableSyntaxCheckerRegistry)immutableSyntaxCheckerRegistry.copy();
}
@@ -176,4 +177,13 @@
{
throw new LdapOperationNotSupportedException( "Cannot modify the SyntaxCheckerRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
}
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public SchemaObject get( String oid )
+ {
+ return immutableSyntaxCheckerRegistry.get( oid );
+ }
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/LdapSyntaxRegistry.java Tue Nov 17 17:34:44 2009
@@ -29,16 +29,10 @@
* @version $Rev$
*/
public interface LdapSyntaxRegistry extends SchemaObjectRegistry<LdapSyntax>,
- Iterable<LdapSyntax>, Cloneable
+ Iterable<LdapSyntax>
{
/**
- * Clone the LdapSyntaxRegistry
+ * Copy the LdapSyntaxRegistry
*/
- LdapSyntaxRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of Syntaxes stored
- */
- int size();
+ LdapSyntaxRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleRegistry.java Tue Nov 17 17:34:44 2009
@@ -30,16 +30,10 @@
* @version $Rev$
*/
public interface MatchingRuleRegistry extends SchemaObjectRegistry<MatchingRule>,
- Iterable<MatchingRule>, Cloneable
+ Iterable<MatchingRule>
{
/**
- * Clone the MatchingRuleRegistry
+ * Copy the MatchingRuleRegistry
*/
- MatchingRuleRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of MatchingRule stored
- */
- int size();
+ MatchingRuleRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/MatchingRuleUseRegistry.java Tue Nov 17 17:34:44 2009
@@ -32,16 +32,10 @@
* @version $Rev$
*/
public interface MatchingRuleUseRegistry extends SchemaObjectRegistry<MatchingRuleUse>,
- Iterable<MatchingRuleUse>, Cloneable
+ Iterable<MatchingRuleUse>
{
/**
- * Clone the MatchingRuleUseRegistry
+ * Copy the MatchingRuleUseRegistry
*/
- MatchingRuleUseRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of MatchingRuleUse stored
- */
- int size();
+ MatchingRuleUseRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NameFormRegistry.java Tue Nov 17 17:34:44 2009
@@ -30,16 +30,10 @@
* @version $Rev$
*/
public interface NameFormRegistry extends SchemaObjectRegistry<NameForm>,
- Iterable<NameForm>, Cloneable
+ Iterable<NameForm>
{
/**
- * Clone the NameFormRegistry
+ * Copy the NameFormRegistry
*/
- NameFormRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of NameForms stored
- */
- int size();
+ NameFormRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/NormalizerRegistry.java Tue Nov 17 17:34:44 2009
@@ -32,7 +32,7 @@
* @version $Rev$
*/
public interface NormalizerRegistry extends SchemaObjectRegistry<Normalizer>,
- Iterable<Normalizer>, Cloneable
+ Iterable<Normalizer>
{
/**
* Registers a new Normalizer with this registry.
@@ -64,13 +64,7 @@
/**
- * Clone the NormalizerRegistry
+ * Copy the NormalizerRegistry
*/
- NormalizerRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of Normalizers stored
- */
- int size();
+ NormalizerRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ObjectClassRegistry.java Tue Nov 17 17:34:44 2009
@@ -35,7 +35,7 @@
* @version $Rev$
*/
public interface ObjectClassRegistry extends SchemaObjectRegistry<ObjectClass>,
- Iterable<ObjectClass>, Cloneable
+ Iterable<ObjectClass>
{
/**
* Quick lookup to see if an objectClass has descendants.
@@ -105,13 +105,7 @@
/**
- * Clone the ObjectClassRegistry
+ * Copy the ObjectClassRegistry
*/
- ObjectClassRegistry clone() throws CloneNotSupportedException;
-
-
- /**
- * @return The number of ObjectClasses stored
- */
- int size();
+ ObjectClassRegistry copy();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java?rev=881393&r1=881392&r2=881393&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java Tue Nov 17 17:34:44 2009
@@ -42,7 +42,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class OidRegistry implements Cloneable
+public class OidRegistry implements Iterable<SchemaObject>
{
/** static class logger */
private static final Logger LOG = LoggerFactory.getLogger( OidRegistry.class );
@@ -215,6 +215,19 @@
}
}
}
+
+
+ /**
+ * Store the given SchemaObject into the OidRegistry. Available only to
+ * the current package. A weak form (no check is done) of the register
+ * method, define for clone methods.
+ *
+ * @param schemaObject The SchemaObject to inject into the OidRegistry
+ */
+ /* No qualifier */ void put( SchemaObject schemaObject )
+ {
+ byOid.put( schemaObject.getOid(), schemaObject );
+ }
/**
@@ -236,25 +249,18 @@
/**
- * Clone the OidRegistry, and all the contained values
+ * Copy the OidRegistry, without the contained values
*
* @return A new OidRegistry instance
*/
- public OidRegistry clone() throws CloneNotSupportedException
+ public OidRegistry copy()
{
- OidRegistry clone = (OidRegistry)super.clone();
-
- clone.byOid = new HashMap<String,SchemaObject>();
+ OidRegistry copy = new OidRegistry();
- // Clone the byOid Map
- for ( String key : byOid.keySet() )
- {
- // Clone each SchemaObject
- SchemaObject value = byOid.get( key );
- clone.byOid.put( key, value.clone() );
- }
+ // Clone the map
+ copy.byOid = new HashMap<String,SchemaObject>();
- return clone;
+ return copy;
}
@@ -265,4 +271,47 @@
{
return byOid.size();
}
+
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+
+ if ( byOid != null )
+ {
+ boolean isFirst = true;
+
+ for ( String oid : byOid.keySet() )
+ {
+ if ( isFirst )
+ {
+ isFirst = false;
+ }
+ else
+ {
+ sb.append( ", " );
+ }
+
+ sb.append( "<" );
+
+ SchemaObject schemaObject = byOid.get( oid );
+
+ if ( schemaObject != null )
+ {
+ sb.append( schemaObject.getObjectType() );
+ sb.append( ", " );
+ sb.append( schemaObject.getOid() );
+ sb.append( ", " );
+ sb.append( schemaObject.getName() );
+ }
+
+ sb.append( ">" );
+ }
+ }
+
+ return sb.toString();
+ }
}