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

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


        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 );

        try
        {
            entry.put( (String)null, strValue1 );
            fail();
View Full Code Here


        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 );

        EntryAttribute attrPWD = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );

        entry.put( attrPWD );
        assertTrue( entry.remove( atCN, strNullValue ) );
View Full Code Here

        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 );

        EntryAttribute attrPWD = new DefaultServerAttribute( atCN, "test1", (String)null, "test2" );

        entry.put( attrPWD );
        assertTrue( entry.remove( "CN", strNullValue ) );
View Full Code Here

        byte[] b2 = StringTools.getBytesUtf8( "test2" );

        Value<String> test1 = new StringValue( atCN, "test1" );
        Value<String> test2 = new StringValue( atCN, "test2" );
       
        Value<byte[]> testB1 = new BinaryValue( atPassword, b1 );
        Value<byte[]> testB2 = new BinaryValue( atPassword, b2 );
       
        // test a removal of an non existing attribute
        List<EntryAttribute> removed = entry.removeAttributes( atCN );
        assertNull( removed );
       
View Full Code Here

       
        Value<String> strValueTop = new StringValue( "top" );
        Value<String> strValuePerson = new StringValue( "person" );
        Value<String> strNullValue = new StringValue( (String)null);

        Value<byte[]> binValue1 = new BinaryValue( BYTES1 );
        Value<byte[]> binValue2 = new BinaryValue( BYTES2 );
        Value<byte[]> binNullValue = new BinaryValue( (byte[])null );
       
        entry.put( "ObjectClass", atOC, strValueTop, strValuePerson, strNullValue );
        entry.put( "UserPassword", atPwd, binValue1, binValue2, binNullValue );

        String expected =
View Full Code Here

                Object value = attr.get();
                SimpleNode<?> node;

                if ( value instanceof byte[] )
                {
                    node = new EqualityNode<byte[]>( attr.getID(), new BinaryValue( ( byte[] ) value ) );
                }
                else
                {
                    node = new EqualityNode<String>( attr.getID(), new StringValue( ( String ) value ) );
                }
View Full Code Here

        }
        else
        {
            if ( value instanceof String )
            {
                val = new BinaryValue( attributeType, StringTools.getBytesUtf8( (String)value ) );
            }
            else if ( value instanceof byte[] )
            {
                val = new BinaryValue( attributeType, (byte[])value );
            }
            else
            {
                throw new NamingException( I18n.err( I18n.ERR_309, oid ) );
            }
View Full Code Here

        {
            if ( value instanceof String )
            {
                try
                {
                    return new BinaryValue( ( ( String ) value ).getBytes( "UTF-8" ) );
                }
                catch ( UnsupportedEncodingException uee )
                {
                    String message = I18n.err( I18n.ERR_48 );
                    LOG.error( message );
View Full Code Here

            {
                List<Value<?>> binaries = new ArrayList<Value<?>>();

                for ( Value<?> value : attribute )
                {
                    binaries.add( new BinaryValue( attribute.getAttributeType(),
                        value.getBytes() ) );
                }

                attribute.clear();
                attribute.put( binaries );
View Full Code Here

        }
        else
        {
            if ( value instanceof String )
            {
                val = new BinaryValue( attributeType, StringTools.getBytesUtf8( (String)value ) );
            }
            else if ( value instanceof byte[] )
            {
                val = new BinaryValue( attributeType, (byte[])value );
            }
            else
            {
                throw new LdapException( I18n.err( I18n.ERR_309, oid ) );
            }
View Full Code Here

TOP

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

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.