Package org.apache.directory.api.ldap.model.exception

Examples of org.apache.directory.api.ldap.model.exception.LdapSchemaException


                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04484_COLLECTIVE_NOT_ALLOWED_IN_MUST, mustAttributeTypeName,
                            objectClass.getOid() );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_COLLECTIVE_NOT_ALLOWED_IN_MUST, msg );
                        ldapSchemaException.setSourceObject( objectClass );
                        ldapSchemaException.setRelatedId( mustAttributeTypeName );
                        errors.add( ldapSchemaException );
                        LOG.info( msg );

                        break;
                    }

                    if ( objectClass.getMustAttributeTypes().contains( attributeType ) )
                    {
                        // Already registered : this is an error
                        String msg = I18n.err( I18n.ERR_04324, objectClass.getOid(), mustAttributeTypeName );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MUST, msg );
                        ldapSchemaException.setSourceObject( objectClass );
                        ldapSchemaException.setRelatedId( mustAttributeTypeName );
                        errors.add( ldapSchemaException );
                        LOG.info( msg );

                        break;
                    }

                    // Check that the MUST AT is not also present in the MAY AT
                    if ( objectClass.getMayAttributeTypes().contains( attributeType ) )
                    {
                        // Already registered : this is an error
                        String msg = I18n.err( I18n.ERR_04325, objectClass.getOid(), mustAttributeTypeName );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY_AND_MUST,
                            msg );
                        ldapSchemaException.setSourceObject( objectClass );
                        ldapSchemaException.setRelatedId( mustAttributeTypeName );
                        errors.add( ldapSchemaException );
                        LOG.info( msg );

                        break;
                    }

                    objectClass.getMustAttributeTypes().add( attributeType );
                }
                catch ( LdapException ne )
                {
                    // Cannot find the AT
                    String msg = I18n.err( I18n.ERR_04326, objectClass.getOid(), mustAttributeTypeName );

                    LdapSchemaException ldapSchemaException = new LdapSchemaException(
                        LdapSchemaExceptionCodes.OC_NONEXISTENT_MUST_AT, msg, ne );
                    ldapSchemaException.setSourceObject( objectClass );
                    ldapSchemaException.setRelatedId( mustAttributeTypeName );
                    errors.add( ldapSchemaException );
                    LOG.info( msg );

                    break;
                }
View Full Code Here


                    if ( attributeType.isCollective() )
                    {
                        // Collective Attributes are not allowed in MAY or MUST
                        String msg = I18n.err( I18n.ERR_04485_COLLECTIVE_NOT_ALLOWED_IN_MAY, mayAttributeTypeName, objectClass.getOid() );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_COLLECTIVE_NOT_ALLOWED_IN_MAY, msg );
                        ldapSchemaException.setSourceObject( objectClass );
                        ldapSchemaException.setRelatedId( mayAttributeTypeName );
                        errors.add( ldapSchemaException );
                        LOG.info( msg );

                        break;
                    }

                    if ( objectClass.getMayAttributeTypes().contains( attributeType ) )
                    {
                        // Already registered : this is an error
                        String msg = I18n.err( I18n.ERR_04322, objectClass.getOid(), mayAttributeTypeName );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY, msg );
                        ldapSchemaException.setSourceObject( objectClass );
                        ldapSchemaException.setRelatedId( mayAttributeTypeName );
                        errors.add( ldapSchemaException );
                        LOG.info( msg );

                        break;
                    }

                    objectClass.getMayAttributeTypes().add( attributeType );
                }
                catch ( LdapException ne )
                {
                    // Cannot find the AT
                    String msg = I18n.err( I18n.ERR_04323, objectClass.getOid(), mayAttributeTypeName );

                    LdapSchemaException ldapSchemaException = new LdapSchemaException(
                        LdapSchemaExceptionCodes.OC_NONEXISTENT_MAY_AT, msg, ne );
                    ldapSchemaException.setSourceObject( objectClass );
                    ldapSchemaException.setRelatedId( mayAttributeTypeName );
                    errors.add( ldapSchemaException );
                    LOG.info( msg );

                    break;
                }
View Full Code Here

                catch ( LdapException ne )
                {
                    // The Syntax is a mandatory element, it must exist.
                    String msg = I18n.err( I18n.ERR_04317 );

                    LdapSchemaException ldapSchemaException = new LdapSchemaException(
                        LdapSchemaExceptionCodes.MR_NONEXISTENT_SYNTAX, msg, ne );
                    ldapSchemaException.setSourceObject( matchingRule );
                    ldapSchemaException.setRelatedId( matchingRule.getSyntaxOid() );
                    errors.add( ldapSchemaException );
                    LOG.info( msg );
                }

                /**
 
View Full Code Here

TOP

Related Classes of org.apache.directory.api.ldap.model.exception.LdapSchemaException

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.