directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r809675 - in /directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core: authz/ authz/support/ event/ normalization/
Date Mon, 31 Aug 2009 17:58:20 GMT
Author: akarasulu
Date: Mon Aug 31 17:58:19 2009
New Revision: 809675

URL: http://svn.apache.org/viewvc?rev=809675&view=rev
Log:
fixing several compiler errors due to api changes in schema

Modified:
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/event/SubstringEvaluator.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/FilterNormalizingVisitor.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -78,8 +78,8 @@
 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.OidRegistry;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -98,7 +98,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( AciAuthorizationInterceptor.class
);
 
     /**
-     * the multivalued op attr used to track the perscriptive access control
+     * the multivalued op attr used to track the prescriptive access control
      * subentries that apply to an entry.
      */
     private static final String AC_SUBENTRY_ATTR = "accessControlSubentries";
@@ -216,18 +216,17 @@
         registries = directoryService.getRegistries();
         atRegistry = registries.getAttributeTypeRegistry();
         ocRegistry = registries.getObjectClassRegistry();
-        OidRegistry oidRegistry = registries.getOidRegistry();
         
         // look up some constant information
-        String objectClassOid = atRegistry.getOid( SchemaConstants.OBJECT_CLASS_AT );
-        subentryOid = ocRegistry.getOid( SchemaConstants.SUBENTRY_OC );
-        String acSubentryOid = atRegistry.getOid( AC_SUBENTRY_ATTR );
+        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 );
         
-        aciParser = new ACIItemParser( new ConcreteNameComponentNormalizer( atRegistry, oidRegistry
), atRegistry.getNormalizerMapping() );
+        aciParser = new ACIItemParser( new ConcreteNameComponentNormalizer( atRegistry ),
atRegistry.getNormalizerMapping() );
         engine = new ACDFEngine( registries.getOidRegistry(), atRegistry );
         chain = directoryService.getInterceptorChain();
         enabled = directoryService.isAccessControlEnabled();

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -45,7 +45,7 @@
 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.apache.directory.shared.ldap.schema.registries.OidRegistry;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -82,7 +82,7 @@
     /** a normalizing ACIItem parser */
     private final ACIItemParser aciParser;
 
