Examples of EntryAttribute


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

        {
            // The search result is a referral
            SearchResultReferenceDsml srr = new SearchResultReferenceDsml();

            // Getting the 'ref' attribute
            EntryAttribute refAttribute = entry.get( ExportDsmlJob.REF_ATTRIBUTETYPE_NAME );
            if ( refAttribute == null )
            {
                // If we did not get it by its name, let's get it by its OID
                refAttribute = entry.get( ExportDsmlJob.REF_ATTRIBUTETYPE_OID );
            }

            // Adding references
            if ( refAttribute != null )
            {
                for ( Iterator<Value<?>> iterator = refAttribute.iterator(); iterator.hasNext(); )
                {
                    Value<?> value = ( Value<?> ) iterator.next();

                    srr.addSearchResultReference( new LdapURL( ( String ) value.get() ) );
                }
View Full Code Here

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

    private static boolean isReferral( Entry entry )
    {
        if ( entry != null )
        {
            // Getting the 'objectClass' Attribute
            EntryAttribute objectClassAttribute = entry.get( ExportDsmlJob.OBJECTCLASS_OBJECTCLASS_NAME );
            if ( objectClassAttribute == null )
            {
                objectClassAttribute = entry.get( ExportDsmlJob.OBJECTCLASS_OBJECTCLASS_OID );
            }

            if ( objectClassAttribute != null )
            {
                // Checking if the 'objectClass' attribute contains the
                // 'referral' object class as value
                return ( ( objectClassAttribute.contains( ExportDsmlJob.REFERRAL_OBJECTCLASS_NAME ) ) || ( objectClassAttribute
                    .contains( ExportDsmlJob.REFERRAL_OBJECTCLASS_OID ) ) );
            }
        }

        return false;
View Full Code Here

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

        // Read the entry we just created using the akarasuluSession
        Entry readEntry = service.getAdminSession().lookup( akarasulu.getDn(), new String[]{ "userPassword"} );
       
        assertTrue( Arrays.equals( akarasulu.get( "userPassword" ).getBytes(), readEntry.get( "userPassword" ).getBytes() ) );

        EntryAttribute attribute = new DefaultClientAttribute( "userPassword", "replaced" );

        List<Modification> mods = new ArrayList<Modification>();
       
        Modification mod = new ClientModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
        mods.add( mod );
View Full Code Here

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

                String message = I18n.err( I18n.ERR_103 );
                LOG.error( message );
                throw new IllegalArgumentException( message );
            }
           
            EntryAttribute removed = this.attributes.put( ((ServerAttribute)serverAttribute).getAttributeType(), serverAttribute );
           
            if ( removed != null )
            {
                previous.add( removed );
            }
View Full Code Here

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

            String message = I18n.err( I18n.ERR_102 );
            LOG.error( message );
            throw new UnsupportedOperationException( message );
        }

        EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
        return attributes.put( attributeType, attribute );
    }
View Full Code Here

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

   
    private LdapReferralException buildReferralException( ServerEntry parentEntry, DN childDn )
        throws NamingException, LdapURLEncodingException
    {
        // Get the Ref attributeType
        EntryAttribute refs = parentEntry.get( SchemaConstants.REF_AT );
       
        List<String> urls = new ArrayList<String>();
       
        // manage each Referral, building the correct URL for each of them
        for ( Value<?> url:refs )
View Full Code Here

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

            {
                upId = getUpId( upId, attributeType );
            }
        }
       
        EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
        return attributes.put( attributeType, attribute );
    }
View Full Code Here

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

    private LdapReferralException buildReferralExceptionForSearch(
        ServerEntry parentEntry, DN childDn, SearchScope scope )
        throws NamingException, LdapURLEncodingException
    {
        // Get the Ref attributeType
        EntryAttribute refs = parentEntry.get( SchemaConstants.REF_AT );
       
        List<String> urls = new ArrayList<String>();
       
        // manage each Referral, building the correct URL for each of them
        for ( Value<?> url:refs )
View Full Code Here

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

        else
        {
            upId = getUpId( upId, attributeType );
        }
       
        EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values );
        return attributes.put( attributeType, attribute );
    }
View Full Code Here

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

     */
    public boolean remove( AttributeType attributeType, byte[]... values ) throws NamingException
    {
        try
        {
            EntryAttribute attribute = attributes.get( attributeType );
           
            if ( attribute == null )
            {
                // Can't remove values from a not existing attribute !
                return false;
            }
           
            int nbOldValues = attribute.size();
           
            // Remove the values
            attribute.remove( values );
           
            if ( attribute.size() == 0 )
            {
                // No mare values, remove the attribute
                attributes.remove( attributeType );
               
                return true;
            }
           
            if ( nbOldValues != attribute.size() )
            {
                // At least one value have been removed, return true.
                return true;
            }
            else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.