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 2009/11/07 08:57:42 UTC
svn commit: r833647 [7/17] - in /directory:
apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/
apacheds/branches/apacheds-schema/avl-partition/src/test/java/org/apache/directory/server/core/par...
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Sat Nov 7 07:57:34 2009
@@ -75,10 +75,8 @@
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.ObjectClassRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -167,13 +165,10 @@
private InterceptorChain chain;
/** Global registries */
- private Registries registries;
-
- /** attribute type registry */
- private AttributeTypeRegistry atRegistry;
+ private SchemaManager schemaManager;
/** ObjectClass registry */
- private ObjectClassRegistry ocRegistry;
+ //private ObjectClassRegistry ocRegistry;
/** whether or not this interceptor is activated */
private boolean enabled;
@@ -206,27 +201,26 @@
super.init( directoryService );
LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
- adminDn.normalize( directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+ adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
CoreSession adminSession = new DefaultCoreSession(
new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
tupleCache = new TupleCache( adminSession );
groupCache = new GroupCache( adminSession );
- registries = directoryService.getRegistries();
- atRegistry = registries.getAttributeTypeRegistry();
- ocRegistry = registries.getObjectClassRegistry();
+ schemaManager = directoryService.getSchemaManager();
+ //ocRegistry = registries.getObjectClassRegistry();
// look up some constant information
- String objectClassOid = atRegistry.getOidByName( SchemaConstants.OBJECT_CLASS_AT );
- subentryOid = ocRegistry.getOidByName( SchemaConstants.SUBENTRY_OC );
- String acSubentryOid = atRegistry.getOidByName( AC_SUBENTRY_ATTR );
- objectClassType = atRegistry.lookup( objectClassOid );
- acSubentryType = atRegistry.lookup( acSubentryOid );
- entryAciType = atRegistry.lookup( SchemaConstants.ENTRY_ACI_AT_OID );
- subentryAciType = atRegistry.lookup( SchemaConstants.SUBENTRY_ACI_AT_OID );
+ String objectClassOid = schemaManager.getAttributeTypeRegistry().getOidByName( SchemaConstants.OBJECT_CLASS_AT );
+ subentryOid = schemaManager.getObjectClassRegistry().getOidByName( SchemaConstants.SUBENTRY_OC );
+ String acSubentryOid = schemaManager.getAttributeTypeRegistry().getOidByName( AC_SUBENTRY_ATTR );
+ objectClassType = schemaManager.lookupAttributeTypeRegistry( objectClassOid );
+ acSubentryType = schemaManager.lookupAttributeTypeRegistry( acSubentryOid );
+ entryAciType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_ACI_AT_OID );
+ subentryAciType = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.SUBENTRY_ACI_AT_OID );
- aciParser = new ACIItemParser( new ConcreteNameComponentNormalizer( atRegistry ), atRegistry.getNormalizerMapping() );
- engine = new ACDFEngine( registries.getOidRegistry(), atRegistry );
+ aciParser = new ACIItemParser( new ConcreteNameComponentNormalizer( schemaManager ), schemaManager.getNormalizerMapping() );
+ engine = new ACDFEngine( schemaManager.getOidRegistry(), schemaManager );
chain = directoryService.getInterceptorChain();
enabled = directoryService.isAccessControlEnabled();
@@ -235,7 +229,7 @@
directoryService.getPartitionNexus().getRootDSE( null ).
get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
LdapDN subschemaSubentryDnName = new LdapDN( subschemaSubentry.getString() );
- subschemaSubentryDnName.normalize( atRegistry.getNormalizerMapping() );
+ subschemaSubentryDnName.normalize( schemaManager.getNormalizerMapping() );
subschemaSubentryDn = subschemaSubentryDnName.toNormName();
}
@@ -480,7 +474,7 @@
addSubentryAciTuples( addContext, tuples, name, subentryAttrs );
// check if entry scope permission is granted
- engine.checkPermission( registries, addContext, userGroups, principalDn, principal.getAuthenticationLevel(), name, null, null,
+ engine.checkPermission( schemaManager, addContext, 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
@@ -488,7 +482,7 @@
{
for ( Value<?> value:attribute )
{
- engine.checkPermission( registries, addContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, addContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, attribute.getUpId(), value,
ADD_PERMS, tuples, serverEntry, null );
}
@@ -543,7 +537,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( deleteContext, tuples, name, entry );
- engine.checkPermission( registries, deleteContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, deleteContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, null, null, REMOVE_PERMS, tuples, entry, null );
next.delete( deleteContext );
@@ -580,7 +574,7 @@
*/
ServerEntry modifiedEntry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );
tupleCache.subentryModified( name, mods, modifiedEntry );
- groupCache.groupModified( name, mods, entry, registries );
+ groupCache.groupModified( name, mods, entry, schemaManager );
return;
}
@@ -590,7 +584,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( opContext, tuples, name, entry );
- engine.checkPermission( registries, opContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, null, null,
Collections.singleton( MicroOperation.MODIFY ), tuples, entry, null );
@@ -610,7 +604,7 @@
if ( entry.get( attr.getId() ) == null )
{
// ... we also need to check if adding the attribute is permitted
- engine.checkPermission( registries, opContext, userGroups, principalDn, principal.getAuthenticationLevel(), name,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn, principal.getAuthenticationLevel(), name,
attr.getId(), null, perms, tuples, entry, null );
}
@@ -626,7 +620,7 @@
if ( entryAttr.size() == 1 )
{
// ... we also need to check if removing the attribute at all is permitted
- engine.checkPermission( registries, opContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, attr.getId(),
null, perms, tuples, entry, null );
}
@@ -652,11 +646,11 @@
* not the individual Value Additions) we just handle this when the first value of an
* attribute is being checked for relevant permissions below.
*/
- entryView = ServerEntryUtils.getTargetEntry( mod, entryView, registries );
+ entryView = ServerEntryUtils.getTargetEntry( mod, entryView, schemaManager );
for ( Value<?> value:attr )
{
- engine.checkPermission( registries, opContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, attr.getId(), value,
perms, tuples, entry, entryView );
}
@@ -670,7 +664,7 @@
*/
ServerEntry modifiedEntry = opContext.lookup( name, ByPassConstants.LOOKUP_BYPASS );
tupleCache.subentryModified( name, mods, modifiedEntry );
- groupCache.groupModified( name, mods, entry, registries );
+ groupCache.groupModified( name, mods, entry, schemaManager );
}
@@ -708,7 +702,7 @@
addSubentryAciTuples( entryContext, tuples, name, entry.getOriginalEntry() );
// check that we have browse access to the entry
- engine.checkPermission( registries, entryContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, entryContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, null, null,
BROWSE_PERMS, tuples, entry.getOriginalEntry(), null );
@@ -748,7 +742,7 @@
addSubentryAciTuples( lookupContext, tuples, lookupContext.getDn(), entry );
// check that we have read access to the entry
- engine.checkPermission( registries, lookupContext, userGroups, userName, principal.getAuthenticationLevel(),
+ engine.checkPermission( schemaManager, lookupContext, userGroups, userName, principal.getAuthenticationLevel(),
lookupContext.getDn(), null, null,
LOOKUP_PERMS, tuples, entry, null );
@@ -759,7 +753,7 @@
for ( Value<?> value:attribute )
{
engine.checkPermission(
- registries,
+ schemaManager,
lookupContext,
userGroups,
userName,
@@ -783,7 +777,7 @@
if ( !principalDn.isNormalized() )
{
- principalDn.normalize( atRegistry.getNormalizerMapping() );
+ principalDn.normalize( schemaManager.getNormalizerMapping() );
}
if ( isPrincipalAnAdministrator( principalDn ) || !enabled )
@@ -841,7 +835,7 @@
addEntryAciTuples( tuples, originalEntry );
addSubentryAciTuples( renameContext, tuples, oldName, originalEntry );
- engine.checkPermission( registries, renameContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, renameContext, userGroups, principalDn,
principal.getAuthenticationLevel(), oldName, null, null,
RENAME_PERMS, tuples, originalEntry, null );
@@ -888,7 +882,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( moveAndRenameContext, tuples, oriChildName, entry );
- engine.checkPermission( registries, moveAndRenameContext, userGroups,
+ engine.checkPermission( schemaManager, moveAndRenameContext, userGroups,
principalDn, principal.getAuthenticationLevel(), oriChildName, null,
null, MOVERENAME_PERMS, tuples, entry, null );
@@ -919,7 +913,7 @@
addPerscriptiveAciTuples( moveAndRenameContext, destTuples, newName, subentryAttrs );
// Evaluate the target context to see whether it
// allows an entry named newName to be imported as a subordinate.
- engine.checkPermission( registries, moveAndRenameContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, moveAndRenameContext, userGroups, principalDn,
principal.getAuthenticationLevel(), newName, null,
null, IMPORT_PERMS, destTuples, subentryAttrs, null );
@@ -967,7 +961,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( moveContext, tuples, oriChildName, entry );
- engine.checkPermission( registries, moveContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, moveContext, userGroups, principalDn,
principal.getAuthenticationLevel(), oriChildName, null,
null, EXPORT_PERMS, tuples, entry, null );
@@ -998,7 +992,7 @@
addPerscriptiveAciTuples( moveContext, destTuples, newName, subentryAttrs );
// Evaluate the target context to see whether it
// allows an entry named newName to be imported as a subordinate.
- engine.checkPermission( registries, moveContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, moveContext, userGroups, principalDn,
principal.getAuthenticationLevel(), newName, null,
null, IMPORT_PERMS, destTuples, subentryAttrs, null );
@@ -1072,10 +1066,10 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( opContext, tuples, name, entry );
- engine.checkPermission( registries, opContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, null, null,
READ_PERMS, tuples, entry, null );
- engine.checkPermission( registries, opContext, userGroups, principalDn,
+ engine.checkPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), name, oid, value,
COMPARE_PERMS, tuples, entry, null );
@@ -1111,7 +1105,7 @@
addEntryAciTuples( tuples, entry );
addSubentryAciTuples( opContext, tuples, matched, entry );
- if ( engine.hasPermission( registries, opContext, userGroups, principalDn,
+ if ( engine.hasPermission( schemaManager, opContext, userGroups, principalDn,
principal.getAuthenticationLevel(), matched, null,
null, MATCHEDNAME_PERMS, tuples, entry, null ) )
{
@@ -1149,7 +1143,7 @@
addSubentryAciTuples( opContext, tuples, normName, clonedEntry.getOriginalEntry() );
if ( !engine.hasPermission(
- registries,
+ schemaManager,
opContext,
userGroups,
userDn,
@@ -1181,7 +1175,7 @@
EntryAttribute attr = clonedEntry.get( attributeType );
if ( !engine.hasPermission(
- registries,
+ schemaManager,
opContext,
userGroups,
userDn,
@@ -1205,7 +1199,7 @@
for ( Value<?> value:attr )
{
if ( !engine.hasPermission(
- registries,
+ schemaManager,
opContext,
userGroups,
userDn,
@@ -1250,7 +1244,7 @@
public boolean accept( SearchingOperationContext operationContext, ClonedServerEntry entry )
throws Exception
{
- LdapDN normName = entry.getDn().normalize( atRegistry.getNormalizerMapping() );
+ LdapDN normName = entry.getDn().normalize( schemaManager.getNormalizerMapping() );
return filter( operationContext, normName, entry );
}
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Sat Nov 7 07:57:34 2009
@@ -20,12 +20,11 @@
package org.apache.directory.server.core.authz;
-import javax.naming.NoPermissionException;
-
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
+import javax.naming.NoPermissionException;
+
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.CoreSession;
import org.apache.directory.server.core.DefaultCoreSession;
@@ -57,8 +56,7 @@
import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -101,9 +99,6 @@
private Set<String> administrators = new HashSet<String>(2);
- /** The normalizer mapping containing a relation between an OID and a normalizer */
- private Map<String, OidNormalizer> normalizerMapping;
-
private PartitionNexus nexus;
/** A starage for the uniqueMember attributeType */
@@ -122,23 +117,21 @@
public void init( DirectoryService directoryService ) throws Exception
{
nexus = directoryService.getPartitionNexus();
- normalizerMapping = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+ SchemaManager schemaManager = directoryService.getSchemaManager();
// disable this static module if basic access control mechanisms are enabled
enabled = ! directoryService.isAccessControlEnabled();
USER_BASE_DN = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN );
- USER_BASE_DN.normalize( normalizerMapping );
+ USER_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
GROUP_BASE_DN = new LdapDN( ServerDNConstants.GROUPS_SYSTEM_DN );
- GROUP_BASE_DN.normalize( normalizerMapping );
+ GROUP_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
ADMIN_GROUP_DN = new LdapDN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
- ADMIN_GROUP_DN.normalize( normalizerMapping );
+ ADMIN_GROUP_DN.normalize( schemaManager.getNormalizerMapping() );
- AttributeTypeRegistry attrRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
-
- uniqueMemberAT = attrRegistry.lookup( SchemaConstants.UNIQUE_MEMBER_AT_OID );
+ uniqueMemberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.UNIQUE_MEMBER_AT_OID );
loadAdministrators( directoryService );
}
@@ -149,7 +142,7 @@
// read in the administrators and cache their normalized names
Set<String> newAdministrators = new HashSet<String>( 2 );
LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
- adminDn.normalize( directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+ adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
CoreSession adminSession = new DefaultCoreSession(
new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
@@ -165,7 +158,7 @@
for ( Value<?> value:uniqueMember )
{
LdapDN memberDn = new LdapDN( value.getString() );
- memberDn.normalize( normalizerMapping );
+ memberDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
newAdministrators.add( memberDn.getNormName() );
}
@@ -546,7 +539,7 @@
if ( !dn.isNormalized() )
{
- dn.normalize( normalizerMapping );
+ dn.normalize( opContext.getSession().getDirectoryService().getSchemaManager().getNormalizerMapping() );
}
// Admin users gets full access to all entries
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Sat Nov 7 07:57:34 2009
@@ -48,9 +48,8 @@
import org.apache.directory.shared.ldap.message.AliasDerefMode;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -100,13 +99,11 @@
*/
public GroupCache( CoreSession session ) throws Exception
{
- normalizerMap = session.getDirectoryService().getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
+ SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
+ normalizerMap = schemaManager.getNormalizerMapping();
nexus = session.getDirectoryService().getPartitionNexus();
- AttributeTypeRegistry attributeTypeRegistry = session.getDirectoryService()
- .getRegistries().getAttributeTypeRegistry();
-
- memberAT = attributeTypeRegistry.lookup( SchemaConstants.MEMBER_AT_OID );
- uniqueMemberAT = attributeTypeRegistry.lookup( SchemaConstants.UNIQUE_MEMBER_AT_OID );
+ memberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.MEMBER_AT_OID );
+ uniqueMemberAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.UNIQUE_MEMBER_AT_OID );
// stuff for dealing with the admin group
administratorsGroupDn = parseNormalized( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
@@ -376,7 +373,7 @@
* @param entry the group entry being modified
* @throws NamingException if there are problems accessing attribute values
*/
- public void groupModified( LdapDN name, List<Modification> mods, ServerEntry entry, Registries registries )
+ public void groupModified( LdapDN name, List<Modification> mods, ServerEntry entry, SchemaManager schemaManager )
throws NamingException
{
EntryAttribute members = null;
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Sat Nov 7 07:57:34 2009
@@ -20,6 +20,17 @@
package org.apache.directory.server.core.authz;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.NamingException;
+import javax.naming.directory.SearchControls;
+
import org.apache.directory.server.core.CoreSession;
import org.apache.directory.server.core.entry.ServerAttribute;
import org.apache.directory.server.core.entry.ServerEntry;
@@ -42,23 +53,11 @@
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
-import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.naming.NamingException;
-import javax.naming.directory.SearchControls;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/**
* A cache for tuple sets which responds to specific events to perform
@@ -85,11 +84,6 @@
/** A storage for the PrescriptiveACI attributeType */
private AttributeType prescriptiveAciAT;
- /**
- * The OIDs normalizer map
- */
- private Map<String, OidNormalizer> normalizerMap;
-
/**
* Creates a ACITuple cache.
@@ -99,22 +93,19 @@
*/
public TupleCache( CoreSession session ) throws Exception
{
- normalizerMap = session.getDirectoryService().getRegistries()
- .getAttributeTypeRegistry().getNormalizerMapping();
+ SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
this.nexus = session.getDirectoryService().getPartitionNexus();
- AttributeTypeRegistry attributeTypeRegistry = session.getDirectoryService()
- .getRegistries().getAttributeTypeRegistry();
- NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry );
- aciParser = new ACIItemParser( ncn, normalizerMap );
- prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT );
+ NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager );
+ aciParser = new ACIItemParser( ncn, schemaManager.getNormalizerMapping() );
+ prescriptiveAciAT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.PRESCRIPTIVE_ACI_AT );
initialize( session );
}
- private LdapDN parseNormalized( String name ) throws NamingException
+ private LdapDN parseNormalized( SchemaManager schemaManager, String name ) throws NamingException
{
LdapDN dn = new LdapDN( name );
- dn.normalize( normalizerMap );
+ dn.normalize( schemaManager.getNormalizerMapping() );
return dn;
}
@@ -128,7 +119,7 @@
for ( String suffix:suffixes )
{
- LdapDN baseDn = parseNormalized( suffix );
+ LdapDN baseDn = parseNormalized( session.getDirectoryService().getSchemaManager(), suffix );
ExprNode filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
new ClientStringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
SearchControls ctls = new SearchControls();
@@ -139,7 +130,8 @@
while ( results.next() )
{
ServerEntry result = results.get();
- LdapDN subentryDn = result.getDn().normalize( normalizerMap );
+ LdapDN subentryDn = result.getDn().normalize( session.getDirectoryService().getSchemaManager().
+ getNormalizerMapping() );
EntryAttribute aci = result.get( prescriptiveAciAT );
if ( aci == null )
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java Sat Nov 7 07:57:34 2009
@@ -49,9 +49,8 @@
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
/**
@@ -90,15 +89,15 @@
*
* @throws NamingException if failed to initialize internal components
*/
- public ACDFEngine( OidRegistry oidRegistry, AttributeTypeRegistry attrTypeRegistry ) throws NamingException
+ public ACDFEngine( OidRegistry oidRegistry, SchemaManager schemaManager ) throws NamingException
{
- Evaluator entryEvaluator = new ExpressionEvaluator( oidRegistry, attrTypeRegistry );
- SubtreeEvaluator subtreeEvaluator = new SubtreeEvaluator( oidRegistry, attrTypeRegistry );
+ Evaluator entryEvaluator = new ExpressionEvaluator( oidRegistry, schemaManager );
+ SubtreeEvaluator subtreeEvaluator = new SubtreeEvaluator( oidRegistry, schemaManager );
RefinementEvaluator refinementEvaluator = new RefinementEvaluator( new RefinementLeafEvaluator( oidRegistry ) );
filters = new ACITupleFilter[] {
new RelatedUserClassFilter( subtreeEvaluator ),
- new RelatedProtectedItemFilter( refinementEvaluator, entryEvaluator, oidRegistry, attrTypeRegistry ),
+ new RelatedProtectedItemFilter( refinementEvaluator, entryEvaluator, oidRegistry, schemaManager ),
new MaxValueCountFilter(),
new MaxImmSubFilter(),
new RestrictedByFilter(),
@@ -128,7 +127,7 @@
* @throws NamingException if failed to evaluate ACI items
*/
public void checkPermission(
- Registries registries,
+ SchemaManager schemaManager,
OperationContext opContext,
Collection<LdapDN> userGroupNames,
LdapDN username,
@@ -141,7 +140,7 @@
ServerEntry entry,
ServerEntry entryView ) throws Exception
{
- if ( !hasPermission( registries, opContext, userGroupNames, username, authenticationLevel, entryName,
+ if ( !hasPermission( schemaManager, opContext, userGroupNames, username, authenticationLevel, entryName,
attrId, attrValue, microOperations, aciTuples, entry, entryView ) )
{
throw new LdapNoPermissionException();
@@ -186,7 +185,7 @@
* @param entryView in case of a Modify operation, view of the entry being modified as if the modification permitted and completed
*/
public boolean hasPermission(
- Registries registries,
+ SchemaManager schemaManager,
OperationContext opContext,
Collection<LdapDN> userGroupNames,
LdapDN userName,
@@ -229,7 +228,7 @@
for ( ACITupleFilter filter : filters )
{
aciTuples = filter.filter(
- registries,
+ schemaManager,
aciTuples,
scope,
opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java Sat Nov 7 07:57:34 2009
@@ -31,7 +31,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -65,7 +65,7 @@
* @throws NamingException if failed to filter the specific tuples
*/
Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java Sat Nov 7 07:57:34 2009
@@ -32,7 +32,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -45,7 +45,7 @@
public class HighestPrecedenceFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java Sat Nov 7 07:57:34 2009
@@ -20,13 +20,13 @@
package org.apache.directory.server.core.authz.support;
-import javax.naming.directory.SearchControls;
-
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
+import javax.naming.directory.SearchControls;
+
import org.apache.directory.server.core.authn.AuthenticationInterceptor;
import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
@@ -49,7 +49,7 @@
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.directory.shared.ldap.message.AliasDerefMode;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
@@ -75,7 +75,7 @@
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
@@ -122,7 +122,7 @@
{
if ( immSubCount < 0 )
{
- immSubCount = getImmSubCount( registries, opContext, entryName );
+ immSubCount = getImmSubCount( schemaManager, opContext, entryName );
}
ProtectedItem.MaxImmSub mis = ( ProtectedItem.MaxImmSub ) item;
@@ -154,7 +154,7 @@
}
- private int getImmSubCount( Registries registries, OperationContext opContext, LdapDN entryName ) throws Exception
+ private int getImmSubCount( SchemaManager schemaManager, OperationContext opContext, LdapDN entryName ) throws Exception
{
int cnt = 0;
EntryFilteringCursor results = null;
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java Sat Nov 7 07:57:34 2009
@@ -35,7 +35,7 @@
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -48,7 +48,7 @@
public class MaxValueCountFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java Sat Nov 7 07:57:34 2009
@@ -20,7 +20,7 @@
package org.apache.directory.server.core.authz.support;
-import java.util.Collection;
+import java.util.Collection;
import java.util.Iterator;
import javax.naming.NamingException;
@@ -32,7 +32,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -46,7 +46,7 @@
public class MicroOperationFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java Sat Nov 7 07:57:34 2009
@@ -33,7 +33,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -54,7 +54,7 @@
public class MostSpecificProtectedItemFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java Sat Nov 7 07:57:34 2009
@@ -33,7 +33,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -52,7 +52,7 @@
public class MostSpecificUserClassFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java Sat Nov 7 07:57:34 2009
@@ -41,9 +41,8 @@
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
import org.apache.directory.shared.ldap.util.AttributeUtils;
@@ -58,20 +57,20 @@
{
private final RefinementEvaluator refinementEvaluator;
private final Evaluator entryEvaluator;
- private final AttributeTypeRegistry atRegistry;
+ private final SchemaManager schemaManager;
public RelatedProtectedItemFilter( RefinementEvaluator refinementEvaluator, Evaluator entryEvaluator,
- OidRegistry oidRegistry, AttributeTypeRegistry attrRegistry )
+ OidRegistry oidRegistry, SchemaManager schemaManager )
{
this.refinementEvaluator = refinementEvaluator;
this.entryEvaluator = entryEvaluator;
- this.atRegistry = attrRegistry;
+ this.schemaManager = schemaManager;
}
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
@@ -113,7 +112,7 @@
if ( attrId != null )
{
- oid = atRegistry.getOidByName( attrId );
+ oid = schemaManager.getAttributeTypeRegistry().getOidByName( attrId );
}
for ( ProtectedItem item : tuple.getProtectedItems() )
@@ -154,7 +153,7 @@
for ( Iterator<String> j = aav.iterator(); j.hasNext(); )
{
- if ( oid.equals( atRegistry.getOidByName( j.next() ) ) )
+ if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( j.next() ) ) )
{
return true;
}
@@ -171,7 +170,7 @@
for ( Iterator<String> j = at.iterator(); j.hasNext(); )
{
- if ( oid.equals( atRegistry.getOidByName( j.next() ) ) )
+ if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( j.next() ) ) )
{
return true;
}
@@ -188,8 +187,8 @@
for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
{
Attribute attr = j.next();
- String attrOid = atRegistry.getOidByName( attr.getID() );
- AttributeType attrType = atRegistry.lookup( attrOid );
+ String attrOid = schemaManager.getAttributeTypeRegistry().getOidByName( attr.getID() );
+ AttributeType attrType = schemaManager.lookupAttributeTypeRegistry( attrOid );
if ( oid.equals( attrOid ) && AttributeUtils.containsValue( attr, attrValue, attrType ) )
{
@@ -221,7 +220,7 @@
{
MaxValueCountItem mvcItem = j.next();
- if ( oid.equals( atRegistry.getOidByName( mvcItem.getAttributeType() ) ) )
+ if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( mvcItem.getAttributeType() ) ) )
{
return true;
}
@@ -247,7 +246,7 @@
for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
{
RestrictedByItem rbItem = j.next();
- if ( oid.equals( atRegistry.getOidByName( rbItem.getAttributeType() ) ) )
+ if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( rbItem.getAttributeType() ) ) )
{
return true;
}
@@ -265,7 +264,7 @@
{
String svItem = j.next();
- if ( oid.equals( atRegistry.getOidByName( svItem ) ) )
+ if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName( svItem ) ) )
{
EntryAttribute attr = entry.get( oid );
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java Sat Nov 7 07:57:34 2009
@@ -34,7 +34,7 @@
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
@@ -59,7 +59,7 @@
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java Sat Nov 7 07:57:34 2009
@@ -35,7 +35,7 @@
import org.apache.directory.shared.ldap.entry.EntryAttribute;
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -48,7 +48,7 @@
public class RestrictedByFilter implements ACITupleFilter
{
public Collection<ACITuple> filter(
- Registries registries,
+ SchemaManager schemaManager,
Collection<ACITuple> tuples,
OperationScope scope,
OperationContext opContext,
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sat Nov 7 07:57:34 2009
@@ -94,8 +94,8 @@
changeLog = directoryService.getChangeLog();
schemaService = directoryService.getSchemaService();
- entryDeleted = directoryService.getRegistries().getAttributeTypeRegistry()
- .lookup( ApacheSchemaConstants.ENTRY_DELETED_AT_OID );
+ entryDeleted = directoryService.getSchemaManager()
+ .lookupAttributeTypeRegistry( ApacheSchemaConstants.ENTRY_DELETED_AT_OID );
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Sat Nov 7 07:57:34 2009
@@ -47,7 +47,7 @@
import org.apache.directory.shared.ldap.entry.Value;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -64,8 +64,8 @@
*/
public class CollectiveAttributeInterceptor extends BaseInterceptor
{
- /** The attributeType registry */
- private AttributeTypeRegistry atRegistry;
+ /** The SchemaManager */
+ private SchemaManager schemaManager;
private PartitionNexus nexus;
@@ -84,7 +84,7 @@
if ( name.isNormalized() == false )
{
- name = LdapDN.normalize( name, atRegistry.getNormalizerMapping() );
+ name = LdapDN.normalize( name, schemaManager.getNormalizerMapping() );
}
String[] retAttrs = operation.getSearchControls().getReturningAttributes();
@@ -96,9 +96,9 @@
public void init( DirectoryService directoryService ) throws Exception
{
super.init( directoryService );
+ schemaManager = directoryService.getSchemaManager();
nexus = directoryService.getPartitionNexus();
- atRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
- collectiveAttributesSchemaChecker = new CollectiveAttributesSchemaChecker( nexus, atRegistry );
+ collectiveAttributesSchemaChecker = new CollectiveAttributesSchemaChecker( nexus, schemaManager );
}
@@ -156,7 +156,7 @@
for ( Value<?> value:collectiveExclusions )
{
- AttributeType attrType = atRegistry.lookup( value.getString() );
+ AttributeType attrType = schemaManager.lookupAttributeTypeRegistry( value.getString() );
exclusions.add( attrType.getOid() );
}
}
@@ -185,7 +185,7 @@
}
else
{
- retIdsSet.add( atRegistry.lookup( retAttr ).getOid() );
+ retIdsSet.add( schemaManager.lookupAttributeTypeRegistry( retAttr ).getOid() );
}
}
@@ -235,11 +235,11 @@
continue;
}
- AttributeType retType = atRegistry.lookup( retId );
+ AttributeType retType = schemaManager.lookupAttributeTypeRegistry( retId );
if ( allSuperTypes.contains( retType ) )
{
- retIdsSet.add( atRegistry.lookup( attrId ).getOid() );
+ retIdsSet.add( schemaManager.lookupAttributeTypeRegistry( attrId ).getOid() );
break;
}
}
@@ -249,7 +249,7 @@
* then bypass the inclusion process.
*/
if ( !( retIdsSet.contains( SchemaConstants.ALL_USER_ATTRIBUTES ) ||
- retIdsSet.contains( atRegistry.lookup( attrId ).getOid() ) ) )
+ retIdsSet.contains( schemaManager.lookupAttributeTypeRegistry( attrId ).getOid() ) ) )
{
continue;
}
@@ -262,7 +262,7 @@
*/
if ( entryColAttr == null )
{
- entryColAttr = new DefaultServerAttribute( attrId, atRegistry.lookup( attrId ) );
+ entryColAttr = new DefaultServerAttribute( attrId, schemaManager.lookupAttributeTypeRegistry( attrId ) );
entry.put( entryColAttr );
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributesSchemaChecker.java Sat Nov 7 07:57:34 2009
@@ -39,8 +39,8 @@
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.SchemaUtils;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
/**
@@ -52,12 +52,12 @@
public class CollectiveAttributesSchemaChecker
{
private PartitionNexus nexus = null;
- private AttributeTypeRegistry attrTypeRegistry = null;
+ private SchemaManager schemaManager = null;
- public CollectiveAttributesSchemaChecker( PartitionNexus nexus, AttributeTypeRegistry attrTypeRegistry )
+ public CollectiveAttributesSchemaChecker( PartitionNexus nexus, SchemaManager schemaManager )
{
this.nexus = nexus;
- this.attrTypeRegistry = attrTypeRegistry;
+ this.schemaManager = schemaManager;
}
/* package scope*/ void checkAdd( LdapDN normName, ServerEntry entry ) throws Exception
@@ -113,13 +113,13 @@
if ( attrType == null )
{
- if ( !attrTypeRegistry.contains( attr.getUpId() ) )
+ if ( !schemaManager.getAttributeTypeRegistry().contains( attr.getUpId() ) )
{
throw new LdapInvalidAttributeIdentifierException();
}
else
{
- attrType = attrTypeRegistry.lookup( attr.getUpId() );
+ attrType = schemaManager.lookupAttributeTypeRegistry( attr.getUpId() );
}
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Sat Nov 7 07:57:34 2009
@@ -46,8 +46,8 @@
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.normalizers.ConcreteNameComponentNormalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -81,11 +81,11 @@
super.init( ds );
this.ds = ds;
- OidRegistry oidRegistry = ds.getRegistries().getOidRegistry();
- AttributeTypeRegistry attributeRegistry = ds.getRegistries().getAttributeTypeRegistry();
- NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry );
- filterNormalizer = new FilterNormalizingVisitor( ncn, ds.getRegistries() );
- evaluator = new ExpressionEvaluator( oidRegistry, attributeRegistry );
+ OidRegistry oidRegistry = ds.getSchemaManager().getOidRegistry();
+ SchemaManager schemaManager = ds.getSchemaManager();
+ NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( schemaManager );
+ filterNormalizer = new FilterNormalizingVisitor( ncn, schemaManager );
+ evaluator = new ExpressionEvaluator( oidRegistry, schemaManager );
executor = new ThreadPoolExecutor( 1, 10, 1000, TimeUnit.MILLISECONDS,
new ArrayBlockingQueue<Runnable>( 100 ) );
@@ -325,7 +325,7 @@
*/
public void addListener( DirectoryListener listener, NotificationCriteria criteria ) throws Exception
{
- criteria.getBase().normalize( ds.getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+ criteria.getBase().normalize( ds.getSchemaManager().getNormalizerMapping() );
ExprNode result = ( ExprNode ) criteria.getFilter().accept( filterNormalizer );
criteria.setFilter( result );
registrations.add( new RegistrationEntry( listener, criteria ) );
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/ExpressionEvaluator.java Sat Nov 7 07:57:34 2009
@@ -28,7 +28,7 @@
import org.apache.directory.shared.ldap.filter.ExprNode;
import org.apache.directory.shared.ldap.filter.NotNode;
import org.apache.directory.shared.ldap.filter.OrNode;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.apache.directory.shared.ldap.schema.registries.OidRegistry;
@@ -55,7 +55,7 @@
*
* @param leafEvaluator handles leaf node evaluation.
*/
- public ExpressionEvaluator(LeafEvaluator leafEvaluator)
+ public ExpressionEvaluator( LeafEvaluator leafEvaluator )
{
this.leafEvaluator = leafEvaluator;
}
@@ -68,11 +68,11 @@
* @param oidRegistry the oid reg used for attrID to oid resolution
* @param attributeTypeRegistry the attribtype reg used for value comparison
*/
- public ExpressionEvaluator(OidRegistry oidRegistry, AttributeTypeRegistry attributeTypeRegistry)
+ public ExpressionEvaluator( OidRegistry oidRegistry, SchemaManager schemaManager )
{
SubstringEvaluator substringEvaluator = null;
- substringEvaluator = new SubstringEvaluator( attributeTypeRegistry );
- leafEvaluator = new LeafEvaluator( attributeTypeRegistry, substringEvaluator );
+ substringEvaluator = new SubstringEvaluator( schemaManager );
+ leafEvaluator = new LeafEvaluator( schemaManager, substringEvaluator );
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/LeafEvaluator.java Sat Nov 7 07:57:34 2009
@@ -43,7 +43,7 @@
import org.apache.directory.shared.ldap.schema.LdapComparator;
import org.apache.directory.shared.ldap.schema.MatchingRule;
import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -63,8 +63,8 @@
/** substring matching type constant */
private static final int SUBSTRING_MATCH = 3;
- /** AttributeType registry needed for normalizing and comparing values */
- private AttributeTypeRegistry attributeTypeRegistry;
+ /** SchemaManager needed for normalizing and comparing values */
+ private SchemaManager schemaManager;
/** Substring node evaluator we depend on */
private SubstringEvaluator substringEvaluator;
@@ -82,10 +82,10 @@
*
* @param substringEvaluator
*/
- public LeafEvaluator( AttributeTypeRegistry attributeTypeRegistry,
+ public LeafEvaluator( SchemaManager schemaManager,
SubstringEvaluator substringEvaluator )
{
- this.attributeTypeRegistry = attributeTypeRegistry;
+ this.schemaManager = schemaManager;
this.scopeEvaluator = new ScopeEvaluator();
this.substringEvaluator = substringEvaluator;
}
@@ -163,7 +163,7 @@
String attrId = node.getAttribute();
// get the attribute associated with the node
- AttributeType type = attributeTypeRegistry.lookup( attrId );
+ AttributeType type = schemaManager.lookupAttributeTypeRegistry( attrId );
EntryAttribute attr = entry.get( type );
// If we do not have the attribute just return false
@@ -260,7 +260,7 @@
}
// check if AVA value exists in attribute
- AttributeType at = attributeTypeRegistry.lookup( node.getAttribute() );
+ AttributeType at = schemaManager.lookupAttributeTypeRegistry( node.getAttribute() );
Value<?> value = null;
if ( at.getSyntax().isHumanReadable() )
@@ -351,7 +351,7 @@
private MatchingRule getMatchingRule( String attrId, int matchType ) throws NamingException
{
MatchingRule mrule = null;
- AttributeType type = attributeTypeRegistry.lookup( attrId );
+ AttributeType type = schemaManager.lookupAttributeTypeRegistry( attrId );
switch ( matchType )
{
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java Sat Nov 7 07:57:34 2009
@@ -33,7 +33,7 @@
import org.apache.directory.shared.ldap.schema.AttributeType;
import org.apache.directory.shared.ldap.schema.MatchingRule;
import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -44,8 +44,8 @@
*/
public class SubstringEvaluator implements Evaluator
{
- /** AttributeType registry needed for normalizing and comparing values */
- private AttributeTypeRegistry atRegistry;
+ /** SchemaManager needed for normalizing and comparing values */
+ private SchemaManager schemaManager;
/**
@@ -54,9 +54,9 @@
* @param oidRegistry the OID registry for name to OID mapping
* @param attributeTypeRegistry the attributeType registry
*/
- public SubstringEvaluator( AttributeTypeRegistry atRegistry )
+ public SubstringEvaluator( SchemaManager schemaManager )
{
- this.atRegistry = atRegistry;
+ this.schemaManager = schemaManager;
}
@@ -67,8 +67,8 @@
{
Pattern regex = null;
SubstringNode snode = (SubstringNode)node;
- String oid = atRegistry.getOidByName( snode.getAttribute() );
- AttributeType type = atRegistry.lookup( oid );
+ String oid = schemaManager.getAttributeTypeRegistry().getOidByName( snode.getAttribute() );
+ AttributeType type = schemaManager.lookupAttributeTypeRegistry( oid );
MatchingRule matchingRule = type.getSubstring();
if ( matchingRule == null )
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Sat Nov 7 07:57:34 2009
@@ -21,7 +21,6 @@
import java.util.List;
-import java.util.Map;
import org.apache.commons.collections.map.LRUMap;
import org.apache.directory.server.core.DirectoryService;
@@ -62,7 +61,6 @@
import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
/**
@@ -84,11 +82,6 @@
/**
- * The OIDs normalizer map
- */
- private Map<String, OidNormalizer> normalizerMap;
-
- /**
* A cache to store entries which are not aliases.
* It's a speedup, we will be able to avoid backend lookups.
*
@@ -124,10 +117,9 @@
{
this.directoryService = directoryService;
nexus = directoryService.getPartitionNexus();
- normalizerMap = directoryService.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
subschemSubentryDn = new LdapDN( attr.getString() );
- subschemSubentryDn.normalize( normalizerMap );
+ subschemSubentryDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
}
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/ExpandingVisitor.java Sat Nov 7 07:57:34 2009
@@ -38,7 +38,7 @@
import org.apache.directory.shared.ldap.filter.PresenceNode;
import org.apache.directory.shared.ldap.filter.SubstringNode;
import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
/**
@@ -49,18 +49,19 @@
*/
public class ExpandingVisitor implements FilterVisitor
{
- private final AttributeTypeRegistry attrRegistry;
-
-
+ /** The schemaManager */
+ private SchemaManager schemaManager;
+
+
/**
*
* Creates a new instance of ExpandingVisitor.
*
- * @param attrRegistry The AttributeType registry
+ * @param schemaManager The schemaManager
*/
- public ExpandingVisitor( AttributeTypeRegistry attrRegistry )
+ public ExpandingVisitor( SchemaManager schemaManager )
{
- this.attrRegistry = attrRegistry;
+ this.schemaManager = schemaManager;
}
@@ -102,7 +103,7 @@
try
{
- if ( attrRegistry.hasDescendants( leaf.getAttribute() ) )
+ if ( schemaManager.getAttributeTypeRegistry().hasDescendants( leaf.getAttribute() ) )
{
// create a new OR node to hold all descendent forms
// add to this node the generalized leaf node and
@@ -112,7 +113,7 @@
children.set( childNumber++, orNode );
// iterate through descendants adding them to the orNode
- Iterator<AttributeType> descendants = attrRegistry.descendants( leaf.getAttribute() );
+ Iterator<AttributeType> descendants = schemaManager.getAttributeTypeRegistry().descendants( leaf.getAttribute() );
while ( descendants.hasNext() )
{
Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java?rev=833647&r1=833646&r2=833647&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java Sat Nov 7 07:57:34 2009
@@ -39,8 +39,7 @@
import org.apache.directory.shared.ldap.filter.SubstringNode;
import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -71,11 +70,8 @@
private final NameComponentNormalizer ncn;
/** the global registries used to resolve OIDs for attributeType ids */
- private final Registries registries;
+ private final SchemaManager schemaManager;
- /** The AttributeType registry */
- private AttributeTypeRegistry atRegistry;
-
/**
* Chars which need to be escaped in a filter
@@ -121,11 +117,10 @@
* @param ncn The name component normalizer to use
* @param registries The global registries
*/
- public FilterNormalizingVisitor( NameComponentNormalizer ncn, Registries registries )
+ public FilterNormalizingVisitor( NameComponentNormalizer ncn, SchemaManager schemaManager )
{
this.ncn = ncn;
- this.registries = registries;
- atRegistry = registries.getAttributeTypeRegistry();
+ this.schemaManager = schemaManager;
}
@@ -145,7 +140,7 @@
{
Value<?> normalized = null;
- AttributeType attributeType = registries.getAttributeTypeRegistry().lookup( attribute );
+ AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( attribute );
if ( attributeType.getSyntax().isHumanReadable() )
{
@@ -176,7 +171,7 @@
*/
private ExprNode visitPresenceNode( PresenceNode node ) throws NamingException
{
- node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
+ node.setAttribute( schemaManager.getAttributeTypeRegistry().getOidByName( node.getAttribute() ) );
return node;
}
@@ -208,7 +203,7 @@
return null;
}
- node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
+ node.setAttribute( schemaManager.getAttributeTypeRegistry().getOidByName( node.getAttribute() ) );
node.setValue( normalized );
return node;
@@ -279,7 +274,7 @@
}
}
- node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
+ node.setAttribute( schemaManager.getAttributeTypeRegistry().getOidByName( node.getAttribute() ) );
if ( normInitial != null )
{
@@ -316,7 +311,7 @@
*/
private ExprNode visitExtensibleNode( ExtensibleNode node ) throws NamingException
{
- node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
+ node.setAttribute( schemaManager.getAttributeTypeRegistry().getOidByName( node.getAttribute() ) );
return node;
}