Package javax.naming.directory

Examples of javax.naming.directory.Attribute


            for ( int ii = 0; ii < modSpecs.length; ii++ )
            {
                LdifModSpecTypeLine modSpecType = modSpecs[ii].getModSpecType();
                LdifAttrValLine[] attrVals = modSpecs[ii].getAttrVals();

                Attribute attribute = new BasicAttribute( modSpecType.getUnfoldedAttributeDescription() );
                for ( int x = 0; x < attrVals.length; x++ )
                {
                    attribute.add( attrVals[x].getValueAsObject() );
                }

                if ( modSpecType.isAdd() )
                {
                    mis[ii] = new ModificationItem( DirContext.ADD_ATTRIBUTE, attribute );
View Full Code Here


            LdifContentRecord record = LdifContentRecord.create( dn.getUpName() );

            NamingEnumeration<? extends Attribute> attributeEnumeration = sr.getAttributes().getAll();
            while ( attributeEnumeration.hasMore() )
            {
                Attribute attribute = attributeEnumeration.next();
                String attributeName = attribute.getID();
                NamingEnumeration<?> valueEnumeration = attribute.getAll();
                while ( valueEnumeration.hasMore() )
                {
                    Object o = valueEnumeration.next();
                    if ( o instanceof String )
                    {
View Full Code Here

            Attributes contextEntry = partition.getContextEntry();
            StringBuffer sb = new StringBuffer();
            NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
            while ( ne.hasMoreElements() )
            {
                Attribute attribute = ( Attribute ) ne.nextElement();
                try
                {
                    NamingEnumeration<?> values = attribute.getAll();
                    while ( values.hasMoreElements() )
                    {
                        sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
                    }
                }
                catch ( NamingException e )
                {
                }
View Full Code Here

        // Looping on attributes
        NamingEnumeration<? extends Attribute> ne = contextEntry.getAll();
        while ( ne.hasMoreElements() )
        {
            Attribute attribute = ( Attribute ) ne.nextElement();
            try
            {
                NamingEnumeration<?> values = attribute.getAll();
                while ( values.hasMoreElements() )
                {
                    sb.append( attribute.getID() + ": " + values.nextElement() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
                }
            }
            catch ( NamingException e )
            {
            }
View Full Code Here

                SearchResult sr = enumeration.next();
                NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
                while ( attributes.hasMore() )
                {
                    Attribute attribute = attributes.next();
                    if ( attribute.getID().equalsIgnoreCase( SchemaConstants.MODIFY_TIMESTAMP_AT ) )
                    {
                        modifyTimestamp = ( String ) attribute.get();
                    }
                    if ( attribute.getID().equalsIgnoreCase( SchemaConstants.CREATE_TIMESTAMP_AT ) )
                    {
                        createTimestamp = ( String ) attribute.get();
                    }
                }

                String schemaTimestamp = modifyTimestamp != null ? modifyTimestamp : createTimestamp;
                String cacheTimestamp = schema.getModifyTimestamp() != null ? schema.getModifyTimestamp() : schema
View Full Code Here

            {
                SearchResult sr = enumeration.next();
                NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
                while ( attributes.hasMore() )
                {
                    Attribute attribute = attributes.next();
                    if ( attribute.getID().equalsIgnoreCase( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ) )
                    {
                        String value = ( String ) attribute.get();
                        if ( LdapDN.isValid( value ) )
                        {
                            LdapDN dn = new LdapDN( value );
                            return dn;
                        }
View Full Code Here

                while ( answer.hasMore() )
                {
                    SearchResult searchResult = ( SearchResult ) answer.next();

                    // Getting the 'cn' Attribute
                    Attribute cnAttribute = searchResult.getAttributes().get( "cn" );

                    // Looping on the values
                    NamingEnumeration<?> ne = null;
                    ne = cnAttribute.getAll();
                    if ( ne != null )
                    {
                        while ( ne.hasMore() )
                        {
                            String value = ( String ) ne.next();
View Full Code Here

            {
                if ( answer.hasMore() )
                {
                    SearchResult searchResult = ( SearchResult ) answer.next();

                    Attribute vendorNameAttribute = searchResult.getAttributes().get( "vendorName" );
                    if ( vendorNameAttribute == null )
                    {
                        return false;
                    }

                    if ( vendorNameAttribute.size() != 1 )
                    {
                        return false;
                    }

                    String vendorName = null;
                    try
                    {
                        vendorName = ( String ) vendorNameAttribute.get();
                    }
                    catch ( NamingException e )
                    {
                        return false;
                    }
View Full Code Here

     *      if an error occurrs when reading the SearchResult
     */
    private static SchemaNodeTypes getNodeType( SearchResult sr ) throws NamingException
    {
        // Getting the 'ObjectClass' Attribute
        Attribute objectClassAttribute = sr.getAttributes().get( "objectClass" );

        // Looping on the values
        NamingEnumeration<?> ne = objectClassAttribute.getAll();
        while ( ne.hasMore() )
        {
            String value = ( String ) ne.next();
            if ( META_ATTRIBUTE_TYPE.equals( value ) )
            {
View Full Code Here

     * @throws NamingException
     *      if an error occurrs when searching in the SearchResult
     */
    private static String getOid( SearchResult sr ) throws NamingException
    {
        Attribute at = sr.getAttributes().get( "m-oid" );
        if ( at == null )
        {
            return null;
        }
        else
        {
            return ( String ) at.get();
        }
    }
View Full Code Here

TOP

Related Classes of javax.naming.directory.Attribute

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.