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 2006/02/10 11:49:57 UTC
svn commit: r376623 [16/38] - in /directory/sandbox/akarasulu/rc1/apacheds:
core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/
core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/
core-shared/src/main/java/org/...
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java Fri Feb 10 02:48:07 2006
@@ -37,7 +37,7 @@
* @version $Rev$
*/
public class GlobalOidRegistry implements OidRegistry
-{
+{
/** Maps OID to a name or a list of names if more than one name exists */
private Hashtable byOid = new Hashtable();
@@ -55,23 +55,20 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates a default OidRegistry by initializing the map and the montior.
*/
- public GlobalOidRegistry( BootstrapOidRegistry bootstrap )
+ public GlobalOidRegistry(BootstrapOidRegistry bootstrap)
{
this.bootstrap = bootstrap;
if ( this.bootstrap == null )
{
- throw new NullPointerException( "the bootstrap registry cannot be null" ) ;
+ throw new NullPointerException( "the bootstrap registry cannot be null" );
}
}
-
-
/**
* Gets the monitor.
*
@@ -98,7 +95,6 @@
// Service Methods
// ------------------------------------------------------------------------
-
/**
* @see OidRegistry#getOid(String)
*/
@@ -143,37 +139,37 @@
* returned on a getNameSet.
*/
String lowerCase = name.trim().toLowerCase();
- if ( ! name.equals( lowerCase ) )
- {
- if ( byName.containsKey( lowerCase ) )
- {
- String oid = ( String ) byName.get( lowerCase );
- monitor.oidResolved( name, lowerCase, oid );
+ if ( !name.equals( lowerCase ) )
+ {
+ if ( byName.containsKey( lowerCase ) )
+ {
+ String oid = ( String ) byName.get( lowerCase );
+ monitor.oidResolved( name, lowerCase, oid );
- // We expect to see this version of the key again so we add it
- byName.put( name, oid );
+ // We expect to see this version of the key again so we add it
+ byName.put( name, oid );
return oid;
- }
-
- /*
- * Some LDAP servers (MS Active Directory) tend to use some of the
- * bootstrap oid names as all caps, like OU. This should resolve that.
- * Lets stash this in the byName if we find it.
- */
-
- if ( bootstrap.hasOid( lowerCase) )
- {
- String oid = bootstrap.getOid( name );
+ }
+
+ /*
+ * Some LDAP servers (MS Active Directory) tend to use some of the
+ * bootstrap oid names as all caps, like OU. This should resolve that.
+ * Lets stash this in the byName if we find it.
+ */
+
+ if ( bootstrap.hasOid( lowerCase ) )
+ {
+ String oid = bootstrap.getOid( name );
monitor.oidResolved( name, oid );
- // We expect to see this version of the key again so we add it
+ // We expect to see this version of the key again so we add it
byName.put( name, oid );
return oid;
- }
- }
+ }
+ }
String msg = "OID for name '" + name + "' was not " + "found within the OID registry";
- NamingException fault = new NamingException ( msg );
+ NamingException fault = new NamingException( msg );
monitor.oidResolutionFailed( name, fault );
throw fault;
}
@@ -197,35 +193,35 @@
}
/*
- * As a last resort we check if name is not normalized and if the
- * normalized version used as a key returns an OID. If the normalized
- * name works add the normalized name as a key with its OID to the
- * byName lookup. BTW these normalized versions of the key are not
- * returned on a getNameSet.
- */
+ * As a last resort we check if name is not normalized and if the
+ * normalized version used as a key returns an OID. If the normalized
+ * name works add the normalized name as a key with its OID to the
+ * byName lookup. BTW these normalized versions of the key are not
+ * returned on a getNameSet.
+ */
String lowerCase = name.trim().toLowerCase();
- if ( ! name.equals( lowerCase ) )
- {
- if ( byName.containsKey( lowerCase ) )
- {
- String oid = ( String ) byName.get( lowerCase );
- monitor.oidResolved( name, lowerCase, oid );
+ if ( !name.equals( lowerCase ) )
+ {
+ if ( byName.containsKey( lowerCase ) )
+ {
+ String oid = ( String ) byName.get( lowerCase );
+ monitor.oidResolved( name, lowerCase, oid );
- // We expect to see this version of the key again so we add it
- byName.put( name, oid );
+ // We expect to see this version of the key again so we add it
+ byName.put( name, oid );
return true;
- }
+ }
- /*
- * Some LDAP servers (MS Active Directory) tend to use some of the
- * bootstrap oid names as all caps, like OU. This should resolve that.
- * Lets stash this in the byName if we find it.
- */
- if ( bootstrap.hasOid( lowerCase) )
- {
+ /*
+ * Some LDAP servers (MS Active Directory) tend to use some of the
+ * bootstrap oid names as all caps, like OU. This should resolve that.
+ * Lets stash this in the byName if we find it.
+ */
+ if ( bootstrap.hasOid( lowerCase ) )
+ {
return true;
- }
- }
+ }
+ }
return false;
}
@@ -237,25 +233,25 @@
public String getPrimaryName( String oid ) throws NamingException
{
Object value = byOid.get( oid );
-
+
if ( null == value )
{
String msg = "OID '" + oid + "' was not found within the OID registry";
- NamingException fault = new NamingException ( msg );
+ NamingException fault = new NamingException( msg );
monitor.oidDoesNotExist( oid, fault );
throw fault;
}
-
+
if ( value instanceof String )
{
monitor.nameResolved( oid, ( String ) value );
return ( String ) value;
}
-
+
String name = ( String ) ( ( List ) value ).get( 0 );
monitor.nameResolved( oid, name );
@@ -270,7 +266,7 @@
public List getNameSet( String oid ) throws NamingException
{
Object value = this.byOid.get( oid );
-
+
if ( null == value )
{
value = this.bootstrap.getNameSet( oid );
@@ -280,13 +276,13 @@
{
String msg = "OID '" + oid + "' was not found within the OID registry";
- NamingException fault = new NamingException ( msg );
+ NamingException fault = new NamingException( msg );
monitor.oidDoesNotExist( oid, fault );
throw fault;
}
-
+
if ( value instanceof String )
{
List list = Collections.singletonList( value );
@@ -295,7 +291,7 @@
return list;
}
-
+
monitor.namesResolved( oid, ( List ) value );
return ( List ) value;
@@ -316,10 +312,9 @@
*/
public void register( String name, String oid )
{
- if ( ! Character.isDigit( oid.charAt( 0 ) ) )
+ if ( !Character.isDigit( oid.charAt( 0 ) ) )
{
- throw new RuntimeException( "Swap the parameter order: the oid " +
- "does not start with a digit!" );
+ throw new RuntimeException( "Swap the parameter order: the oid " + "does not start with a digit!" );
}
/*
@@ -328,16 +323,16 @@
*/
String lowerCase = name.toLowerCase();
- if ( ! lowerCase.equals( name ) )
+ if ( !lowerCase.equals( name ) )
{
byName.put( lowerCase, oid );
}
-
+
// Put both the name and the oid as names
byName.put( name, oid );
byName.put( oid, oid );
-
+
/*
* Update OID Map
*
@@ -350,26 +345,26 @@
*/
Object value = null;
- if ( ! byOid.containsKey( oid ) )
+ if ( !byOid.containsKey( oid ) )
{
value = name;
}
- else
+ else
{
ArrayList list = null;
value = byOid.get( oid );
-
+
if ( value instanceof String )
{
String existingName = ( String ) value;
-
+
// if the existing name is already there we don't readd it
if ( existingName.equalsIgnoreCase( name ) )
{
return;
}
-
+
list = new ArrayList();
list.add( value );
@@ -380,16 +375,16 @@
else if ( value instanceof ArrayList )
{
list = ( ArrayList ) value;
-
+
for ( int ii = 0; ii < list.size(); ii++ )
{
// One form or another of the name already exists in list
- if ( ! name.equalsIgnoreCase( ( String ) list.get( ii ) ) )
+ if ( !name.equalsIgnoreCase( ( String ) list.get( ii ) ) )
{
return;
}
}
-
+
list.add( name );
}
}
@@ -399,22 +394,23 @@
monitor.registered( name, oid );
}
+
/**
* Get the map of all the oids by their name
* @return The Map that contains all the oids
*/
public Map getOidByName()
{
- return byName;
+ return byName;
}
+
/**
* Get the map of all the oids by their name
* @return The Map that contains all the oids
*/
public Map getNameByOid()
{
- return byOid;
+ return byOid;
}
}
-
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalRegistries.java Fri Feb 10 02:48:07 2006
@@ -64,40 +64,31 @@
private GlobalSyntaxRegistry syntaxRegistry;
- public GlobalRegistries( BootstrapRegistries bootstrapRegistries )
+ public GlobalRegistries(BootstrapRegistries bootstrapRegistries)
{
- oidRegistry = new GlobalOidRegistry(
- ( BootstrapOidRegistry ) bootstrapRegistries.getOidRegistry() );
- normalizerRegistry = new GlobalNormalizerRegistry(
- ( BootstrapNormalizerRegistry ) bootstrapRegistries.getNormalizerRegistry());
- comparatorRegistry = new GlobalComparatorRegistry(
- ( BootstrapComparatorRegistry ) bootstrapRegistries.getComparatorRegistry());
- syntaxCheckerRegistry = new GlobalSyntaxCheckerRegistry(
- ( BootstrapSyntaxCheckerRegistry ) bootstrapRegistries.getSyntaxCheckerRegistry());
- syntaxRegistry = new GlobalSyntaxRegistry(
- ( BootstrapSyntaxRegistry ) bootstrapRegistries.getSyntaxRegistry(),
- oidRegistry );
- matchingRuleRegistry = new GlobalMatchingRuleRegistry(
- ( BootstrapMatchingRuleRegistry ) bootstrapRegistries.getMatchingRuleRegistry(),
- oidRegistry );
- attributeTypeRegistry = new GlobalAttributeTypeRegistry(
- ( BootstrapAttributeTypeRegistry ) bootstrapRegistries.getAttributeTypeRegistry(),
- oidRegistry );
- objectClassRegistry = new GlobalObjectClassRegistry(
- ( BootstrapObjectClassRegistry ) bootstrapRegistries.getObjectClassRegistry(),
- oidRegistry );
+ oidRegistry = new GlobalOidRegistry( ( BootstrapOidRegistry ) bootstrapRegistries.getOidRegistry() );
+ normalizerRegistry = new GlobalNormalizerRegistry( ( BootstrapNormalizerRegistry ) bootstrapRegistries
+ .getNormalizerRegistry() );
+ comparatorRegistry = new GlobalComparatorRegistry( ( BootstrapComparatorRegistry ) bootstrapRegistries
+ .getComparatorRegistry() );
+ syntaxCheckerRegistry = new GlobalSyntaxCheckerRegistry( ( BootstrapSyntaxCheckerRegistry ) bootstrapRegistries
+ .getSyntaxCheckerRegistry() );
+ syntaxRegistry = new GlobalSyntaxRegistry( ( BootstrapSyntaxRegistry ) bootstrapRegistries.getSyntaxRegistry(),
+ oidRegistry );
+ matchingRuleRegistry = new GlobalMatchingRuleRegistry( ( BootstrapMatchingRuleRegistry ) bootstrapRegistries
+ .getMatchingRuleRegistry(), oidRegistry );
+ attributeTypeRegistry = new GlobalAttributeTypeRegistry( ( BootstrapAttributeTypeRegistry ) bootstrapRegistries
+ .getAttributeTypeRegistry(), oidRegistry );
+ objectClassRegistry = new GlobalObjectClassRegistry( ( BootstrapObjectClassRegistry ) bootstrapRegistries
+ .getObjectClassRegistry(), oidRegistry );
ditContentRuleRegistry = new GlobalDitContentRuleRegistry(
- ( BootstrapDitContentRuleRegistry ) bootstrapRegistries.getDitContentRuleRegistry(),
- oidRegistry );
+ ( BootstrapDitContentRuleRegistry ) bootstrapRegistries.getDitContentRuleRegistry(), oidRegistry );
ditStructureRuleRegistry = new GlobalDitStructureRuleRegistry(
- ( BootstrapDitStructureRuleRegistry ) bootstrapRegistries.getDitStructureRuleRegistry(),
- oidRegistry );
+ ( BootstrapDitStructureRuleRegistry ) bootstrapRegistries.getDitStructureRuleRegistry(), oidRegistry );
matchingRuleUseRegistry = new GlobalMatchingRuleUseRegistry(
- ( BootstrapMatchingRuleUseRegistry ) bootstrapRegistries.getMatchingRuleUseRegistry(),
- oidRegistry );
- nameFormRegistry = new GlobalNameFormRegistry(
- ( BootstrapNameFormRegistry ) bootstrapRegistries.getNameFormRegistry(),
- oidRegistry );
+ ( BootstrapMatchingRuleUseRegistry ) bootstrapRegistries.getMatchingRuleUseRegistry(), oidRegistry );
+ nameFormRegistry = new GlobalNameFormRegistry( ( BootstrapNameFormRegistry ) bootstrapRegistries
+ .getNameFormRegistry(), oidRegistry );
}
@@ -106,56 +97,67 @@
return attributeTypeRegistry;
}
+
public ComparatorRegistry getComparatorRegistry()
{
return comparatorRegistry;
}
+
public DITContentRuleRegistry getDitContentRuleRegistry()
{
return ditContentRuleRegistry;
}
+
public DITStructureRuleRegistry getDitStructureRuleRegistry()
{
return ditStructureRuleRegistry;
}
+
public MatchingRuleRegistry getMatchingRuleRegistry()
{
return matchingRuleRegistry;
}
+
public MatchingRuleUseRegistry getMatchingRuleUseRegistry()
{
return matchingRuleUseRegistry;
}
+
public NameFormRegistry getNameFormRegistry()
{
return nameFormRegistry;
}
+
public NormalizerRegistry getNormalizerRegistry()
{
return normalizerRegistry;
}
+
public ObjectClassRegistry getObjectClassRegistry()
{
return objectClassRegistry;
}
+
public OidRegistry getOidRegistry()
{
return oidRegistry;
}
+
public SyntaxCheckerRegistry getSyntaxCheckerRegistry()
{
return syntaxCheckerRegistry;
}
+
public SyntaxRegistry getSyntaxRegistry()
{
return syntaxRegistry;
@@ -166,7 +168,6 @@
// Code used to sanity check the resolution of entities in registries
// ------------------------------------------------------------------------
-
/**
* Attempts to resolve the dependent schema objects of all entities that
* refer to other objects within the registries. Null references will be
@@ -251,9 +252,8 @@
if ( mr.getComparator() == null )
{
String schema = matchingRuleRegistry.getSchemaName( mr.getOid() );
- errors.add( new NullPointerException( "matchingRule "
- + mr.getName() + " in schema " + schema + " with OID "
- + mr.getOid() + " has a null comparator" ) );
+ errors.add( new NullPointerException( "matchingRule " + mr.getName() + " in schema " + schema
+ + " with OID " + mr.getOid() + " has a null comparator" ) );
isSuccess = false;
}
}
@@ -268,9 +268,8 @@
if ( mr.getNormalizer() == null )
{
String schema = matchingRuleRegistry.getSchemaName( mr.getOid() );
- errors.add( new NullPointerException( "matchingRule "
- + mr.getName() + " in schema " + schema + " with OID "
- + mr.getOid() + " has a null normalizer" ) );
+ errors.add( new NullPointerException( "matchingRule " + mr.getName() + " in schema " + schema
+ + " with OID " + mr.getOid() + " has a null normalizer" ) );
isSuccess = false;
}
}
@@ -287,9 +286,8 @@
if ( mr.getSyntax() == null )
{
String schema = matchingRuleRegistry.getSchemaName( mr.getOid() );
- errors.add( new NullPointerException( "matchingRule "
- + mr.getName() + " in schema " + schema + " with OID " + mr.getOid()
- + " has a null Syntax" ) );
+ errors.add( new NullPointerException( "matchingRule " + mr.getName() + " in schema " + schema
+ + " with OID " + mr.getOid() + " has a null Syntax" ) );
isSuccess = false;
}
}
@@ -375,9 +373,8 @@
if ( at.getSyntax() == null )
{
String schema = attributeTypeRegistry.getSchemaName( at.getOid() );
- errors.add( new NullPointerException( "attributeType "
- + at.getName() + " in schema " + schema + " with OID "
- + at.getOid() + " has a null Syntax" ) );
+ errors.add( new NullPointerException( "attributeType " + at.getName() + " in schema " + schema
+ + " with OID " + at.getOid() + " has a null Syntax" ) );
isSuccess = false;
}
}
@@ -391,22 +388,22 @@
{
// ----
}
-// try
-// {
-// String schema = attributeTypeRegistry.getSchemaName( at.getOid() );
-// if ( ! hasMatchingRule && at.getSyntax().isHumanReadible() )
-// {
-// errors.add( new NullPointerException( "attributeType "
-// + at.getName() + " in schema " + schema + " with OID "
-// + at.getOid() + " has a no matchingRules defined" ) );
-// isSuccess = false;
-// }
-// }
-// catch ( NamingException e )
-// {
-// errors.add( e );
-// isSuccess = false;
-// }
+ // try
+ // {
+ // String schema = attributeTypeRegistry.getSchemaName( at.getOid() );
+ // if ( ! hasMatchingRule && at.getSyntax().isHumanReadible() )
+ // {
+ // errors.add( new NullPointerException( "attributeType "
+ // + at.getName() + " in schema " + schema + " with OID "
+ // + at.getOid() + " has a no matchingRules defined" ) );
+ // isSuccess = false;
+ // }
+ // }
+ // catch ( NamingException e )
+ // {
+ // errors.add( e );
+ // isSuccess = false;
+ // }
return isSuccess;
}
@@ -435,7 +432,7 @@
for ( int ii = 0; ii < superiors.length; ii++ )
{
- isSuccess &= resolve( superiors[ii], errors ) ;
+ isSuccess &= resolve( superiors[ii], errors );
}
AttributeType[] mayList = new AttributeType[0];
@@ -452,10 +449,9 @@
for ( int ii = 0; ii < mayList.length; ii++ )
{
- isSuccess &= resolve( mayList[ii], errors ) ;
+ isSuccess &= resolve( mayList[ii], errors );
}
-
AttributeType[] mustList = new AttributeType[0];
try
{
@@ -470,7 +466,7 @@
for ( int ii = 0; ii < mustList.length; ii++ )
{
- isSuccess &= resolve( mustList[ii], errors ) ;
+ isSuccess &= resolve( mustList[ii], errors );
}
return isSuccess;
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxCheckerRegistry.java Fri Feb 10 02:48:07 2006
@@ -48,12 +48,11 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates a default SyntaxCheckerRegistry by initializing the map and the
* montior.
*/
- public GlobalSyntaxCheckerRegistry( BootstrapSyntaxCheckerRegistry bootstrap )
+ public GlobalSyntaxCheckerRegistry(BootstrapSyntaxCheckerRegistry bootstrap)
{
this.oidToSchema = new HashMap();
this.syntaxCheckers = new HashMap();
@@ -62,7 +61,7 @@
this.bootstrap = bootstrap;
if ( this.bootstrap == null )
{
- throw new NullPointerException( "the bootstrap registry cannot be null" ) ;
+ throw new NullPointerException( "the bootstrap registry cannot be null" );
}
}
@@ -82,14 +81,11 @@
// Service Methods
// ------------------------------------------------------------------------
-
- public void register( String schema, String oid, SyntaxChecker syntaxChecker )
- throws NamingException
+ public void register( String schema, String oid, SyntaxChecker syntaxChecker ) throws NamingException
{
if ( syntaxCheckers.containsKey( oid ) || bootstrap.hasSyntaxChecker( oid ) )
{
- NamingException e = new NamingException( "SyntaxChecker with OID "
- + oid + " already registered!" );
+ NamingException e = new NamingException( "SyntaxChecker with OID " + oid + " already registered!" );
monitor.registerFailed( oid, syntaxChecker, e );
throw e;
}
@@ -133,11 +129,11 @@
public String getSchemaName( String oid ) throws NamingException
{
- if ( ! Character.isDigit( oid.charAt( 0 ) ) )
+ if ( !Character.isDigit( oid.charAt( 0 ) ) )
{
throw new NamingException( "OID " + oid + " is not a numeric OID" );
}
-
+
if ( oidToSchema.containsKey( oid ) )
{
return ( String ) oidToSchema.get( oid );
@@ -148,7 +144,6 @@
return bootstrap.getSchemaName( oid );
}
- throw new NamingException( "OID " + oid + " not found in oid to " +
- "schema name map!" );
+ throw new NamingException( "OID " + oid + " not found in oid to " + "schema name map!" );
}
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/GlobalSyntaxRegistry.java Fri Feb 10 02:48:07 2006
@@ -52,11 +52,10 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates an empty BootstrapSyntaxRegistry.
*/
- public GlobalSyntaxRegistry( BootstrapSyntaxRegistry bootstrap, OidRegistry oidRegistry )
+ public GlobalSyntaxRegistry(BootstrapSyntaxRegistry bootstrap, OidRegistry oidRegistry)
{
this.byOid = new HashMap();
this.oidToSchema = new HashMap();
@@ -66,7 +65,7 @@
this.bootstrap = bootstrap;
if ( this.bootstrap == null )
{
- throw new NullPointerException( "the bootstrap registry cannot be null" ) ;
+ throw new NullPointerException( "the bootstrap registry cannot be null" );
}
}
@@ -86,19 +85,17 @@
// Service Methods
// ------------------------------------------------------------------------
-
public void register( String schema, Syntax dITContentRule ) throws NamingException
{
- if ( byOid.containsKey( dITContentRule.getOid() ) ||
- bootstrap.hasSyntax( dITContentRule.getOid() ) )
+ if ( byOid.containsKey( dITContentRule.getOid() ) || bootstrap.hasSyntax( dITContentRule.getOid() ) )
{
- NamingException e = new NamingException( "dITContentRule w/ OID " +
- dITContentRule.getOid() + " has already been registered!" );
+ NamingException e = new NamingException( "dITContentRule w/ OID " + dITContentRule.getOid()
+ + " has already been registered!" );
monitor.registerFailed( dITContentRule, e );
throw e;
}
- oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() ) ;
+ oidRegistry.register( dITContentRule.getName(), dITContentRule.getOid() );
byOid.put( dITContentRule.getOid(), dITContentRule );
oidToSchema.put( dITContentRule.getOid(), schema );
monitor.registered( dITContentRule );
@@ -123,8 +120,7 @@
return dITContentRule;
}
- NamingException e = new NamingException( "dITContentRule w/ OID "
- + id + " not registered!" );
+ NamingException e = new NamingException( "dITContentRule w/ OID " + id + " not registered!" );
monitor.lookupFailed( id, e );
throw e;
}
@@ -136,8 +132,7 @@
{
try
{
- return byOid.containsKey( oidRegistry.getOid( id ) ) ||
- bootstrap.hasSyntax( id );
+ return byOid.containsKey( oidRegistry.getOid( id ) ) || bootstrap.hasSyntax( id );
}
catch ( NamingException e )
{
@@ -163,14 +158,13 @@
return bootstrap.getSchemaName( id );
}
- throw new NamingException( "OID " + id + " not found in oid to " +
- "schema name map!" );
+ throw new NamingException( "OID " + id + " not found in oid to " + "schema name map!" );
}
public Iterator list()
{
return new JoinIterator( new Iterator[]
- { byOid.values().iterator(),bootstrap.list() } );
+ { byOid.values().iterator(), bootstrap.list() } );
}
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistry.java Fri Feb 10 02:48:07 2006
@@ -41,7 +41,8 @@
* registration operation is not supported
*/
void register( String schema, MatchingRule matchingRule ) throws NamingException;
-
+
+
/**
* Looks up a MatchingRule by its unique Object Identifier or by name.
*
@@ -52,6 +53,7 @@
*/
MatchingRule lookup( String id ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -61,6 +63,7 @@
*/
String getSchemaName( String id ) throws NamingException;
+
/**
* Checks to see if a MatchingRule exists. Backing store failures simply
* return false.
@@ -70,6 +73,7 @@
* otherwise
*/
boolean hasMatchingRule( String oid );
+
/**
* Gets an Iterator over the MatchingRules within this registry.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -37,6 +37,7 @@
*/
void registered( MatchingRule matchingRule );
+
/**
* Monitors when a MatchingRule is successfully looked up.
*
@@ -44,6 +45,7 @@
*/
void lookedUp( MatchingRule matchingRule );
+
/**
* Monitors when a lookup attempt fails.
*
@@ -51,7 +53,8 @@
* @param fault the exception to be thrown for the fault
*/
void lookupFailed( String oid, NamingException fault );
-
+
+
/**
* Monitors when a registration attempt fails.
*
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -30,11 +30,11 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class MatchingRuleRegistryMonitorAdapter
- implements MatchingRuleRegistryMonitor
+public class MatchingRuleRegistryMonitorAdapter implements MatchingRuleRegistryMonitor
{
private static final Logger log = LoggerFactory.getLogger( MatchingRuleRegistryMonitorAdapter.class );
-
+
+
/**
* @see org.apache.directory.server.core.schema.MatchingRuleRegistryMonitor#registered(
* org.apache.directory.shared.ldap.schema.MatchingRule)
@@ -42,7 +42,7 @@
public void registered( MatchingRule rule )
{
}
-
+
/**
* @see org.apache.directory.server.core.schema.MatchingRuleRegistryMonitor#lookedUp(
@@ -52,7 +52,7 @@
{
}
-
+
/**
* @see org.apache.directory.server.core.schema.MatchingRuleRegistryMonitor#lookupFailed(
* java.lang.String, javax.naming.NamingException)
@@ -65,7 +65,7 @@
}
}
-
+
/**
* @see org.apache.directory.server.core.schema.MatchingRuleRegistryMonitor#registerFailed(
* org.apache.directory.shared.ldap.schema.MatchingRule, javax.naming.NamingException)
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistry.java Fri Feb 10 02:48:07 2006
@@ -43,7 +43,8 @@
* the registration operation is not supported
*/
void register( String schema, MatchingRuleUse matchingRuleUse ) throws NamingException;
-
+
+
/**
* Looks up an matchingRuleUse by its name.
*
@@ -53,6 +54,7 @@
*/
MatchingRuleUse lookup( String name ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -62,6 +64,7 @@
*/
String getSchemaName( String name ) throws NamingException;
+
/**
* Checks to see if an matchingRuleUse exists.
*
@@ -70,6 +73,7 @@
* otherwise
*/
boolean hasMatchingRuleUse( String name );
+
/**
* Lists all the MatchingRuleUses within this registry.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -35,6 +35,7 @@
*/
void registered( MatchingRuleUse matchingRuleUse );
+
/**
* Monitors when a Comparator is successfully looked up.
*
@@ -42,6 +43,7 @@
*/
void lookedUp( MatchingRuleUse matchingRuleUse );
+
/**
* Monitors when a lookup attempt fails.
*
@@ -49,6 +51,7 @@
* @param fault the exception to be thrown for the fault
*/
void lookupFailed( String name, Throwable fault );
+
/**
* Monitors when a registration attempt fails.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/MatchingRuleUseRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -29,11 +29,11 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class MatchingRuleUseRegistryMonitorAdapter
- implements MatchingRuleUseRegistryMonitor
+public class MatchingRuleUseRegistryMonitorAdapter implements MatchingRuleUseRegistryMonitor
{
private static final Logger log = LoggerFactory.getLogger( MatchingRuleUseRegistryMonitorAdapter.class );
-
+
+
public void registered( MatchingRuleUse matchingRuleUse )
{
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistry.java Fri Feb 10 02:48:07 2006
@@ -41,7 +41,8 @@
* registration operation is not supported
*/
void register( String schema, NameForm nameForm ) throws NamingException;
-
+
+
/**
* Looks up a nameForm by its unique Object Identifier or by name.
*
@@ -51,6 +52,7 @@
*/
NameForm lookup( String id ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -60,6 +62,7 @@
*/
String getSchemaName( String id ) throws NamingException;
+
/**
* Checks to see if an nameForm exists.
*
@@ -69,10 +72,11 @@
*/
boolean hasNameForm( String id );
+
/**
* Lists all the NameForms within this registry.
*
* @return an Iterator over all the NameForms within this registry
- */
+ */
Iterator list();
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -35,6 +35,7 @@
*/
void registered( NameForm nameForm );
+
/**
* Monitors when a Comparator is successfully looked up.
*
@@ -42,6 +43,7 @@
*/
void lookedUp( NameForm nameForm );
+
/**
* Monitors when a lookup attempt fails.
*
@@ -49,6 +51,7 @@
* @param fault the exception to be thrown for the fault
*/
void lookupFailed( String oid, Throwable fault );
+
/**
* Monitors when a registration attempt fails.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NameFormRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -32,7 +32,8 @@
public class NameFormRegistryMonitorAdapter implements NameFormRegistryMonitor
{
private static final Logger log = LoggerFactory.getLogger( NameFormRegistryMonitorAdapter.class );
-
+
+
public void registered( NameForm nameForm )
{
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistry.java Fri Feb 10 02:48:07 2006
@@ -39,7 +39,8 @@
* registration operation is not supported
*/
void register( String schema, String oid, Normalizer normalizer ) throws NamingException;
-
+
+
/**
* Looks up a Normalizer by its unique Object Identifier.
*
@@ -50,6 +51,7 @@
*/
Normalizer lookup( String oid ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -58,6 +60,7 @@
* @throws NamingException if the schema object does not exist
*/
String getSchemaName( String oid ) throws NamingException;
+
/**
* Checks to see if a Normalizer exists. Backing store failures simply
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -38,6 +38,7 @@
*/
void registered( String oid, Normalizer normalizer );
+
/**
* Monitors when a Normalizer is successfully looked up.
*
@@ -46,6 +47,7 @@
*/
void lookedUp( String oid, Normalizer normalizer );
+
/**
* Monitors when a lookup attempt fails.
*
@@ -53,7 +55,8 @@
* @param fault the exception to be thrown for the fault
*/
void lookupFailed( String oid, NamingException fault );
-
+
+
/**
* Monitors when a registration attempt fails.
*
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/NormalizerRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -30,11 +30,11 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class NormalizerRegistryMonitorAdapter
- implements NormalizerRegistryMonitor
+public class NormalizerRegistryMonitorAdapter implements NormalizerRegistryMonitor
{
private static final Logger log = LoggerFactory.getLogger( NormalizerRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.NormalizerRegistryMonitor#registered(
* org.apache.eve.schema.Normalizer)
@@ -43,7 +43,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.NormalizerRegistryMonitor#lookedUp(
* org.apache.eve.schema.Normalizer)
@@ -52,7 +52,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.NormalizerRegistryMonitor#lookupFailed(
* java.lang.String, javax.naming.NamingException)
@@ -61,11 +61,11 @@
{
if ( fault != null )
{
- log.warn( "Failed to look up the normalizer: " + oid , fault );
+ log.warn( "Failed to look up the normalizer: " + oid, fault );
}
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.NormalizerRegistryMonitor#registerFailed(
* org.apache.eve.schema.Normalizer, javax.naming.NamingException)
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistry.java Fri Feb 10 02:48:07 2006
@@ -42,6 +42,7 @@
*/
void register( String schema, ObjectClass objectClass ) throws NamingException;
+
/**
* Looks up an objectClass by its unique Object Identifier or by name.
*
@@ -51,6 +52,7 @@
*/
ObjectClass lookup( String id ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -60,6 +62,7 @@
*/
String getSchemaName( String id ) throws NamingException;
+
/**
* Checks to see if an objectClass exists.
*
@@ -68,6 +71,7 @@
* otherwise
*/
boolean hasObjectClass( String id );
+
/**
* Gets an Iterator over the ObjectClasses within this ObjectClassRegistry.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -35,6 +35,7 @@
*/
void registered( ObjectClass objectClass );
+
/**
* Monitors when a Comparator is successfully looked up.
*
@@ -42,6 +43,7 @@
*/
void lookedUp( ObjectClass objectClass );
+
/**
* Monitors when a lookup attempt fails.
*
@@ -49,6 +51,7 @@
* @param fault the exception to be thrown for the fault
*/
void lookupFailed( String oid, Throwable fault );
+
/**
* Monitors when a registration attempt fails.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectClassRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -32,7 +32,8 @@
public class ObjectClassRegistryMonitorAdapter implements ObjectClassRegistryMonitor
{
private static final Logger log = LoggerFactory.getLogger( ObjectClassRegistryMonitorAdapter.class );
-
+
+
public void registered( ObjectClass objectClass )
{
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectFactoryRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectFactoryRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectFactoryRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/ObjectFactoryRegistry.java Fri Feb 10 02:48:07 2006
@@ -45,6 +45,7 @@
*/
ServerDirObjectFactory getObjectFactories( LdapContext ctx ) throws NamingException;
+
/**
* Registers a server-side object factory with this registry.
*
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistry.java Fri Feb 10 02:48:07 2006
@@ -42,6 +42,7 @@
*/
String getOid( String name ) throws NamingException;
+
/**
* Checks to see if an identifier, oid or name exists within this registry.
*
@@ -50,6 +51,7 @@
*/
boolean hasOid( String id );
+
/**
* Gets the primary name associated with an OID. The primary name is the
* first name specified for the OID.
@@ -59,7 +61,8 @@
* @throws NamingException if oid does not exist
*/
String getPrimaryName( String oid ) throws NamingException;
-
+
+
/**
* Gets the names associated with an OID. An OID is unique however it may
* have many names used to refer to it. A good example is the cn and
@@ -73,14 +76,16 @@
* @throws NamingException if oid does not exist
*/
List getNameSet( String oid ) throws NamingException;
-
+
+
/**
* Lists all the OIDs within the registry. This may be a really big list.
*
* @return all the OIDs registered
*/
Iterator list();
-
+
+
/**
* Adds an OID name pair to the registry.
*
@@ -88,12 +93,14 @@
* @param oid the OID to add or associate a new name with
*/
void register( String name, String oid );
-
+
+
/**
* Get the map of all the oids by their name
* @return The Map that contains all the oids
*/
public Map getOidByName();
+
/**
* Get the map of all the oids by their name
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitor.java Fri Feb 10 02:48:07 2006
@@ -37,7 +37,8 @@
* @param oid the OID argument and return value
*/
void getOidWithOid( String oid );
-
+
+
/**
* Monitors when an OID is resolved successfully for a name.
*
@@ -45,7 +46,8 @@
* @param oid the OID returned for the name
*/
void oidResolved( String name, String oid );
-
+
+
/**
* Monitors when an OID is resolved successfully by using a normalized form
* of the name.
@@ -55,7 +57,8 @@
* @param oid the OID returned for the name
*/
void oidResolved( String name, String normalized, String oid );
-
+
+
/**
* Monitors when resolution of an OID by name fails.
*
@@ -63,7 +66,8 @@
* @param fault the exception thrown for the failure after this call
*/
void oidResolutionFailed( String name, NamingException fault );
-
+
+
/**
* Monitors when a name lookups fail due to the use of an unknown OID.
*
@@ -71,7 +75,8 @@
* @param fault the exception thrown for the failure after this call
*/
void oidDoesNotExist( String oid, NamingException fault );
-
+
+
/**
* Monitors situations where a primary name is resolved for a OID.
*
@@ -80,6 +85,7 @@
*/
void nameResolved( String oid, String primaryName );
+
/**
* Monitors situations where a names are resolved for a OID.
*
@@ -87,7 +93,8 @@
* @param names the names found for the OID
*/
void namesResolved( String oid, List names );
-
+
+
/**
* Monitors the successful registration of a name for an OID.
*
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitorAdapter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitorAdapter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitorAdapter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/OidRegistryMonitorAdapter.java Fri Feb 10 02:48:07 2006
@@ -16,6 +16,7 @@
*/
package org.apache.directory.server.core.schema;
+
import java.util.List;
import javax.naming.NamingException;
@@ -34,6 +35,7 @@
{
private static final Logger log = LoggerFactory.getLogger( OidRegistryMonitorAdapter.class );
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#getOidWithOid(
* java.lang.String)
@@ -42,7 +44,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#oidResolved(
* java.lang.String, java.lang.String)
@@ -50,7 +52,7 @@
public void oidResolved( String name, String oid )
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#oidResolved(
@@ -60,7 +62,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#oidResolutionFailed(
* java.lang.String, javax.naming.NamingException)
@@ -73,7 +75,7 @@
}
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#oidDoesNotExist(
* java.lang.String, javax.naming.NamingException)
@@ -86,7 +88,7 @@
}
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#nameResolved(
* java.lang.String, java.lang.String)
@@ -95,7 +97,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#namesResolved(
* java.lang.String, java.util.List)
@@ -104,7 +106,7 @@
{
}
-
+
/* (non-Javadoc)
* @see org.apache.directory.server.schema.OidRegistryMonitor#registered(
* java.lang.String, java.lang.String)
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java Fri Feb 10 02:48:07 2006
@@ -48,6 +48,7 @@
/** the SLF4J logger for this class */
private static Logger log = LoggerFactory.getLogger( SchemaChecker.class );
+
/**
* Makes sure modify operations do not leave the entry without a STRUCTURAL
* objectClass. At least one STRUCTURAL objectClass must be specified for
@@ -62,15 +63,14 @@
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyReplace( ObjectClassRegistry registry, Name name, int mod,
- Attribute attribute )
- throws NamingException
+ Attribute attribute ) throws NamingException
{
if ( mod != DirContext.REPLACE_ATTRIBUTE )
{
return;
}
- if ( ! "objectclass".equalsIgnoreCase( attribute.getID() ) )
+ if ( !"objectclass".equalsIgnoreCase( attribute.getID() ) )
{
return;
}
@@ -122,8 +122,7 @@
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyReplace( ObjectClassRegistry registry, Name name, int mod,
- Attributes attributes )
- throws NamingException
+ Attributes attributes ) throws NamingException
{
if ( mod != DirContext.REPLACE_ATTRIBUTE )
{
@@ -184,15 +183,14 @@
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyRemove( ObjectClassRegistry registry, Name name, int mod,
- Attribute attribute, Attribute entryObjectClasses )
- throws NamingException
+ Attribute attribute, Attribute entryObjectClasses ) throws NamingException
{
if ( mod != DirContext.REMOVE_ATTRIBUTE )
{
return;
}
- if ( ! "objectclass".equalsIgnoreCase( attribute.getID() ) )
+ if ( !"objectclass".equalsIgnoreCase( attribute.getID() ) )
{
return;
}
@@ -255,8 +253,7 @@
* without a STRUCTURAL objectClass
*/
public static void preventStructuralClassRemovalOnModifyRemove( ObjectClassRegistry registry, Name name, int mod,
- Attributes attributes, Attribute entryObjectClasses )
- throws NamingException
+ Attributes attributes, Attribute entryObjectClasses ) throws NamingException
{
if ( mod != DirContext.REMOVE_ATTRIBUTE )
{
@@ -332,7 +329,7 @@
* @throws NamingException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyReplace( Name name, int mod, Attribute attribute )
- throws NamingException
+ throws NamingException
{
if ( mod != DirContext.REPLACE_ATTRIBUTE )
{
@@ -342,7 +339,7 @@
Set rdnAttributes = getRdnAttributes( name );
String id = ( String ) attribute.getID();
- if ( ! rdnAttributes.contains( id ) )
+ if ( !rdnAttributes.contains( id ) )
{
return;
}
@@ -370,7 +367,7 @@
{
// if the old rdn value is not in the rdn attribute then
// we must complain with a schema violation
- if ( ! attribute.contains( rdnValue ) )
+ if ( !attribute.contains( rdnValue ) )
{
String msg = "Modify operation attempts to delete RDN attribute values in use for ";
msg += id + " on entry " + name + " and violates schema constraints";
@@ -405,7 +402,7 @@
* @throws NamingException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyReplace( Name name, int mod, Attributes attributes )
- throws NamingException
+ throws NamingException
{
if ( mod != DirContext.REPLACE_ATTRIBUTE )
{
@@ -444,7 +441,7 @@
{
// if the old rdn value is not in the rdn attribute then
// we must complain with a schema violation
- if ( ! rdnAttr.contains( rdnValue ) )
+ if ( !rdnAttr.contains( rdnValue ) )
{
String msg = "Modify operation attempts to delete RDN attribute values in use for ";
msg += id + " on entry " + name + " and violates schema constraints";
@@ -480,8 +477,7 @@
* @param attribute the attribute being modified
* @throws NamingException if the modify operation is removing an Rdn attribute
*/
- public static void preventRdnChangeOnModifyRemove( Name name, int mod, Attribute attribute )
- throws NamingException
+ public static void preventRdnChangeOnModifyRemove( Name name, int mod, Attribute attribute ) throws NamingException
{
if ( mod != DirContext.REMOVE_ATTRIBUTE )
{
@@ -491,7 +487,7 @@
Set rdnAttributes = getRdnAttributes( name );
String id = attribute.getID();
- if ( ! rdnAttributes.contains( id ) )
+ if ( !rdnAttributes.contains( id ) )
{
return;
}
@@ -552,7 +548,7 @@
* @throws NamingException if the modify operation is removing an Rdn attribute
*/
public static void preventRdnChangeOnModifyRemove( Name name, int mod, Attributes attributes )
- throws NamingException
+ throws NamingException
{
if ( mod != DirContext.REMOVE_ATTRIBUTE )
{
@@ -618,7 +614,7 @@
*/
private static String getRdnValue( String id, Name name ) throws NamingException
{
- String [] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
+ String[] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
for ( int ii = 0; ii < comps.length; ii++ )
{
@@ -644,7 +640,7 @@
*/
private static Set getRdnAttributes( Name name ) throws NamingException
{
- String [] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
+ String[] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );
Set attributes = new HashSet();
for ( int ii = 0; ii < comps.length; ii++ )
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Fri Feb 10 02:48:07 2006
@@ -91,16 +91,16 @@
* a binary attribute tranforming filter: String -> byte[]
*/
private BinaryAttributeFilter binaryAttributeFilter;
-
+
private TopFilter topFilter;
-
+
private List filters = new ArrayList();
/**
* the global schema object registries
*/
private GlobalRegistries globalRegistries;
-
+
private Set binaries;
/**
@@ -113,6 +113,7 @@
*/
private String startUpTimeStamp;
+
/**
* Creates a schema service interceptor.
*/
@@ -160,9 +161,8 @@
}
- public NamingEnumeration search( NextInterceptor nextInterceptor,
- Name base, Map env, ExprNode filter,
- SearchControls searchCtls ) throws NamingException
+ public NamingEnumeration search( NextInterceptor nextInterceptor, Name base, Map env, ExprNode filter,
+ SearchControls searchCtls ) throws NamingException
{
// check to make sure the DN searched for is a subentry
if ( !subschemaSubentryDn.equals( base.toString() ) )
@@ -177,15 +177,12 @@
return new SearchResultFilteringEnumeration( e, searchCtls, invocation, filters );
}
- if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE &&
- filter instanceof SimpleNode )
+ if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE && filter instanceof SimpleNode )
{
SimpleNode node = ( SimpleNode ) filter;
- if ( node.getAttribute().equalsIgnoreCase( "objectClass" ) &&
- node.getValue().equalsIgnoreCase( "subschema" ) &&
- node.getAssertionType() == SimpleNode.EQUALITY
- )
+ if ( node.getAttribute().equalsIgnoreCase( "objectClass" )
+ && node.getValue().equalsIgnoreCase( "subschema" ) && node.getAssertionType() == SimpleNode.EQUALITY )
{
// call.setBypass( true );
Attributes attrs = getSubschemaEntry( searchCtls.getReturningAttributes() );
@@ -193,8 +190,7 @@
return new SingletonEnumeration( result );
}
}
- else if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE &&
- filter instanceof PresenceNode )
+ else if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE && filter instanceof PresenceNode )
{
PresenceNode node = ( PresenceNode ) filter;
@@ -337,7 +333,6 @@
// timeestamps are hacks for now until the schema is actually updateable these
// use the servers startup time stamp for both modify and create timestamps
-
if ( returnAllOperationalAttributes || set.contains( "createtimestamp" ) )
{
attr = new LockableAttributeImpl( "createTimestamp" );
@@ -436,7 +431,7 @@
OidRegistry oidRegistry = globalRegistries.getOidRegistry();
ObjectClassRegistry registry = globalRegistries.getObjectClassRegistry();
- if ( ! oidRegistry.hasOid( attrId ) )
+ if ( !oidRegistry.hasOid( attrId ) )
{
return false;
}
@@ -512,20 +507,20 @@
return new LockableAttributeImpl( "objectClasses" );
}
- switch( modOp )
+ switch ( modOp )
{
- case( DirContext.ADD_ATTRIBUTE ):
+ case ( DirContext.ADD_ATTRIBUTE ):
return AttributeUtils.getUnion( existing, changes );
- case( DirContext.REPLACE_ATTRIBUTE ):
+ case ( DirContext.REPLACE_ATTRIBUTE ):
return ( Attribute ) changes.clone();
- case( DirContext.REMOVE_ATTRIBUTE ):
+ case ( DirContext.REMOVE_ATTRIBUTE ):
return AttributeUtils.getDifference( existing, changes );
default:
throw new InternalError( "" );
}
}
-
-
+
+
/**
* Given the objectClasses for an entry, this method adds missing ancestors
* in the hierarchy except for top which it removes. This is used for this
@@ -535,24 +530,25 @@
* @param objectClassAttr the objectClass attribute to modify
* @throws NamingException if there are problems
*/
- public static void alterObjectClasses( Attribute objectClassAttr, ObjectClassRegistry registry ) throws NamingException
+ public static void alterObjectClasses( Attribute objectClassAttr, ObjectClassRegistry registry )
+ throws NamingException
{
- if ( ! objectClassAttr.getID().equalsIgnoreCase( "objectClass" ) )
+ if ( !objectClassAttr.getID().equalsIgnoreCase( "objectClass" ) )
{
- throw new LdapNamingException( "Expecting an objectClass attribute but got " + objectClassAttr.getID(),
+ throw new LdapNamingException( "Expecting an objectClass attribute but got " + objectClassAttr.getID(),
ResultCodeEnum.OPERATIONSERROR );
}
-
+
Set objectClasses = new HashSet();
for ( int ii = 0; ii < objectClassAttr.size(); ii++ )
{
String val = ( String ) objectClassAttr.get( ii );
- if ( ! val.equalsIgnoreCase( "top" ) )
+ if ( !val.equalsIgnoreCase( "top" ) )
{
objectClasses.add( val.toLowerCase() );
}
}
-
+
for ( int ii = 0; ii < objectClassAttr.size(); ii++ )
{
String val = ( String ) objectClassAttr.get( ii );
@@ -560,15 +556,15 @@
{
objectClassAttr.remove( val );
}
-
+
ObjectClass objectClass = registry.lookup( val );
-
+
// cannot use Collections.addAll(Collection, Object[]) since it's 1.5
ObjectClass top = registry.lookup( "top" );
ObjectClass[] superiors = objectClass.getSuperClasses();
for ( int jj = 0; jj < superiors.length; jj++ )
{
- if ( superiors[jj] != top && ! objectClasses.contains( superiors[jj].getName().toLowerCase() ) )
+ if ( superiors[jj] != top && !objectClasses.contains( superiors[jj].getName().toLowerCase() ) )
{
objectClassAttr.add( superiors[jj].getName() );
}
@@ -580,7 +576,7 @@
public void modify( NextInterceptor next, Name name, int modOp, Attributes mods ) throws NamingException
{
Attributes entry = nexus.lookup( name );
- Attribute objectClass = getResultantObjectClasses( modOp, mods.get( "objectClass"), entry.get( "objectClass" ) );
+ Attribute objectClass = getResultantObjectClasses( modOp, mods.get( "objectClass" ), entry.get( "objectClass" ) );
ObjectClassRegistry ocRegistry = this.globalRegistries.getObjectClassRegistry();
AttributeTypeRegistry atRegistry = this.globalRegistries.getAttributeTypeRegistry();
@@ -590,7 +586,7 @@
String id = ( String ) changes.next();
Attribute change = mods.get( id );
- if ( ! atRegistry.hasAttributeType( change.getID() ) && ! objectClass.contains( "extensibleObject" ) )
+ if ( !atRegistry.hasAttributeType( change.getID() ) && !objectClass.contains( "extensibleObject" ) )
{
throw new LdapInvalidAttributeIdentifierException( "unrecognized attributeID " + change.getID() );
}
@@ -602,9 +598,8 @@
// for required attributes we need to check if all values are removed
// if so then we have a schema violation that must be thrown
- if ( modOp == DirContext.REMOVE_ATTRIBUTE &&
- isRequired( change.getID(), objectClass ) &&
- isCompleteRemoval( change, entry ) )
+ if ( modOp == DirContext.REMOVE_ATTRIBUTE && isRequired( change.getID(), objectClass )
+ && isCompleteRemoval( change, entry ) )
{
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECTCLASSVIOLATION );
}
@@ -628,38 +623,38 @@
{
Attribute alteredObjectClass = ( Attribute ) objectClass.clone();
alterObjectClasses( alteredObjectClass, ocRegistry );
-
- if ( ! alteredObjectClass.equals( objectClass ) )
+
+ if ( !alteredObjectClass.equals( objectClass ) )
{
Attribute ocMods = mods.get( "objectClass" );
- switch( modOp )
+ switch ( modOp )
{
- case( DirContext.ADD_ATTRIBUTE ):
+ case ( DirContext.ADD_ATTRIBUTE ):
if ( ocMods.contains( "top" ) )
{
ocMods.remove( "top" );
}
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.add( alteredObjectClass.get( ii ) );
}
}
break;
- case( DirContext.REMOVE_ATTRIBUTE ):
+ case ( DirContext.REMOVE_ATTRIBUTE ):
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.remove( alteredObjectClass.get( ii ) );
}
}
break;
- case( DirContext.REPLACE_ATTRIBUTE ):
+ case ( DirContext.REPLACE_ATTRIBUTE ):
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.add( alteredObjectClass.get( ii ) );
}
@@ -669,7 +664,7 @@
}
}
}
-
+
next.modify( name, modOp, mods );
}
@@ -679,14 +674,14 @@
Attributes entry = nexus.lookup( name );
Set modset = new HashSet();
ModificationItem objectClassMod = null;
-
+
for ( int ii = 0; ii < mods.length; ii++ )
{
if ( mods[ii].getAttribute().getID().equalsIgnoreCase( "objectclass" ) )
{
objectClassMod = mods[ii];
}
-
+
StringBuffer keybuf = new StringBuffer();
keybuf.append( mods[ii].getModificationOp() );
keybuf.append( mods[ii].getAttribute().getID() );
@@ -694,9 +689,9 @@
{
keybuf.append( mods[ii].getAttribute().get( jj ) );
}
- if ( ! modset.add( keybuf.toString() ) && mods[ii].getModificationOp() == DirContext.ADD_ATTRIBUTE )
+ if ( !modset.add( keybuf.toString() ) && mods[ii].getModificationOp() == DirContext.ADD_ATTRIBUTE )
{
- throw new LdapAttributeInUseException( "found two copies of the following modification item: "
+ throw new LdapAttributeInUseException( "found two copies of the following modification item: "
+ mods[ii] );
}
}
@@ -708,8 +703,8 @@
}
else
{
- objectClass = getResultantObjectClasses( objectClassMod.getModificationOp(),
- objectClassMod.getAttribute(), entry.get( "objectClass" ) );
+ objectClass = getResultantObjectClasses( objectClassMod.getModificationOp(), objectClassMod.getAttribute(),
+ entry.get( "objectClass" ) );
}
ObjectClassRegistry ocRegistry = this.globalRegistries.getObjectClassRegistry();
@@ -720,7 +715,7 @@
int modOp = mods[ii].getModificationOp();
Attribute change = mods[ii].getAttribute();
- if ( ! atRegistry.hasAttributeType( change.getID() ) && ! objectClass.contains( "extensibleObject" ) )
+ if ( !atRegistry.hasAttributeType( change.getID() ) && !objectClass.contains( "extensibleObject" ) )
{
throw new LdapInvalidAttributeIdentifierException();
}
@@ -739,7 +734,8 @@
throw new LdapSchemaViolationException( ResultCodeEnum.OBJECTCLASSVIOLATION );
}
SchemaChecker.preventRdnChangeOnModifyRemove( name, modOp, change );
- SchemaChecker.preventStructuralClassRemovalOnModifyRemove( ocRegistry, name, modOp, change, objectClass );
+ SchemaChecker
+ .preventStructuralClassRemovalOnModifyRemove( ocRegistry, name, modOp, change, objectClass );
}
if ( modOp == DirContext.REPLACE_ATTRIBUTE )
@@ -755,38 +751,38 @@
{
Attribute alteredObjectClass = ( Attribute ) objectClass.clone();
alterObjectClasses( alteredObjectClass, ocRegistry );
-
- if ( ! alteredObjectClass.equals( objectClass ) )
+
+ if ( !alteredObjectClass.equals( objectClass ) )
{
Attribute ocMods = objectClassMod.getAttribute();
- switch( objectClassMod.getModificationOp() )
+ switch ( objectClassMod.getModificationOp() )
{
- case( DirContext.ADD_ATTRIBUTE ):
+ case ( DirContext.ADD_ATTRIBUTE ):
if ( ocMods.contains( "top" ) )
{
ocMods.remove( "top" );
}
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.add( alteredObjectClass.get( ii ) );
}
}
break;
- case( DirContext.REMOVE_ATTRIBUTE ):
+ case ( DirContext.REMOVE_ATTRIBUTE ):
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.remove( alteredObjectClass.get( ii ) );
}
}
break;
- case( DirContext.REPLACE_ATTRIBUTE ):
+ case ( DirContext.REPLACE_ATTRIBUTE ):
for ( int ii = 0; ii < alteredObjectClass.size(); ii++ )
{
- if ( ! objectClass.contains( alteredObjectClass.get( ii ) ) )
+ if ( !objectClass.contains( alteredObjectClass.get( ii ) ) )
{
ocMods.add( alteredObjectClass.get( ii ) );
}
@@ -800,14 +796,14 @@
next.modify( name, mods );
}
-
+
private void filterTop( Attributes entry ) throws NamingException
{
// add top if objectClass is included and missing top
Attribute oc = entry.get( "objectClass" );
if ( oc != null )
{
- if ( ! oc.contains( "top" ) )
+ if ( !oc.contains( "top" ) )
{
oc.add( "top" );
}
@@ -818,13 +814,13 @@
private void filterBinaryAttributes( Attributes entry ) throws NamingException
{
long t0 = -1;
-
+
if ( log.isDebugEnabled() )
{
t0 = System.currentTimeMillis();
- log.debug( "Filtering entry " + AttributeUtils.toString( entry ) );
+ log.debug( "Filtering entry " + AttributeUtils.toString( entry ) );
}
-
+
/*
* start converting values of attributes to byte[]s which are not
* human readable and those that are in the binaries set
@@ -868,15 +864,14 @@
entry.put( binary );
}
}
-
+
if ( log.isDebugEnabled() )
{
long t1 = System.currentTimeMillis();
- log.debug( "Time to filter entry = " + (t1 - t0) + " ms" );
+ log.debug( "Time to filter entry = " + ( t1 - t0 ) + " ms" );
}
}
-
/**
* A special filter over entry attributes which replaces Attribute String values with their respective byte[]
* representations using schema information and the value held in the JNDI environment property:
@@ -887,7 +882,8 @@
*/
private class BinaryAttributeFilter implements SearchResultFilter
{
- public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException
+ public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+ throws NamingException
{
filterBinaryAttributes( result.getAttributes() );
return true;
@@ -899,13 +895,15 @@
*/
private class TopFilter implements SearchResultFilter
{
- public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException
+ public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
+ throws NamingException
{
filterTop( result.getAttributes() );
return true;
}
}
+
/**
* Check that all the attributes exist in the schema for this entry.
*/
@@ -915,13 +913,13 @@
NamingEnumeration attrEnum = attrs.getIDs();
while ( attrEnum.hasMoreElements() )
{
- String name = (String)attrEnum.nextElement();
- if ( ! atRegistry.hasAttributeType( name ) )
+ String name = ( String ) attrEnum.nextElement();
+ if ( !atRegistry.hasAttributeType( name ) )
{
throw new LdapInvalidAttributeIdentifierException( name + " not found in attribute registry!" );
}
}
-
+
alterObjectClasses( attrs.get( "objectClass" ), this.globalRegistries.getObjectClassRegistry() );
next.add( upName, normName, attrs );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SerializableComparator.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SerializableComparator.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SerializableComparator.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SerializableComparator.java Fri Feb 10 02:48:07 2006
@@ -47,7 +47,6 @@
// S T A T I C M E T H O D S
// ------------------------------------------------------------------------
-
/**
* Sets the global Comparator registry for comparator lookups.
*
@@ -63,8 +62,7 @@
// C O N T R U C T O R S
// ------------------------------------------------------------------------
-
- public SerializableComparator( String matchingRuleOid )
+ public SerializableComparator(String matchingRuleOid)
{
this.matchingRuleOid = matchingRuleOid;
}
@@ -73,7 +71,6 @@
// ------------------------------------------------------------------------
// C O M P A R A T O R I M P L E M E N T A T I O N S
// ------------------------------------------------------------------------
-
/**
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/StateFactoryRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/StateFactoryRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/StateFactoryRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/StateFactoryRegistry.java Fri Feb 10 02:48:07 2006
@@ -47,6 +47,7 @@
*/
ServerDirStateFactory getStateFactories( Object obj ) throws NamingException;
+
/**
* Registers a server-side state factory with this registry.
*
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SyntaxCheckerRegistry.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SyntaxCheckerRegistry.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SyntaxCheckerRegistry.java Fri Feb 10 02:48:07 2006
@@ -38,9 +38,9 @@
* @throws NamingException if the SyntaxChecker is already registered or the
* registration operation is not supported
*/
- void register( String schema, String oid, SyntaxChecker syntaxChecker )
- throws NamingException;
-
+ void register( String schema, String oid, SyntaxChecker syntaxChecker ) throws NamingException;
+
+
/**
* Looks up a SyntaxChecker by its unique Object Identifier.
*
@@ -51,6 +51,7 @@
*/
SyntaxChecker lookup( String oid ) throws NamingException;
+
/**
* Gets the name of the schema this schema object is associated with.
*
@@ -59,6 +60,7 @@
* @throws NamingException if the schema object does not exist
*/
String getSchemaName( String oid ) throws NamingException;
+
/**
* Checks to see if a SyntaxChecker exists. Backing store failures simply