Examples of LdapNoSuchAttributeException


Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

        Attribute attr = compareContext.getOriginalEntry().get( compareContext.getAttributeType() );

        // complain if the attribute being compared does not exist in the entry
        if ( attr == null )
        {
            throw new LdapNoSuchAttributeException();
        }

        // see first if simple match without normalization succeeds
        if ( attr.contains( compareContext.getValue() ) )
        {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

                    // First check that the removed attribute exists
                    if ( !tempEntry.containsAttribute( attributeType ) )
                    {
                        String msg = I18n.err( I18n.ERR_55, attributeType );
                        LOG.error( msg );
                        throw new LdapNoSuchAttributeException( msg );
                    }

                    // We may have to remove the attribute or only some values
                    if ( attribute.size() == 0 )
                    {
                        // No value : we have to remove the entire attribute
                        tempEntry.removeAttributes( attributeType );
                    }
                    else
                    {
                        currentAttribute = tempEntry.get( attributeType );

                        // Now remove all the values
                        for ( Value<?> value : attribute )
                        {
                            // We can only remove existing values.
                            if ( currentAttribute.contains( value ) )
                            {
                                currentAttribute.remove( value );
                            }
                            else
                            {
                                String msg = I18n.err( I18n.ERR_56, attributeType );
                                LOG.error( msg );
                                throw new LdapNoSuchAttributeException( msg );
                            }
                        }

                        // If the current attribute is empty, we have to remove
                        // it from the entry
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

                        if ( modifiedAdminRole == null )
                        {
                            // We can't remove a value when the attribute does not exist.
                            String msg = "Cannot remove the administrative role, it does not exist";
                            LOG.error( msg );
                            throw new LdapNoSuchAttributeException( msg );
                        }

                        // It may be a complete removal
                        if ( attribute.size() == 0 )
                        {
                            // Complete removal. Loop on all the existing roles and remove them
                            for ( Value<?> role : modifiedAdminRole )
                            {
                                //checkDelRole( role, modifiedAdminRole, dn, directoryService.getAdministrativePoints() );
                                delRole( role.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy,
                                    ssapCacheCopy );
                            }

                            modifiedAdminRole.clear();
                            break;
                        }

                        // Now deal with the values to remove
                        for ( Value<?> value : attribute )
                        {
                            if ( !isValidRole( value.getString() ) )
                            {
                                // Not a valid role : we will throw an exception
                                String msg = "Invalid role : " + value.getString();
                                LOG.error( msg );
                                throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
                                    msg );
                            }

                            if ( !modifiedAdminRole.contains( value ) )
                            {
                                // We can't remove a value if it does not exist !
                                String msg = "Cannot remove the administrative role value" + value
                                    + ", it does not exist";
                                LOG.error( msg );
                                throw new LdapNoSuchAttributeException( msg );
                            }

                            modifiedAdminRole.remove( value );
                            delRole( value.getString(), dn, uuid, acapCacheCopy, caapCacheCopy, teapCacheCopy,
                                ssapCacheCopy );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

        Attribute attr = compareContext.getOriginalEntry().get( compareContext.getAttributeType() );

        // complain if the attribute being compared does not exist in the entry
        if ( attr == null )
        {
            throw new LdapNoSuchAttributeException();
        }

        // see first if simple match without normalization succeeds
        if ( attr.contains( compareContext.getValue() ) )
        {
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

                    // First check that the removed attribute exists
                    if ( !tempEntry.containsAttribute( attributeType ) )
                    {
                        String msg = I18n.err( I18n.ERR_55, attributeType );
                        LOG.error( msg );
                        throw new LdapNoSuchAttributeException( msg );
                    }

                    // We may have to remove the attribute or only some values
                    if ( attribute.size() == 0 )
                    {
                        // No value : we have to remove the entire attribute
                        tempEntry.removeAttributes( attributeType );
                    }
                    else
                    {
                        currentAttribute = tempEntry.get( attributeType );

                        // Now remove all the values
                        for ( Value<?> value : attribute )
                        {
                            // We can only remove existing values.
                            if ( currentAttribute.contains( value ) )
                            {
                                currentAttribute.remove( value );
                            }
                            else
                            {
                                String msg = I18n.err( I18n.ERR_56, attributeType );
                                LOG.error( msg );
                                throw new LdapNoSuchAttributeException( msg );
                            }
                        }

                        // If the current attribute is empty, we have to remove
                        // it from the entry
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

        {
            return immutableAttributeTypeRegistry.getOidByName( name );
        }
        catch ( LdapException le )
        {
            throw new LdapNoSuchAttributeException( le.getMessage() , le);
        }
    }
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException

            Set<AttributeType> descendants = oidToDescendantSet.get( oid );
            return ( descendants != null ) && !descendants.isEmpty();
        }
        catch ( LdapException ne )
        {
            throw new LdapNoSuchAttributeException( ne.getMessage(), ne );
        }
    }
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapNoSuchAttributeException

        Attribute attr = partition.lookup( name ).get( attrType.getName() );

        // complain if the attribute being compared does not exist in the entry
        if ( attr == null )
        {
            throw new LdapNoSuchAttributeException();
        }

        // see first if simple match without normalization succeeds
        if ( attr.contains( value ) )
        {
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapNoSuchAttributeException

                throw new LdapInvalidAttributeIdentifierException( "unrecognized attributeID " + change.getID() );
            }

            if ( modOp == DirContext.REMOVE_ATTRIBUTE && entry.get( change.getID() ) == null )
            {
                throw new LdapNoSuchAttributeException();
            }

            // for required attributes we need to check if all values are removed
            // if so then we have a schema violation that must be thrown
            if ( modOp == DirContext.REMOVE_ATTRIBUTE &&
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapNoSuchAttributeException

                throw new LdapInvalidAttributeIdentifierException();
            }

            if ( modOp == DirContext.REMOVE_ATTRIBUTE && entry.get( change.getID() ) == null )
            {
                throw new LdapNoSuchAttributeException();
            }

            if ( modOp == DirContext.REMOVE_ATTRIBUTE )
            {
                // for required attributes we need to check if all values are removed
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.