Package javax.naming.directory

Examples of javax.naming.directory.SchemaViolationException


        {
            serverEntry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, JavaLdapSupport.JCONTAINER_ATTR );
        }
        catch ( LdapException le )
        {
            throw new SchemaViolationException( I18n.err( I18n.ERR_491, name ) );
        }

        // Now add the CN attribute, which is mandatory
        Rdn rdn = target.getRdn();

        if ( rdn != null )
        {
            if ( SchemaConstants.CN_AT_OID.equals( rdn.getNormType() ) )
            {
                serverEntry.put( rdn.getType(), rdn.getValue() );
            }
            else
            {
                // No CN in the rdn, this is an error
                throw new SchemaViolationException( I18n.err( I18n.ERR_491, name ) );
            }
        }
        else
        {
            // No CN in the rdn, this is an error
            throw new SchemaViolationException( I18n.err( I18n.ERR_491, name ) );
        }

        /*
         * Add the new context to the server which as a side effect adds
         * operational attributes to the serverEntry refering instance which
View Full Code Here


                {
                    outAttrs.put( "sn", per.getLastname() );
                }
                else
                {
                    throw new SchemaViolationException( "Person must have surname" );
                }

                if ( per.getCn() != null )
                {
                    outAttrs.put( "cn", per.getCn() );
                }
                else
                {
                    throw new SchemaViolationException( "Person must have common name" );
                }

                // optional attributes
                if ( per.getPassword() != null )
                {
View Full Code Here

        {
            ne = new WrappedPartialResultException( ( LdapPartialResultException ) t );
        }
        else if ( t instanceof LdapSchemaViolationException )
        {
            ne = new SchemaViolationException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapServiceUnavailableException)
        {
            ne = new ServiceUnavailableException( t.getLocalizedMessage() );
        }
View Full Code Here

        {
            ne = new WrappedPartialResultException( ( LdapPartialResultException ) t );
        }
        else if ( t instanceof LdapSchemaViolationException )
        {
            ne = new SchemaViolationException( t.getLocalizedMessage() );
        }
        else if ( t instanceof LdapServiceUnavailableException)
        {
            ne = new ServiceUnavailableException( t.getLocalizedMessage() );
        }
View Full Code Here

        checkName(name);

        Name schemaType = name.getPrefix(name.size() - 1);

        if (null == attributes || attributes.size() == 0) {
            throw new SchemaViolationException(Messages.getString("jndi.8D"));
        }

        String schema = schemaJndi2Ldap.get(schemaType.toString().toLowerCase());
        if (null == schema) {
            throw new SchemaViolationException(Messages.getString("jndi.8D"));
        }
        if (!LdapContextImpl.schemaTree.keySet().contains(schema)) {
            throw new SchemaViolationException(Messages.getString("jndi.8E"));
        }
        String targetDN = rdn.toString() + parent.subschemasubentry;
        StringBuilder builder = new StringBuilder("( ");
        NamingEnumeration<String> ids = attributes.getIDs();
View Full Code Here

                new LdapAttribute(newAttr, parent));
       
        try {
            doBasicOperation(op);
        } catch (Exception e) {
            throw new SchemaViolationException("Cannot modify schema root");
        }

    }
View Full Code Here

    public Object lookup(String name) throws NamingException {
        return lookup(convertFromStringToName(name));
    }

    public void rename(Name nOld, Name nNew) throws NamingException {
        throw new SchemaViolationException(Messages.getString("jndi.err.01"));
    }
View Full Code Here

    public void rename(Name nOld, Name nNew) throws NamingException {
        throw new SchemaViolationException(Messages.getString("jndi.err.01"));
    }

    public void rename(String sOld, String sNew) throws NamingException {
        throw new SchemaViolationException(Messages.getString("jndi.err.01"));
    }
View Full Code Here

        {
            serverEntry.add( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, JavaLdapSupport.JCONTAINER_ATTR );
        }
        catch ( LdapException le )
        {
            throw new SchemaViolationException( I18n.err( I18n.ERR_491, name) );
        }

        // Now add the CN attribute, which is mandatory
        Rdn rdn = target.getRdn();

        if ( rdn != null )
        {
            if ( SchemaConstants.CN_AT_OID.equals( rdn.getNormType() ) )
            {
                serverEntry.put( rdn.getUpType(), rdn.getUpValue() );
            }
            else
            {
                // No CN in the rdn, this is an error
                throw new SchemaViolationException( I18n.err( I18n.ERR_491, name) );
            }
        }
        else
        {
            // No CN in the rdn, this is an error
            throw new SchemaViolationException( I18n.err( I18n.ERR_491, name) );
        }

        /*
         * Add the new context to the server which as a side effect adds
         * operational attributes to the serverEntry refering instance which
View Full Code Here

                {
                    outAttrs.put( "sn", per.getLastname() );
                }
                else
                {
                    throw new SchemaViolationException( "Person must have surname" );
                }

                if ( per.getCn() != null )
                {
                    outAttrs.put( "cn", per.getCn() );
                }
                else
                {
                    throw new SchemaViolationException( "Person must have common name" );
                }

                // optional attributes
                if ( per.getPassword() != null )
                {
View Full Code Here

TOP

Related Classes of javax.naming.directory.SchemaViolationException

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.