Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/NameForm.java Mon Dec 7 14:06:56 2009
@@ -95,17 +95,17 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class NameForm extends SchemaObject
+public class NameForm extends AbstractSchemaObject
{
/** The serialVersionUID */
private static final long serialVersionUID = 1L;
/** The structural object class OID this rule applies to */
private String structuralObjectClassOid;
-
+
/** The structural object class this rule applies to */
private ObjectClass structuralObjectClass;
-
+
/** The set of required attribute OIDs for this name form */
private List<String> mustAttributeTypeOids;
@@ -114,10 +114,10 @@
/** The set of allowed attribute OIDs for this name form */
private List<String> mayAttributeTypeOids;
-
+
/** The set of allowed AttributeTypes for this name form */
private List<AttributeType> mayAttributeTypes;
-
+
/**
* Creates a new instance of MatchingRule.
@@ -128,33 +128,33 @@
public NameForm( String oid )
{
super( SchemaObjectType.NAME_FORM, oid );
-
+
mustAttributeTypeOids = new ArrayList<String>();
mayAttributeTypeOids = new ArrayList<String>();
mustAttributeTypes = new ArrayList<AttributeType>();
mayAttributeTypes = new ArrayList<AttributeType>();
}
-
-
+
+
/**
- * Inject the registries into this Object, updating the references to
+ * Inject the NameForm into the registries, updating the references to
* other SchemaObject
*
* @param registries The Registries
*/
- public void setRegistries( Registries registries ) throws NamingException
+ public void addToRegistries( Registries registries ) throws NamingException
{
if ( registries != null )
{
AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
structuralObjectClass = registries.getObjectClassRegistry().lookup( structuralObjectClassOid );
-
+
if ( mayAttributeTypeOids != null )
{
mayAttributeTypes = new ArrayList<AttributeType>( mayAttributeTypeOids.size() );
-
+
for ( String oid : mayAttributeTypeOids )
{
mayAttributeTypes.add( atRegistry.lookup( oid ) );
@@ -164,7 +164,7 @@
if ( mustAttributeTypeOids != null )
{
mustAttributeTypes = new ArrayList<AttributeType>( mustAttributeTypeOids.size() );
-
+
for ( String oid : mustAttributeTypeOids )
{
mustAttributeTypes.add( atRegistry.lookup( oid ) );
@@ -268,7 +268,7 @@
}
}
-
+
/**
* Sets the list of required AttributeTypes
*
@@ -279,10 +279,10 @@
if ( !isReadOnly )
{
this.mustAttributeTypes = mustAttributeTypes;
-
+
// update the OIDS now
mustAttributeTypeOids.clear();
-
+
for ( AttributeType may : mustAttributeTypes )
{
mustAttributeTypeOids.add( may.getOid() );
@@ -290,7 +290,7 @@
}
}
-
+
/**
* Add a required AttributeType OID
*
@@ -314,15 +314,15 @@
{
if ( !isReadOnly )
{
- if ( ! mustAttributeTypeOids.contains( attributeType.getOid() ) )
+ if ( !mustAttributeTypeOids.contains( attributeType.getOid() ) )
{
mustAttributeTypes.add( attributeType );
mustAttributeTypeOids.add( attributeType.getOid() );
}
}
}
-
-
+
+
/**
* Gets all the AttributeTypes OIDs of the attribute this NameForm specifies as
* being usable without requirement in the given objectClass for naming: as
@@ -336,7 +336,7 @@
return Collections.unmodifiableList( mayAttributeTypeOids );
}
-
+
/**
* Gets all the AttributeTypes of the attribute this NameForm specifies as
* being useable without requirement in the given objectClass for naming: as
@@ -348,8 +348,8 @@
{
return Collections.unmodifiableList( mayAttributeTypes );
}
-
-
+
+
/**
* Sets the list of allowed AttributeTypes
*
@@ -362,8 +362,8 @@
this.mayAttributeTypeOids = mayAttributeTypeOids;
}
}
-
-
+
+
/**
* Sets the list of allowed AttributeTypes
*
@@ -374,18 +374,18 @@
if ( !isReadOnly )
{
this.mayAttributeTypes = mayAttributeTypes;
-
+
// update the OIDS now
mayAttributeTypeOids.clear();
-
+
for ( AttributeType may : mayAttributeTypes )
{
mayAttributeTypeOids.add( may.getOid() );
}
}
}
-
-
+
+
/**
* Add an allowed AttributeType
*
@@ -409,7 +409,7 @@
{
if ( !isReadOnly )
{
- if ( ! mayAttributeTypeOids.contains( attributeType.getOid() ) )
+ if ( !mayAttributeTypeOids.contains( attributeType.getOid() ) )
{
mayAttributeTypes.add( attributeType );
mayAttributeTypeOids.add( attributeType.getOid() );
@@ -425,8 +425,8 @@
{
return objectType + " " + DescriptionUtils.getDescription( this );
}
-
-
+
+
/**
* Copy a NameForm
*/
@@ -436,39 +436,39 @@
// Copy the SchemaObject common data
copy.copy( this );
-
+
// Copy the MAY AttributeTypes OIDs
copy.mayAttributeTypeOids = new ArrayList<String>();
-
+
for ( String oid : mayAttributeTypeOids )
{
copy.mayAttributeTypeOids.add( oid );
}
-
+
// Copy the MAY AttributeTypes (will be empty)
copy.mayAttributeTypes = new ArrayList<AttributeType>();
-
+
// Copy the MUST AttributeTypes OIDs
copy.mustAttributeTypeOids = new ArrayList<String>();
-
+
for ( String oid : mustAttributeTypeOids )
{
copy.mustAttributeTypeOids.add( oid );
}
-
+
// Copy the MUST AttributeTypes ( will be empty )
copy.mustAttributeTypes = new ArrayList<AttributeType>();
// Copy the Structural ObjectClass OID
copy.structuralObjectClassOid = structuralObjectClassOid;
-
+
// All the references to other Registries object are set to null.
copy.structuralObjectClass = null;
-
+
return copy;
}
-
-
+
+
/**
* @see Object#equals(Object)
*/
@@ -483,14 +483,14 @@
{
return false;
}
-
- NameForm that = (NameForm)o;
-
+
+ NameForm that = ( NameForm ) o;
+
// TODO : complete the checks
return true;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -498,7 +498,7 @@
{
// Clear the common elements
super.clear();
-
+
// Clear the references
mayAttributeTypes.clear();
mayAttributeTypeOids.clear();
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/Normalizer.java Mon Dec 7 14:06:56 2009
@@ -36,6 +36,7 @@
/** The serialversionUID */
private static final long serialVersionUID = 1L;
+
/**
* The Normalizer base constructor. We use it's MR OID to
* initialize the SchemaObject instance
@@ -58,7 +59,7 @@
}
- /**
+ /**
* Gets the normalized value.
*
* @param value the value to normalize. It must *not* be null !
@@ -67,6 +68,7 @@
*/
public abstract Value<?> normalize( Value<?> value ) throws NamingException;
+
/**
* Gets the normalized value.
*
@@ -75,8 +77,8 @@
* @throws NamingException if an error results during normalization
*/
public abstract String normalize( String value ) throws NamingException;
-
-
+
+
/**
* Store the SchemaManager in this instance. It may be necessary for some
* normalizer which needs to have access to the oidNormalizer Map.
@@ -87,8 +89,8 @@
{
// Do nothing (general case).
}
-
-
+
+
/**
* @see Object#equals()
*/
@@ -101,7 +103,7 @@
return o instanceof Normalizer;
}
-
+
/**
* @see Object#toString()
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClass.java Mon Dec 7 14:06:56 2009
@@ -74,14 +74,14 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class ObjectClass extends SchemaObject
+public class ObjectClass extends AbstractSchemaObject
{
/** The serialVersionUID */
private static final long serialVersionUID = 1L;
/** The ObjectClass type : ABSTRACT, AUXILIARY or STRUCTURAL */
private ObjectClassTypeEnum objectClassType = ObjectClassTypeEnum.STRUCTURAL;
-
+
/** The ObjectClass superior OIDs */
private List<String> superiorOids;
@@ -100,14 +100,15 @@
/** The list of required AttributeTypes */
private List<AttributeType> mustAttributeTypes;
+
/**
* Creates a new instance of MatchingRuleUseDescription
* @param oid the OID for this objectClass
*/
public ObjectClass( String oid )
{
- super( SchemaObjectType.OBJECT_CLASS, oid );
-
+ super( SchemaObjectType.OBJECT_CLASS, oid );
+
mayAttributeTypeOids = new ArrayList<String>();
mustAttributeTypeOids = new ArrayList<String>();
superiorOids = new ArrayList<String>();
@@ -117,27 +118,27 @@
superiors = new ArrayList<ObjectClass>();
objectClassType = ObjectClassTypeEnum.STRUCTURAL;
}
-
-
+
+
/**
- * Inject the registries into this Object, updating the references to
+ * Inject the ObjectClass into the registries, updating the references to
* other SchemaObject
*
* @param registries The Registries
* @throws Exception on failure
*
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
+ public void addToRegistries( List<Throwable> errors, Registries registries ) throws NamingException
{
if ( registries != null )
{
AttributeTypeRegistry atRegistry = registries.getAttributeTypeRegistry();
ObjectClassRegistry ocRegistry = registries.getObjectClassRegistry();
-
+
if ( superiorOids != null )
{
superiors = new ArrayList<ObjectClass>( superiorOids.size() );
-
+
for ( String superiorName : superiorOids )
{
superiors.add( ocRegistry.lookup( ocRegistry.getOidByName( superiorName ) ) );
@@ -147,7 +148,7 @@
if ( mayAttributeTypeOids != null )
{
mayAttributeTypes = new ArrayList<AttributeType>( mayAttributeTypeOids.size() );
-
+
for ( String mayAttributeTypeName : mayAttributeTypeOids )
{
mayAttributeTypes.add( atRegistry.lookup( atRegistry.getOidByName( mayAttributeTypeName ) ) );
@@ -157,13 +158,13 @@
if ( mustAttributeTypeOids != null )
{
mustAttributeTypes = new ArrayList<AttributeType>( mustAttributeTypeOids.size() );
-
+
for ( String mustAttributeTypeName : mustAttributeTypeOids )
{
mustAttributeTypes.add( atRegistry.lookup( atRegistry.getOidByName( mustAttributeTypeName ) ) );
}
}
-
+
/**
* Add the OC references (using and usedBy) :
* OC -> AT (MAY and MUST)
@@ -178,7 +179,7 @@
{
registries.addReference( this, mustAttributeType );
}
-
+
for ( ObjectClass superiorObjectClass : superiors )
{
registries.addReference( this, superiorObjectClass );
@@ -186,7 +187,7 @@
}
}
-
+
/**
* @return the mayAttributeTypeOids
*/
@@ -204,7 +205,7 @@
return mayAttributeTypes;
}
-
+
/**
* Add an allowed AttributeType
*
@@ -228,7 +229,7 @@
{
if ( !isReadOnly )
{
- if ( ! mayAttributeTypeOids.contains( attributeType.getOid() ) )
+ if ( !mayAttributeTypeOids.contains( attributeType.getOid() ) )
{
mayAttributeTypes.add( attributeType );
mayAttributeTypeOids.add( attributeType.getOid() );
@@ -236,7 +237,7 @@
}
}
-
+
/**
* @param mayAttributeTypeOids the mayAttributeTypeOids to set
*/
@@ -247,8 +248,8 @@
this.mayAttributeTypeOids = mayAttributeTypeOids;
}
}
-
-
+
+
/**
* Sets the list of allowed AttributeTypes
*
@@ -259,18 +260,18 @@
if ( !isReadOnly )
{
this.mayAttributeTypes = mayAttributeTypes;
-
+
// update the OIDS now
mayAttributeTypeOids.clear();
-
+
for ( AttributeType may : mayAttributeTypes )
{
mayAttributeTypeOids.add( may.getOid() );
}
}
}
-
-
+
+
/**
* Update the associated MAY AttributeType, even if the SchemaObject is readOnly
*
@@ -280,10 +281,10 @@
{
this.mayAttributeTypes.clear();
this.mayAttributeTypes.addAll( mayAttributeTypes );
-
+
// update the OIDS now
mayAttributeTypeOids.clear();
-
+
for ( AttributeType may : mayAttributeTypes )
{
mayAttributeTypeOids.add( may.getOid() );
@@ -308,7 +309,7 @@
return mustAttributeTypes;
}
-
+
/**
* Add a required AttributeType OID
*
@@ -332,7 +333,7 @@
{
if ( !isReadOnly )
{
- if ( ! mustAttributeTypeOids.contains( attributeType.getOid() ) )
+ if ( !mustAttributeTypeOids.contains( attributeType.getOid() ) )
{
mustAttributeTypes.add( attributeType );
mustAttributeTypeOids.add( attributeType.getOid() );
@@ -352,7 +353,7 @@
}
}
-
+
/**
* Sets the list of required AttributeTypes
*
@@ -363,18 +364,18 @@
if ( !isReadOnly )
{
this.mustAttributeTypes = mustAttributeTypes;
-
+
// update the OIDS now
mustAttributeTypeOids.clear();
-
+
for ( AttributeType may : mustAttributeTypes )
{
mustAttributeTypeOids.add( may.getOid() );
}
}
}
-
-
+
+
/**
* Update the associated MUST AttributeType, even if the SchemaObject is readOnly
*
@@ -384,17 +385,17 @@
{
this.mustAttributeTypes.clear();
this.mustAttributeTypes.addAll( mustAttributeTypes );
-
+
// update the OIDS now
mustAttributeTypeOids.clear();
-
+
for ( AttributeType must : mustAttributeTypes )
{
mustAttributeTypeOids.add( must.getOid() );
}
}
-
+
/**
* Gets the superclasses of this ObjectClass.
*
@@ -406,7 +407,7 @@
return superiors;
}
-
+
/**
* Gets the superclasses OIDsof this ObjectClass.
*
@@ -458,7 +459,7 @@
}
}
-
+
/**
* Sets the superior object classes
*
@@ -469,10 +470,10 @@
if ( !isReadOnly )
{
this.superiors = superiors;
-
+
// update the OIDS now
superiorOids.clear();
-
+
for ( ObjectClass oc : superiors )
{
superiorOids.add( oc.getOid() );
@@ -480,7 +481,7 @@
}
}
-
+
/**
* Update the associated SUPERIORS ObjectClasses, even if the SchemaObject is readOnly
*
@@ -490,17 +491,17 @@
{
this.superiors.clear();
this.superiors.addAll( superiors );
-
+
// update the OIDS now
superiorOids.clear();
-
+
for ( ObjectClass oc : superiors )
{
superiorOids.add( oc.getOid() );
}
}
-
+
/**
* Sets the superior object class OIDs
*
@@ -513,7 +514,7 @@
this.superiorOids = superiorOids;
}
}
-
+
/**
* Gets the type of this ObjectClass as a type safe enum.
@@ -524,8 +525,8 @@
{
return objectClassType;
}
-
-
+
+
/**
* Set the ObjectClass type, one of ABSTRACT, AUXILIARY or STRUCTURAL.
*
@@ -538,8 +539,8 @@
this.objectClassType = objectClassType;
}
}
-
-
+
+
/**
* Tells if the current ObjectClass is STRUCTURAL
*
@@ -549,7 +550,7 @@
{
return objectClassType == ObjectClassTypeEnum.STRUCTURAL;
}
-
+
/**
* Tells if the current ObjectClass is ABSTRACT
@@ -560,7 +561,7 @@
{
return objectClassType == ObjectClassTypeEnum.ABSTRACT;
}
-
+
/**
* Tells if the current ObjectClass is AUXILIARY
@@ -581,57 +582,57 @@
return objectType + " " + DescriptionUtils.getDescription( this );
}
-
+
/**
* Copy an ObjectClass
*/
public ObjectClass copy()
{
ObjectClass copy = new ObjectClass( oid );
-
+
// Copy the SchemaObject common data
copy.copy( this );
-
+
// Copy the ObjectClass type
copy.objectClassType = objectClassType;
-
+
// Copy the Superiors ObjectClasses OIDs
copy.superiorOids = new ArrayList<String>();
-
+
for ( String oid : superiorOids )
{
copy.superiorOids.add( oid );
}
-
+
// Copy the Superiors ObjectClasses ( will be empty )
copy.superiors = new ArrayList<ObjectClass>();
-
+
// Copy the MAY AttributeTypes OIDs
copy.mayAttributeTypeOids = new ArrayList<String>();
-
+
for ( String oid : mayAttributeTypeOids )
{
copy.mayAttributeTypeOids.add( oid );
}
-
+
// Copy the MAY AttributeTypes ( will be empty )
copy.mayAttributeTypes = new ArrayList<AttributeType>();
-
+
// Copy the MUST AttributeTypes OIDs
copy.mustAttributeTypeOids = new ArrayList<String>();
-
+
for ( String oid : mustAttributeTypeOids )
{
copy.mustAttributeTypeOids.add( oid );
}
-
+
// Copy the MUST AttributeTypes ( will be empty )
copy.mustAttributeTypes = new ArrayList<AttributeType>();
-
+
return copy;
}
-
-
+
+
/**
* @see Object#equals(Object)
*/
@@ -646,21 +647,21 @@
{
return false;
}
-
- ObjectClass that = (ObjectClass)o;
-
+
+ ObjectClass that = ( ObjectClass ) o;
+
// The ObjectClassType
if ( objectClassType != that.objectClassType )
{
return false;
}
-
+
// The Superiors OIDs
if ( superiorOids.size() != that.superiorOids.size() )
{
return false;
}
-
+
// One way
for ( String oid : superiorOids )
{
@@ -684,7 +685,7 @@
{
return false;
}
-
+
// One way
for ( ObjectClass oid : superiors )
{
@@ -702,13 +703,13 @@
return false;
}
}
-
+
// The MAY OIDs
if ( mayAttributeTypeOids.size() != that.mayAttributeTypeOids.size() )
{
return false;
}
-
+
// One way
for ( String oid : mayAttributeTypeOids )
{
@@ -732,7 +733,7 @@
{
return false;
}
-
+
// One way
for ( AttributeType oid : mayAttributeTypes )
{
@@ -756,7 +757,7 @@
{
return false;
}
-
+
// One way
for ( String oid : mustAttributeTypeOids )
{
@@ -780,7 +781,7 @@
{
return false;
}
-
+
// One way
for ( AttributeType oid : mustAttributeTypes )
{
@@ -801,8 +802,8 @@
return true;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -810,7 +811,7 @@
{
// Clear the common elements
super.clear();
-
+
// Clear the references
mayAttributeTypes.clear();
mayAttributeTypeOids.clear();
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java Mon Dec 7 14:06:56 2009
@@ -565,12 +565,17 @@
/**
- * Removes the registered SchemaObject from the registries
- *
- * @param schemaObject the schemaObject to unregister
- * @throws NamingException if the schemaObject is invalid
+ * Unregisters a new SchemaObject. The registries will be updated only if it's
+ * consistent after this deletion, if the SchemaManager is in Strict mode.
+ * If something went wrong during this operation, the
+ * SchemaManager.getErrors() will give the list of generated errors.
+ *
+ * @param schemaObject the SchemaObject to unregister
+ * @return true if the deletion has been made, false if there were some errors
+ * @throws Exception if the SchemaObject is not registered or
+ * the deletion operation is not supported
*/
- SchemaObject unregister( SchemaObject schemaObject ) throws NamingException;
+ boolean delete( SchemaObject schemaObject ) throws Exception;
/**
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaObject.java Mon Dec 7 14:06:56 2009
@@ -19,19 +19,14 @@
*/
package org.apache.directory.shared.ldap.schema;
+
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import javax.naming.NamingException;
import org.apache.directory.shared.ldap.schema.registries.Registries;
-import org.apache.directory.shared.ldap.util.StringTools;
/**
@@ -71,70 +66,8 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public abstract class SchemaObject implements Serializable
+public interface SchemaObject extends Serializable
{
- /** The serialVersionUID */
- public static final long serialVersionUID = 1L;
-
- /** The SchemaObject numeric OID */
- protected String oid;
-
- /** The optional names for this SchemaObject */
- protected List<String> names;
-
- /** Whether or not this SchemaObject is enabled */
- protected boolean isEnabled = true;
-
- /** Whether or not this SchemaObject can be modified */
- protected boolean isReadOnly = false;
-
- /** Whether or not this SchemaObject is obsolete */
- protected boolean isObsolete = false;
-
- /** A short description of this SchemaObject */
- protected String description;
-
- /** The SchemaObject specification */
- protected String specification;
-
- /** The name of the schema this object is associated with */
- protected String schemaName;
-
- /** The SchemaObjectType */
- protected SchemaObjectType objectType;
-
- /** A map containing the list of supported extensions */
- protected Map<String, List<String>> extensions;
-
- /**
- * A constructor for a SchemaObject instance. It must be
- * invoked by the inherited class.
- *
- * @param objectType The SchemaObjectType to create
- */
- protected SchemaObject( SchemaObjectType objectType, String oid )
- {
- this.objectType = objectType;
- this.oid = oid;
- extensions = new HashMap<String, List<String>>();
- names = new ArrayList<String>();
- }
-
-
- /**
- * Constructor used when a generic reusable SchemaObject is assigned an
- * OID after being instantiated.
- *
- * @param objectType The SchemaObjectType to create
- */
- protected SchemaObject( SchemaObjectType objectType )
- {
- this.objectType = objectType;
- extensions = new HashMap<String, List<String>>();
- names = new ArrayList<String>();
- }
-
-
/**
* Gets usually what is the numeric object identifier assigned to this
* SchemaObject. All schema objects except for MatchingRuleUses have an OID
@@ -145,40 +78,24 @@
* @return an OID for this SchemaObject or its MatchingRule if this
* SchemaObject is a MatchingRuleUse object
*/
- public String getOid()
- {
- return oid;
- }
-
-
+ String getOid();
+
+
/**
* A special method used when renaming an SchemaObject: we may have to
* change it's OID
* @param oid The new OID
*/
- public void setOid( String oid )
- {
- this.oid = oid;
- }
-
-
+ void setOid( String oid );
+
+
/**
* Gets short names for this SchemaObject if any exists for it, otherwise,
* returns an empty list.
*
* @return the names for this SchemaObject
*/
- public List<String> getNames()
- {
- if ( names != null )
- {
- return Collections.unmodifiableList( names );
- }
- else
- {
- return Collections.emptyList();
- }
- }
+ List<String> getNames();
/**
@@ -188,66 +105,37 @@
* @return the first of the names for this SchemaObject or the oid
* if one does not exist
*/
- public String getName()
- {
- if ( ( names != null ) && ( names.size() != 0 ) )
- {
- return names.get( 0 );
- }
- else
- {
- return oid;
- }
- }
+ String getName();
+
+
+ /**
+ * Inject this SchemaObject into the given registries, updating the references to
+ * other SchemaObject
+ *
+ * @param errors The errors we got
+ * @param registries The Registries
+ */
+ void addToRegistries( List<Throwable> errors, Registries registries ) throws NamingException;
+
-
/**
- * Inject the registries into this Object, updating the references to
+ * Remove this SchemaObject from the given registries, updating the references to
* other SchemaObject
*
* @param errors The errors we got
* @param registries The Registries
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
- {
- // do nothing
- }
-
-
+ void removeFromRegistries( List<Throwable> errors, Registries registries ) throws NamingException;
+
+
/**
* Add a new name to the list of names for this SchemaObject. The name
* is lowercased and trimmed.
*
* @param names The names to add
*/
- public void addName( String... names )
- {
- if ( ! isReadOnly )
- {
- // We must avoid duplicated names, as names are case insensitive
- Set<String> lowerNames = new HashSet<String>();
-
- // Fills a set with all the existing names
- for ( String name : this.names )
- {
- lowerNames.add( StringTools.toLowerCase( name ) );
- }
-
- for ( String name : names )
- {
- if ( name != null )
- {
- String lowerName = StringTools.toLowerCase( name );
- // Check that the lower cased names is not already present
- if ( ! lowerNames.contains( lowerName ) )
- {
- this.names.add( name );
- lowerNames.add( lowerName );
- }
- }
- }
- }
- }
+ void addName( String... names );
+
/**
* Sets the list of names for this SchemaObject. The names are
@@ -255,78 +143,41 @@
*
* @param names The list of names. Can be empty
*/
- public void setNames( List<String> names )
- {
- if ( names == null )
- {
- return;
- }
-
- if ( ! isReadOnly )
- {
- this.names = new ArrayList<String>( names.size() );
-
- for ( String name:names )
- {
- if ( name != null )
- {
- this.names.add( name );
- }
- }
- }
- }
+ void setNames( List<String> names );
+
-
/**
* Gets a short description about this SchemaObject.
*
* @return a short description about this SchemaObject
*/
- public String getDescription()
- {
- return description;
- }
-
-
+ public String getDescription();
+
+
/**
* Sets the SchemaObject's description
*
* @param description The SchemaObject's description
*/
- public void setDescription( String description )
- {
- if ( !isReadOnly )
- {
- this.description = description;
- }
- }
+ public void setDescription( String description );
+
-
/**
* Gets the SchemaObject specification.
*
* @return the SchemaObject specification
*/
- public String getSpecification()
- {
- return specification;
- }
-
-
+ public String getSpecification();
+
+
/**
* Sets the SchemaObject's specification
*
* @param specification The SchemaObject's specification
*/
- public void setSpecification( String specification )
- {
- if ( !isReadOnly )
- {
- this.specification = specification;
- }
- }
-
-
+ void setSpecification( String specification );
+
+
/**
* Tells if this SchemaObject is enabled.
*
@@ -334,58 +185,40 @@
* @return true if the SchemaObject is enabled, or if it depends on
* an enabled schema
*/
- public boolean isEnabled()
- {
- return isEnabled;
- }
-
-
+ boolean isEnabled();
+
+
/**
* Tells if this SchemaObject is disabled.
*
* @return true if the SchemaObject is disabled
*/
- public boolean isDisabled()
- {
- return !isEnabled;
- }
-
+ boolean isDisabled();
+
/**
* Sets the SchemaObject state, either enabled or disabled.
*
* @param enabled The current SchemaObject state
*/
- public void setEnabled( boolean enabled )
- {
- if ( !isReadOnly )
- {
- isEnabled = enabled;
- }
- }
-
+ void setEnabled( boolean enabled );
+
/**
* Tells if this SchemaObject is ReadOnly.
*
* @return true if the SchemaObject is not modifiable
*/
- public boolean isReadOnly()
- {
- return isReadOnly;
- }
-
+ boolean isReadOnly();
+
/**
* Sets the SchemaObject readOnly flag
*
* @param enabled The current SchemaObject ReadOnly status
*/
- public void setReadOnly( boolean isReadOnly )
- {
- this.isReadOnly = isReadOnly;
- }
-
+ void setReadOnly( boolean isReadOnly );
+
/**
* Gets whether or not this SchemaObject has been inactivated. All
@@ -395,77 +228,40 @@
*
* @return true if inactive, false if active
*/
- public boolean isObsolete()
- {
- return isObsolete;
- }
+ boolean isObsolete();
+
-
/**
* Sets the Obsolete flag.
*
* @param obsolete The Obsolete flag state
*/
- public void setObsolete( boolean obsolete )
- {
- if ( ! isReadOnly )
- {
- this.isObsolete = obsolete;
- }
- }
+ void setObsolete( boolean obsolete );
+
-
/**
* @return The SchemaObject extensions, as a Map of [extension, values]
*/
- public Map<String, List<String>> getExtensions()
- {
- return extensions;
- }
-
-
+ Map<String, List<String>> getExtensions();
+
+
/**
* Add an extension with its values
* @param key The extension key
* @param values The associated values
*/
- public void addExtension( String key, List<String> values )
- {
- if ( !isReadOnly )
- {
- extensions.put( key, values );
- }
- }
+ void addExtension( String key, List<String> values );
+
-
/**
* Add an extensions with their values. (Actually do a copy)
*
* @param key The extension key
* @param values The associated values
*/
- public void setExtensions( Map<String, List<String>> extensions )
- {
- if ( !isReadOnly && ( extensions != null ) )
- {
- this.extensions = new HashMap<String, List<String>>();
-
- for ( String key : extensions.keySet() )
- {
- List<String> values = new ArrayList<String>();
-
- for ( String value : extensions.get( key ) )
- {
- values.add( value );
- }
-
- this.extensions.put( key, values );
- }
-
- }
- }
+ void setExtensions( Map<String, List<String>> extensions );
+
-
/**
* The SchemaObject type :
* <li> AttributeType
@@ -482,21 +278,15 @@
*
* @return the SchemaObject type
*/
- public SchemaObjectType getObjectType()
- {
- return objectType;
- }
-
-
+ SchemaObjectType getObjectType();
+
+
/**
* Gets the name of the schema this SchemaObject is associated with.
*
* @return the name of the schema associated with this schemaObject
*/
- public String getSchemaName()
- {
- return schemaName;
- }
+ String getSchemaName();
/**
@@ -504,223 +294,21 @@
*
* @param schemaName the new schema name
*/
- public void setSchemaName( String schemaName )
- {
- if ( !isReadOnly )
- {
- this.schemaName = schemaName;
- }
- }
-
-
+ void setSchemaName( String schemaName );
+
+
/**
* @see Object#hashCode()
*/
- public int hashCode()
- {
- int h = 37;
-
- // The OID
- h += h*17 + oid.hashCode();
-
- // The SchemaObject type
- h += h*17 + objectType.getValue();
-
- // The Names, if any
- if ( ( names != null ) && ( names.size() != 0 ) )
- {
- for ( String name:names )
- {
- h += h*17 + name.hashCode();
- }
- }
-
- // The schemaName if any
- if ( schemaName != null )
- {
- h += h*17 + schemaName.hashCode();
- }
-
- h += h*17 + ( isEnabled ? 1 : 0 );
- h += h*17 + ( isReadOnly ? 1 : 0 );
-
- // The description, if any
- if ( description != null )
- {
- h += h*17 + description.hashCode();
- }
-
- // The extensions, if any
- for ( String key : extensions.keySet() )
- {
- h += h*17 + key.hashCode();
-
- List<String> values = extensions.get( key );
-
- if ( values != null )
- {
- for ( String value:values )
- {
- h += h*17 + value.hashCode();
- }
- }
- }
-
- return h;
- }
-
-
+ int hashCode();
+
+
/**
* @see Object#equals(Object)
*/
- public boolean equals( Object o1 )
- {
- if ( this == o1 )
- {
- return true;
- }
-
- if ( ! ( o1 instanceof SchemaObject ) )
- {
- return false;
- }
-
- SchemaObject that = (SchemaObject)o1;
-
- // Two schemaObject are equals if their oid is equal,
- // their ObjectType is equal, their names are equals
- // their schema name is the same, all their flags are equals,
- // the description is the same and their extensions are equals
- if ( !compareOid( oid, that.oid ) )
- {
- return false;
- }
-
- // Compare the names
- if ( names == null )
- {
- if ( that.names != null )
- {
- return false;
- }
- }
- else if ( that.names == null )
- {
- return false;
- }
- else
- {
- int nbNames = 0;
-
- for ( String name:names )
- {
- if ( ! that.names.contains( name ) )
- {
- return false;
- }
-
- nbNames++;
- }
-
- if ( nbNames != names.size() )
- {
- return false;
- }
- }
-
-
- if ( schemaName == null )
- {
- if ( that.schemaName != null )
- {
- return false;
- }
- }
- else
- {
- if ( !schemaName.equalsIgnoreCase( that.schemaName ) )
- {
- return false;
- }
- }
-
- if ( objectType != that.objectType )
- {
- return false;
- }
-
- if ( extensions != null )
- {
- if ( that.extensions == null )
- {
- return false;
- }
- else
- {
- for ( String key : extensions.keySet() )
- {
- if ( !that.extensions.containsKey( key ) )
- {
- return false;
- }
-
- List<String> thisValues = extensions.get( key );
- List<String> thatValues = that.extensions.get( key );
-
- if ( thisValues != null )
- {
- if ( thatValues == null )
- {
- return false;
- }
- else
- {
- if ( thisValues.size() != thatValues.size() )
- {
- return false;
- }
-
- // TODO compare the values
- }
- }
- else if ( thatValues != null )
- {
- return false;
- }
- }
- }
- }
- else if ( that.extensions != null )
- {
- return false;
- }
-
- if ( this.isEnabled != that.isEnabled )
- {
- return false;
- }
-
- if ( this.isObsolete != that.isObsolete )
- {
- return false;
- }
-
- if ( this.isReadOnly != that.isReadOnly )
- {
- return false;
- }
-
- if ( this.description == null )
- {
- return that.description == null;
- }
- else
- {
- return this.description.equalsIgnoreCase( that.description );
- }
- }
-
-
+ boolean equals( Object o1 );
+
+
/**
* Register the given SchemaObject into the given registries' globalOidRegistry
*
@@ -728,105 +316,36 @@
* @param registries The registries in which we want it to be stored
* @throws NamingException If the OID is invalid
*/
- public void registerOid( SchemaObject schemaObject, Registries registries ) throws NamingException
- {
- // Add the SchemaObject into the globalOidRegistry
- registries.getGlobalOidRegistry().register( this );
- }
-
-
+ void registerOid( SchemaObject schemaObject, Registries registries ) throws NamingException;
+
+
/**
* Copy the current SchemaObject on place
*
* @return The copied SchemaObject
*/
- public abstract SchemaObject copy();
-
-
- /**
- * Compare two oids, and return true if they are both null or
- * equals
- */
- protected boolean compareOid( String oid1, String oid2 )
- {
- if ( oid1 == null )
- {
- return oid2 == null;
- }
- else
- {
- return oid1.equals( oid2 );
- }
- }
+ SchemaObject copy();
+
-
/**
* Copy a SchemaObject.
*
* @return A copy of the current SchemaObject
*/
- public SchemaObject copy( SchemaObject original )
- {
- // copy the description
- description = original.description;
-
- // copy the flags
- isEnabled = original.isEnabled;
- isObsolete = original.isObsolete;
- isReadOnly = original.isReadOnly;
-
- // copy the names
- names = new ArrayList<String>();
-
- for ( String name : original.names )
- {
- names.add( name );
- }
-
- // copy the extensions
- extensions = new HashMap<String, List<String>>();
-
- for ( String key : original.extensions.keySet() )
- {
- List<String> extensionValues = original.extensions.get( key );
-
- List<String> cloneExtension = new ArrayList<String>();
-
- for ( String value : extensionValues )
- {
- cloneExtension.add( value );
- }
-
- extensions.put( key, cloneExtension );
- }
-
- // The SchemaName
- schemaName = original.schemaName;
-
- // The specification
- specification = original.specification;
-
- return this;
- }
-
-
+ SchemaObject copy( SchemaObject original );
+
+
/**
* Clear the current SchemaObject : remove all the references to other objects,
* and all the Maps.
*/
- public void clear()
- {
- // Clear the extensions
- for ( String extension : extensions.keySet() )
- {
- List<String> extensionList = extensions.get( extension );
-
- extensionList.clear();
- }
-
- extensions.clear();
-
- // Clear the names
- names.clear();
- }
+ void clear();
+
+
+ /**
+ * Inject the Registries into the SchemaObject
+ *
+ * @param registries The Registries
+ */
+ void setRegistries( Registries registries );
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimNormalizer.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimNormalizer.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimNormalizer.java Mon Dec 7 14:06:56 2009
@@ -19,9 +19,6 @@
*/
package org.apache.directory.shared.ldap.schema.normalizers;
-import java.util.List;
-
-import javax.naming.NamingException;
import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -41,17 +38,18 @@
/** serial version UID */
private static final long serialVersionUID = -206263185305284269L;
+
public CachingDeepTrimNormalizer()
{
super( new DeepTrimNormalizer() );
}
-
+
/**
* {@inheritDoc}
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
+ public void setRegistries( Registries registries )
{
- super.applyRegistries( errors, registries );
+ super.setRegistries( registries );
}
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimToLowerNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimToLowerNormalizer.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimToLowerNormalizer.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDeepTrimToLowerNormalizer.java Mon Dec 7 14:06:56 2009
@@ -19,9 +19,6 @@
*/
package org.apache.directory.shared.ldap.schema.normalizers;
-import java.util.List;
-
-import javax.naming.NamingException;
import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -41,17 +38,18 @@
/** serial version UID */
private static final long serialVersionUID = -206263185305284269L;
+
public CachingDeepTrimToLowerNormalizer()
{
super( new DeepTrimToLowerNormalizer() );
}
-
+
/**
* {@inheritDoc}
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
+ public void setRegistries( Registries registries )
{
- super.applyRegistries( errors, registries );
+ super.setRegistries( registries );
}
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDnNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDnNormalizer.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDnNormalizer.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingDnNormalizer.java Mon Dec 7 14:06:56 2009
@@ -19,9 +19,6 @@
*/
package org.apache.directory.shared.ldap.schema.normalizers;
-import java.util.List;
-
-import javax.naming.NamingException;
import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.Registries;
@@ -41,21 +38,21 @@
{
/** serial version UID */
private static final long serialVersionUID = -206263185305284269L;
-
+
+
public CachingDnNormalizer()
{
super( new DnNormalizer() );
}
-
+
/**
* {@inheritDoc}
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
+ public void setRegistries( Registries registries )
{
- super.applyRegistries( errors, registries );
+ super.setRegistries( registries );
}
-
/**
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/CachingNormalizer.java Mon Dec 7 14:06:56 2009
@@ -20,8 +20,6 @@
package org.apache.directory.shared.ldap.schema.normalizers;
-import java.util.List;
-
import javax.naming.NamingException;
import org.apache.directory.shared.ldap.entry.Value;
@@ -83,7 +81,7 @@
cache = new SynchronizedLRUMap( cacheSz );
}
-
+
/**
* Overrides default behavior by returning the OID of the wrapped
* Normalizer.
@@ -93,8 +91,8 @@
{
return normalizer.getOid();
}
-
-
+
+
/**
* Overrides default behavior by setting the OID of the wrapped Normalizer.
*
@@ -103,10 +101,10 @@
@Override
public void setOid( String oid )
{
- super.setOid( oid );
+ super.setOid( oid );
normalizer.setOid( oid );
}
-
+
/**
* {@inheritDoc}
@@ -118,7 +116,7 @@
return null;
}
- Value<?> result = (Value<?>)cache.get( value );
+ Value<?> result = ( Value<?> ) cache.get( value );
if ( result != null )
{
@@ -141,7 +139,7 @@
return null;
}
- String normalized = (String)cache.get( value );
+ String normalized = ( String ) cache.get( value );
if ( normalized != null )
{
@@ -157,12 +155,12 @@
/**
* {@inheritDoc}
*/
- public void applyRegistries( List<Throwable> errors, Registries registries ) throws NamingException
+ public void setRegistries( Registries registries )
{
- normalizer.applyRegistries( errors, registries );
+ normalizer.setRegistries( registries );
}
-
-
+
+
/**
* Sets the SchemaManager
*
@@ -170,6 +168,6 @@
*/
public void setSchemaManager( SchemaManager schemaManager )
{
- normalizer.setSchemaManager( schemaManager );
+ normalizer.setSchemaManager( schemaManager );
}
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AttributeTypeRegistry.java Mon Dec 7 14:06:56 2009
@@ -35,8 +35,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public interface AttributeTypeRegistry extends SchemaObjectRegistry<AttributeType>,
- Iterable<AttributeType>
+public interface AttributeTypeRegistry extends SchemaObjectRegistry<AttributeType>, Iterable<AttributeType>
{
/**
* Gets an oid/name to normalizer mapping used to normalize distinguished
@@ -45,8 +44,8 @@
* @return a map of OID Strings to OidNormalizer instances
*/
Map<String, OidNormalizer> getNormalizerMapping();
-
-
+
+
/**
* Quick lookup to see if an attribute has descendants.
*
@@ -57,8 +56,8 @@
* discerned from the ancestorId supplied
*/
boolean hasDescendants( String ancestorId ) throws NamingException;
-
-
+
+
/**
* Get's an iterator over the set of descendant attributeTypes for
* some ancestor's name alias or their OID.
@@ -70,8 +69,8 @@
* discerned from the ancestorId supplied
*/
Iterator<AttributeType> descendants( String ancestorId ) throws NamingException;
-
-
+
+
/**
* Store the AttributeType into a map associating an AttributeType to its
* descendants.
@@ -80,8 +79,8 @@
* @throws NamingException If something went wrong
*/
void registerDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException;
-
-
+
+
/**
* Remove the AttributeType from the map associating an AttributeType to its
* descendants.
@@ -91,14 +90,20 @@
* @throws NamingException If something went wrong
*/
void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException;
-
-
+
+
/**
* Add a new Oid/Normalizer couple in the OidNormalizer map
*/
void addMappingFor( AttributeType attributeType ) throws NamingException;
-
+
+ /**
+ * Remove a new Oid/Normalizer couple in the OidNormalizer map
+ */
+ void removeMappingFor( AttributeType attributeType ) throws NamingException;
+
+
/**
* Copy the AttributeTypeRegistry
*/
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java Mon Dec 7 14:06:56 2009
@@ -32,7 +32,6 @@
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.MatchingRule;
-import org.apache.directory.shared.ldap.schema.SchemaObject;
import org.apache.directory.shared.ldap.schema.SchemaObjectType;
import org.apache.directory.shared.ldap.schema.normalizers.NoOpNormalizer;
import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
@@ -187,6 +186,7 @@
}
}
+ /*
try
{
// And recurse until we reach the top of the hierarchy
@@ -196,6 +196,7 @@
{
throw new NoSuchAttributeException( ne.getMessage() );
}
+ */
}
@@ -260,7 +261,7 @@
/**
* Remove the AttributeType normalizer from the OidNormalizer map
*/
- private void removeMappingFor( SchemaObject attributeType )
+ public void removeMappingFor( AttributeType attributeType ) throws NamingException
{
if ( attributeType == null )
{
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java Mon Dec 7 14:06:56 2009
@@ -41,24 +41,25 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public abstract class DefaultSchemaObjectRegistry<T extends SchemaObject> implements SchemaObjectRegistry<T>, Iterable<T>
+public abstract class DefaultSchemaObjectRegistry<T extends SchemaObject> implements SchemaObjectRegistry<T>,
+ Iterable<T>
{
/** static class logger */
private static final Logger LOG = LoggerFactory.getLogger( DefaultSchemaObjectRegistry.class );
/** A speedup for debug */
private static final boolean DEBUG = LOG.isDebugEnabled();
-
+
/** a map of SchemaObject looked up by name */
protected Map<String, T> byName;
-
+
/** The SchemaObject type, used by the toString() method */
protected SchemaObjectType schemaObjectType;
/** the global OID Registry */
protected OidRegistry oidRegistry;
-
-
+
+
/**
* Creates a new DefaultSchemaObjectRegistry instance.
*/
@@ -68,8 +69,8 @@
this.schemaObjectType = schemaObjectType;
this.oidRegistry = oidRegistry;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -79,36 +80,36 @@
{
return byName.containsKey( StringTools.toLowerCase( oid ) );
}
-
+
return true;
}
-
-
+
+
/**
* {@inheritDoc}
*/
public String getSchemaName( String oid ) throws NamingException
{
- if ( ! OID.isOID( oid ) )
+ if ( !OID.isOID( oid ) )
{
String msg = "Looks like the arg is not a numeric OID";
LOG.warn( msg );
throw new NamingException( msg );
}
-
+
SchemaObject schemaObject = byName.get( oid );
if ( schemaObject != null )
{
return schemaObject.getSchemaName();
}
-
+
String msg = "OID " + oid + " not found in oid to schema name map!";
LOG.warn( msg );
throw new NamingException( msg );
}
-
+
/**
* {@inheritDoc}
*/
@@ -121,7 +122,7 @@
if ( originalSchemaName.equalsIgnoreCase( schemaObject.getSchemaName() ) )
{
schemaObject.setSchemaName( newSchemaName );
-
+
if ( DEBUG )
{
LOG.debug( "Renamed {} schemaName to {}", schemaObject, newSchemaName );
@@ -129,17 +130,17 @@
}
}
}
-
-
+
+
/**
* {@inheritDoc}
*/
public Iterator<T> iterator()
{
- return (Iterator<T>)oidRegistry.iterator();
+ return ( Iterator<T> ) oidRegistry.iterator();
}
-
+
/**
* {@inheritDoc}
*/
@@ -148,7 +149,7 @@
return byName.keySet().iterator();
}
-
+
/**
* {@inheritDoc}
*/
@@ -158,9 +159,9 @@
{
return null;
}
-
+
T schemaObject = byName.get( oid );
-
+
if ( schemaObject == null )
{
// let's try with trimming and lowercasing now
@@ -176,20 +177,20 @@
if ( DEBUG )
{
- LOG.debug( "Found {} with oid: {}", schemaObject, oid );
+ LOG.debug( "Found {} with oid: {}", schemaObject, oid );
}
-
+
return schemaObject;
}
-
-
+
+
/**
* {@inheritDoc}
*/
public void register( T schemaObject ) throws NamingException
{
String oid = schemaObject.getOid();
-
+
if ( byName.containsKey( oid ) )
{
String msg = schemaObjectType.name() + " with OID " + oid + " already registered!";
@@ -198,19 +199,19 @@
}
byName.put( oid, schemaObject );
-
+
/*
* add the aliases/names to the name map along with their toLowerCase
* versions of the name: this is used to make sure name lookups work
*/
for ( String name : schemaObject.getNames() )
{
- byName.put( StringTools.trim( StringTools.toLowerCase( name ) ), schemaObject );
+ byName.put( StringTools.trim( StringTools.toLowerCase( name ) ), schemaObject );
}
// And register the oid -> schemaObject relation
oidRegistry.register( schemaObject );
-
+
if ( LOG.isDebugEnabled() )
{
LOG.debug( "registered " + schemaObject.getName() + " for OID {}", oid );
@@ -231,24 +232,57 @@
}
T schemaObject = byName.remove( numericOid );
-
+
for ( String name : schemaObject.getNames() )
{
byName.remove( name );
}
-
+
// And remove the SchemaObject from the oidRegistry
oidRegistry.unregister( numericOid );
-
+
if ( DEBUG )
{
LOG.debug( "Removed {} with oid {} from the registry", schemaObject, numericOid );
}
-
+
return schemaObject;
}
-
-
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public T unregister( T schemaObject ) throws NamingException
+ {
+ String oid = schemaObject.getOid();
+
+ if ( !byName.containsKey( oid ) )
+ {
+ String msg = schemaObjectType.name() + " with OID " + oid + " not registered!";
+ LOG.warn( msg );
+ throw new NamingException( msg );
+ }
+
+ // Remove the oid
+ T removed = byName.remove( oid );
+
+ /*
+ * Remove the aliases/names from the name map along with their toLowerCase
+ * versions of the name.
+ */
+ for ( String name : schemaObject.getNames() )
+ {
+ byName.remove( StringTools.trim( StringTools.toLowerCase( name ) ) );
+ }
+
+ // And unregister the oid -> schemaObject relation
+ oidRegistry.unregister( oid );
+
+ return removed;
+ }
+
+
/**
* {@inheritDoc}
*/
@@ -258,7 +292,7 @@
{
return;
}
-
+
// Loop on all the SchemaObjects stored and remove those associated
// with the give schemaName
for ( T schemaObject : this )
@@ -267,7 +301,7 @@
{
String oid = schemaObject.getOid();
SchemaObject removed = unregister( oid );
-
+
if ( DEBUG )
{
LOG.debug( "Removed {} with oid {} from the registry", removed, oid );
@@ -275,8 +309,8 @@
}
}
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -284,21 +318,21 @@
{
T schemaObject = byName.get( name );
- if ( schemaObject == null )
- {
- // last resort before giving up check with lower cased version
- String lowerCased = name.toLowerCase();
-
- schemaObject = byName.get( lowerCased );
-
- // ok this name is not for a schema object in the registry
- if ( schemaObject == null )
- {
- throw new NamingException( "Can't find an OID for the name " + name );
- }
- }
-
- // we found the schema object by key on the first lookup attempt
+ if ( schemaObject == null )
+ {
+ // last resort before giving up check with lower cased version
+ String lowerCased = name.toLowerCase();
+
+ schemaObject = byName.get( lowerCased );
+
+ // ok this name is not for a schema object in the registry
+ if ( schemaObject == null )
+ {
+ throw new NamingException( "Can't find an OID for the name " + name );
+ }
+ }
+
+ // we found the schema object by key on the first lookup attempt
return schemaObject.getOid();
}
@@ -309,31 +343,31 @@
public SchemaObjectRegistry<T> copy( SchemaObjectRegistry<T> original )
{
// Fill the byName and OidRegistry maps, the type has already be copied
- for ( String key : ((DefaultSchemaObjectRegistry<T>)original).byName.keySet() )
+ for ( String key : ( ( DefaultSchemaObjectRegistry<T> ) original ).byName.keySet() )
{
// Clone each SchemaObject
- T value = ((DefaultSchemaObjectRegistry<T>)original).byName.get( key );
-
+ T value = ( ( DefaultSchemaObjectRegistry<T> ) original ).byName.get( key );
+
if ( value instanceof LoadableSchemaObject )
{
// Update the data structure.
// Comparators, Normalizers and SyntaxCheckers aren't copied,
// they are immutable
byName.put( key, value );
-
+
// Update the OidRegistry
oidRegistry.put( value );
}
else
{
T copiedValue = null;
-
+
// Copy the value if it's not already in the oidRegistry
if ( oidRegistry.hasOid( value.getOid() ) )
{
try
{
- copiedValue = (T)oidRegistry.getSchemaObject( value.getOid() );
+ copiedValue = ( T ) oidRegistry.getSchemaObject( value.getOid() );
}
catch ( NamingException ne )
{
@@ -342,9 +376,9 @@
}
else
{
- copiedValue = (T)value.copy();
+ copiedValue = ( T ) value.copy();
}
-
+
// Update the data structure.
byName.put( key, copiedValue );
@@ -352,7 +386,7 @@
oidRegistry.put( copiedValue );
}
}
-
+
return this;
}
@@ -372,7 +406,7 @@
}
}
-
+
/**
* {@inheritDoc}
*/
@@ -380,8 +414,8 @@
{
return schemaObjectType;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -389,18 +423,18 @@
{
return oidRegistry.size();
}
-
-
+
+
/**
* @see Object#toString()
*/
public String toString()
{
StringBuilder sb = new StringBuilder();
-
+
sb.append( schemaObjectType ).append( ": " );
boolean isFirst = true;
-
+
for ( String name : byName.keySet() )
{
if ( isFirst )
@@ -411,16 +445,16 @@
{
sb.append( ", " );
}
-
+
T schemaObject = byName.get( name );
-
+
sb.append( '<' ).append( name ).append( ", " ).append( schemaObject.getOid() ).append( '>' );
}
-
+
return sb.toString();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -430,15 +464,15 @@
for ( SchemaObject schemaObject : oidRegistry )
{
// Don't clear LoadableSchemaObject
- if ( ! (schemaObject instanceof LoadableSchemaObject ) )
+ if ( !( schemaObject instanceof LoadableSchemaObject ) )
{
schemaObject.clear();
}
}
-
+
// Remove the byName elements
byName.clear();
-
+
// Clear the OidRegistry
oidRegistry.clear();
}
Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableAttributeTypeRegistry.java?rev=887926&r1=887925&r2=887926&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableAttributeTypeRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/ImmutableAttributeTypeRegistry.java Mon Dec 7 14:06:56 2009
@@ -43,7 +43,8 @@
{
/** The wrapped AttributeType registry */
AttributeTypeRegistry immutableAttributeTypeRegistry;
-
+
+
/**
* Creates a new instance of ImmutableAttributeTypeRegistry.
*
@@ -53,8 +54,8 @@
{
immutableAttributeTypeRegistry = attributeTypeRegistry;
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -62,8 +63,8 @@
{
return immutableAttributeTypeRegistry.getNormalizerMapping();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -71,8 +72,8 @@
{
return immutableAttributeTypeRegistry.hasDescendants( ancestorId );
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -80,52 +81,65 @@
{
return immutableAttributeTypeRegistry.descendants( ancestorId );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public void register( AttributeType attributeType ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
+
/**
* {@inheritDoc}
*/
- public void registerDescendants( AttributeType attributeType, AttributeType ancestor )
- throws NamingException
+ public void registerDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
- public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor )
- throws NamingException
+ public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public AttributeType unregister( String numericOid ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
+
/**
* {@inheritDoc}
*/
public void addMappingFor( AttributeType attributeType ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void removeMappingFor( AttributeType attributeType ) throws NamingException
+ {
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -136,7 +150,8 @@
{
return immutableAttributeTypeRegistry.lookup( oid );
}
-
+
+
/**
* {@inheritDoc}
*/
@@ -144,17 +159,17 @@
{
return immutableAttributeTypeRegistry.toString();
}
-
-
+
+
/**
* {@inheritDoc}
*/
public AttributeTypeRegistry copy()
{
- return (AttributeTypeRegistry)immutableAttributeTypeRegistry.copy();
+ return ( AttributeTypeRegistry ) immutableAttributeTypeRegistry.copy();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -163,7 +178,7 @@
return immutableAttributeTypeRegistry.size();
}
-
+
/**
* {@inheritDoc}
*/
@@ -222,7 +237,7 @@
* {@inheritDoc}
*/
public void renameSchema( String originalSchemaName, String newSchemaName )
- {
+ {
// Do nothing
}
@@ -232,7 +247,8 @@
*/
public void unregisterSchemaElements( String schemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -250,6 +266,17 @@
*/
public void clear() throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public AttributeType unregister( AttributeType schemaObject ) throws NamingException
+ {
+ throw new LdapOperationNotSupportedException( "Cannot modify the AttributeTypeRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
}
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=887926&r1=887925&r2=887926&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 Mon Dec 7 14:06:56 2009
@@ -41,7 +41,8 @@
{
/** The wrapped LdapComparator registry */
ComparatorRegistry immutableComparatorRegistry;
-
+
+
/**
* Creates a new immutable ComparatorRegistry instance.
*
@@ -51,14 +52,15 @@
{
immutableComparatorRegistry = comparatorRegistry;
}
-
-
+
+
/**
* {@inheritDoc}
*/
public void register( LdapComparator<?> comparator ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -67,28 +69,30 @@
*/
public LdapComparator<?> unregister( String numericOid ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public void unregisterSchemaElements( String schemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public ImmutableComparatorRegistry copy()
{
- return (ImmutableComparatorRegistry)immutableComparatorRegistry.copy();
+ return ( ImmutableComparatorRegistry ) immutableComparatorRegistry.copy();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -166,7 +170,8 @@
*/
public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -184,6 +189,17 @@
*/
public void clear() throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the ComparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public LdapComparator<?> unregister( LdapComparator<?> schemaObject ) throws NamingException
+ {
+ throw new LdapOperationNotSupportedException( "Cannot modify the omparatorRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
}
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=887926&r1=887925&r2=887926&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 Mon Dec 7 14:06:56 2009
@@ -41,7 +41,8 @@
{
/** The wrapped DITContentRule registry */
DITContentRuleRegistry immutableDITContentRuleRegistry;
-
+
+
/**
* Creates a new instance of ImmutableDITContentRuleRegistry.
*
@@ -51,17 +52,17 @@
{
immutableDITContentRuleRegistry = ditContentRuleRegistry;
}
-
-
+
+
/**
* {@inheritDoc}
*/
public ImmutableDITContentRuleRegistry copy()
{
- return (ImmutableDITContentRuleRegistry)immutableDITContentRuleRegistry.copy();
+ return ( ImmutableDITContentRuleRegistry ) immutableDITContentRuleRegistry.copy();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -139,7 +140,8 @@
*/
public void register( DITContentRule schemaObject ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -148,7 +150,8 @@
*/
public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -157,7 +160,8 @@
*/
public DITContentRule unregister( String numericOid ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -166,7 +170,8 @@
*/
public void unregisterSchemaElements( String schemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -184,6 +189,17 @@
*/
public void clear() throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public DITContentRule unregister( DITContentRule schemaObject ) throws NamingException
+ {
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITContentRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
}
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=887926&r1=887925&r2=887926&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 Mon Dec 7 14:06:56 2009
@@ -41,7 +41,8 @@
{
/** The wrapped DITStructureRule registry */
DITStructureRuleRegistry immutableDITStructureRuleRegistry;
-
+
+
/**
* Creates a new instance of ImmutableDITStructureRuleRegistry.
*
@@ -61,7 +62,7 @@
return immutableDITStructureRuleRegistry.contains( ruleId );
}
-
+
/**
* {@inheritDoc}
*/
@@ -69,8 +70,8 @@
{
return immutableDITStructureRuleRegistry.iterator();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -78,8 +79,8 @@
{
return immutableDITStructureRuleRegistry.ruleIdIterator();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -88,7 +89,7 @@
return immutableDITStructureRuleRegistry.getSchemaName( ruleId );
}
-
+
/**
* {@inheritDoc}
*/
@@ -96,7 +97,7 @@
{
}
-
+
/**
* {@inheritDoc}
*/
@@ -111,37 +112,40 @@
*/
public void unregister( int ruleId ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public void unregisterSchemaElements( String schemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
+
/**
* {@inheritDoc}
*/
public void renameSchema( String originalSchemaName, String newSchemaName ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
-
-
+
+
/**
* {@inheritDoc}
*/
public ImmutableDITStructureRuleRegistry copy()
{
- return (ImmutableDITStructureRuleRegistry)immutableDITStructureRuleRegistry.copy();
+ return ( ImmutableDITStructureRuleRegistry ) immutableDITStructureRuleRegistry.copy();
}
-
-
+
+
/**
* {@inheritDoc}
*/
@@ -210,7 +214,8 @@
*/
public DITStructureRule unregister( String numericOid ) throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
@@ -228,6 +233,17 @@
*/
public void clear() throws NamingException
{
- throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy", ResultCodeEnum.NO_SUCH_OPERATION );
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public DITStructureRule unregister( DITStructureRule schemaObject ) throws NamingException
+ {
+ throw new LdapOperationNotSupportedException( "Cannot modify the DITStructureRuleRegistry copy",
+ ResultCodeEnum.NO_SUCH_OPERATION );
}
}
|