Package org.apache.directory.shared.ldap.aci.protectedItem

Examples of org.apache.directory.shared.ldap.aci.protectedItem.AttributeValueItem


        Set<EntryAttribute> colC = new HashSet<EntryAttribute>();
        colC.add( attrB );
        colC.add( attrC );
        colC.add( attrD );

        attributeValueA = new AttributeValueItem( colA );
        attributeValueACopy = new AttributeValueItem( colA );
        attributeValueB = new AttributeValueItem( colB );
        attributeValueC = new AttributeValueItem( colC );
    }
View Full Code Here


                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                AttributeValueItem av = ( AttributeValueItem ) item;
               
                for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
                {
                    Attribute entryAttribute = j.next();
                   
                    AttributeType attr =  entryAttribute.getAttributeType();
                    String attrOid = null;
View Full Code Here

    @Test
    public void testAttributeValue() throws Exception
    {
        Set<Attribute> attributes = new HashSet<Attribute>();
        attributes.add( new DefaultAttribute( "cn", CN_AT, "valueA" ) );
        Collection<ACITuple> tuples = getTuples( new AttributeValueItem( attributes ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
        aciContext.setAttrValue( new StringValue( "valueA" ) );

        assertEquals( 1, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
        aciContext.setAttrValue( new StringValue( "valueB" ) );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() );

        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( SN_AT );
View Full Code Here

        Collection<ProtectedItem> allUserAttributeTypesAndValues = new ArrayList<ProtectedItem>();

        attributeType.add( new AttributeTypeItem( EMPTY_STRING_COLLECTION ) );
        allAttributeValues.add( new AllAttributeValuesItem( EMPTY_STRING_COLLECTION ) );
        selfValue.add( new SelfValueItem( EMPTY_STRING_COLLECTION ) );
        attributeValue.add( new AttributeValueItem( EMPTY_ATTRIBUTE_COLLECTION ) );
        rangeOfValues.add( new RangeOfValuesItem( new PresenceNode( ( String ) null ) ) );
        allUserAttributeTypes.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
        allUserAttributeTypesAndValues.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );

        ACITuple attributeTypeTuple = new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE,
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                AttributeValueItem av = ( AttributeValueItem ) item;

                for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
                {
                    Attribute entryAttribute = j.next();

                    AttributeType attr = entryAttribute.getAttributeType();
                    String attrOid = null;
View Full Code Here

        Set<Attribute> colC = new HashSet<Attribute>();
        colC.add( attrB );
        colC.add( attrC );
        colC.add( attrD );

        attributeValueA = new AttributeValueItem( colA );
        attributeValueACopy = new AttributeValueItem( colA );
        attributeValueB = new AttributeValueItem( colB );
        attributeValueC = new AttributeValueItem( colC );
    }
View Full Code Here

    @Test
    public void testAttributeValue() throws Exception
    {
        Set<Attribute> attributes = new HashSet<Attribute>();
        attributes.add( new DefaultAttribute( "cn", CN_AT, "valueA" ) );
        Collection<ACITuple> tuples = getTuples( new AttributeValueItem( attributes ) );

        // Test wrong scope
        AciContext aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ENTRY, null ).size() );
        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE, null ).size() );

        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
        aciContext.setAttrValue( new StringValue( "valueA" ) );

        assertEquals( 1, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( CN_AT );
        aciContext.setAttrValue( new StringValue( "valueB" ) );

        assertEquals( 0, filterA.filter( aciContext, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null ).size() );

        tuples = getTuples( new AttributeValueItem( attributes ) );

        aciContext = new AciContext( null, null );
        aciContext.setAciTuples( tuples );
        aciContext.setUserDn( USER_NAME );
        aciContext.setAttributeType( SN_AT );
View Full Code Here

        Collection<ProtectedItem> allUserAttributeTypesAndValues = new ArrayList<ProtectedItem>();

        attributeType.add( new AttributeTypeItem( EMPTY_STRING_COLLECTION ) );
        allAttributeValues.add( new AllAttributeValuesItem( EMPTY_STRING_COLLECTION ) );
        selfValue.add( new SelfValueItem( EMPTY_STRING_COLLECTION ) );
        attributeValue.add( new AttributeValueItem( EMPTY_ATTRIBUTE_COLLECTION ) );
        rangeOfValues.add( new RangeOfValuesItem( new PresenceNode( (String)null ) ) );
        allUserAttributeTypes.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES );
        allUserAttributeTypesAndValues.add( ProtectedItem.ALL_USER_ATTRIBUTE_TYPES_AND_VALUES );

        ACITuple attributeTypeTuple = new ACITuple( EMPTY_USER_CLASS_COLLECTION, AuthenticationLevel.NONE, attributeType,
View Full Code Here

                if ( scope != OperationScope.ATTRIBUTE_TYPE_AND_VALUE )
                {
                    continue;
                }

                AttributeValueItem av = ( AttributeValueItem ) item;
               
                for ( Iterator<Attribute> j = av.iterator(); j.hasNext(); )
                {
                    Attribute entryAttribute = j.next();
                   
                    AttributeType attr =  entryAttribute.getAttributeType();
                    String attrOid = null;
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.aci.protectedItem.AttributeValueItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.