You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2011/03/10 23:55:56 UTC
svn commit: r1080387 - in /directory:
shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/
studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/...
Author: akarasulu
Date: Thu Mar 10 22:55:55 2011
New Revision: 1080387
URL: http://svn.apache.org/viewvc?rev=1080387&view=rev
Log:
breaking apart abstract schema object into mutable and immutable versions
Added:
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractMutableSchemaObject.java
- copied, changed from r1080337, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java
Modified:
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSchemaObject.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaDetailsPage.java
directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaPage.java
Copied: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractMutableSchemaObject.java (from r1080337, directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java)
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractMutableSchemaObject.java?p2=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractMutableSchemaObject.java&p1=directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java&r1=1080337&r2=1080387&rev=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractMutableSchemaObject.java Thu Mar 10 22:55:55 2011
@@ -22,7 +22,6 @@ package org.apache.directory.shared.ldap
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -71,48 +70,13 @@ import org.apache.directory.shared.util.
* <b>obsolete</b> : LdapSyntax, Comparator, Normalizer, SyntaxChecker
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public abstract class AbstractSchemaObject implements MutableSchemaObject, Serializable
+public abstract class AbstractMutableSchemaObject extends AbstractSchemaObject implements MutableSchemaObject, Serializable
{
- /** The serial version UID */
- private static final long serialVersionUID = 2L;
+ private 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 locked to avoid modifications when set to true */
protected volatile boolean locked;
- /** The hashcode for this schemaObject */
- private int h;
-
-
/**
* A constructor for a SchemaObject instance. It must be
* invoked by the inherited class.
@@ -120,7 +84,7 @@ public abstract class AbstractSchemaObje
* @param objectType The SchemaObjectType to create
* @param oid the SchemaObject numeric OID
*/
- protected AbstractSchemaObject( SchemaObjectType objectType, String oid )
+ protected AbstractMutableSchemaObject( SchemaObjectType objectType, String oid )
{
this.objectType = objectType;
this.oid = oid;
@@ -135,7 +99,7 @@ public abstract class AbstractSchemaObje
*
* @param objectType The SchemaObjectType to create
*/
- protected AbstractSchemaObject( SchemaObjectType objectType )
+ protected AbstractMutableSchemaObject( SchemaObjectType objectType )
{
this.objectType = objectType;
extensions = new HashMap<String, List<String>>();
@@ -144,22 +108,6 @@ public abstract class AbstractSchemaObje
/**
- * Gets usually what is the numeric object identifier assigned to this
- * SchemaObject. All schema objects except for MatchingRuleUses have an OID
- * assigned specifically to then. A MatchingRuleUse's OID really is the OID
- * of it's MatchingRule and not specific to the MatchingRuleUse. This
- * effects how MatchingRuleUse objects are maintained by the system.
- *
- * @return an OID for this SchemaObject or its MatchingRule if this
- * SchemaObject is a MatchingRuleUse object
- */
- public String getOid()
- {
- return oid;
- }
-
-
- /**
* A special method used when renaming an SchemaObject: we may have to
* change it's OID
* @param oid The new OID
@@ -176,45 +124,6 @@ public abstract class AbstractSchemaObje
/**
- * 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();
- }
- }
-
-
- /**
- * Gets the first name in the set of short names for this SchemaObject if
- * any exists for it.
- *
- * @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;
- }
- }
-
-
- /**
* {@inheritDoc}
*/
public void addToRegistries( List<Throwable> errors, Registries registries ) throws LdapException
@@ -351,17 +260,6 @@ public abstract class AbstractSchemaObje
/**
- * Gets a short description about this SchemaObject.
- *
- * @return a short description about this SchemaObject
- */
- public String getDescription()
- {
- return description;
- }
-
-
- /**
* Sets the SchemaObject's description
*
* @param description The SchemaObject's description
@@ -381,17 +279,6 @@ public abstract class AbstractSchemaObje
/**
- * Gets the SchemaObject specification.
- *
- * @return the SchemaObject specification
- */
- public String getSpecification()
- {
- return specification;
- }
-
-
- /**
* Sets the SchemaObject's specification
*
* @param specification The SchemaObject's specification
@@ -411,29 +298,6 @@ public abstract class AbstractSchemaObje
/**
- * Tells if this SchemaObject is enabled.
- *
- * @return true if the SchemaObject is enabled, or if it depends on
- * an enabled schema
- */
- public boolean isEnabled()
- {
- return isEnabled;
- }
-
-
- /**
- * Tells if this SchemaObject is disabled.
- *
- * @return true if the SchemaObject is disabled
- */
- public boolean isDisabled()
- {
- return !isEnabled;
- }
-
-
- /**
* Sets the SchemaObject state, either enabled or disabled.
*
* @param enabled The current SchemaObject state
@@ -448,17 +312,6 @@ public abstract class AbstractSchemaObje
/**
- * Tells if this SchemaObject is ReadOnly.
- *
- * @return true if the SchemaObject is not modifiable
- */
- public boolean isReadOnly()
- {
- return isReadOnly;
- }
-
-
- /**
* Sets the SchemaObject readOnly flag
*
* @param readOnly The current SchemaObject ReadOnly status
@@ -475,20 +328,6 @@ public abstract class AbstractSchemaObje
/**
- * Gets whether or not this SchemaObject has been inactivated. All
- * SchemaObjects except Syntaxes allow for this parameter within their
- * definition. For Syntaxes this property should always return false in
- * which case it is never included in the description.
- *
- * @return true if inactive, false if active
- */
- public boolean isObsolete()
- {
- return isObsolete;
- }
-
-
- /**
* Sets the Obsolete flag.
*
* @param obsolete The Obsolete flag state
@@ -508,15 +347,6 @@ public abstract class AbstractSchemaObje
/**
- * @return The SchemaObject extensions, as a Map of [extension, values]
- */
- public Map<String, List<String>> getExtensions()
- {
- return extensions;
- }
-
-
- /**
* Add an extension with its values
* @param key The extension key
* @param values The associated values
@@ -568,39 +398,6 @@ public abstract class AbstractSchemaObje
/**
- * The SchemaObject type :
- * <li> AttributeType
- * <li> DitCOntentRule
- * <li> DitStructureRule
- * <li> LdapComparator (specific to ADS)
- * <li> LdapSyntaxe
- * <li> MatchingRule
- * <li> MatchingRuleUse
- * <li> NameForm
- * <li> Normalizer (specific to ADS)
- * <li> ObjectClass
- * <li> SyntaxChecker (specific to ADS)
- *
- * @return the SchemaObject type
- */
- public SchemaObjectType getObjectType()
- {
- return objectType;
- }
-
-
- /**
- * 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;
- }
-
-
- /**
* Sets the name of the schema this SchemaObject is associated with.
*
* @param schemaName the new schema name
@@ -620,174 +417,6 @@ public abstract class AbstractSchemaObje
/**
- * This method is final to forbid the inherited classes to implement
- * it. This has been done for performances reasons : the hashcode should
- * be computed only once, and stored locally.
- *
- * The hashcode is currently computed in the lock() method, which is a hack
- * that should be fixed.
- *
- * @return {@inheritDoc}
- */
- @Override
- public final int hashCode()
- {
- return h;
- }
-
-
- /**
- * @{@inheritDoc}
- */
- @Override
- public boolean equals( Object o1 )
- {
- if ( this == o1 )
- {
- return true;
- }
-
- if ( !( o1 instanceof AbstractSchemaObject ) )
- {
- return false;
- }
-
- AbstractSchemaObject that = ( AbstractSchemaObject ) 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 );
- }
- }
-
-
- /**
* Register the given SchemaObject into the given registries' globalOidRegistry
*
* @param schemaObject the SchemaObject we want to register
@@ -802,34 +431,6 @@ public abstract class AbstractSchemaObje
/**
- * Copy the current SchemaObject on place
- *
- * @return The copied SchemaObject
- */
- public abstract MutableSchemaObject copy();
-
-
- /**
- * Compare two oids, and return true if they are both null or equal.
- *
- * @param oid1 the first OID
- * @param oid2 the second OID
- * @return <code>true</code> if both OIDs are null or equal
- */
- protected boolean compareOid( String oid1, String oid2 )
- {
- if ( oid1 == null )
- {
- return oid2 == null;
- }
- else
- {
- return oid1.equals( oid2 );
- }
- }
-
-
- /**
* {@inheritDoc}
*/
public SchemaObject copy( SchemaObject original )
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AbstractSchemaObject.java Thu Mar 10 22:55:55 2011
@@ -20,129 +20,44 @@
package org.apache.directory.shared.ldap.model.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 org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.schema.registries.Registries;
-import org.apache.directory.shared.util.Strings;
-
-
-/**
- * Most schema objects have some common attributes. This class
- * contains the minimum set of properties exposed by a SchemaObject.<br>
- * We have 11 types of SchemaObjects :
- * <li> AttributeType
- * <li> DitCOntentRule
- * <li> DitStructureRule
- * <li> LdapComparator (specific to ADS)
- * <li> LdapSyntaxe
- * <li> MatchingRule
- * <li> MatchingRuleUse
- * <li> NameForm
- * <li> Normalizer (specific to ADS)
- * <li> ObjectClass
- * <li> SyntaxChecker (specific to ADS)
- * <br>
- * <br>
- * This class provides accessors and setters for the following attributes,
- * which are common to all those SchemaObjects :
- * <li>oid : The numeric OID
- * <li>description : The SchemaObject description
- * <li>obsolete : Tells if the schema object is obsolete
- * <li>extensions : The extensions, a key/Values map
- * <li>schemaObjectType : The SchemaObject type (see upper)
- * <li>schema : The schema the SchemaObject is associated with (it's an extension).
- * Can be null
- * <li>isEnabled : The SchemaObject status (it's related to the schema status)
- * <li>isReadOnly : Tells if the SchemaObject can be modified or not
- * <br><br>
- * Some of those attributes are not used by some Schema elements, even if they should
- * have been used. Here is the list :
- * <b>name</b> : LdapSyntax, Comparator, Normalizer, SyntaxChecker
- * <b>numericOid</b> : DitStructureRule,
- * <b>obsolete</b> : LdapSyntax, Comparator, Normalizer, SyntaxChecker
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- */
-public abstract class AbstractSchemaObject implements MutableSchemaObject, Serializable
+
+public abstract class AbstractSchemaObject
{
+
/** The serial version UID */
private static final long serialVersionUID = 2L;
-
/** 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 locked to avoid modifications when set to true */
- protected volatile boolean locked;
-
/** The hashcode for this schemaObject */
- private int h;
+ protected int h;
-
- /**
- * A constructor for a SchemaObject instance. It must be
- * invoked by the inherited class.
- *
- * @param objectType The SchemaObjectType to create
- * @param oid the SchemaObject numeric OID
- */
- protected AbstractSchemaObject( SchemaObjectType objectType, String oid )
+ public AbstractSchemaObject()
{
- this.objectType = objectType;
- this.oid = oid;
- extensions = new HashMap<String, List<String>>();
- names = new ArrayList<String>();
+ super();
}
-
- /**
- * Constructor used when a generic reusable SchemaObject is assigned an
- * OID after being instantiated.
- *
- * @param objectType The SchemaObjectType to create
- */
- protected AbstractSchemaObject( 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
@@ -158,23 +73,6 @@ public abstract class AbstractSchemaObje
return oid;
}
-
- /**
- * 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 )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- this.oid = oid;
- }
-
-
/**
* Gets short names for this SchemaObject if any exists for it, otherwise,
* returns an empty list.
@@ -193,7 +91,6 @@ public abstract class AbstractSchemaObje
}
}
-
/**
* Gets the first name in the set of short names for this SchemaObject if
* any exists for it.
@@ -213,143 +110,6 @@ public abstract class AbstractSchemaObje
}
}
-
- /**
- * {@inheritDoc}
- */
- public void addToRegistries( List<Throwable> errors, Registries registries ) throws LdapException
- {
- // do nothing
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void removeFromRegistries( List<Throwable> errors, Registries registries ) throws LdapException
- {
- // do nothing
- }
-
-
- /**
- * Inject the Registries into the SchemaObject
- *
- * @param registries The Registries
- */
- public void setRegistries( Registries registries )
- {
- // do nothing
- }
-
-
- /**
- * Add a new name to the list of names for this SchemaObject. The name
- * is lowercased and trimmed.
- *
- * @param namesToAdd The names to add
- */
- public void addName( String... namesToAdd )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- 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( Strings.toLowerCase(name) );
- }
-
- for ( String name : namesToAdd )
- {
- if ( name != null )
- {
- String lowerName = Strings.toLowerCase(name);
- // Check that the lower cased names is not already present
- if ( !lowerNames.contains( lowerName ) )
- {
- this.names.add( name );
- lowerNames.add( lowerName );
- }
- }
- }
- }
- }
-
-
- /**
- * Sets the list of names for this SchemaObject. The names are
- * lowercased and trimmed.
- *
- * @param names The list of names. Can be empty
- */
- public void setNames( List<String> names )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( names == null )
- {
- return;
- }
-
- if ( !isReadOnly )
- {
- this.names = new ArrayList<String>( names.size() );
-
- for ( String name : names )
- {
- if ( name != null )
- {
- this.names.add( name );
- }
- }
- }
- }
-
-
- /**
- * Sets the list of names for this SchemaObject. The names are
- * lowercased and trimmed.
- *
- * @param names The list of names.
- */
- public void setNames( String... names )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( names == null )
- {
- return;
- }
-
- if ( !isReadOnly )
- {
- this.names.clear();
-
- for ( String name : names )
- {
- if ( name != null )
- {
- this.names.add( name );
- }
- }
- }
- }
-
-
/**
* Gets a short description about this SchemaObject.
*
@@ -360,26 +120,6 @@ public abstract class AbstractSchemaObje
return description;
}
-
- /**
- * Sets the SchemaObject's description
- *
- * @param description The SchemaObject's description
- */
- public void setDescription( String description )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.description = description;
- }
- }
-
-
/**
* Gets the SchemaObject specification.
*
@@ -390,26 +130,6 @@ public abstract class AbstractSchemaObje
return specification;
}
-
- /**
- * Sets the SchemaObject's specification
- *
- * @param specification The SchemaObject's specification
- */
- public void setSpecification( String specification )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.specification = specification;
- }
- }
-
-
/**
* Tells if this SchemaObject is enabled.
*
@@ -421,7 +141,6 @@ public abstract class AbstractSchemaObje
return isEnabled;
}
-
/**
* Tells if this SchemaObject is disabled.
*
@@ -432,21 +151,6 @@ public abstract class AbstractSchemaObje
return !isEnabled;
}
-
- /**
- * Sets the SchemaObject state, either enabled or disabled.
- *
- * @param enabled The current SchemaObject state
- */
- public void setEnabled( boolean enabled )
- {
- if ( !isReadOnly )
- {
- isEnabled = enabled;
- }
- }
-
-
/**
* Tells if this SchemaObject is ReadOnly.
*
@@ -457,23 +161,6 @@ public abstract class AbstractSchemaObje
return isReadOnly;
}
-
- /**
- * Sets the SchemaObject readOnly flag
- *
- * @param readOnly The current SchemaObject ReadOnly status
- */
- public void setReadOnly( boolean readOnly )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- this.isReadOnly = readOnly;
- }
-
-
/**
* Gets whether or not this SchemaObject has been inactivated. All
* SchemaObjects except Syntaxes allow for this parameter within their
@@ -487,26 +174,6 @@ public abstract class AbstractSchemaObje
return isObsolete;
}
-
- /**
- * Sets the Obsolete flag.
- *
- * @param obsolete The Obsolete flag state
- */
- public void setObsolete( boolean obsolete )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.isObsolete = obsolete;
- }
- }
-
-
/**
* @return The SchemaObject extensions, as a Map of [extension, values]
*/
@@ -515,58 +182,6 @@ public abstract class AbstractSchemaObje
return extensions;
}
-
- /**
- * 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 ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- extensions.put( key, values );
- }
- }
-
-
- /**
- * Add an extensions with their values. (Actually do a copy)
- *
- * @param extensions The extensions map
- */
- public void setExtensions( Map<String, List<String>> extensions )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- 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 );
- }
-
- }
- }
-
-
/**
* The SchemaObject type :
* <li> AttributeType
@@ -588,7 +203,6 @@ public abstract class AbstractSchemaObje
return objectType;
}
-
/**
* Gets the name of the schema this SchemaObject is associated with.
*
@@ -599,26 +213,6 @@ public abstract class AbstractSchemaObje
return schemaName;
}
-
- /**
- * Sets the name of the schema this SchemaObject is associated with.
- *
- * @param schemaName the new schema name
- */
- public void setSchemaName( String schemaName )
- {
- if ( locked )
- {
- throw new UnsupportedOperationException( I18n.err( I18n.ERR_04441, getName() ) );
- }
-
- if ( !isReadOnly )
- {
- this.schemaName = schemaName;
- }
- }
-
-
/**
* This method is final to forbid the inherited classes to implement
* it. This has been done for performances reasons : the hashcode should
@@ -635,7 +229,6 @@ public abstract class AbstractSchemaObje
return h;
}
-
/**
* @{@inheritDoc}
*/
@@ -646,14 +239,14 @@ public abstract class AbstractSchemaObje
{
return true;
}
-
- if ( !( o1 instanceof AbstractSchemaObject ) )
+
+ if ( !( o1 instanceof AbstractMutableSchemaObject ) )
{
return false;
}
-
- AbstractSchemaObject that = ( AbstractSchemaObject ) o1;
-
+
+ AbstractMutableSchemaObject that = ( AbstractMutableSchemaObject ) 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,
@@ -662,7 +255,7 @@ public abstract class AbstractSchemaObje
{
return false;
}
-
+
// Compare the names
if ( names == null )
{
@@ -678,23 +271,23 @@ public abstract class AbstractSchemaObje
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 )
@@ -709,12 +302,12 @@ public abstract class AbstractSchemaObje
return false;
}
}
-
+
if ( objectType != that.objectType )
{
return false;
}
-
+
if ( extensions != null )
{
if ( that.extensions == null )
@@ -729,10 +322,10 @@ public abstract class AbstractSchemaObje
{
return false;
}
-
+
List<String> thisValues = extensions.get( key );
List<String> thatValues = that.extensions.get( key );
-
+
if ( thisValues != null )
{
if ( thatValues == null )
@@ -745,7 +338,7 @@ public abstract class AbstractSchemaObje
{
return false;
}
-
+
// TODO compare the values
}
}
@@ -760,22 +353,22 @@ public abstract class AbstractSchemaObje
{
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;
@@ -786,21 +379,6 @@ public abstract class AbstractSchemaObje
}
}
-
- /**
- * Register the given SchemaObject into the given registries' globalOidRegistry
- *
- * @param schemaObject the SchemaObject we want to register
- * @param registries The registries in which we want it to be stored
- * @throws LdapException If the OID is invalid
- */
- public void registerOid( MutableSchemaObject schemaObject, Registries registries ) throws LdapException
- {
- // Add the SchemaObject into the globalOidRegistry
- registries.getGlobalOidRegistry().register( schemaObject );
- }
-
-
/**
* Copy the current SchemaObject on place
*
@@ -808,7 +386,6 @@ public abstract class AbstractSchemaObje
*/
public abstract MutableSchemaObject copy();
-
/**
* Compare two oids, and return true if they are both null or equal.
*
@@ -828,134 +405,4 @@ public abstract class AbstractSchemaObje
}
}
-
- /**
- * {@inheritDoc}
- */
- public SchemaObject copy( SchemaObject original )
- {
- // copy the description
- description = original.getDescription();
-
- // copy the flags
- isEnabled = original.isEnabled();
- isObsolete = original.isObsolete();
- isReadOnly = original.isReadOnly();
-
- // copy the names
- names = new ArrayList<String>();
-
- for ( String name : original.getNames() )
- {
- names.add( name );
- }
-
- // copy the extensions
- extensions = new HashMap<String, List<String>>();
-
- for ( String key : original.getExtensions().keySet() )
- {
- List<String> extensionValues = original.getExtensions().get( key );
-
- List<String> cloneExtension = new ArrayList<String>();
-
- for ( String value : extensionValues )
- {
- cloneExtension.add( value );
- }
-
- extensions.put( key, cloneExtension );
- }
-
- // The SchemaName
- schemaName = original.getSchemaName();
-
- // The specification
- specification = original.getSpecification();
-
- return this;
- }
-
-
- /**
- * 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();
- }
-
-
- /**
- * {@inheritDoc}
- */
- public final void lock()
- {
- if ( locked )
- {
- return;
- }
-
- 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();
- }
- }
- }
-
- locked = true;
- }
-}
+}
\ No newline at end of file
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/AttributeType.java Thu Mar 10 22:55:55 2011
@@ -139,7 +139,7 @@ import org.slf4j.LoggerFactory;
* @see DescriptionUtils#getDescription(AttributeType)
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public class AttributeType extends AbstractSchemaObject implements Cloneable
+public class AttributeType extends AbstractMutableSchemaObject implements Cloneable
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITContentRule.java Thu Mar 10 22:55:55 2011
@@ -117,7 +117,7 @@ import org.apache.directory.shared.ldap.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class DITContentRule extends AbstractSchemaObject
+public class DITContentRule extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/DITStructureRule.java Thu Mar 10 22:55:55 2011
@@ -82,7 +82,7 @@ import org.apache.directory.shared.util.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class DITStructureRule extends AbstractSchemaObject
+public class DITStructureRule extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LdapSyntax.java Thu Mar 10 22:55:55 2011
@@ -72,7 +72,7 @@ import org.apache.directory.shared.ldap.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class LdapSyntax extends AbstractSchemaObject
+public class LdapSyntax extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/LoadableSchemaObject.java Thu Mar 10 22:55:55 2011
@@ -32,12 +32,9 @@ import org.apache.directory.shared.util.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-// super.hashCode is final
-@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public abstract class LoadableSchemaObject extends AbstractSchemaObject
+public abstract class LoadableSchemaObject extends AbstractMutableSchemaObject
{
- /** The serial version UID */
- private static final long serialVersionUID = 2L;
+ private static final long serialVersionUID = 8370373510870284033L;
/** The Full Qualified Class Name */
private String fqcn;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRule.java Thu Mar 10 22:55:55 2011
@@ -87,7 +87,7 @@ import org.slf4j.LoggerFactory;
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class MatchingRule extends AbstractSchemaObject
+public class MatchingRule extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MatchingRuleUse.java Thu Mar 10 22:55:55 2011
@@ -86,7 +86,7 @@ import org.apache.directory.shared.ldap.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class MatchingRuleUse extends AbstractSchemaObject
+public class MatchingRuleUse extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSchemaObject.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSchemaObject.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSchemaObject.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/MutableSchemaObject.java Thu Mar 10 22:55:55 2011
@@ -74,18 +74,6 @@ public interface MutableSchemaObject ext
/**
- * {@inheritDoc}
- */
- int hashCode();
-
-
- /**
- * {@inheritDoc}
- */
- boolean equals( Object o1 );
-
-
- /**
* Copies the given schema object into this schema object.
*
* @param original the original SchemaObject
@@ -184,16 +172,6 @@ public interface MutableSchemaObject ext
/**
- * Register the given SchemaObject into the given registries' globalOidRegistry
- *
- * @param schemaObject the SchemaObject we want to register
- * @param registries The registries in which we want it to be stored
- * @throws LdapException If the OID is invalid
- */
- void registerOid( MutableSchemaObject schemaObject, Registries registries ) throws LdapException;
-
-
- /**
* Inject this SchemaObject into the given registries, updating the references to
* other SchemaObject
*
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/NameForm.java Thu Mar 10 22:55:55 2011
@@ -96,7 +96,7 @@ import org.apache.directory.shared.ldap.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class NameForm extends AbstractSchemaObject
+public class NameForm extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java (original)
+++ directory/shared/branches/akarasulu/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/ObjectClass.java Thu Mar 10 22:55:55 2011
@@ -77,7 +77,7 @@ import org.apache.directory.shared.ldap.
*/
// super.hashCode is final
@SuppressWarnings("PMD.OverrideBothEqualsAndHashcode")
-public class ObjectClass extends AbstractSchemaObject
+public class ObjectClass extends AbstractMutableSchemaObject
{
private static final long serialVersionUID = 1L;
Modified: directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java (original)
+++ directory/studio/branches/akarasulu/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaUtils.java Thu Mar 10 22:55:55 2011
@@ -31,6 +31,7 @@ import java.util.TreeSet;
import org.apache.commons.collections.CollectionUtils;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.schema.AbstractMutableSchemaObject;
import org.apache.directory.shared.ldap.model.schema.AbstractSchemaObject;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
import org.apache.directory.shared.ldap.model.schema.LdapSyntax;
@@ -165,9 +166,9 @@ public class SchemaUtils
}
};
- private static final Comparator<AbstractSchemaObject> schemaElementNameComparator = new Comparator<AbstractSchemaObject>()
+ private static final Comparator<AbstractMutableSchemaObject> schemaElementNameComparator = new Comparator<AbstractMutableSchemaObject>()
{
- public int compare( AbstractSchemaObject s1, AbstractSchemaObject s2 )
+ public int compare( AbstractMutableSchemaObject s1, AbstractMutableSchemaObject s2 )
{
return SchemaUtils.toString( s1 ).compareToIgnoreCase( SchemaUtils.toString( s2 ) );
}
@@ -181,7 +182,7 @@ public class SchemaUtils
*
* @return the names
*/
- public static Collection<String> getNames( Collection<? extends AbstractSchemaObject> asds )
+ public static Collection<String> getNames( Collection<? extends AbstractMutableSchemaObject> asds )
{
Set<String> nameSet = new TreeSet<String>( nameAndOidComparator );
for ( AbstractSchemaObject asd : asds )
@@ -199,7 +200,7 @@ public class SchemaUtils
*
* @return the names
*/
- public static String[] getNamesAsArray( Collection<? extends AbstractSchemaObject> asds )
+ public static String[] getNamesAsArray( Collection<? extends AbstractMutableSchemaObject> asds )
{
return getNames( asds ).toArray( new String[0] );
}
@@ -210,7 +211,7 @@ public class SchemaUtils
*
* @return the numeric OIDs of the given schema descriptions
*/
- public static Collection<String> getNumericOids( Collection<? extends AbstractSchemaObject> descriptions )
+ public static Collection<String> getNumericOids( Collection<? extends AbstractMutableSchemaObject> descriptions )
{
Set<String> oids = new HashSet<String>();
for ( AbstractSchemaObject asd : descriptions )
Modified: directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaDetailsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaDetailsPage.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaDetailsPage.java (original)
+++ directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaDetailsPage.java Thu Mar 10 22:55:55 2011
@@ -23,6 +23,7 @@ package org.apache.directory.studio.ldap
import java.util.List;
+import org.apache.directory.shared.ldap.model.schema.AbstractMutableSchemaObject;
import org.apache.directory.shared.ldap.model.schema.AbstractSchemaObject;
import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
@@ -91,7 +92,7 @@ public abstract class SchemaDetailsPage
public void linkActivated( HyperlinkEvent e )
{
Object obj = e.getHref();
- if ( obj instanceof AbstractSchemaObject )
+ if ( obj instanceof AbstractMutableSchemaObject )
{
schemaPage.getSchemaBrowser().setInput(
new SchemaBrowserInput( schemaPage.getConnection(), ( AbstractSchemaObject ) obj ) );
Modified: directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaPage.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaPage.java?rev=1080387&r1=1080386&r2=1080387&view=diff
==============================================================================
--- directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaPage.java (original)
+++ directory/studio/branches/akarasulu/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/SchemaPage.java Thu Mar 10 22:55:55 2011
@@ -21,6 +21,7 @@
package org.apache.directory.studio.ldapbrowser.ui.editors.schemabrowser;
+import org.apache.directory.shared.ldap.model.schema.AbstractMutableSchemaObject;
import org.apache.directory.shared.ldap.model.schema.AbstractSchemaObject;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
@@ -349,7 +350,7 @@ public abstract class SchemaPage
// Do not set the input of the schema browser if
// the selection was changed programatically.
- if ( !inChange && obj instanceof AbstractSchemaObject )
+ if ( !inChange && obj instanceof AbstractMutableSchemaObject )
{
schemaBrowser.setInput( new SchemaBrowserInput( getConnection(),
( AbstractSchemaObject ) obj ) );