-    /** A starage for the PrescriptiveACI attributeType */
+    /** A storage for the PrescriptiveACI attributeType */
     private AttributeType prescriptiveAciAT;
 
     /**
@@ -104,8 +104,7 @@
         this.nexus = session.getDirectoryService().getPartitionNexus();
         AttributeTypeRegistry attributeTypeRegistry = session.getDirectoryService()
             .getRegistries().getAttributeTypeRegistry();
-        OidRegistry oidRegistry = session.getDirectoryService().getRegistries().getOidRegistry();
-        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry,
oidRegistry );
+        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeTypeRegistry
);
         aciParser = new ACIItemParser( ncn, normalizerMap );
         prescriptiveAciAT = attributeTypeRegistry.lookup( SchemaConstants.PRESCRIPTIVE_ACI_AT
);
         initialize( session );

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -113,7 +113,7 @@
         
         if ( attrId != null )
         {
-            oid = atRegistry.getOid( attrId );
+            oid = atRegistry.getOidByName( attrId );
         }
         
         for ( ProtectedItem item : tuple.getProtectedItems() )
@@ -154,7 +154,7 @@
 
                 for ( Iterator<String> j = aav.iterator(); j.hasNext(); )
                 {
-                    if ( oid.equals( atRegistry.getOid( j.next() ) ) )
+                    if ( oid.equals( atRegistry.getOidByName( j.next() ) ) )
                     {
                         return true;
                     }
@@ -171,7 +171,7 @@
                 
                 for ( Iterator<String> j = at.iterator(); j.hasNext(); )
                 {
-                    if ( oid.equals( atRegistry.getOid( j.next() ) ) )
+                    if ( oid.equals( atRegistry.getOidByName( j.next() ) ) )
                     {
                         return true;
                     }
@@ -188,7 +188,7 @@
                 for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
                 {
                     Attribute attr = j.next();
-                    String attrOid = atRegistry.getOid( attr.getID() );
+                    String attrOid = atRegistry.getOidByName( attr.getID() );
                     AttributeType attrType = atRegistry.lookup( attrOid );
                     
                     if ( oid.equals( attrOid ) && AttributeUtils.containsValue( attr,
attrValue, attrType ) )
@@ -221,7 +221,7 @@
                 {
                     MaxValueCountItem mvcItem = j.next();
                     
-                    if ( oid.equals( atRegistry.getOid( mvcItem.getAttributeType() ) ) )
+                    if ( oid.equals( atRegistry.getOidByName( mvcItem.getAttributeType()
) ) )
                     {
                         return true;
                     }
@@ -247,7 +247,7 @@
                 for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
                 {
                     RestrictedByItem rbItem = j.next();
-                    if ( oid.equals( atRegistry.getOid( rbItem.getAttributeType() ) ) )
+                    if ( oid.equals( atRegistry.getOidByName( rbItem.getAttributeType() )
) )
                     {
                         return true;
                     }
@@ -265,7 +265,7 @@
                 {
                     String svItem = j.next();
                     
-                    if ( oid.equals( atRegistry.getOid( svItem ) ) )
+                    if ( oid.equals( atRegistry.getOidByName( svItem ) ) )
                     {
                         EntryAttribute attr = entry.get( oid );
                         

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -84,7 +84,7 @@
         this.ds = ds;
         OidRegistry oidRegistry = ds.getRegistries().getOidRegistry();
         AttributeTypeRegistry attributeRegistry = ds.getRegistries().getAttributeTypeRegistry();
-        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry,
oidRegistry );
+        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry
);
         filterNormalizer = new FilterNormalizingVisitor( ncn, ds.getRegistries() );
         evaluator = new ExpressionEvaluator( oidRegistry, attributeRegistry );
         executor = new ThreadPoolExecutor( 1, 10, 1000, TimeUnit.MILLISECONDS, 

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -67,7 +67,7 @@
     {
         Pattern regex = null;
         SubstringNode snode = (SubstringNode)node;
-        String oid = atRegistry.getOid( snode.getAttribute() );
+        String oid = atRegistry.getOidByName( snode.getAttribute() );
         AttributeType type = atRegistry.lookup( oid );
         MatchingRule matchingRule = type.getSubstring();
         

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=809675&r1=809674&r2=809675&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
Mon Aug 31 17:58:19 2009
@@ -56,7 +56,7 @@
  * might make some partition implementations choke.  To avoid this problem we clean up branch
  * nodes that don't make sense.  For example all BranchNodes without children are just
  * removed.  An AND and OR BranchNode with a single child is replaced with it's child for
- * all but the topmost branchnode which we cannot replace.  So again the top most branch
+ * all but the topmost branch node which we cannot replace.  So again the top most branch
  * node must be inspected by code outside of this visitor.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
@@ -174,9 +174,9 @@
      * @param node the node to visit
      * @return The visited node
      */
-    private ExprNode visitPresenceNode( PresenceNode node )
+    private ExprNode visitPresenceNode( PresenceNode node ) throws NamingException
     {
-        node.setAttribute( atRegistry.getOid( node.getAttribute() ) );
+        node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
         return node;
     }
 
@@ -192,7 +192,7 @@
      * @param node the node to visit
      * @return the visited node
      */
-    private ExprNode visitSimpleNode( SimpleNode node )
+    private ExprNode visitSimpleNode( SimpleNode node ) throws NamingException
     {
         // still need this check here in case the top level is a leaf node
         // with an undefined attributeType for its attribute
@@ -208,7 +208,7 @@
             return null;
         }
 
-        node.setAttribute( atRegistry.getOid( node.getAttribute() ) );
+        node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
         node.setValue( normalized );
         
         return node;
@@ -224,7 +224,7 @@
      * @param node the node to visit
      * @return the visited node
      */
-    private ExprNode visitSubstringNode( SubstringNode node )
+    private ExprNode visitSubstringNode( SubstringNode node ) throws NamingException
     {
         // still need this check here in case the top level is a leaf node
         // with an undefined attributeType for its attribute
@@ -279,7 +279,7 @@
             }
         }
 
