You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2007/12/29 12:42:44 UTC
svn commit: r607412 [1/4] - in /directory:
apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/
apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/
apacheds/branches/bigbang/core/src/main/java/...
Author: elecharny
Date: Sat Dec 29 03:42:29 2007
New Revision: 607412
URL: http://svn.apache.org/viewvc?rev=607412&view=rev
Log:
o Added the Registries into all contexts
o Remove some warnings (generics)
o Removed some constants and used SchemaConstants instead
Modified:
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AbstractOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/AddContextPartitionOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/BindOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EmptyOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/EntryOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetMatchedNameOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetRootDSEOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ListSuffixOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/LookupOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/OperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/ReplaceOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/interceptor/context/UnbindOperationContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/jndi/ServerLdapContext.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaOperationControl.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/StoredProcedureParameterInjector.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MicroOperationFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
directory/apacheds/branches/bigbang/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
directory/apacheds/branches/bigbang/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/KeyDerivationInterceptor.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AddEntryOperation.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/AttributeOperation.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
directory/apacheds/branches/bigbang/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java
directory/shared/branches/bigbang/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sat Dec 29 03:42:29 2007
@@ -470,7 +470,7 @@
return;
}
- AddContextPartitionOperationContext addPartitionCtx = new AddContextPartitionOperationContext( parition );
+ AddContextPartitionOperationContext addPartitionCtx = new AddContextPartitionOperationContext( registries, parition );
partitionNexus.addContextPartition( addPartitionCtx );
}
@@ -485,7 +485,7 @@
}
RemoveContextPartitionOperationContext removePartitionCtx =
- new RemoveContextPartitionOperationContext( partition.getSuffixDn() );
+ new RemoveContextPartitionOperationContext( registries, partition.getSuffixDn() );
partitionNexus.removeContextPartition( removePartitionCtx );
}
@@ -921,7 +921,7 @@
/*
* If the admin entry is there, then the database was already created
*/
- if ( !partitionNexus.hasEntry( new EntryOperationContext( PartitionNexus.getAdminName() ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, PartitionNexus.getAdminName() ) ) )
{
firstStart = true;
@@ -954,7 +954,7 @@
LdapDN userDn = new LdapDN( ServerDNConstants.USERS_SYSTEM_DN );
userDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( userDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, userDn ) ) )
{
firstStart = true;
@@ -979,7 +979,7 @@
LdapDN groupDn = new LdapDN( ServerDNConstants.GROUPS_SYSTEM_DN );
groupDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( groupDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, groupDn ) ) )
{
firstStart = true;
@@ -1004,7 +1004,7 @@
LdapDN name = new LdapDN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
name.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( name ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, name ) ) )
{
firstStart = true;
@@ -1049,7 +1049,7 @@
LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" );
configurationDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( configurationDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, configurationDn ) ) )
{
firstStart = true;
@@ -1074,7 +1074,7 @@
LdapDN partitionsDn = new LdapDN( "ou=partitions,ou=configuration,ou=system" );
partitionsDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( partitionsDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, partitionsDn ) ) )
{
firstStart = true;
@@ -1099,7 +1099,7 @@
LdapDN servicesDn = new LdapDN( "ou=services,ou=configuration,ou=system" );
servicesDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( servicesDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, servicesDn ) ) )
{
firstStart = true;
@@ -1124,7 +1124,7 @@
LdapDN interceptorsDn = new LdapDN( "ou=interceptors,ou=configuration,ou=system" );
interceptorsDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( interceptorsDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, interceptorsDn ) ) )
{
firstStart = true;
@@ -1149,7 +1149,7 @@
LdapDN sysPrefRootDn = new LdapDN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
sysPrefRootDn.normalize( oidsMap );
- if ( !partitionNexus.hasEntry( new EntryOperationContext( sysPrefRootDn ) ) )
+ if ( !partitionNexus.hasEntry( new EntryOperationContext( registries, sysPrefRootDn ) ) )
{
firstStart = true;
@@ -1184,7 +1184,7 @@
LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
adminDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
- Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( adminDn ) );
+ Attributes adminEntry = partitionNexus.lookup( new LookupOperationContext( registries, adminDn ) );
Object userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
if ( userPassword instanceof byte[] )
{
@@ -1394,7 +1394,7 @@
partitionNexus = new DefaultPartitionNexus( new AttributesImpl() );
partitionNexus.init( this );
- partitionNexus.addContextPartition( new AddContextPartitionOperationContext( schemaPartition ) );
+ partitionNexus.addContextPartition( new AddContextPartitionOperationContext( registries, schemaPartition ) );
interceptorChain = new InterceptorChain();
interceptorChain.init( this );
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Sat Dec 29 03:42:29 2007
@@ -36,7 +36,7 @@
public abstract class AbstractAuthenticator implements Authenticator
{
private DirectoryService directoryService;
-
+
/** authenticator type */
private final String authenticatorType;
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java Sat Dec 29 03:42:29 2007
@@ -51,7 +51,7 @@
*/
public LdapPrincipal authenticate( LdapDN bindDn, ServerContext ctx ) throws NamingException
{
- if ( super.getDirectoryService().isAllowAnonymousAccess() )
+ if ( getDirectoryService().isAllowAnonymousAccess() )
{
return LdapPrincipal.ANONYMOUS;
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Sat Dec 29 03:42:29 2007
@@ -52,6 +52,7 @@
import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
import org.apache.directory.server.core.event.EventInterceptor;
import org.apache.directory.server.core.trigger.TriggerInterceptor;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.constants.LdapSecurityConstants;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -185,7 +186,7 @@
* @return A byte array which can be empty if the password was not found
* @throws NamingException If we have a problem during the lookup operation
*/
- private LdapPrincipal getStoredPassword( LdapDN principalDN ) throws NamingException
+ private LdapPrincipal getStoredPassword( Registries registries, LdapDN principalDN ) throws NamingException
{
LdapPrincipal principal;
String principalNorm = principalDN.getNormName();
@@ -201,7 +202,7 @@
{
// Not found in the cache
// Get the user password from the backend
- storedPassword = lookupUserPassword( principalDN );
+ storedPassword = lookupUserPassword( registries, principalDN );
// Deal with the special case where the user didn't enter a password
@@ -304,7 +305,7 @@
// ---- extract password from JNDI environment
byte[] credentials = getCredentials( ctx );
- LdapPrincipal principal = getStoredPassword( principalDn );
+ LdapPrincipal principal = getStoredPassword( getDirectoryService().getRegistries(), principalDn );
// Get the stored password, either from cache or from backend
byte[] storedPassword = principal.getUserPassword();
@@ -573,7 +574,7 @@
* @return the credentials from the backend
* @throws NamingException if there are problems accessing backend
*/
- private byte[] lookupUserPassword( LdapDN principalDn ) throws NamingException
+ private byte[] lookupUserPassword( Registries registries, LdapDN principalDn ) throws NamingException
{
// ---- lookup the principal entry's userPassword attribute
Invocation invocation = InvocationStack.getInstance().peek();
@@ -582,7 +583,7 @@
try
{
- LookupOperationContext lookupContex = new LookupOperationContext( new String[] { SchemaConstants.USER_PASSWORD_AT } );
+ LookupOperationContext lookupContex = new LookupOperationContext( registries, new String[] { SchemaConstants.USER_PASSWORD_AT } );
lookupContex.setDn( principalDn );
userEntry = proxy.lookup( lookupContex, USERLOOKUP_BYPASS );
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Sat Dec 29 03:42:29 2007
@@ -299,7 +299,7 @@
{
LdapDN parentDn = ( LdapDN ) dn.clone();
parentDn.remove( dn.size() - 1 );
- entry = proxy.lookup( new LookupOperationContext( parentDn), PartitionNexusProxy.LOOKUP_BYPASS );
+ entry = proxy.lookup( new LookupOperationContext( registries, parentDn), PartitionNexusProxy.LOOKUP_BYPASS );
}
Attribute subentries = AttributeUtils.getAttribute( entry, acSubentryType );
@@ -379,7 +379,7 @@
LdapDN parentDn = ( LdapDN ) dn.clone();
parentDn.remove( dn.size() - 1 );
Attributes administrativeEntry = proxy.lookup(
- new LookupOperationContext( parentDn, new String[]
+ new LookupOperationContext( registries, parentDn, new String[]
{ SchemaConstants.SUBENTRY_ACI_AT }) , PartitionNexusProxy.LOOKUP_BYPASS );
Attribute subentryAci = AttributeUtils.getAttribute( administrativeEntry, subentryAciType );
@@ -479,7 +479,7 @@
// check if entry scope permission is granted
PartitionNexusProxy proxy = invocation.getProxy();
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
ADD_PERMS, tuples, subentryAttrs, null );
// now we must check if attribute type and value scope permission is granted
@@ -491,7 +491,7 @@
for ( int ii = 0; ii < attr.size(); ii++ )
{
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, attr
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, attr
.getID(), attr.get( ii ), ADD_PERMS, tuples, entry, null );
}
}
@@ -519,7 +519,7 @@
// Access the principal requesting the operation, and bypass checks if it is the admin
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- Attributes entry = proxy.lookup( new LookupOperationContext( name ) , PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, name ) , PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
LdapDN principalDn = principal.getJndiName();
@@ -547,7 +547,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, name, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
REMOVE_PERMS, tuples, entry, null );
next.delete( deleteContext );
@@ -564,7 +564,7 @@
LdapDN name = opContext.getDn();
// Access the principal requesting the operation, and bypass checks if it is the admin
- Attributes entry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
LdapDN principalDn = principal.getJndiName();
@@ -584,7 +584,7 @@
/**
* @TODO: A virtual entry can be created here for not hitting the backend again.
*/
- Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
tupleCache.subentryModified( name, mods, ServerEntryUtils.toServerEntry( modifiedEntry, name, registries ) );
groupCache.groupModified( name, mods, entry );
return;
@@ -596,7 +596,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, name, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
Collections.singleton( MicroOperation.MODIFY ), tuples, entry, null );
Collection<MicroOperation> perms = null;
@@ -615,7 +615,7 @@
if ( entry.get( attr.getID() ) == null )
{
// ... we also need to check if adding the attribute is permitted
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
attr.getID(), null, perms, tuples, entry, null );
}
@@ -631,7 +631,7 @@
if ( entryAttr.size() == 1 )
{
// ... we also need to check if removing the attribute at all is permitted
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
attr.getID(), null, perms, tuples, entry, null );
}
}
@@ -660,7 +660,7 @@
for ( int jj = 0; jj < attr.size(); jj++ )
{
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name,
attr.getID(), attr.get( jj ), perms, tuples, entry, entryView );
}
}
@@ -671,7 +671,7 @@
/**
* @TODO: A virtual entry can be created here for not hitting the backend again.
*/
- Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes modifiedEntry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
tupleCache.subentryModified( name, mods, ServerEntryUtils.toServerEntry( modifiedEntry, name, registries ) );
groupCache.groupModified( name, mods, entry );
}
@@ -681,7 +681,7 @@
LdapDN name = entryContext.getDn();
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- Attributes entry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
LdapDN principalDn = principal.getJndiName();
@@ -698,7 +698,7 @@
addSubentryAciTuples( proxy, tuples, name, entry );
// check that we have browse access to the entry
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
BROWSE_PERMS, tuples, entry, null );
return next.hasEntry( entryContext );
@@ -737,7 +737,7 @@
addSubentryAciTuples( proxy, tuples, dn, entry );
// check that we have read access to the entry
- engine.checkPermission( proxy, userGroups, userName, principal.getAuthenticationLevel(), dn, null, null,
+ engine.checkPermission( registries, proxy, userGroups, userName, principal.getAuthenticationLevel(), dn, null, null,
LOOKUP_PERMS, tuples, entry, null );
// check that we have read access to every attribute type and value
@@ -747,7 +747,7 @@
Attribute attr = attributeList.next();
for ( int ii = 0; ii < attr.size(); ii++ )
{
- engine.checkPermission( proxy, userGroups, userName, principal.getAuthenticationLevel(), dn, attr
+ engine.checkPermission( registries, proxy, userGroups, userName, principal.getAuthenticationLevel(), dn, attr
.getID(), attr.get( ii ), READ_PERMS, tuples, entry, null );
}
}
@@ -783,7 +783,7 @@
// Access the principal requesting the operation, and bypass checks if it is the admin
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- Attributes entry = proxy.lookup( new LookupOperationContext( name ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, name ), PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
LdapDN principalDn = principal.getJndiName();
LdapDN newName = ( LdapDN ) name.clone();
@@ -818,7 +818,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, name, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
RENAME_PERMS, tuples, entry, null );
next.rename( renameContext );
@@ -836,7 +836,7 @@
// Access the principal requesting the operation, and bypass checks if it is the admin
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- Attributes entry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
LdapDN principalDn = principal.getJndiName();
LdapDN newName = ( LdapDN ) newParentName.clone();
@@ -866,7 +866,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, oriChildName, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), oriChildName, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), oriChildName, null,
null, MOVERENAME_PERMS, tuples, entry, null );
// Get the entry again without operational attributes
@@ -874,7 +874,7 @@
// will not be valid at the new location.
// This will certainly be fixed by the SubentryInterceptor,
// but after this service.
- Attributes importedEntry = proxy.lookup( new LookupOperationContext( oriChildName ),
+ Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ),
PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
// As the target entry does not exist yet and so
@@ -896,7 +896,7 @@
addPerscriptiveAciTuples( proxy, destTuples, newName, subentryAttrs );
// Evaluate the target context to see whether it
// allows an entry named newName to be imported as a subordinate.
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), newName, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), newName, null,
null, IMPORT_PERMS, destTuples, subentryAttrs, null );
@@ -914,7 +914,7 @@
// Access the principal requesting the operation, and bypass checks if it is the admin
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- Attributes entry = proxy.lookup( new LookupOperationContext( oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = proxy.lookup( new LookupOperationContext( registries, oriChildName ), PartitionNexusProxy.LOOKUP_BYPASS );
LdapDN newName = ( LdapDN ) newParentName.clone();
newName.add( oriChildName.get( oriChildName.size() - 1 ) );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
@@ -944,7 +944,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, oriChildName, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), oriChildName, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), oriChildName, null,
null, EXPORT_PERMS, tuples, entry, null );
// Get the entry again without operational attributes
@@ -952,7 +952,7 @@
// will not be valid at the new location.
// This will certainly be fixed by the SubentryInterceptor,
// but after this service.
- Attributes importedEntry = proxy.lookup( new LookupOperationContext( oriChildName ),
+ Attributes importedEntry = proxy.lookup( new LookupOperationContext( registries, oriChildName ),
PartitionNexusProxy.LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS );
// As the target entry does not exist yet and so
// its subentry operational attributes are not there,
@@ -973,7 +973,7 @@
addPerscriptiveAciTuples( proxy, destTuples, newName, subentryAttrs );
// Evaluate the target context to see whether it
// allows an entry named newName to be imported as a subordinate.
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), newName, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), newName, null,
null, IMPORT_PERMS, destTuples, subentryAttrs, null );
next.move( moveContext );
@@ -1037,7 +1037,7 @@
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
Attributes entry = proxy.lookup(
- new LookupOperationContext( name ),
+ new LookupOperationContext( registries, name ),
PartitionNexusProxy.LOOKUP_BYPASS );
LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
@@ -1054,9 +1054,9 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, name, entry );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
READ_PERMS, tuples, entry, null );
- engine.checkPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, oid, value,
+ engine.checkPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), name, oid, value,
COMPARE_PERMS, tuples, entry, null );
return next.compare( opContext );
@@ -1085,14 +1085,14 @@
// that but if permission is granted then short the process and return the dn
while ( matched.size() > 0 )
{
- entry = proxy.lookup( new LookupOperationContext( matched ), PartitionNexusProxy.GETMATCHEDDN_BYPASS );
+ entry = proxy.lookup( new LookupOperationContext( registries, matched ), PartitionNexusProxy.GETMATCHEDDN_BYPASS );
Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
Collection<ACITuple> tuples = new HashSet<ACITuple>();
addPerscriptiveAciTuples( proxy, tuples, matched, entry );
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( proxy, tuples, matched, entry );
- if ( engine.hasPermission( proxy, userGroups, principalDn, principal.getAuthenticationLevel(), matched, null,
+ if ( engine.hasPermission( registries, proxy, userGroups, principalDn, principal.getAuthenticationLevel(), matched, null,
null, MATCHEDNAME_PERMS, tuples, entry, null ) )
{
return matched;
@@ -1118,7 +1118,7 @@
* tests. If we hasPermission() returns false we immediately short the
* process and return false.
*/
- Attributes entry = invocation.getProxy().lookup( new LookupOperationContext( normName ), PartitionNexusProxy.LOOKUP_BYPASS );
+ Attributes entry = invocation.getProxy().lookup( new LookupOperationContext( registries, normName ), PartitionNexusProxy.LOOKUP_BYPASS );
ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
LdapDN userDn = ctx.getPrincipal().getJndiName();
Set<Name> userGroups = groupCache.getGroups( userDn.toNormName() );
@@ -1127,7 +1127,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( invocation.getProxy(), tuples, normName, entry );
- if ( !engine.hasPermission( invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
+ if ( !engine.hasPermission( registries, invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
.getAuthenticationLevel(), normName, null, null, SEARCH_ENTRY_PERMS, tuples, entry, null ) )
{
return false;
@@ -1148,7 +1148,7 @@
String id = idList.next();
Attribute attr = result.getAttributes().get( id );
- if ( !engine.hasPermission( invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
+ if ( !engine.hasPermission( registries, invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
.getAuthenticationLevel(), normName, attr.getID(), null, SEARCH_ATTRVAL_PERMS, tuples, entry, null ) )
{
result.getAttributes().remove( attr.getID() );
@@ -1163,7 +1163,7 @@
// attribute type scope is ok now let's determine value level scope
for ( int ii = 0; ii < attr.size(); ii++ )
{
- if ( !engine.hasPermission( invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
+ if ( !engine.hasPermission( registries, invocation.getProxy(), userGroups, userDn, ctx.getPrincipal()
.getAuthenticationLevel(), normName, attr.getID(), attr.get( ii ), SEARCH_ATTRVAL_PERMS, tuples,
entry, null ) )
{
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Sat Dec 29 03:42:29 2007
@@ -40,6 +40,7 @@
import org.apache.directory.server.core.jndi.ServerContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.message.ServerSearchResult;
@@ -140,15 +141,15 @@
uniqueMemberAT = attrRegistry.lookup( SchemaConstants.UNIQUE_MEMBER_AT_OID );
- loadAdministrators();
+ loadAdministrators( directoryService.getRegistries() );
}
- private void loadAdministrators() throws NamingException
+ private void loadAdministrators( Registries registries ) throws NamingException
{
// read in the administrators and cache their normalized names
Set<String> newAdministrators = new HashSet<String>( 2 );
- Attributes adminGroup = nexus.lookup( new LookupOperationContext( ADMIN_GROUP_DN ) );
+ Attributes adminGroup = nexus.lookup( new LookupOperationContext( registries, ADMIN_GROUP_DN ) );
if ( adminGroup == null )
{
@@ -271,7 +272,7 @@
// update administrators if we change administrators group
if ( dn.getNormName().equals( ADMIN_GROUP_DN.getNormName() ) )
{
- loadAdministrators();
+ loadAdministrators( opContext.getRegistries() );
}
}
else
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Sat Dec 29 03:42:29 2007
@@ -31,6 +31,7 @@
import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.filter.BranchNode;
import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -109,7 +110,7 @@
// stuff for dealing with the admin group
administratorsGroupDn = parseNormalized( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
- initialize();
+ initialize( directoryService.getRegistries() );
}
@@ -121,7 +122,7 @@
}
- private void initialize() throws NamingException
+ private void initialize( Registries registries ) throws NamingException
{
// search all naming contexts for static groups and generate
// normalized sets of members to cache within the map
@@ -139,7 +140,7 @@
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
NamingEnumeration<SearchResult> results = nexus.search(
- new SearchOperationContext( baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
+ new SearchOperationContext( registries, baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
while ( results.hasMore() )
{
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Sat Dec 29 03:42:29 2007
@@ -137,7 +137,8 @@
SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC );
SearchControls ctls = new SearchControls();
ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
- NamingEnumeration<SearchResult> results = nexus.search( new SearchOperationContext( baseDn,
+ NamingEnumeration<SearchResult> results = nexus.search(
+ new SearchOperationContext( registries, baseDn,
AliasDerefMode.NEVER_DEREF_ALIASES, filter, ctls ) );
while ( results.hasMore() )
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Sat Dec 29 03:42:29 2007
@@ -47,6 +47,7 @@
import org.apache.directory.server.core.trigger.TriggerInterceptor;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
@@ -127,11 +128,21 @@
* @param entryView in case of a Modify operation, view of the entry being modified as if the modification permitted and completed
* @throws NamingException if failed to evaluate ACI items
*/
- public void checkPermission( PartitionNexusProxy proxy, Collection<Name> userGroupNames, LdapDN username,
- AuthenticationLevel authenticationLevel, LdapDN entryName, String attrId, Object attrValue,
- Collection<MicroOperation> microOperations, Collection<ACITuple> aciTuples, Attributes entry, Attributes entryView ) throws NamingException
+ public void checkPermission(
+ Registries registries,
+ PartitionNexusProxy proxy,
+ Collection<Name> userGroupNames,
+ LdapDN username,
+ AuthenticationLevel authenticationLevel,
+ LdapDN entryName,
+ String attrId,
+ Object attrValue,
+ Collection<MicroOperation> microOperations,
+ Collection<ACITuple> aciTuples,
+ Attributes entry,
+ Attributes entryView ) throws NamingException
{
- if ( !hasPermission( proxy, userGroupNames, username, authenticationLevel, entryName, attrId, attrValue,
+ if ( !hasPermission( registries, proxy, userGroupNames, username, authenticationLevel, entryName, attrId, attrValue,
microOperations, aciTuples, entry, entryView ) )
{
throw new LdapNoPermissionException();
@@ -175,16 +186,26 @@
* @param aciTuples {@link org.apache.directory.shared.ldap.aci.ACITuple}s translated from {@link org.apache.directory.shared.ldap.aci.ACIItem}s in the subtree entries
* @param entryView in case of a Modify operation, view of the entry being modified as if the modification permitted and completed
*/
- public boolean hasPermission( PartitionNexusProxy proxy, Collection<Name> userGroupNames, LdapDN userName,
- AuthenticationLevel authenticationLevel, LdapDN entryName, String attrId, Object attrValue,
- Collection<MicroOperation> microOperations, Collection<ACITuple> aciTuples, Attributes entry, Attributes entryView ) throws NamingException
+ public boolean hasPermission(
+ Registries registries,
+ PartitionNexusProxy proxy,
+ Collection<Name> userGroupNames,
+ LdapDN userName,
+ AuthenticationLevel authenticationLevel,
+ LdapDN entryName,
+ String attrId,
+ Object attrValue,
+ Collection<MicroOperation> microOperations,
+ Collection<ACITuple> aciTuples,
+ Attributes entry,
+ Attributes entryView ) throws NamingException
{
if ( entryName == null )
{
throw new NullPointerException( "entryName" );
}
- Attributes userEntry = proxy.lookup( new LookupOperationContext( userName ), USER_LOOKUP_BYPASS );
+ Attributes userEntry = proxy.lookup( new LookupOperationContext( registries, userName ), USER_LOOKUP_BYPASS );
// Determine the scope of the requested operation.
OperationScope scope;
@@ -208,7 +229,7 @@
// Filter unrelated and invalid tuples
for ( ACITupleFilter filter : filters )
{
- aciTuples = filter.filter( aciTuples, scope, proxy, userGroupNames, userName, userEntry,
+ aciTuples = filter.filter( registries, aciTuples, scope, proxy, userGroupNames, userName, userEntry,
authenticationLevel, entryName, attrId, attrValue, entry, microOperations, entryView );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java Sat Dec 29 03:42:29 2007
@@ -27,6 +27,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
@@ -64,6 +65,7 @@
* @throws NamingException if failed to filter the specific tuples
*/
Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java Sat Dec 29 03:42:29 2007
@@ -28,6 +28,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
@@ -44,6 +45,7 @@
public class HighestPrecedenceFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Sat Dec 29 03:42:29 2007
@@ -30,6 +30,7 @@
import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.server.core.schema.SchemaInterceptor;
import org.apache.directory.server.core.subtree.SubentryInterceptor;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -74,6 +75,7 @@
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
@@ -120,7 +122,7 @@
{
if ( immSubCount < 0 )
{
- immSubCount = getImmSubCount( proxy, entryName );
+ immSubCount = getImmSubCount( registries, proxy, entryName );
}
ProtectedItem.MaxImmSub mis = ( ProtectedItem.MaxImmSub ) item;
@@ -156,14 +158,14 @@
}
- private int getImmSubCount( PartitionNexusProxy proxy, LdapDN entryName ) throws NamingException
+ private int getImmSubCount( Registries registries, PartitionNexusProxy proxy, LdapDN entryName ) throws NamingException
{
int cnt = 0;
NamingEnumeration<SearchResult> e = null;
try
{
- e = proxy.search( new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ),
+ e = proxy.search( new SearchOperationContext( registries, ( LdapDN ) entryName.getPrefix( 1 ),
AliasDerefMode.DEREF_ALWAYS, childrenFilter, childrenSearchControls ), SEARCH_BYPASS );
while ( e.hasMore() )
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java Sat Dec 29 03:42:29 2007
@@ -29,6 +29,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -47,6 +48,7 @@
public class MaxValueCountFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java Sat Dec 29 03:42:29 2007
@@ -28,6 +28,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
@@ -45,19 +46,20 @@
public class MicroOperationFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Collection<ACITuple> tuples,
- OperationScope scope,
- PartitionNexusProxy proxy,
- Collection<Name> userGroupNames,
- LdapDN userName,
- Attributes userEntry,
- AuthenticationLevel authenticationLevel,
- LdapDN entryName,
- String attrId,
- Object attrValue,
- Attributes entry,
- Collection<MicroOperation> microOperations,
- Attributes entryView )
+ Registries registries,
+ Collection<ACITuple> tuples,
+ OperationScope scope,
+ PartitionNexusProxy proxy,
+ Collection<Name> userGroupNames,
+ LdapDN userName,
+ Attributes userEntry,
+ AuthenticationLevel authenticationLevel,
+ LdapDN entryName,
+ String attrId,
+ Object attrValue,
+ Attributes entry,
+ Collection<MicroOperation> microOperations,
+ Attributes entryView )
throws NamingException
{
if ( tuples.size() == 0 )
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java Sat Dec 29 03:42:29 2007
@@ -28,6 +28,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -53,6 +54,7 @@
public class MostSpecificProtectedItemFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java Sat Dec 29 03:42:29 2007
@@ -28,6 +28,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.UserClass;
@@ -51,6 +52,7 @@
public class MostSpecificUserClassFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Sat Dec 29 03:42:29 2007
@@ -33,6 +33,7 @@
import org.apache.directory.server.core.subtree.RefinementEvaluator;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
import org.apache.directory.server.schema.registries.OidRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -71,6 +72,7 @@
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java Sat Dec 29 03:42:29 2007
@@ -29,6 +29,7 @@
import org.apache.directory.server.core.partition.PartitionNexusProxy;
import org.apache.directory.server.core.subtree.SubtreeEvaluator;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.UserClass;
@@ -58,6 +59,7 @@
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Sat Dec 29 03:42:29 2007
@@ -29,6 +29,7 @@
import javax.naming.directory.Attributes;
import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.aci.ACITuple;
import org.apache.directory.shared.ldap.aci.MicroOperation;
import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -47,6 +48,7 @@
public class RestrictedByFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
+ Registries registries,
Collection<ACITuple> tuples,
OperationScope scope,
PartitionNexusProxy proxy,
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sat Dec 29 03:42:29 2007
@@ -33,6 +33,7 @@
import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.interceptor.context.OperationContext;
import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
import org.apache.directory.server.core.invocation.Invocation;
import org.apache.directory.server.core.invocation.InvocationStack;
@@ -130,7 +131,7 @@
if ( changeLog.isEnabled() && ! opContext.isCollateralOperation() )
{
- attributes = getAttributes( opContext.getDn() );
+ attributes = getAttributes( opContext );
}
next.delete( opContext );
@@ -155,8 +156,9 @@
* @return the entry's attributes (may be immutable if the schema subentry)
* @throws NamingException on error accessing the entry's attributes
*/
- private Attributes getAttributes( LdapDN dn ) throws NamingException
+ private Attributes getAttributes( OperationContext opContext ) throws NamingException
{
+ LdapDN dn = opContext.getDn();
Attributes attributes;
// @todo make sure we're not putting in operational attributes that cannot be user modified
@@ -169,7 +171,7 @@
}
else
{
- attributes = proxy.lookup( new LookupOperationContext( dn ), PartitionNexusProxy.LOOKUP_BYPASS );
+ attributes = proxy.lookup( new LookupOperationContext( opContext.getRegistries(), dn ), PartitionNexusProxy.LOOKUP_BYPASS );
}
return attributes;
@@ -184,7 +186,7 @@
if ( ! isDelete && ( changeLog.isEnabled() && ! opContext.isCollateralOperation() ) )
{
// @todo make sure we're not putting in operational attributes that cannot be user modified
- attributes = getAttributes( opContext.getDn() );
+ attributes = getAttributes( opContext );
}
next.modify( opContext );
@@ -224,7 +226,7 @@
if ( changeLog.isEnabled() && ! renameContext.isCollateralOperation() )
{
// @todo make sure we're not putting in operational attributes that cannot be user modified
- attributes = getAttributes( renameContext.getDn() );
+ attributes = getAttributes( renameContext );
}
next.rename( renameContext );
@@ -254,7 +256,7 @@
// @todo make sure we're not putting in operational attributes that cannot be user modified
Invocation invocation = InvocationStack.getInstance().peek();
PartitionNexusProxy proxy = invocation.getProxy();
- attributes = proxy.lookup( new LookupOperationContext( opCtx.getDn() ),
+ attributes = proxy.lookup( new LookupOperationContext( opCtx.getRegistries(), opCtx.getDn() ),
PartitionNexusProxy.LOOKUP_BYPASS );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Sat Dec 29 03:42:29 2007
@@ -34,6 +34,7 @@
import org.apache.directory.server.core.invocation.InvocationStack;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.message.AttributeImpl;
import org.apache.directory.shared.ldap.message.ServerSearchResult;
@@ -65,9 +66,17 @@
*/
public class CollectiveAttributeInterceptor extends BaseInterceptor
{
- public static final String EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_OID = "2.5.18.0";
- public static final String EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES = "excludeAllCollectiveAttributes";
+ /** The global registries */
+ private Registries registries;
+ /** The attributeType registry */
+ private AttributeTypeRegistry atRegistry;
+
+ private PartitionNexus nexus;
+
+ private CollectiveAttributesSchemaChecker collectiveAttributesSchemaChecker;
+
+
/**
* the search result filter to use for collective attribute injection
*/
@@ -80,7 +89,7 @@
if ( !name.isNormalized() )
{
- name = LdapDN.normalize( name, attrTypeRegistry.getNormalizerMapping() );
+ name = LdapDN.normalize( name, atRegistry.getNormalizerMapping() );
}
Attributes entry = result.getAttributes();
@@ -90,18 +99,13 @@
}
};
- private AttributeTypeRegistry attrTypeRegistry;
- private PartitionNexus nexus;
-
- private CollectiveAttributesSchemaChecker collectiveAttributesSchemaChecker;
-
-
public void init( DirectoryService directoryService ) throws NamingException
{
super.init( directoryService );
nexus = directoryService.getPartitionNexus();
- attrTypeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
- collectiveAttributesSchemaChecker = new CollectiveAttributesSchemaChecker(nexus, attrTypeRegistry);
+ atRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
+ collectiveAttributesSchemaChecker = new CollectiveAttributesSchemaChecker( nexus, atRegistry );
+ registries = directoryService.getRegistries();
}
@@ -123,7 +127,7 @@
//noinspection StringEquality
if ( ( retAttrs == null ) || ( retAttrs.length != 1 ) || ( retAttrs[0] != SchemaConstants.ALL_USER_ATTRIBUTES ) )
{
- Attributes entryWithCAS = nexus.lookup( new LookupOperationContext( normName, new String[] {
+ Attributes entryWithCAS = nexus.lookup( new LookupOperationContext( registries, normName, new String[] {
SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT } ) );
caSubentries = entryWithCAS.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT );
}
@@ -152,8 +156,9 @@
if ( collectiveExclusions != null )
{
- if ( AttributeUtils.containsValueCaseIgnore( collectiveExclusions, EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_OID )
- || AttributeUtils.containsValue( collectiveExclusions, EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES, attrTypeRegistry.lookup( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT_OID ) ) )
+ if ( AttributeUtils.containsValueCaseIgnore( collectiveExclusions, SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT_OID )
+ || AttributeUtils.containsValue( collectiveExclusions, SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT,
+ atRegistry.lookup( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT_OID ) ) )
{
/*
* This entry does not allow any collective attributes
@@ -166,7 +171,7 @@
for ( int ii = 0; ii < collectiveExclusions.size(); ii++ )
{
- AttributeType attrType = attrTypeRegistry.lookup( ( String ) collectiveExclusions.get( ii ) );
+ AttributeType attrType = atRegistry.lookup( ( String ) collectiveExclusions.get( ii ) );
exclusions.add( attrType.getOid() );
}
}
@@ -200,13 +205,13 @@
{
String subentryDnStr = ( String ) caSubentries.get( ii );
LdapDN subentryDn = new LdapDN( subentryDnStr );
- Attributes subentry = nexus.lookup( new LookupOperationContext( subentryDn ) );
+ Attributes subentry = nexus.lookup( new LookupOperationContext( registries, subentryDn ) );
NamingEnumeration<String> attrIds = subentry.getIDs();
while ( attrIds.hasMore() )
{
String attrId = attrIds.next();
- AttributeType attrType = attrTypeRegistry.lookup( attrId );
+ AttributeType attrType = atRegistry.lookup( attrId );
if ( !attrType.isCollective() )
{
@@ -231,7 +236,7 @@
continue;
}
- AttributeType retType = attrTypeRegistry.lookup( retId );
+ AttributeType retType = atRegistry.lookup( retId );
if ( allSuperTypes.contains( retType ) )
{
@@ -350,7 +355,7 @@
public void modify( NextInterceptor next, ModifyOperationContext opContext ) throws NamingException
{
- collectiveAttributesSchemaChecker.checkModify( opContext.getDn(), opContext.getModItems() );
+ collectiveAttributesSchemaChecker.checkModify( opContext.getRegistries(),opContext.getDn(), opContext.getModItems() );
next.modify( opContext );
}
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java Sat Dec 29 03:42:29 2007
@@ -35,6 +35,7 @@
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -80,7 +81,7 @@
}
}
- public void checkModify( LdapDN normName, int modOp, Attributes mods ) throws NamingException
+ public void checkModify( Registries registries, LdapDN normName, int modOp, Attributes mods ) throws NamingException
{
ArrayList<ModificationItemImpl> modsAsArray = new ArrayList<ModificationItemImpl>( mods.size() );
NamingEnumeration<? extends Attribute> allAttrs = mods.getAll();
@@ -91,13 +92,13 @@
modsAsArray.add( new ModificationItemImpl( modOp, attr ) );
}
- checkModify( normName, modsAsArray );
+ checkModify( registries, normName, modsAsArray );
}
- public void checkModify( LdapDN normName, List<ModificationItemImpl> mods ) throws NamingException
+ public void checkModify( Registries registries, LdapDN normName, List<ModificationItemImpl> mods ) throws NamingException
{
- Attributes originalEntry = nexus.lookup( new LookupOperationContext( normName ) );
+ Attributes originalEntry = nexus.lookup( new LookupOperationContext( registries, normName ) );
Attributes targetEntry = SchemaUtils.getTargetEntry( mods, originalEntry );
Attribute targetObjectClasses = targetEntry.get( SchemaConstants.OBJECT_CLASS_AT );
Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?rev=607412&r1=607411&r2=607412&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Sat Dec 29 03:42:29 2007
@@ -34,7 +34,7 @@
import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
import org.apache.directory.server.core.partition.PartitionNexus;
import org.apache.directory.server.core.referral.ReferralLut;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.server.schema.registries.Registries;
import org.apache.directory.shared.ldap.codec.util.LdapURL;
import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -68,16 +68,25 @@
* The OIDs normalizer map
*/
private Map<String, OidNormalizer> normalizerMap;
-
- public ReferralHandlingEnumeration( NamingEnumeration<SearchResult> underlying, ReferralLut lut,
- AttributeTypeRegistry registry, PartitionNexus nexus, int scope, boolean doThrow ) throws NamingException
+
+ /** The global registries */
+ private Registries registries;
+
+ public ReferralHandlingEnumeration(
+ NamingEnumeration<SearchResult> underlying,
+ ReferralLut lut,
+ Registries registries,
+ PartitionNexus nexus,
+ int scope,
+ boolean doThrow ) throws NamingException
{
- normalizerMap = registry.getNormalizerMapping();
+ normalizerMap = registries.getAttributeTypeRegistry().getNormalizerMapping();
this.underlying = underlying;
this.doThrow = doThrow;
this.lut = lut;
this.scope = scope;
this.nexus = nexus;
+ this.registries = registries;
prefetch();
}
@@ -104,7 +113,7 @@
prefetched = referrals.get( refIndex );
if ( doThrow )
{
- doReferralExceptionOnSearchBase();
+ doReferralExceptionOnSearchBase( registries );
}
}
@@ -170,7 +179,7 @@
}
- public void doReferralExceptionOnSearchBase() throws NamingException
+ public void doReferralExceptionOnSearchBase( Registries registries ) throws NamingException
{
// the refs attribute may be filtered out so we might need to lookup the entry
Attribute refs = prefetched.getAttributes().get( SchemaConstants.REF_AT );
@@ -179,7 +188,7 @@
{
LdapDN prefetchedDn = new LdapDN( prefetched.getName() );
prefetchedDn.normalize( normalizerMap );
- refs = nexus.lookup( new LookupOperationContext( prefetchedDn ) ).get( SchemaConstants.REF_AT );
+ refs = nexus.lookup( new LookupOperationContext( registries, prefetchedDn ) ).get( SchemaConstants.REF_AT );
}
if ( refs == null )