directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r959698 - in /directory: apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/ apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/ shared/trunk/ldap-aci/src/main/antlr/ shared/trunk/...
Date Thu, 01 Jul 2010 15:40:31 GMT
Author: elecharny
Date: Thu Jul  1 15:40:31 2010
New Revision: 959698

URL: http://svn.apache.org/viewvc?rev=959698&view=rev
Log:
Moved some inner class out of the ProtectedItem class

Added:
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/MaxValueCountElem.java
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/RestrictedByElem.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g
    directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_MaxValueCountTest.java
    directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_RestrictedByTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java
Thu Jul  1 15:40:31 2010
@@ -27,7 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -104,9 +104,9 @@ public class MaxValueCountFilter impleme
 
     private boolean isRemovable( ProtectedItem.MaxValueCount mvc, String attrId, Entry entryView
) throws LdapException
     {
-        for ( Iterator<ProtectedItem.MaxValueCountItem> k = mvc.iterator(); k.hasNext();
)
+        for ( Iterator<MaxValueCountElem> k = mvc.iterator(); k.hasNext(); )
         {
-            MaxValueCountItem mvcItem = k.next();
+            MaxValueCountElem mvcItem = k.next();
             if ( attrId.equalsIgnoreCase( mvcItem.getAttributeType() ) )
             {
                 EntryAttribute attr = entryView.get( attrId );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java
Thu Jul  1 15:40:31 2010
@@ -30,13 +30,13 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllAttributeValuesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeTypeItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeValueItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.ClassesItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
 import org.apache.directory.shared.ldap.aci.protectedItem.RangeOfValuesItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.apache.directory.shared.ldap.aci.protectedItem.SelfValueItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -237,9 +237,9 @@ public class RelatedProtectedItemFilter 
                 }
 
                 ProtectedItem.MaxValueCount mvc = ( ProtectedItem.MaxValueCount ) item;
-                for ( Iterator<MaxValueCountItem> j = mvc.iterator(); j.hasNext();
)
+                for ( Iterator<MaxValueCountElem> j = mvc.iterator(); j.hasNext();
)
                 {
-                    MaxValueCountItem mvcItem = j.next();
+                    MaxValueCountElem mvcItem = j.next();
                     
                     if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName(
mvcItem.getAttributeType() ) ) )
                     {
@@ -264,9 +264,9 @@ public class RelatedProtectedItemFilter 
                 }
 
                 ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
-                for ( Iterator<RestrictedByItem> j = rb.iterator(); j.hasNext(); )
+                for ( Iterator<RestrictedByElem> j = rb.iterator(); j.hasNext(); )
                 {
-                    RestrictedByItem rbItem = j.next();
+                    RestrictedByElem rbItem = j.next();
                     if ( oid.equals( schemaManager.getAttributeTypeRegistry().getOidByName(
rbItem.getAttributeType() ) ) )
                     {
                         return true;

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java
Thu Jul  1 15:40:31 2010
@@ -27,7 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -99,9 +99,9 @@ public class RestrictedByFilter implemen
             {
                 ProtectedItem.RestrictedBy rb = ( ProtectedItem.RestrictedBy ) item;
             
-                for ( Iterator<RestrictedByItem> k = rb.iterator(); k.hasNext(); )
+                for ( Iterator<RestrictedByElem> k = rb.iterator(); k.hasNext(); )
                 {
-                    RestrictedByItem rbItem = k.next();
+                    RestrictedByElem rbItem = k.next();
                 
                     // TODO Fix DIRSEVER-832 
                     if ( attrId.equalsIgnoreCase( rbItem.getAttributeType() ) )

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
Thu Jul  1 15:40:31 2010
@@ -35,7 +35,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.UserClass;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -70,8 +70,8 @@ public class MaxValueCountFilterTest
 
     static
     {
-        Set<MaxValueCountItem> mvcItems = new HashSet<MaxValueCountItem>();
-        mvcItems.add( new MaxValueCountItem( "cn", 2 ) );
+        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
+        mvcItems.add( new MaxValueCountElem( "cn", 2 ) );
         PROTECTED_ITEMS.add( new ProtectedItem.MaxValueCount( mvcItems ) );
     }
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
Thu Jul  1 15:40:31 2010
@@ -38,11 +38,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.UserClass;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllAttributeValuesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeTypeItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AttributeValueItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.apache.directory.shared.ldap.aci.protectedItem.SelfValueItem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
@@ -264,8 +264,8 @@ public class RelatedProtectedItemFilterT
     @Test 
     public void testMaxValueCount() throws Exception
     {
-        Set<MaxValueCountItem> mvcItems = new HashSet<MaxValueCountItem>();
-        mvcItems.add( new MaxValueCountItem( "cn", 3 ) );
+        Set<MaxValueCountElem> mvcItems = new HashSet<MaxValueCountElem>();
+        mvcItems.add( new MaxValueCountElem( "cn", 3 ) );
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.MaxValueCount( mvcItems
) );
 
         // Test wrong scope
@@ -308,8 +308,8 @@ public class RelatedProtectedItemFilterT
     @Test 
     public void testRestrictedBy() throws Exception
     {
-        Set<RestrictedByItem> rbItems = new HashSet<RestrictedByItem>();
-        rbItems.add( new RestrictedByItem( "cn", "sn" ) );
+        Set<RestrictedByElem> rbItems = new HashSet<RestrictedByElem>();
+        rbItems.add( new RestrictedByElem( "cn", "sn" ) );
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.RestrictedBy( rbItems
) );
 
         // Test wrong scope

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
Thu Jul  1 15:40:31 2010
@@ -35,11 +35,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
 import org.apache.directory.shared.ldap.aci.UserClass;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
-import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.loader.ldif.JarLdifSchemaLoader;
@@ -69,8 +69,8 @@ public class RestrictedByFilterTest
 
     static
     {
-        Set<RestrictedByItem> mvcItems = new HashSet<RestrictedByItem>();
-        mvcItems.add( new RestrictedByItem( "sn", "cn" ) );
+        Set<RestrictedByElem> mvcItems = new HashSet<RestrictedByElem>();
+        mvcItems.add( new RestrictedByElem( "sn", "cn" ) );
         PROTECTED_ITEMS.add( new ProtectedItem.RestrictedBy( mvcItems ) );
     }
 

Modified: directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g (original)
+++ directory/shared/trunk/ldap-aci/src/main/antlr/ACIItem.g Thu Jul  1 15:40:31 2010
@@ -65,6 +65,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.aci.protectedItem.ClassesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.EntryItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.RangeOfValuesItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -550,8 +552,8 @@ rangeOfValues
 maxValueCount
 {
     log.debug( "entered maxValueCount()" );
-    ProtectedItem.MaxValueCountItem maxValueCount = null;
-    Set<ProtectedItem.MaxValueCountItem> maxValueCountSet = new HashSet<ProtectedItem.MaxValueCountItem>();
+    MaxValueCountElem maxValueCount = null;
+    Set<MaxValueCountElem> maxValueCountSet = new HashSet<MaxValueCountElem>();
 }
     :
     ID_maxValueCount ( SP )+
@@ -571,7 +573,7 @@ maxValueCount
     }
     ;
 
-aMaxValueCount returns [ ProtectedItem.MaxValueCountItem maxValueCount ]
+aMaxValueCount returns [ MaxValueCountElem maxValueCount ]
 {
     log.debug( "entered aMaxValueCount()" );
     maxValueCount = null;
@@ -591,7 +593,7 @@ aMaxValueCount returns [ ProtectedItem.M
         )
     ( SP )* CLOSE_CURLY
     {
-        maxValueCount = new ProtectedItem.MaxValueCountItem( oid, token2Integer( token )
);
+        maxValueCount = new MaxValueCountElem( oid, token2Integer( token ) );
     }
     ;
 
@@ -612,8 +614,8 @@ maxImmSub
 restrictedBy
 {
     log.debug( "entered restrictedBy()" );
-    ProtectedItem.RestrictedByItem restrictedValue = null;
-    Set<ProtectedItem.RestrictedByItem> restrictedBy = new HashSet<ProtectedItem.RestrictedByItem>();
+    RestrictedByElem restrictedValue = null;
+    Set<RestrictedByElem> restrictedBy = new HashSet<RestrictedByElem>();
 }
     :
     ID_restrictedBy ( SP )+
@@ -633,7 +635,7 @@ restrictedBy
     }
     ;
 
-restrictedValue returns [ ProtectedItem.RestrictedByItem restrictedValue ]
+restrictedValue returns [ RestrictedByElem restrictedValue ]
 {
     log.debug( "entered restrictedValue()" );
     String typeOid = null;
@@ -651,7 +653,7 @@ restrictedValue returns [ ProtectedItem.
         )
     ( SP )* CLOSE_CURLY
     {
-        restrictedValue = new ProtectedItem.RestrictedByItem( typeOid, valuesInOid );
+        restrictedValue = new RestrictedByElem( typeOid, valuesInOid );
     }
     ;
 

Modified: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
(original)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/ProtectedItem.java
Thu Jul  1 15:40:31 2010
@@ -27,6 +27,8 @@ import java.util.Set;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllUserAttributeTypesAndValuesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.AllUserAttributeTypesItem;
 import org.apache.directory.shared.ldap.aci.protectedItem.EntryItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 
 
 /**
@@ -80,25 +82,25 @@ public abstract class ProtectedItem
      */
     public static class MaxValueCount extends ProtectedItem
     {
-        private final Set<ProtectedItem.MaxValueCountItem> items;
+        private final Set<MaxValueCountElem> items;
 
 
         /**
          * Creates a new instance.
          * 
          * @param items
-         *            the collection of {@link MaxValueCountItem}s.
+         *            the collection of {@link MaxValueCountElem}s.
          */
-        public MaxValueCount( Set<MaxValueCountItem> items )
+        public MaxValueCount( Set<MaxValueCountElem> items )
         {
             this.items = Collections.unmodifiableSet( items );
         }
 
 
         /**
-         * Returns an iterator of all {@link MaxValueCountItem}s.
+         * Returns an iterator of all {@link MaxValueCountElem}s.
          */
-        public Iterator<MaxValueCountItem> iterator()
+        public Iterator<MaxValueCountElem> iterator()
         {
             return items.iterator();
         }
@@ -150,7 +152,7 @@ public abstract class ProtectedItem
 
             boolean isFirst = true;
 
-            for ( MaxValueCountItem item : items )
+            for ( MaxValueCountElem item : items )
             {
                 if ( isFirst )
                 {
@@ -258,24 +260,24 @@ public abstract class ProtectedItem
      */
     public static class RestrictedBy extends ProtectedItem
     {
-        private final Set<RestrictedByItem> items;
+        private final Set<RestrictedByElem> items;
 
 
         /**
          * Creates a new instance.
          * 
-         * @param items the collection of {@link RestrictedByItem}s.
+         * @param items the collection of {@link RestrictedByElem}s.
          */
-        public RestrictedBy( Set<RestrictedByItem> items )
+        public RestrictedBy( Set<RestrictedByElem> items )
         {
             this.items = Collections.unmodifiableSet( items );
         }
 
 
         /**
-         * Returns an iterator of all {@link RestrictedByItem}s.
+         * Returns an iterator of all {@link RestrictedByElem}s.
          */
-        public Iterator<RestrictedByItem> iterator()
+        public Iterator<RestrictedByElem> iterator()
         {
             return items.iterator();
         }
@@ -327,7 +329,7 @@ public abstract class ProtectedItem
 
             boolean isFirst = true;
 
-            for ( RestrictedByItem item : items )
+            for ( RestrictedByElem item : items )
             {
                 if ( isFirst )
                 {
@@ -346,105 +348,4 @@ public abstract class ProtectedItem
             return buf.toString();
         }
     }
-
-    /**
-     * An element of {@link MaxValueCount}.
-     */
-    public static class MaxValueCountItem
-    {
-        private String attributeType;
-
-        private int maxCount;
-
-
-        /**
-         * Creates a new instance.
-         * 
-         * @param attributeType
-         *            the attribute ID to limit the maximum count
-         * @param maxCount
-         *            the maximum count of the attribute allowed
-         */
-
-        public MaxValueCountItem( String attributeType, int maxCount )
-        {
-            this.attributeType = attributeType;
-            this.maxCount = maxCount;
-        }
-
-
-        /**
-         * Returns the attribute ID to limit the maximum count.
-         */
-        public String getAttributeType()
-        {
-            return attributeType;
-        }
-
-
-        /**
-         * Returns the maximum count of the attribute allowed.
-         */
-        public int getMaxCount()
-        {
-            return maxCount;
-        }
-
-
-        public String toString()
-        {
-            return "{ type " + attributeType + ", maxCount " + maxCount + " }";
-        }
-    }
-
-    /**
-     * An element of {@link RestrictedBy}.
-     */
-    public static class RestrictedByItem
-    {
-        private String attributeType;
-
-        private String valuesIn;
-
-
-        /**
-         * Creates a new instance.
-         * 
-         * @param attributeType
-         *            the attribute type to restrict
-         * @param valuesIn
-         *            the attribute type only whose values are allowed in
-         *            <tt>attributeType</tt>.
-         */
-        public RestrictedByItem( String attributeType, String valuesIn )
-        {
-            this.attributeType = attributeType;
-            this.valuesIn = valuesIn;
-        }
-
-
-        /**
-         * Returns the attribute type to restrict.
-         */
-        public String getAttributeType()
-        {
-            return attributeType;
-        }
-
-
-        /**
-         * Returns the attribute type only whose values are allowed in
-         * <tt>attributeType</tt>.
-         */
-        public String getValuesIn()
-        {
-            return valuesIn;
-        }
-
-
-        public String toString()
-        {
-            return "{ type " + attributeType + ", valuesIn " + valuesIn + " }";
-        }
-    }
 }

Added: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/MaxValueCountElem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/MaxValueCountElem.java?rev=959698&view=auto
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/MaxValueCountElem.java
(added)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/MaxValueCountElem.java
Thu Jul  1 15:40:31 2010
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.aci.protectedItem;
+
+import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCount;
+
+/**
+ * An element of {@link MaxValueCount}.
+ */
+public class MaxValueCountElem
+{
+    /** The targetted AttributeType */
+    private String attributeType;
+
+    /** The maximum number of accepted values for this attributeType */
+    private int maxCount;
+
+
+    /**
+     * Creates a new instance.
+     * 
+     * @param attributeType the attribute ID to limit the maximum count
+     * @param maxCount the maximum count of the attribute allowed
+     */
+
+    public MaxValueCountElem( String attributeType, int maxCount )
+    {
+        this.attributeType = attributeType;
+        this.maxCount = maxCount;
+    }
+
+
+    /**
+     * Returns the attribute ID to limit the maximum count.
+     */
+    public String getAttributeType()
+    {
+        return attributeType;
+    }
+
+
+    /**
+     * Returns the maximum count of the attribute allowed.
+     */
+    public int getMaxCount()
+    {
+        return maxCount;
+    }
+
+
+    public String toString()
+    {
+        return "{ type " + attributeType + ", maxCount " + maxCount + " }";
+    }
+}

Added: directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/RestrictedByElem.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/RestrictedByElem.java?rev=959698&view=auto
==============================================================================
--- directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/RestrictedByElem.java
(added)
+++ directory/shared/trunk/ldap-aci/src/main/java/org/apache/directory/shared/ldap/aci/protectedItem/RestrictedByElem.java
Thu Jul  1 15:40:31 2010
@@ -0,0 +1,72 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.aci.protectedItem;
+
+import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedBy;
+
+/**
+ * An element of {@link RestrictedBy}.
+ */
+public class RestrictedByElem
+{
+    // The AttributeType on which the restriction is applied */
+    private String attributeType;
+
+    /** The list of allowed values */
+    private String valuesIn;
+
+
+    /**
+     * Creates a new instance.
+     * 
+     * @param attributeType the attribute type to restrict
+     * @param valuesIn the attribute type only whose values are allowed in <tt>attributeType</tt>.
+     */
+    public RestrictedByElem( String attributeType, String valuesIn )
+    {
+        this.attributeType = attributeType;
+        this.valuesIn = valuesIn;
+    }
+
+
+    /**
+     * Returns the attribute type to restrict.
+     */
+    public String getAttributeType()
+    {
+        return attributeType;
+    }
+
+
+    /**
+     * Returns the attribute type only whose values are allowed in
+     * <tt>attributeType</tt>.
+     */
+    public String getValuesIn()
+    {
+        return valuesIn;
+    }
+
+
+    public String toString()
+    {
+        return "{ type " + attributeType + ", valuesIn " + valuesIn + " }";
+    }
+}

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_MaxValueCountTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_MaxValueCountTest.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_MaxValueCountTest.java
(original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_MaxValueCountTest.java
Thu Jul  1 15:40:31 2010
@@ -29,7 +29,7 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCount;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.MaxValueCountItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.MaxValueCountElem;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -57,20 +57,20 @@ public class ProtectedItem_MaxValueCount
     public void initNames() throws Exception
     {
 
-        MaxValueCountItem mvciA = new MaxValueCountItem( "aa", 1 );
-        MaxValueCountItem mvciB = new MaxValueCountItem( "bb", 2 );
-        MaxValueCountItem mvciC = new MaxValueCountItem( "cc", 3 );
-        MaxValueCountItem mvciD = new MaxValueCountItem( "dd", 4 );
+        MaxValueCountElem mvciA = new MaxValueCountElem( "aa", 1 );
+        MaxValueCountElem mvciB = new MaxValueCountElem( "bb", 2 );
+        MaxValueCountElem mvciC = new MaxValueCountElem( "cc", 3 );
+        MaxValueCountElem mvciD = new MaxValueCountElem( "dd", 4 );
 
-        Set<MaxValueCountItem> colA = new HashSet<MaxValueCountItem>();
+        Set<MaxValueCountElem> colA = new HashSet<MaxValueCountElem>();
         colA.add( mvciA );
         colA.add( mvciB );
         colA.add( mvciC );
-        Set<MaxValueCountItem> colB = new HashSet<MaxValueCountItem>();
+        Set<MaxValueCountElem> colB = new HashSet<MaxValueCountElem>();
         colB.add( mvciA );
         colB.add( mvciB );
         colB.add( mvciC );
-        Set<MaxValueCountItem> colC = new HashSet<MaxValueCountItem>();
+        Set<MaxValueCountElem> colC = new HashSet<MaxValueCountElem>();
         colC.add( mvciB );
         colC.add( mvciC );
         colC.add( mvciD );

Modified: directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_RestrictedByTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_RestrictedByTest.java?rev=959698&r1=959697&r2=959698&view=diff
==============================================================================
--- directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_RestrictedByTest.java
(original)
+++ directory/shared/trunk/ldap-aci/src/test/java/org/apache/directory/shared/ldap/aci/ProtectedItem_RestrictedByTest.java
Thu Jul  1 15:40:31 2010
@@ -29,7 +29,7 @@ import java.util.Set;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedBy;
-import org.apache.directory.shared.ldap.aci.ProtectedItem.RestrictedByItem;
+import org.apache.directory.shared.ldap.aci.protectedItem.RestrictedByElem;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -56,20 +56,20 @@ public class ProtectedItem_RestrictedByT
     @Before
     public void initNames() throws Exception
     {
-        RestrictedByItem rbiA = new RestrictedByItem( "aa", "aa" );
-        RestrictedByItem rbiB = new RestrictedByItem( "bb", "bb" );
-        RestrictedByItem rbiC = new RestrictedByItem( "cc", "cc" );
-        RestrictedByItem rbiD = new RestrictedByItem( "dd", "dd" );
+        RestrictedByElem rbiA = new RestrictedByElem( "aa", "aa" );
+        RestrictedByElem rbiB = new RestrictedByElem( "bb", "bb" );
+        RestrictedByElem rbiC = new RestrictedByElem( "cc", "cc" );
+        RestrictedByElem rbiD = new RestrictedByElem( "dd", "dd" );
 
-        Set<RestrictedByItem> colA = new HashSet<RestrictedByItem>();
+        Set<RestrictedByElem> colA = new HashSet<RestrictedByElem>();
         colA.add( rbiA );
         colA.add( rbiB );
         colA.add( rbiC );
-        Set<RestrictedByItem> colB = new HashSet<RestrictedByItem>();
+        Set<RestrictedByElem> colB = new HashSet<RestrictedByElem>();
         colB.add( rbiA );
         colB.add( rbiB );
         colB.add( rbiC );
-        Set<RestrictedByItem> colC = new HashSet<RestrictedByItem>();
+        Set<RestrictedByElem> colC = new HashSet<RestrictedByElem>();
         colC.add( rbiB );
         colC.add( rbiC );
         colC.add( rbiD );



Mime
View raw message