Package org.apache.directory.shared.ldap.entry

Examples of org.apache.directory.shared.ldap.entry.StringValue


        Set<ServerEntry> set = new HashSet<ServerEntry>();
        BranchNode filter = new AndNode();

        filter.addNode( new EqualityNode<String>( OBJECTCLASS_OID,
            new StringValue( MetaSchemaConstants.META_SCHEMA_OC.toLowerCase() ) ) );
        filter.addNode( new EqualityNode<String>( M_DEPENDENCIES_OID,
            new StringValue( schemaName.toLowerCase() ) ) );

        SearchControls searchControls = new SearchControls();
        searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
        EntryFilteringCursor cursor = null;
View Full Code Here


    public Set<ServerEntry> listEnabledSchemaDependents( String schemaName ) throws Exception
    {
        Set<ServerEntry> set = new HashSet<ServerEntry>();
        BranchNode filter = new AndNode();

        filter.addNode( new EqualityNode<String>( OBJECTCLASS_OID, new StringValue(
            MetaSchemaConstants.META_SCHEMA_OC.toLowerCase() ) ) );
        filter.addNode( new EqualityNode<String>( M_DEPENDENCIES_OID, new StringValue(
            schemaName.toLowerCase() ) ) );

        SearchControls searchControls = new SearchControls();
        searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
        EntryFilteringCursor cursor = null;
View Full Code Here

        Set<ServerEntry> set = new HashSet<ServerEntry>();
        BranchNode filter = new AndNode();

        BranchNode or = new OrNode();
        or.addNode( new EqualityNode<String>( OBJECTCLASS_OID, new StringValue( MetaSchemaConstants.META_NAME_FORM_OC
            .toLowerCase() ) ) );
        or.addNode( new EqualityNode<String>( OBJECTCLASS_OID, new StringValue( MetaSchemaConstants.META_OBJECT_CLASS_OC
            .toLowerCase() ) ) );
        or.addNode( new EqualityNode<String>( OBJECTCLASS_OID, new StringValue(
            MetaSchemaConstants.META_DIT_CONTENT_RULE_OC.toLowerCase() ) ) );
        filter.addNode( or );

        or = new OrNode();
        or.addNode( new EqualityNode<String>( M_AUX_OID, new StringValue( oc.getOid() ) ) );
        or.addNode( new EqualityNode<String>( M_OC_OID, new StringValue( oc.getOid() ) ) );
        or.addNode( new EqualityNode<String>( M_SUP_OBJECT_CLASS_OID, new StringValue( oc.getOid() ) ) );
        filter.addNode( or );

        SearchControls searchControls = new SearchControls();
        searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );
        EntryFilteringCursor cursor = null;
View Full Code Here

            null, null, "cn", null, null, null, null ).size() );

        tuples = getTuples( new ProtectedItem.AttributeValue( convert( attributes )  ) );

        assertEquals( 1, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
            null, null, null, "cn", new StringValue( "valueA" ), null, null, null ).size() );

        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
            null, null, null, "cn", new StringValue( "valueB" ), null, null, null ).size() );

        tuples = getTuples( new ProtectedItem.AttributeValue( convert( attributes )  ) );

        assertEquals( 0, filterA.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
            null, null, null, "sn", new StringValue( "valueA" ), null, null, null ).size() );
    }
View Full Code Here

        RestrictedByFilter filter = new RestrictedByFilter();
        Collection<ACITuple> tuples = new ArrayList<ACITuple>();
        tuples.add( new ACITuple( UC_EMPTY_COLLECTION, AuthenticationLevel.NONE, PROTECTED_ITEMS, MO_EMPTY_SET, true, 0 ) );

        assertEquals( 1, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
            null, null, "sn", new StringValue( "1" ), ENTRY, null, null ).size() );

        assertEquals( 1, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
            null, null, "sn", new StringValue( "2" ), ENTRY, null, null ).size() );

        assertEquals( 0, filter.filter( null, tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, null, null,
            null, null, "sn", new StringValue( "3" ), ENTRY, null, null ).size() );
    }
View Full Code Here

     */
    @Test
    public void testAddStringValueArray() throws Exception
    {
        Entry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
        Value<String> value = new StringValue( atCN, (String)null );
       
        entry.add( "cn", value );
        assertEquals( 1, entry.size() );
        EntryAttribute attributeCN = entry.get( "cn" );
        assertEquals( 1, attributeCN.size() );
        assertNotNull( attributeCN.get() );
        assertNull( attributeCN.get().get() );
        
        Value<String> value1 = new StringValue( atCN, "test1" );
        Value<String> value2 = new StringValue( atCN, "test2" );
        Value<String> value3 = new StringValue( atCN, "test1" );

        entry.add( "sn", value1, value2, value3 );
        assertEquals( 2, entry.size() );
        EntryAttribute attributeSN = entry.get( "sn" );
        assertEquals( 2, attributeSN.size() );
View Full Code Here

    @Test
    public void testAddAttributeTypeValueArray() throws Exception
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        Value<String> strValue1 = new StringValue( atCN, "test1" );
        Value<String> strValue2 = new StringValue( atCN, "test2" );
        Value<String> strValue3 = new StringValue( atCN, "test3" );
        Value<String> strNullValue = new StringValue( atCN, null);

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );
        Value<byte[]> binValue2 = new BinaryValue( atPwd, BYTES2 );
        Value<byte[]> binValue3 = new BinaryValue( atPwd, BYTES3 );
       
View Full Code Here

    @Test
    public void testAddStringAttributeTypeValueArray() throws Exception
    {
        ServerEntry entry = new DefaultServerEntry( schemaManager, EXAMPLE_DN );
       
        Value<String> strValue1 = new StringValue( atCN, "test1" );
        Value<String> strValue2 = new StringValue( atCN, "test2" );
        Value<String> strValue3 = new StringValue( atCN, "test3" );
        Value<String> strNullValue = new StringValue( atCN, null);

        Value<byte[]> binValue1 = new BinaryValue( atPwd, BYTES1 );
        Value<byte[]> binValue2 = new BinaryValue( atPwd, BYTES2 );
        Value<byte[]> binValue3 = new BinaryValue( atPwd, BYTES3 );
       
View Full Code Here

       
        byte[] b1 = StringTools.getBytesUtf8( "test1" );
        byte[] b2 = StringTools.getBytesUtf8( "test2" );
        byte[] b3 = StringTools.getBytesUtf8( "test3" );

        Value<String> test1 = new StringValue( atCN, "test1" );
        Value<String> test2 = new StringValue( atCN, "test2" );
        Value<String> test3 = new StringValue( atCN, "test3" );
       
        Value<byte[]> testB1 = new BinaryValue( atPassword, b1 );
        Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );
        Value<byte[]> testB3 = new BinaryValue( atPassword, b3 );
       
View Full Code Here

       
        byte[] b1 = StringTools.getBytesUtf8( "test1" );
        byte[] b2 = StringTools.getBytesUtf8( "test2" );
        byte[] b3 = StringTools.getBytesUtf8( "test3" );

        Value<String> test1 = new StringValue( atCN, "test1" );
        Value<String> test2 = new StringValue( atCN, "test2" );
        Value<String> test3 = new StringValue( atCN, "test3" );
       
        Value<byte[]> testB1 = new BinaryValue( atPassword, b1 );
        Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );
        Value<byte[]> testB3 = new BinaryValue( atPassword, b3 );
       
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.entry.StringValue

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.