Examples of LdapSchemaException


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

                    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, oid );

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_COLLECTIVE_NOT_ALLOWED_IN_MAY, msg );
                        ldapSchemaException.setSourceObject( this );
                        ldapSchemaException.setRelatedId( mayAttributeTypeName );
                        errors.add( ldapSchemaException );
                        break;
                    }

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

                        LdapSchemaException ldapSchemaException = new LdapSchemaException(
                            LdapSchemaExceptionCodes.OC_DUPLICATE_AT_IN_MAY, msg );
                        ldapSchemaException.setSourceObject( this );
                        ldapSchemaException.setRelatedId( mayAttributeTypeName );
                        errors.add( ldapSchemaException );
                        break;
                    }

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

                    LdapSchemaException ldapSchemaException = new LdapSchemaException(
                        LdapSchemaExceptionCodes.OC_NONEXISTENT_MAY_AT, msg, ne );
                    ldapSchemaException.setSourceObject( this );
                    ldapSchemaException.setRelatedId( mayAttributeTypeName );
                    errors.add( ldapSchemaException );
                    break;
                }
            }
        }
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.