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

Examples of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute


     *            the id for the attribute
     * @return the AttributeImpl assembled for testing
     */
    private EntryAttribute getAttribute( String id )
    {
        EntryAttribute attr = new DefaultEntryAttribute( id );
        attr.add( "value0" );
        attr.add( "value1" );
        attr.add( "value2" );
        return attr;
    }
View Full Code Here


   
   
    @Test
    public void testEntryAttributeNoStringValueSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( cn );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here

   
   
    @Test
    public void testEntryAttributeOneStringValueSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( "CommonName", cn, "test" );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here

   
   
    @Test
    public void testEntryAttributeManyStringValuesSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( "CN", cn, "test1", "test2", "test3" );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here


    @Test
    public void testEntryAttributeNoBinaryValueSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( userCertificate );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here

   
   
    @Test
    public void testEntryAttributeOneBinaryValueSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( userCertificate, data1 );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here

   
   
    @Test
    public void testEntryAttributeManyBinaryValuesSerialization() throws IOException
    {
        EntryAttribute attribute1 = new DefaultEntryAttribute( "UserCertificate", userCertificate, data1, data2, data3 );
       
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream( baos );

        EntryAttributeSerializer.serialize( attribute1, out );
View Full Code Here

     *
     * @param type The attribute's type
     */
    public void addAttribute( String type ) throws LdapException
    {
        currentAttribute = new DefaultEntryAttribute( type );

        getDecorated().getEntry().put( currentAttribute );
    }
View Full Code Here

            EntryAttribute attr;

            if ( value == null )
            {
                value = new StringValue( ( String ) null );
                attr = new DefaultEntryAttribute( id, ( Value<?> ) value );
            }
            else
            {
                attr = ( EntryAttribute ) value;
            }
View Full Code Here

     */
    public EntryAttribute get( String attributeId )
    {
        if ( "dn".equalsIgnoreCase( attributeId ) )
        {
            return new DefaultEntryAttribute( "dn", entry.getDn().getName() );
        }

        return entry.get( attributeId );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute

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.