| | |
| | | { |
| | | // This means that the definition was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRTYPE_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRTYPE_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_ATTRIBUTE_USAGE |
| | | .get(String.valueOf(oid), usageStr); |
| | | final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_ATTRIBUTE_USAGE1 |
| | | .get(definition, usageStr); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRTYPE_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_ATTRTYPE_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_DCR_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_DSR_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE.get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MR_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_MR_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_MRUSE_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | // it cannot be valid. |
| | | if (structuralClass == null) |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_NAME_FORM_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | final char c = reader.read(); |
| | | if (c != '(') |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS1 |
| | | .get(definition, (reader.pos() - 1), String.valueOf(c)); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_OBJECTCLASS_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_OBJECTCLASS_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | * {@code true} if existing schema elements with the same conflicting |
| | | * OIDs should be overwritten. |
| | | * @return A reference to this schema builder. |
| | | * @throws ConflictingSchemaElementException |
| | | * If {@code overwrite} was {@code false} and conflicting schema |
| | | * elements were found. |
| | | * @throws NullPointerException |
| | | * If {@code entry} was {@code null}. |
| | | */ |
| | | public SchemaBuilder addSchema(final Entry entry, final boolean overwrite) |
| | | throws ConflictingSchemaElementException, NullPointerException |
| | | throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(entry); |
| | | |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final LocalizedIllegalArgumentException e) |
| | | { |
| | | addWarning(e.getMessageObject()); |
| | | warnings.add(e.getMessageObject()); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | // This means that the value was empty or contained only |
| | | // whitespace. That is illegal. |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRSYNTAX_EMPTY_VALUE |
| | | .get(); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRSYNTAX_EMPTY_VALUE1 |
| | | .get(definition); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ILLEGAL_TOKEN |
| | | .get(tokenName); |
| | | final LocalizableMessage message = ERR_ATTR_SYNTAX_ATTRSYNTAX_ILLEGAL_TOKEN1 |
| | | .get(definition, tokenName); |
| | | throw new LocalizedIllegalArgumentException(message); |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (final DecodeException e) |
| | | { |
| | | throw new LocalizedIllegalArgumentException(e.getMessageObject(), e |
| | | .getCause()); |
| | | LocalizableMessage msg = ERR_ATTR_SYNTAX_ATTRSYNTAX_INVALID1.get(definition, |
| | | e.getMessageObject()); |
| | | throw new LocalizedIllegalArgumentException(msg, e.getCause()); |
| | | } |
| | | return this; |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | void addWarning(final LocalizableMessage warning) |
| | | { |
| | | warnings.add(warning); |
| | | } |
| | | |
| | | |
| | | |
| | | private void addAttributeType(final AttributeType attribute, |
| | | final boolean overwrite) throws ConflictingSchemaElementException |
| | | { |
| | |
| | | .getStructuralClassOID()); |
| | | if (!overwrite) |
| | | { |
| | | final LocalizableMessage message = ERR_SCHEMA_CONFLICTING_DIT_CONTENT_RULE |
| | | final LocalizableMessage message = ERR_SCHEMA_CONFLICTING_DIT_CONTENT_RULE1 |
| | | .get(rule.getNameOrOID(), rule.getStructuralClassOID(), |
| | | conflictingRule.getNameOrOID()); |
| | | throw new ConflictingSchemaElementException(message); |
| | |
| | | conflictingOC = numericOID2ObjectClasses.get(oc.getOID()); |
| | | if (!overwrite) |
| | | { |
| | | final LocalizableMessage message = ERR_SCHEMA_CONFLICTING_OBJECTCLASS_OID |
| | | final LocalizableMessage message = ERR_SCHEMA_CONFLICTING_OBJECTCLASS_OID1 |
| | | .get(oc.getNameOrOID(), oc.getOID(), conflictingOC.getNameOrOID()); |
| | | throw new ConflictingSchemaElementException(message); |
| | | } |