-        node.setAttribute( atRegistry.getOid( node.getAttribute() ) );
+        node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
 
         if ( normInitial != null )
         {
@@ -314,9 +314,9 @@
      * @param node the node to visit
      * @return the visited node
      */
-    private ExprNode visitExtensibleNode( ExtensibleNode node )
+    private ExprNode visitExtensibleNode( ExtensibleNode node ) throws NamingException
     {
-        node.setAttribute( atRegistry.getOid( node.getAttribute() ) );
+        node.setAttribute( atRegistry.getOidByName( node.getAttribute() ) );
 
         return node;
     }
@@ -433,47 +433,54 @@
      * @param node the node to visit
      * @return the visited node
      */
-    public Object visit( ExprNode node )
+    public Object visit( ExprNode node ) 
     {
-        // -------------------------------------------------------------------
-        // Handle PresenceNodes
-        // -------------------------------------------------------------------
-
-        if ( node instanceof PresenceNode )
-        {
-            return visitPresenceNode( ( PresenceNode ) node );
-        }
-
-        // -------------------------------------------------------------------
-        // Handle BranchNodes (AndNode, NotNode and OrNode)
-        // -------------------------------------------------------------------
-
-        else if ( node instanceof BranchNode )
-        {
-            return visitBranchNode( ( BranchNode ) node );
-        }
-
-        // -------------------------------------------------------------------
-        // Handle SimpleNodes (ApproximateNode, EqualityNode, GreaterEqNode,
-        // and LesserEqNode) 
-        // -------------------------------------------------------------------
-
-        else if ( node instanceof SimpleNode )
-        {
-            return visitSimpleNode( ( SimpleNode ) node );
-        }
-        else if ( node instanceof ExtensibleNode )
-        {
-            return visitExtensibleNode( ( ExtensibleNode ) node );
-        }
-        else if ( node instanceof SubstringNode )
-        {
-            return visitSubstringNode( ( SubstringNode ) node );
-        }
-        else
-        {
-            return null;
-        }
+    	try
+    	{
+	        // -------------------------------------------------------------------
+	        // Handle PresenceNodes
+	        // -------------------------------------------------------------------
+	
+	        if ( node instanceof PresenceNode )
+	        {
+	            return visitPresenceNode( ( PresenceNode ) node );
+	        }
+	
+	        // -------------------------------------------------------------------
+	        // Handle BranchNodes (AndNode, NotNode and OrNode)
+	        // -------------------------------------------------------------------
+	
+	        else if ( node instanceof BranchNode )
+	        {
+	            return visitBranchNode( ( BranchNode ) node );
+	        }
+	
+	        // -------------------------------------------------------------------
+	        // Handle SimpleNodes (ApproximateNode, EqualityNode, GreaterEqNode,
+	        // and LesserEqNode) 
+	        // -------------------------------------------------------------------
+	
+	        else if ( node instanceof SimpleNode )
+	        {
+	            return visitSimpleNode( ( SimpleNode ) node );
+	        }
+	        else if ( node instanceof ExtensibleNode )
+	        {
+	            return visitExtensibleNode( ( ExtensibleNode ) node );
+	        }
+	        else if ( node instanceof SubstringNode )
+	        {
+	            return visitSubstringNode( ( SubstringNode ) node );
+	        }
+	        else
+	        {
+	            return null;
+	        }
+    	}
+    	catch( NamingException e )
+    	{
+    		throw new RuntimeException( e );
+    	}
     }
 
 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=809675&r1=809674&r2=809675&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Mon Aug 31 17:58:19 2009
@@ -55,7 +55,7 @@
 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.apache.directory.shared.ldap.schema.registries.OidRegistry;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -88,7 +88,7 @@
     /** The association between attributeTypes and their normalizers */
     private Map<String, OidNormalizer> attrNormalizers; 
     
-    /** The globa attributeType registry */
+    /** The attributeType registry */
     private AttributeTypeRegistry attributeRegistry;
 
     /**
@@ -98,9 +98,8 @@
     {
         LOG.debug( "Initialiazing the NormalizationInterceptor" );
         
-        OidRegistry oidRegistry = directoryService.getRegistries().getOidRegistry();
         attributeRegistry = directoryService.getRegistries().getAttributeTypeRegistry();
-        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry,
oidRegistry );
+        NameComponentNormalizer ncn = new ConcreteNameComponentNormalizer( attributeRegistry
);
         normVisitor = new FilterNormalizingVisitor( ncn, directoryService.getRegistries()
);
         attrNormalizers = attributeRegistry.getNormalizerMapping();
     }



Mime
View raw message