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 [7/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/a...
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.authz.support;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -47,9 +48,12 @@
*/
public class MostSpecificUserClassFilter implements ACITupleFilter
{
- public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy, Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel, Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations ) throws NamingException
+ public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy,
+ Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel,
+ Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations )
+ throws NamingException
{
- if( tuples.size() <= 1 )
+ if ( tuples.size() <= 1 )
{
return tuples;
}
@@ -58,14 +62,13 @@
// If there are any tuples matching the requestor with UserClasses
// element name or thisEntry, discard all other tuples.
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
+ for ( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
- if( userClass instanceof UserClass.Name ||
- userClass instanceof UserClass.ThisEntry )
+ if ( userClass instanceof UserClass.Name || userClass instanceof UserClass.ThisEntry )
{
filteredTuples.add( tuple );
break;
@@ -73,20 +76,20 @@
}
}
- if( filteredTuples.size() > 0 )
+ if ( filteredTuples.size() > 0 )
{
return filteredTuples;
}
// Otherwise if there are any tuples matching UserGroup,
// discard all other tuples.
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
+ for ( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
- if( userClass instanceof UserClass.UserGroup )
+ if ( userClass instanceof UserClass.UserGroup )
{
filteredTuples.add( tuple );
break;
@@ -94,20 +97,20 @@
}
}
- if( filteredTuples.size() > 0 )
+ if ( filteredTuples.size() > 0 )
{
return filteredTuples;
}
// Otherwise if there are any tuples matching subtree,
// discard all other tuples.
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- for( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
+ for ( Iterator j = tuple.getUserClasses().iterator(); j.hasNext(); )
{
UserClass userClass = ( UserClass ) j.next();
- if( userClass instanceof UserClass.Subtree )
+ if ( userClass instanceof UserClass.Subtree )
{
filteredTuples.add( tuple );
break;
@@ -115,7 +118,7 @@
}
}
- if( filteredTuples.size() > 0 )
+ if ( filteredTuples.size() > 0 )
{
return filteredTuples;
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/OperationScope.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/OperationScope.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/OperationScope.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/OperationScope.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.authz.support;
+
/**
* An enumeration that represents the scope of user operation.
*
@@ -30,24 +31,26 @@
* An operation that affects the whole entry.
*/
public static final OperationScope ENTRY = new OperationScope( "Entry" );
-
+
/**
* An operation that affects all values in an attribute type.
*/
public static final OperationScope ATTRIBUTE_TYPE = new OperationScope( "Attribute Type" );
-
+
/**
* An operation that affects the specific value in an attribute type.
*/
public static final OperationScope ATTRIBUTE_TYPE_AND_VALUE = new OperationScope( "Attribute Type & Value" );
-
+
private final String name;
-
- private OperationScope( String name )
+
+
+ private OperationScope(String name)
{
this.name = name;
}
-
+
+
/**
* Return the name of this scope.
*/
@@ -55,6 +58,7 @@
{
return name;
}
+
/**
* Returns the name of this scope.
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.authz.support;
+
import java.util.Collection;
import java.util.Iterator;
@@ -48,24 +49,28 @@
private final RefinementEvaluator refinementEvaluator;
private final Evaluator entryEvaluator;
- public RelatedProtectedItemFilter(
- RefinementEvaluator refinementEvaluator, Evaluator entryEvaluator )
+
+ public RelatedProtectedItemFilter(RefinementEvaluator refinementEvaluator, Evaluator entryEvaluator)
{
this.refinementEvaluator = refinementEvaluator;
this.entryEvaluator = entryEvaluator;
}
- public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy, Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel, Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations ) throws NamingException
+
+ public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy,
+ Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel,
+ Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations )
+ throws NamingException
{
- if( tuples.size() == 0 )
+ if ( tuples.size() == 0 )
{
return tuples;
}
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- if( !isRelated( tuple, scope, userName, entryName, attrId, attrValue, entry ) )
+ if ( !isRelated( tuple, scope, userName, entryName, attrId, attrValue, entry ) )
{
i.remove();
}
@@ -74,166 +79,162 @@
return tuples;
}
- private boolean isRelated( ACITuple tuple, OperationScope scope, Name userName, Name entryName, String attrId, Object attrValue, Attributes entry ) throws NamingException, InternalError
+
+ private boolean isRelated( ACITuple tuple, OperationScope scope, Name userName, Name entryName, String attrId,
+ Object attrValue, Attributes entry ) throws NamingException, InternalError
{
- for( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
+ for ( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
{
ProtectedItem item = ( ProtectedItem ) i.next();
- if( item == ProtectedItem.ENTRY )
+ if ( item == ProtectedItem.ENTRY )
{
- if( scope == OperationScope.ENTRY )
+ if ( scope == OperationScope.ENTRY )
{
return true;
}
}
- else if( item == ProtectedItem.ALL_USER_ATTRIBUTE_TYPES )
+ else if ( item == ProtectedItem.ALL_USER_ATTRIBUTE_TYPES )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE &&
- scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE && scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
- if( isUserAttribute( attrId ) )
+ if ( isUserAttribute( attrId ) )
{
return true;
}
}
- else if( item == ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES )
+ else if ( item == ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE &&
- scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE && scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
- if( isUserAttribute( attrId ) )
+ if ( isUserAttribute( attrId ) )
{
return true;
}
}
- else if( item instanceof ProtectedItem.AllAttributeValues )
+ else if ( item instanceof ProtectedItem.AllAttributeValues )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE &&
- scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE && scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
ProtectedItem.AllAttributeValues aav = ( ProtectedItem.AllAttributeValues ) item;
- for( Iterator j = aav.iterator(); j.hasNext(); )
+ for ( Iterator j = aav.iterator(); j.hasNext(); )
{
- if( attrId.equalsIgnoreCase( ( String ) j.next() ) )
+ if ( attrId.equalsIgnoreCase( ( String ) j.next() ) )
{
return true;
}
}
}
- else if( item instanceof ProtectedItem.AttributeType )
+ else if ( item instanceof ProtectedItem.AttributeType )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE )
{
continue;
}
ProtectedItem.AttributeType at = ( ProtectedItem.AttributeType ) item;
- for( Iterator j = at.iterator(); j.hasNext(); )
+ for ( Iterator j = at.iterator(); j.hasNext(); )
{
- if( attrId.equalsIgnoreCase( ( String ) j.next() ) )
+ if ( attrId.equalsIgnoreCase( ( String ) j.next() ) )
{
return true;
}
}
}
- else if( item instanceof ProtectedItem.AttributeValue )
+ else if ( item instanceof ProtectedItem.AttributeValue )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
ProtectedItem.AttributeValue av = ( ProtectedItem.AttributeValue ) item;
- for( Iterator j = av.iterator(); j.hasNext(); )
+ for ( Iterator j = av.iterator(); j.hasNext(); )
{
Attribute attr = ( Attribute ) j.next();
- if( attrId.equalsIgnoreCase( attr.getID() ) &&
- attr.contains( attrValue ) )
+ if ( attrId.equalsIgnoreCase( attr.getID() ) && attr.contains( attrValue ) )
{
return true;
}
}
}
- else if( item instanceof ProtectedItem.Classes )
+ else if ( item instanceof ProtectedItem.Classes )
{
ProtectedItem.Classes c = ( ProtectedItem.Classes ) item;
- if( refinementEvaluator.evaluate(
- c.getClasses(), entry.get( "objectClass" ) ) )
+ if ( refinementEvaluator.evaluate( c.getClasses(), entry.get( "objectClass" ) ) )
{
return true;
}
}
- else if( item instanceof ProtectedItem.MaxImmSub )
+ else if ( item instanceof ProtectedItem.MaxImmSub )
{
return true;
}
- else if( item instanceof ProtectedItem.MaxValueCount )
+ else if ( item instanceof ProtectedItem.MaxValueCount )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
- for( Iterator j = mvc.iterator(); j.hasNext(); )
+ for ( Iterator j = mvc.iterator(); j.hasNext(); )
{
MaxValueCountItem mvcItem = ( MaxValueCountItem ) j.next();
- if( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
+ if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
{
return true;
}
}
}
- else if( item instanceof ProtectedItem.RangeOfValues )
+ else if ( item instanceof ProtectedItem.RangeOfValues )
{
ProtectedItem.RangeOfValues rov = ( ProtectedItem.RangeOfValues ) item;
- if( entryEvaluator.evaluate( rov.getFilter(), entryName.toString(), entry ) )
+ if ( entryEvaluator.evaluate( rov.getFilter(), entryName.toString(), entry ) )
{
return true;
}
}
- else if( item instanceof ProtectedItem.RestrictedBy )
+ else if ( item instanceof ProtectedItem.RestrictedBy )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
continue;
}
ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
- for( Iterator j = rb.iterator(); j.hasNext(); )
+ for ( Iterator j = rb.iterator(); j.hasNext(); )
{
RestrictedByItem rbItem = ( RestrictedByItem ) j.next();
- if( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
+ if ( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
{
return true;
}
}
}
- else if( item instanceof ProtectedItem.SelfValue )
+ else if ( item instanceof ProtectedItem.SelfValue )
{
- if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE &&
- scope != OperationScope.ATTRIBUTE_TYPE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE && scope != OperationScope.ATTRIBUTE_TYPE )
{
continue;
}
ProtectedItem.SelfValue sv = ( ProtectedItem.SelfValue ) item;
- for( Iterator j = sv.iterator(); j.hasNext(); )
+ for ( Iterator j = sv.iterator(); j.hasNext(); )
{
String svItem = String.valueOf( j.next() );
- if( svItem.equalsIgnoreCase( attrId ) )
+ if ( svItem.equalsIgnoreCase( attrId ) )
{
Attribute attr = entry.get( attrId );
- if( attr != null && ( attr.contains( userName ) || attr.contains( userName.toString() ) ) )
+ if ( attr != null && ( attr.contains( userName ) || attr.contains( userName.toString() ) ) )
{
return true;
}
@@ -249,26 +250,27 @@
return false;
}
+
private final boolean isUserAttribute( String attrId )
{
/* Not used anymore. Just retaining in case of resurrection. */
return true;
/*
- try
- {
- AttributeType type = attrTypeRegistry.lookup( attrId );
- if( type != null && type.isCanUserModify() )
- {
- return true;
- }
- }
- catch( NamingException e )
- {
- // Ignore
- }
+ try
+ {
+ AttributeType type = attrTypeRegistry.lookup( attrId );
+ if( type != null && type.isCanUserModify() )
+ {
+ return true;
+ }
+ }
+ catch( NamingException e )
+ {
+ // Ignore
+ }
- return false;
- */
+ return false;
+ */
}
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.authz.support;
+
import java.util.Collection;
import java.util.Iterator;
@@ -47,33 +48,39 @@
private final SubtreeEvaluator subtreeEvaluator;
- public RelatedUserClassFilter( SubtreeEvaluator subtreeEvaluator )
+
+ public RelatedUserClassFilter(SubtreeEvaluator subtreeEvaluator)
{
this.subtreeEvaluator = subtreeEvaluator;
}
- public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy, Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel, Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations ) throws NamingException
+
+ public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy,
+ Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel,
+ Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations )
+ throws NamingException
{
- if( tuples.size() == 0 )
+ if ( tuples.size() == 0 )
{
return tuples;
}
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- if( tuple.isGrant() )
+ if ( tuple.isGrant() )
{
- if( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() ) ||
- authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) < 0 )
+ if ( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() )
+ || authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) < 0 )
{
i.remove();
}
}
- else // Denials
+ else
+ // Denials
{
- if( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() ) &&
- authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) >= 0 )
+ if ( !isRelated( userGroupNames, userName, userEntry, entryName, tuple.getUserClasses() )
+ && authenticationLevel.compareTo( tuple.getAuthenticationLevel() ) >= 0 )
{
i.remove();
}
@@ -83,46 +90,48 @@
return tuples;
}
- private boolean isRelated( Collection userGroupNames, Name userName, Attributes userEntry, Name entryName, Collection userClasses ) throws NamingException
+
+ private boolean isRelated( Collection userGroupNames, Name userName, Attributes userEntry, Name entryName,
+ Collection userClasses ) throws NamingException
{
- for( Iterator i = userClasses.iterator(); i.hasNext(); )
+ for ( Iterator i = userClasses.iterator(); i.hasNext(); )
{
UserClass userClass = ( UserClass ) i.next();
- if( userClass == UserClass.ALL_USERS )
+ if ( userClass == UserClass.ALL_USERS )
{
return true;
}
- else if( userClass == UserClass.THIS_ENTRY )
+ else if ( userClass == UserClass.THIS_ENTRY )
{
- if( userName.equals( entryName ) )
+ if ( userName.equals( entryName ) )
{
return true;
}
}
- else if( userClass instanceof UserClass.Name )
+ else if ( userClass instanceof UserClass.Name )
{
UserClass.Name nameUserClass = ( UserClass.Name ) userClass;
- if( nameUserClass.getNames().contains( userName ) )
+ if ( nameUserClass.getNames().contains( userName ) )
{
return true;
}
}
- else if( userClass instanceof UserClass.UserGroup )
+ else if ( userClass instanceof UserClass.UserGroup )
{
UserClass.UserGroup userGroupUserClass = ( UserClass.UserGroup ) userClass;
- for( Iterator j = userGroupNames.iterator(); j.hasNext(); )
+ for ( Iterator j = userGroupNames.iterator(); j.hasNext(); )
{
Name userGroupName = ( Name ) j.next();
- if( userGroupName != null && userGroupUserClass.getNames().contains( userGroupName ) )
+ if ( userGroupName != null && userGroupUserClass.getNames().contains( userGroupName ) )
{
return true;
}
}
}
- else if( userClass instanceof UserClass.Subtree )
+ else if ( userClass instanceof UserClass.Subtree )
{
UserClass.Subtree subtree = ( UserClass.Subtree ) userClass;
- if( matchUserClassSubtree( userName, userEntry, subtree ) )
+ if ( matchUserClassSubtree( userName, userEntry, subtree ) )
{
return true;
}
@@ -136,14 +145,14 @@
return false;
}
- private boolean matchUserClassSubtree( Name userName, Attributes userEntry, UserClass.Subtree subtree ) throws NamingException
+
+ private boolean matchUserClassSubtree( Name userName, Attributes userEntry, UserClass.Subtree subtree )
+ throws NamingException
{
- for( Iterator i = subtree.getSubtreeSpecifications().iterator();
- i.hasNext(); )
+ for ( Iterator i = subtree.getSubtreeSpecifications().iterator(); i.hasNext(); )
{
SubtreeSpecification subtreeSpec = ( SubtreeSpecification ) i.next();
- if( subtreeEvaluator.evaluate(
- subtreeSpec, ROOTDSE_NAME, userName, userEntry.get( "userClass" ) ) )
+ if ( subtreeEvaluator.evaluate( subtreeSpec, ROOTDSE_NAME, userName, userEntry.get( "userClass" ) ) )
{
return true;
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.authz.support;
+
import java.util.Collection;
import java.util.Iterator;
@@ -42,27 +43,30 @@
*/
public class RestrictedByFilter implements ACITupleFilter
{
- public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy, Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel, Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations ) throws NamingException
+ public Collection filter( Collection tuples, OperationScope scope, DirectoryPartitionNexusProxy proxy,
+ Collection userGroupNames, Name userName, Attributes userEntry, AuthenticationLevel authenticationLevel,
+ Name entryName, String attrId, Object attrValue, Attributes entry, Collection microOperations )
+ throws NamingException
{
- if( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
+ if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
{
return tuples;
}
- if( tuples.size() == 0 )
+ if ( tuples.size() == 0 )
{
return tuples;
}
- for( Iterator i = tuples.iterator(); i.hasNext(); )
+ for ( Iterator i = tuples.iterator(); i.hasNext(); )
{
ACITuple tuple = ( ACITuple ) i.next();
- if( !tuple.isGrant() )
+ if ( !tuple.isGrant() )
{
continue;
}
- if( isRemovable( tuple, attrId, attrValue, entry ) )
+ if ( isRemovable( tuple, attrId, attrValue, entry ) )
{
i.remove();
}
@@ -71,21 +75,22 @@
return tuples;
}
+
public boolean isRemovable( ACITuple tuple, String attrId, Object attrValue, Attributes entry )
{
- for( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
+ for ( Iterator i = tuple.getProtectedItems().iterator(); i.hasNext(); )
{
ProtectedItem item = ( ProtectedItem ) i.next();
- if( item instanceof ProtectedItem.RestrictedBy )
+ if ( item instanceof ProtectedItem.RestrictedBy )
{
ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
- for( Iterator k = rb.iterator(); k.hasNext(); )
+ for ( Iterator k = rb.iterator(); k.hasNext(); )
{
RestrictedByItem rbItem = ( RestrictedByItem ) k.next();
- if( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
+ if ( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )
{
Attribute attr = entry.get( rbItem.getValuesIn() );
- if( attr == null || !attr.contains( attrValue ) )
+ if ( attr == null || !attr.contains( attrValue ) )
{
return true;
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java Fri Feb 10 02:48:07 2006
@@ -64,9 +64,9 @@
private final SearchResultFilter SEARCH_FILTER = new SearchResultFilter()
{
public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
- throws NamingException
+ throws NamingException
{
- return filter( result.getAttributes() );
+ return filter( result.getAttributes() );
}
};
@@ -109,8 +109,8 @@
Set exclusions;
if ( collectiveExclusions != null )
{
- if ( collectiveExclusions.contains( "2.5.18.0" ) ||
- collectiveExclusions.contains( "excludeAllCollectiveAttributes" ) )
+ if ( collectiveExclusions.contains( "2.5.18.0" )
+ || collectiveExclusions.contains( "excludeAllCollectiveAttributes" ) )
{
return;
}
@@ -236,7 +236,6 @@
// Interceptor Method Overrides
// ------------------------------------------------------------------------
-
public Attributes lookup( NextInterceptor nextInterceptor, Name name ) throws NamingException
{
Attributes result = nextInterceptor.lookup( name );
@@ -270,9 +269,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
{
NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
Invocation invocation = InvocationStack.getInstance().peek();
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AddDirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AddDirectoryPartitionConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AddDirectoryPartitionConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AddDirectoryPartitionConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,9 +18,11 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.partition.DirectoryPartition;
import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
+
/**
* A {@link Configuration} that adds a new {@link DirectoryPartition} to
* the current {@link DirectoryPartitionNexus}.
@@ -31,24 +33,27 @@
public class AddDirectoryPartitionConfiguration extends Configuration
{
private static final long serialVersionUID = -6690435863387769527L;
-
+
private final DirectoryPartitionConfiguration directoryPartitionConfiguration;
- public AddDirectoryPartitionConfiguration( DirectoryPartitionConfiguration directoryPartitionConfiguration )
+
+ public AddDirectoryPartitionConfiguration(DirectoryPartitionConfiguration directoryPartitionConfiguration)
{
- if( directoryPartitionConfiguration == null )
+ if ( directoryPartitionConfiguration == null )
{
throw new NullPointerException( "directoryPartitionConfiguration" );
}
-
+
this.directoryPartitionConfiguration = directoryPartitionConfiguration;
}
-
+
+
public DirectoryPartitionConfiguration getDirectoryPartitionConfiguration()
{
return directoryPartitionConfiguration;
}
-
+
+
public void validate()
{
directoryPartitionConfiguration.validate();
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AttributesPropertyEditor.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.configuration;
+
import java.beans.PropertyEditor;
import java.beans.PropertyEditorSupport;
import java.util.Collection;
@@ -38,6 +39,7 @@
import org.apache.directory.shared.ldap.ldif.LdifParserImpl;
import org.apache.directory.shared.ldap.util.MultiMap;
+
/**
* A JavaBeans {@link PropertyEditor} that can convert {@link Attributes}
* to LDIF string and vice versa. This class is useful when you're going
@@ -58,14 +60,16 @@
super();
}
+
/**
* Creates a new instance with source object.
*/
- public AttributesPropertyEditor( Object source )
+ public AttributesPropertyEditor(Object source)
{
super( source );
}
+
/**
* Returns LDIF string of {@link Attributes} object.
*/
@@ -77,81 +81,94 @@
// FIXME Stop forking commons-collections.
private final MultiHashMap map = new MultiHashMap();
+
public Object remove( Object arg0, Object arg1 )
{
return map.remove( arg0, arg1 );
}
+
public int size()
{
return map.size();
}
+
public Object get( Object arg0 )
{
return map.get( arg0 );
}
+
public boolean containsValue( Object arg0 )
{
return map.containsValue( arg0 );
}
+
public Object put( Object arg0, Object arg1 )
{
return map.put( arg0, arg1 );
}
+
public Object remove( Object arg0 )
{
return map.remove( arg0 );
}
+
public Collection values()
{
return map.values();
}
+
public boolean isEmpty()
{
return map.isEmpty();
}
+
public boolean containsKey( Object key )
{
return map.containsKey( key );
}
+
public void putAll( Map arg0 )
{
map.putAll( arg0 );
}
+
public void clear()
{
map.clear();
}
+
public Set keySet()
{
return map.keySet();
}
+
public Set entrySet()
{
return map.entrySet();
}
};
-
+
Attributes attrs = ( Attributes ) getValue();
try
{
NamingEnumeration e = attrs.getAll();
- while( e.hasMore() )
+ while ( e.hasMore() )
{
Attribute attr = ( Attribute ) e.next();
NamingEnumeration e2 = attr.getAll();
- while( e2.hasMoreElements() )
+ while ( e2.hasMoreElements() )
{
Object value = e2.next();
map.put( attr.getID(), value );
@@ -160,18 +177,19 @@
return composer.compose( map );
}
- catch( Exception e )
+ catch ( Exception e )
{
throw new ConfigurationException( e );
}
}
+
/**
* Converts the specified LDIF string into {@link Attributes}.
*/
public void setAsText( String text ) throws IllegalArgumentException
{
- if( text == null )
+ if ( text == null )
{
text = "";
}
@@ -183,7 +201,7 @@
parser.parse( attrs, text.trim() );
setValue( attrs );
}
- catch( NamingException e )
+ catch ( NamingException e )
{
throw ( IllegalArgumentException ) new IllegalArgumentException().initCause( e );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AuthenticatorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AuthenticatorConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AuthenticatorConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/AuthenticatorConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,8 +18,10 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.authn.Authenticator;
+
/**
* A configuration for {@link Authenticator}.
*
@@ -31,6 +33,7 @@
private String name;
private Authenticator authenticator;
+
/**
* Creates a new instance.
*/
@@ -38,6 +41,7 @@
{
}
+
/**
* Returns the {@link Authenticator} this configuration is configuring.
*/
@@ -46,6 +50,7 @@
return authenticator;
}
+
/**
* Sets the {@link Authenticator} to configure.
*/
@@ -54,6 +59,7 @@
this.authenticator = authenticator;
}
+
/**
* Returns the user-defined name of the {@link Authenticator} that
* this configuration configures..
@@ -63,6 +69,7 @@
return name;
}
+
/**
* Sets the user-defined name of the {@link Authenticator} that
* this configuration configures.
@@ -72,18 +79,19 @@
this.name = name.trim();
}
+
/**
* Validates all properties of this configuration.
* @throws ConfigurationException if this configuration is not valid.
*/
public void validate()
{
- if( name == null )
+ if ( name == null )
{
throw new ConfigurationException( "Name is not specified." );
}
-
- if( authenticator == null )
+
+ if ( authenticator == null )
{
throw new ConfigurationException( "Authenticator is not specified." );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/Configuration.java Fri Feb 10 02:48:07 2006
@@ -18,11 +18,13 @@
*/
package org.apache.directory.server.core.configuration;
+
import java.io.Serializable;
import java.util.Hashtable;
import org.apache.directory.server.core.DirectoryService;
+
/**
* A configuration that provides required, optional, or default properties
* to configure {@link DirectoryService}.
@@ -36,13 +38,14 @@
* A JNDI environment key that configuration instance is put on.
*/
public static final String JNDI_KEY = Configuration.class.getName();
-
+
/**
* The default ID of {@link DirectoryService} that is used
* when no instance ID is specified.
*/
public static final String DEFAULT_INSTANCE_ID = "default";
+
/**
* Gets {@link Configuration} instance from the specified JNDI environment
* {@link Hashtable}.
@@ -53,23 +56,25 @@
public static Configuration toConfiguration( Hashtable jndiEnvironment )
{
Object value = jndiEnvironment.get( JNDI_KEY );
- if( value == null || !( value instanceof Configuration ) )
+ if ( value == null || !( value instanceof Configuration ) )
{
throw new ConfigurationException( "Not an ApacheDS configuration: " + value );
}
-
+
return ( Configuration ) value;
}
-
+
private String instanceId = DEFAULT_INSTANCE_ID;
-
+
+
/**
* Creates a new instance.
*/
protected Configuration()
{
}
-
+
+
/**
* Returns the ID of {@link DirectoryService} instance to configure.
*/
@@ -77,7 +82,8 @@
{
return instanceId;
}
-
+
+
/**
* Sets the ID of {@link DirectoryService} instance to configure.
*/
@@ -87,6 +93,7 @@
this.instanceId = instanceId;
}
+
/**
* Validates this configuration.
* @throws ConfigurationException if this configuration is not valid
@@ -94,7 +101,8 @@
public void validate()
{
}
-
+
+
/**
* Converts this configuration to JNDI environment {@link Hashtable}.
* This method simple returns a {@link Hashtable} that contains an entry
@@ -107,13 +115,14 @@
return env;
}
+
public Object clone()
{
try
{
return super.clone();
}
- catch( CloneNotSupportedException e )
+ catch ( CloneNotSupportedException e )
{
throw new InternalError();
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationException.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationException.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationException.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationException.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.configuration;
+
/**
* A {@link RuntimeException} that is thrown when configuration is not valid.
*
@@ -28,6 +29,7 @@
{
private static final long serialVersionUID = -1439234202862091912L;
+
/**
* Creates a new instance.
*/
@@ -36,26 +38,29 @@
super();
}
+
/**
* Creates a new instance.
*/
- public ConfigurationException( String message )
+ public ConfigurationException(String message)
{
super( message );
}
+
/**
* Creates a new instance.
*/
- public ConfigurationException( String message, Throwable cause )
+ public ConfigurationException(String message, Throwable cause)
{
super( message, cause );
}
+
/**
* Creates a new instance.
*/
- public ConfigurationException( Throwable cause )
+ public ConfigurationException(Throwable cause)
{
super( cause );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ConfigurationUtil.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.configuration;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -27,6 +28,7 @@
import javax.naming.directory.Attributes;
+
/**
* A utility class that provides common functionality while validating configuration.
*
@@ -48,6 +50,7 @@
return newSet;
}
+
/**
* Checks all elements of the specified list is of the specified type,
* and returns cloned list.
@@ -61,22 +64,22 @@
return newList;
}
+
public static void getTypeSafeCollection( Collection collection, Class type, Collection newCollection )
{
Iterator i = collection.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
Object e = i.next();
- if( !type.isAssignableFrom( e.getClass() ) )
+ if ( !type.isAssignableFrom( e.getClass() ) )
{
- throw new ConfigurationException(
- "Invalid element type: " + e.getClass() +
- " (expected " + type );
+ throw new ConfigurationException( "Invalid element type: " + e.getClass() + " (expected " + type );
}
newCollection.add( e );
}
}
-
+
+
/**
* Returns the clone of the specified set.
*/
@@ -86,7 +89,8 @@
newSet.addAll( set );
return newSet;
}
-
+
+
/**
* Returns the clone of the specified list.
*/
@@ -96,7 +100,8 @@
newList.addAll( list );
return newList;
}
-
+
+
/**
* Returns the deep clone of the specified {@link Attributes} list.
*/
@@ -104,25 +109,27 @@
{
List newList = new ArrayList();
Iterator i = list.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
newList.add( ( ( Attributes ) i.next() ).clone() );
}
return newList;
}
+
/**
* Throws a {@link ConfigurationException} if the specified port number
* is out of range.
*/
public static void validatePortNumber( int port )
{
- if( port < 0 || port > 65535 )
+ if ( port < 0 || port > 65535 )
{
throw new ConfigurationException( "Invalid port number: " + port );
}
}
-
+
+
private ConfigurationUtil()
{
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java Fri Feb 10 02:48:07 2006
@@ -52,7 +52,8 @@
private Set indexedAttributes; // Set<String>
private Attributes contextEntry = new BasicAttributes( true );
private DirectoryPartition contextPartition = new JdbmDirectoryPartition();
-
+
+
/**
* Creates a new instance.
*/
@@ -60,7 +61,8 @@
{
setIndexedAttributes( new HashSet() );
}
-
+
+
/**
* Returns user-defined name of the {@link DirectoryPartition} that
* this configuration configures.
@@ -69,7 +71,8 @@
{
return name;
}
-
+
+
/**
* Sets user-defined name of the {@link DirectoryPartition} that
* this configuration configures.
@@ -81,6 +84,7 @@
this.name = name;
}
+
/**
* Returns the set of attribute type strings to create an index on.
*/
@@ -88,23 +92,23 @@
{
return ConfigurationUtil.getClonedSet( indexedAttributes );
}
-
+
+
/**
* Sets the set of attribute type strings to create an index on.
*/
protected void setIndexedAttributes( Set indexedAttributes )
{
- Set newIndexedAttributes = ConfigurationUtil.getTypeSafeSet(
- indexedAttributes, String.class );
+ Set newIndexedAttributes = ConfigurationUtil.getTypeSafeSet( indexedAttributes, String.class );
Iterator i = newIndexedAttributes.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
String attribute = ( String ) i.next();
// TODO Attribute name must be normalized and validated
newIndexedAttributes.add( attribute );
}
-
+
// Add default indices
newIndexedAttributes.add( Oid.ALIAS );
newIndexedAttributes.add( Oid.EXISTANCE );
@@ -116,7 +120,8 @@
this.indexedAttributes = newIndexedAttributes;
}
-
+
+
/**
* Returns the {@link DirectoryPartition} that this configuration configures.
*/
@@ -124,19 +129,21 @@
{
return contextPartition;
}
-
+
+
/**
* Sets the {@link DirectoryPartition} that this configuration configures.
*/
protected void setContextPartition( DirectoryPartition partition )
{
- if( partition == null )
+ if ( partition == null )
{
throw new NullPointerException( "partition" );
}
this.contextPartition = partition;
}
-
+
+
/**
* Returns root entry that will be added to the {@link DirectoryPartition}
* after it is initialized.
@@ -145,7 +152,8 @@
{
return ( Attributes ) contextEntry.clone();
}
-
+
+
/**
* Sets root entry that will be added to the {@link DirectoryPartition}
* after it is initialized.
@@ -154,7 +162,8 @@
{
this.contextEntry = ( Attributes ) rootEntry.clone();
}
-
+
+
/**
* Returns the suffix of the {@link DirectoryPartition}.
*/
@@ -162,7 +171,8 @@
{
return suffix;
}
-
+
+
/**
* Returns the normalized suffix of the {@link DirectoryPartition}.
*/
@@ -170,7 +180,8 @@
{
return getNormalizedSuffix( matchingRuleRegistry.lookup( "distinguishedNameMatch" ).getNormalizer() );
}
-
+
+
/**
* Returns the normalized suffix of the {@link DirectoryPartition}.
*/
@@ -178,7 +189,8 @@
{
return new LdapName( normalizer.normalize( suffix ).toString() );
}
-
+
+
/**
* Sets the suffix of the {@link DirectoryPartition}.
*/
@@ -189,14 +201,14 @@
{
new LdapName( suffix );
}
- catch( NamingException e )
+ catch ( NamingException e )
{
throw new ConfigurationException( "Failed to normalize the suffix: " + suffix );
}
this.suffix = suffix;
}
-
-
+
+
/**
* Validates this configuration.
*
@@ -204,12 +216,12 @@
*/
public void validate()
{
- if( getName() == null || getName().length() == 0 )
+ if ( getName() == null || getName().length() == 0 )
{
throw new ConfigurationException( "Name is not specified." );
}
- if( getSuffix() == null )
+ if ( getSuffix() == null )
{
throw new ConfigurationException( "Suffix is not specified." );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/InterceptorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/InterceptorConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/InterceptorConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/InterceptorConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,8 +18,10 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.interceptor.Interceptor;
+
/**
* A configuration for {@link Interceptor}.
*
@@ -31,6 +33,7 @@
private String name;
private Interceptor interceptor;
+
/**
* Creates a new instance.
*/
@@ -38,6 +41,7 @@
{
}
+
/**
* Returns the {@link Interceptor} that this configuration
* configures.
@@ -47,6 +51,7 @@
return interceptor;
}
+
/**
* Sets the {@link Interceptor} that this configuration
* configures.
@@ -56,6 +61,7 @@
this.interceptor = authenticator;
}
+
/**
* Returns the name of the {@link Interceptor}.
*/
@@ -64,6 +70,7 @@
return name;
}
+
/**
* Sets the name of the {@link Interceptor}.
*/
@@ -72,6 +79,7 @@
this.name = name.trim();
}
+
/**
* Validates this configuration.
*
@@ -79,12 +87,12 @@
*/
public void validate()
{
- if( name == null )
+ if ( name == null )
{
throw new ConfigurationException( "Name is not specified." );
}
-
- if( interceptor == null )
+
+ if ( interceptor == null )
{
throw new ConfigurationException( "Interceptor is not specified." );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableAuthenticatorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableAuthenticatorConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableAuthenticatorConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableAuthenticatorConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,16 +18,17 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.authn.Authenticator;
+
/**
* A mutable version of {@link AuthenticatorConfiguration}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class MutableAuthenticatorConfiguration extends
- AuthenticatorConfiguration
+public class MutableAuthenticatorConfiguration extends AuthenticatorConfiguration
{
/**
@@ -37,10 +38,12 @@
{
}
+
public void setAuthenticator( Authenticator authenticator )
{
super.setAuthenticator( authenticator );
}
+
public void setName( String name )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,20 +18,21 @@
*/
package org.apache.directory.server.core.configuration;
+
import java.util.Set;
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.DirectoryPartition;
+
/**
* A mutable version of {@link DirectoryPartitionConfiguration}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class MutableDirectoryPartitionConfiguration extends
- DirectoryPartitionConfiguration
+public class MutableDirectoryPartitionConfiguration extends DirectoryPartitionConfiguration
{
/**
* Creates a new instance.
@@ -39,26 +40,31 @@
public MutableDirectoryPartitionConfiguration()
{
}
-
+
+
public void setName( String name )
{
super.setName( name );
}
+
public void setIndexedAttributes( Set indexedAttributes )
{
super.setIndexedAttributes( indexedAttributes );
}
+
public void setContextPartition( DirectoryPartition partition )
{
super.setContextPartition( partition );
}
+
public void setContextEntry( Attributes rootEntry )
{
super.setContextEntry( rootEntry );
}
+
public void setSuffix( String suffix )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableInterceptorConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableInterceptorConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableInterceptorConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableInterceptorConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,16 +18,17 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.interceptor.Interceptor;
+
/**
* A mutable version of {@link InterceptorConfiguration}.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
-public class MutableInterceptorConfiguration extends
- InterceptorConfiguration
+public class MutableInterceptorConfiguration extends InterceptorConfiguration
{
/**
@@ -37,10 +38,12 @@
{
}
+
public void setInterceptor( Interceptor interceptor )
{
super.setInterceptor( interceptor );
}
+
public void setName( String name )
{
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java Fri Feb 10 02:48:07 2006
@@ -55,61 +55,61 @@
}
- public void setInstanceId(String instanceId)
+ public void setInstanceId( String instanceId )
{
super.setInstanceId( instanceId );
}
- public void setAuthenticatorConfigurations(Set authenticators)
+ public void setAuthenticatorConfigurations( Set authenticators )
{
super.setAuthenticatorConfigurations( authenticators );
}
- public void setBootstrapSchemas(Set bootstrapSchemas)
+ public void setBootstrapSchemas( Set bootstrapSchemas )
{
super.setBootstrapSchemas( bootstrapSchemas );
}
- public void setContextPartitionConfigurations(Set contextParitionConfigurations)
+ public void setContextPartitionConfigurations( Set contextParitionConfigurations )
{
super.setContextPartitionConfigurations( contextParitionConfigurations );
}
- public void setAccessControlEnabled(boolean accessControlEnabled)
+ public void setAccessControlEnabled( boolean accessControlEnabled )
{
super.setAccessControlEnabled( accessControlEnabled );
}
- public void setAllowAnonymousAccess(boolean enableAnonymousAccess)
+ public void setAllowAnonymousAccess( boolean enableAnonymousAccess )
{
super.setAllowAnonymousAccess( enableAnonymousAccess );
}
- public void setInterceptorConfigurations(List interceptorConfigurations)
+ public void setInterceptorConfigurations( List interceptorConfigurations )
{
super.setInterceptorConfigurations( interceptorConfigurations );
}
- public void setTestEntries(List testEntries)
+ public void setTestEntries( List testEntries )
{
super.setTestEntries( testEntries );
}
- public void setWorkingDirectory(File workingDirectory)
+ public void setWorkingDirectory( File workingDirectory )
{
super.setWorkingDirectory( workingDirectory );
}
- public void setShutdownHookEnabled(boolean shutdownHookEnabled)
+ public void setShutdownHookEnabled( boolean shutdownHookEnabled )
{
super.setShutdownHookEnabled( shutdownHookEnabled );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/RemoveDirectoryPartitionConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/RemoveDirectoryPartitionConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/RemoveDirectoryPartitionConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/RemoveDirectoryPartitionConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.configuration;
+
import javax.naming.Name;
import javax.naming.NamingException;
@@ -25,6 +26,7 @@
import org.apache.directory.server.core.partition.DirectoryPartitionNexus;
import org.apache.directory.shared.ldap.name.LdapName;
+
/**
* A {@link Configuration} that removed the attached {@link DirectoryPartition} in
* the current {@link DirectoryPartitionNexus}.
@@ -35,24 +37,27 @@
public class RemoveDirectoryPartitionConfiguration extends Configuration
{
private static final long serialVersionUID = -6690435863387769527L;
-
+
private final Name suffix;
- public RemoveDirectoryPartitionConfiguration( String suffix ) throws NamingException
+
+ public RemoveDirectoryPartitionConfiguration(String suffix) throws NamingException
{
this( new LdapName( suffix.trim() ) );
}
-
- public RemoveDirectoryPartitionConfiguration( Name suffix )
+
+
+ public RemoveDirectoryPartitionConfiguration(Name suffix)
{
- if( suffix == null )
+ if ( suffix == null )
{
throw new NullPointerException( "suffix" );
}
-
+
this.suffix = suffix;
}
-
+
+
public Name getSuffix()
{
return suffix;
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ShutdownConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ShutdownConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ShutdownConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/ShutdownConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,8 +18,10 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.DirectoryService;
+
/**
* A {@link Configuration} that shuts down ApacheDS.
*
@@ -30,6 +32,7 @@
{
private static final long serialVersionUID = 3141844093107051149L;
+
/**
* Creates a new instance.
*/
@@ -37,11 +40,12 @@
{
}
+
/**
* Creates a new instance that operates on the {@link DirectoryService}
* with the specified ID.
*/
- public ShutdownConfiguration( String instanceId )
+ public ShutdownConfiguration(String instanceId)
{
setInstanceId( instanceId );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,6 +18,7 @@
*/
package org.apache.directory.server.core.configuration;
+
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
@@ -43,6 +44,7 @@
import org.apache.directory.server.core.schema.bootstrap.*;
import org.apache.directory.server.core.subtree.SubentryService;
+
/**
* A {@link Configuration} that starts up ApacheDS.
*
@@ -60,11 +62,12 @@
private boolean accessControlEnabled = false; // turn off by default
private Set authenticatorConfigurations; // Set<AuthenticatorConfiguration>
private List interceptorConfigurations; // Set<InterceptorConfiguration>
-
+
private Set bootstrapSchemas; // Set<BootstrapSchema>
private Set contextPartitionConfigurations = new HashSet(); // Set<ContextPartitionConfiguration>
private List testEntries = new ArrayList(); // List<Attributes>
-
+
+
/**
* Creates a new instance with default settings.
*/
@@ -75,11 +78,12 @@
setDefaultInterceptorConfigurations();
}
+
/**
* Creates a new instance with default settings that operates on the
* {@link DirectoryService} with the specified ID.
*/
- public StartupConfiguration( String instanceId )
+ public StartupConfiguration(String instanceId)
{
setDefaultAuthenticatorConfigurations();
setDefaultBootstrapSchemas();
@@ -87,13 +91,14 @@
setInstanceId( instanceId );
}
+
private void setDefaultAuthenticatorConfigurations()
{
- Set set;
-
+ Set set;
+
// Set default authenticator configurations
set = new HashSet();
-
+
MutableAuthenticatorConfiguration authCfg;
// Anonymous
@@ -107,38 +112,40 @@
authCfg.setName( "Simple" );
authCfg.setAuthenticator( new SimpleAuthenticator() );
set.add( authCfg );
-
+
setAuthenticatorConfigurations( set );
}
+
private void setDefaultBootstrapSchemas()
{
Set set;
// Set default bootstrap schemas
set = new HashSet();
-
+
set.add( new CoreSchema() );
- set.add( new CosineSchema() );
- set.add( new ApacheSchema() );
- set.add( new InetorgpersonSchema() );
- set.add( new JavaSchema() );
+ set.add( new CosineSchema() );
+ set.add( new ApacheSchema() );
+ set.add( new InetorgpersonSchema() );
+ set.add( new JavaSchema() );
set.add( new SystemSchema() );
set.add( new CollectiveSchema() );
setBootstrapSchemas( set );
}
+
private void setDefaultInterceptorConfigurations()
{
// Set default interceptor chains
InterceptorConfiguration interceptorCfg;
List list = new ArrayList();
-
+
interceptorCfg = new MutableInterceptorConfiguration();
interceptorCfg.setName( "normalizationService" );
interceptorCfg.setInterceptor( new NormalizationService() );
list.add( interceptorCfg );
-
+
interceptorCfg = new MutableInterceptorConfiguration();
interceptorCfg.setName( "authenticationService" );
interceptorCfg.setInterceptor( new AuthenticationService() );
@@ -148,7 +155,7 @@
interceptorCfg.setName( "referralService" );
interceptorCfg.setInterceptor( new ReferralService() );
list.add( interceptorCfg );
-
+
interceptorCfg = new MutableInterceptorConfiguration();
interceptorCfg.setName( "authorizationService" );
interceptorCfg.setInterceptor( new AuthorizationService() );
@@ -163,12 +170,12 @@
interceptorCfg.setName( "exceptionService" );
interceptorCfg.setInterceptor( new ExceptionService() );
list.add( interceptorCfg );
-
+
interceptorCfg = new MutableInterceptorConfiguration();
interceptorCfg.setName( "schemaService" );
interceptorCfg.setInterceptor( new SchemaService() );
list.add( interceptorCfg );
-
+
interceptorCfg = new MutableInterceptorConfiguration();
interceptorCfg.setName( "subentryService" );
interceptorCfg.setInterceptor( new SubentryService() );
@@ -192,6 +199,7 @@
setInterceptorConfigurations( list );
}
+
/**
* Returns {@link AuthenticatorConfiguration}s to use for authenticating clients.
*/
@@ -200,32 +208,33 @@
return ConfigurationUtil.getClonedSet( authenticatorConfigurations );
}
+
/**
* Sets {@link AuthenticatorConfiguration}s to use for authenticating clients.
*/
protected void setAuthenticatorConfigurations( Set authenticatorConfigurations )
{
- Set newSet = ConfigurationUtil.getTypeSafeSet(
- authenticatorConfigurations, AuthenticatorConfiguration.class );
-
+ Set newSet = ConfigurationUtil.getTypeSafeSet( authenticatorConfigurations, AuthenticatorConfiguration.class );
+
Set names = new HashSet();
Iterator i = newSet.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
AuthenticatorConfiguration cfg = ( AuthenticatorConfiguration ) i.next();
cfg.validate();
-
+
String name = cfg.getName();
- if( names.contains( name ) )
+ if ( names.contains( name ) )
{
throw new ConfigurationException( "Duplicate authenticator name: " + name );
}
names.add( name );
}
-
+
this.authenticatorConfigurations = newSet;
}
+
/**
* Returns {@link BootstrapSchema}s to load while bootstrapping.
*/
@@ -234,15 +243,16 @@
return ConfigurationUtil.getClonedSet( bootstrapSchemas );
}
+
/**
* Sets {@link BootstrapSchema}s to load while bootstrapping.
*/
protected void setBootstrapSchemas( Set bootstrapSchemas )
{
- this.bootstrapSchemas = ConfigurationUtil.getTypeSafeSet(
- bootstrapSchemas, BootstrapSchema.class );
+ this.bootstrapSchemas = ConfigurationUtil.getTypeSafeSet( bootstrapSchemas, BootstrapSchema.class );
}
+
/**
* Returns {@link DirectoryPartitionConfiguration}s to configure context partitions.
*/
@@ -251,32 +261,34 @@
return ConfigurationUtil.getClonedSet( contextPartitionConfigurations );
}
+
/**
* Sets {@link DirectoryPartitionConfiguration}s to configure context partitions.
*/
protected void setContextPartitionConfigurations( Set contextParitionConfigurations )
{
- Set newSet = ConfigurationUtil.getTypeSafeSet(
- contextParitionConfigurations, DirectoryPartitionConfiguration.class );
-
+ Set newSet = ConfigurationUtil.getTypeSafeSet( contextParitionConfigurations,
+ DirectoryPartitionConfiguration.class );
+
Set names = new HashSet();
Iterator i = newSet.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
DirectoryPartitionConfiguration cfg = ( DirectoryPartitionConfiguration ) i.next();
cfg.validate();
String name = cfg.getName();
- if( names.contains( name ) )
+ if ( names.contains( name ) )
{
throw new ConfigurationException( "Duplicate partition name: " + name );
}
names.add( name );
}
-
+
this.contextPartitionConfigurations = newSet;
}
+
/**
* Returns <tt>true</tt> if access control checks are enbaled.
*/
@@ -285,6 +297,7 @@
return accessControlEnabled;
}
+
/**
* Sets whether to enable basic access control checks or not
*/
@@ -293,6 +306,7 @@
this.accessControlEnabled = accessControlEnabled;
}
+
/**
* Returns <tt>true</tt> if anonymous access is allowed.
*/
@@ -301,6 +315,7 @@
return allowAnonymousAccess;
}
+
/**
* Sets whether to allow anonymous access or not
*/
@@ -309,6 +324,7 @@
this.allowAnonymousAccess = enableAnonymousAccess;
}
+
/**
* Returns interceptor chain.
*/
@@ -317,23 +333,23 @@
return ConfigurationUtil.getClonedList( interceptorConfigurations );
}
+
/**
* Sets interceptor chain.
*/
protected void setInterceptorConfigurations( List interceptorConfigurations )
{
- List newList = ConfigurationUtil.getTypeSafeList(
- interceptorConfigurations, InterceptorConfiguration.class );
-
+ List newList = ConfigurationUtil.getTypeSafeList( interceptorConfigurations, InterceptorConfiguration.class );
+
Set names = new HashSet();
Iterator i = newList.iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
InterceptorConfiguration cfg = ( InterceptorConfiguration ) i.next();
cfg.validate();
String name = cfg.getName();
- if( names.contains( name ) )
+ if ( names.contains( name ) )
{
throw new ConfigurationException( "Duplicate interceptor name: " + name );
}
@@ -343,6 +359,7 @@
this.interceptorConfigurations = interceptorConfigurations;
}
+
/**
* Returns test directory entries({@link Attributes}) to be loaded while
* bootstrapping.
@@ -352,28 +369,30 @@
return ConfigurationUtil.getClonedAttributesList( testEntries );
}
+
/**
* Sets test directory entries({@link Attributes}) to be loaded while
* bootstrapping.
*/
protected void setTestEntries( List testEntries )
{
- testEntries = ConfigurationUtil.getClonedAttributesList(
- ConfigurationUtil.getTypeSafeList( testEntries, Attributes.class ) );
-
- Iterator i = testEntries.iterator();
- while( i.hasNext() )
- {
- Attributes entry = ( Attributes ) i.next();
- if( entry.get( "dn" ) == null )
- {
- throw new ConfigurationException( "Test entries must have DN attributes" );
- }
- }
+ testEntries = ConfigurationUtil.getClonedAttributesList( ConfigurationUtil.getTypeSafeList( testEntries,
+ Attributes.class ) );
+
+ Iterator i = testEntries.iterator();
+ while ( i.hasNext() )
+ {
+ Attributes entry = ( Attributes ) i.next();
+ if ( entry.get( "dn" ) == null )
+ {
+ throw new ConfigurationException( "Test entries must have DN attributes" );
+ }
+ }
- this.testEntries = testEntries;
+ this.testEntries = testEntries;
}
+
/**
* Returns working directory (counterpart of <tt>var/lib</tt>).
*/
@@ -382,6 +401,7 @@
return workingDirectory;
}
+
/**
* Sets working directory (counterpart of <tt>var/lib</tt>).
*/
@@ -389,19 +409,20 @@
{
this.workingDirectory = workingDirectory;
}
-
+
+
public void validate()
{
setWorkingDirectory( workingDirectory );
}
-
+
protected void setShutdownHookEnabled( boolean shutdownHookEnabled )
{
this.shutdownHookEnabled = shutdownHookEnabled;
}
-
-
+
+
public boolean isShutdownHookEnabled()
{
return shutdownHookEnabled;
@@ -412,8 +433,8 @@
{
this.exitVmOnShutdown = exitVmOnShutdown;
}
-
-
+
+
public boolean isExitVmOnShutdown()
{
return exitVmOnShutdown;
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/SyncConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/SyncConfiguration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/SyncConfiguration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/SyncConfiguration.java Fri Feb 10 02:48:07 2006
@@ -18,8 +18,10 @@
*/
package org.apache.directory.server.core.configuration;
+
import org.apache.directory.server.core.DirectoryService;
+
/**
* A {@link Configuration} that makes a call to {@link DirectoryService#sync()}.
*
@@ -30,18 +32,20 @@
{
private static final long serialVersionUID = -3260859085299322327L;
+
/**
* Creates a new instance.
*/
public SyncConfiguration()
{
}
-
+
+
/**
* Creates a new instance that operates on the {@link DirectoryService}
* with the specified ID.
*/
- public SyncConfiguration( String instanceId )
+ public SyncConfiguration(String instanceId)
{
setInstanceId( instanceId );
}
Modified: directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=376623&r1=376622&r2=376623&view=diff
==============================================================================
--- directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/sandbox/akarasulu/rc1/apacheds/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Fri Feb 10 02:48:07 2006
@@ -37,7 +37,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
+
/**
* A wrapper enumeration which saves referral entries to be returned last.
@@ -58,10 +58,10 @@
private final int scope;
private SearchResult prefetched;
private int refIndex = -1;
-
-
- public ReferralHandlingEnumeration( NamingEnumeration underlying, ReferralLut lut, DnParser parser,
- DirectoryPartitionNexus nexus, int scope, boolean doThrow ) throws NamingException
+
+
+ public ReferralHandlingEnumeration(NamingEnumeration underlying, ReferralLut lut, DnParser parser,
+ DirectoryPartitionNexus nexus, int scope, boolean doThrow) throws NamingException
{
this.underlying = underlying;
this.parser = parser;
@@ -71,8 +71,8 @@
this.nexus = nexus;
prefetch();
}
-
-
+
+
public void prefetch() throws NamingException
{
while ( underlying.hasMore() )
@@ -87,7 +87,7 @@
prefetched = result;
return;
}
-
+
refIndex++;
prefetched = ( SearchResult ) referrals.get( refIndex );
if ( doThrow )
@@ -95,8 +95,8 @@
doReferralExceptionOnSearchBase();
}
}
-
-
+
+
public Object next() throws NamingException
{
SearchResult retval = prefetched;
@@ -104,7 +104,7 @@
return retval;
}
-
+
public boolean hasMore() throws NamingException
{
return underlying.hasMore() || refIndex < referrals.size();
@@ -119,7 +119,7 @@
refIndex = Integer.MAX_VALUE;
}
-
+
public boolean hasMoreElements()
{
try
@@ -138,7 +138,7 @@
log.error( "Naming enumeration failure. Failed to properly close enumeration!", e1 );
}
}
-
+
return false;
}
@@ -153,7 +153,7 @@
{
log.error( "NamingEnumeration closed prematurely without returning elements.", e );
}
-
+
throw new NoSuchElementException( "NamingEnumeration closed prematurely without returning elements." );
}
@@ -166,25 +166,25 @@
{
refs = nexus.lookup( parser.parse( prefetched.getName() ) ).get( REF_ATTR );
}
-
+
if ( refs == null )
{
- throw new IllegalStateException( prefetched.getName()
+ throw new IllegalStateException( prefetched.getName()
+ " does not seem like a referral but we're trying to handle it as one." );
}
-
+
List list = new ArrayList( refs.size() );
for ( int ii = 0; ii < refs.size(); ii++ )
{
String val = ( String ) refs.get( ii );
-
+
// need to add non-ldap URLs as-is
- if ( ! val.startsWith( "ldap" ) )
+ if ( !val.startsWith( "ldap" ) )
{
list.add( val );
continue;
}
-
+
// parse the ref value and normalize the DN according to schema
LdapURL ldapUrl = new LdapURL();
try
@@ -193,9 +193,11 @@
}
catch ( LdapURLEncodingException e )
{
- log.error( "Bad URL ("+ val +") for ref in " + prefetched.getName() + ". Reference will be ignored." );
+ log
+ .error( "Bad URL (" + val + ") for ref in " + prefetched.getName()
+ + ". Reference will be ignored." );
}
-
+
StringBuffer buf = new StringBuffer();
buf.append( ldapUrl.getScheme() );
buf.append( ldapUrl.getHost() );
@@ -207,25 +209,25 @@
buf.append( "/" );
buf.append( ldapUrl.getDn() );
buf.append( "??" );
-
+
switch ( scope )
{
- case( SearchControls.SUBTREE_SCOPE ):
+ case ( SearchControls.SUBTREE_SCOPE ):
buf.append( "sub" );
break;
-
+
// if we search for one level and encounter a referral then search
// must be continued at that node using base level search scope
- case( SearchControls.ONELEVEL_SCOPE ):
+ case ( SearchControls.ONELEVEL_SCOPE ):
buf.append( "base" );
break;
- case( SearchControls.OBJECT_SCOPE ):
+ case ( SearchControls.OBJECT_SCOPE ):
buf.append( "base" );
break;
default:
throw new IllegalStateException( "Unknown recognized search scope: " + scope );
}
-
+
list.add( buf.toString() );
}
LdapReferralException lre = new LdapReferralException( list );