| | |
| | | // content rule. |
| | | if (checkDITContentRule) |
| | | { |
| | | if (objectClass.getObjectClassType() == ObjectClassType.AUXILIARY) |
| | | if (objectClass.getObjectClassType() == ObjectClassType.AUXILIARY |
| | | && !ditContentRule.getAuxiliaryClasses().contains(objectClass)) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | |
| | | // present. |
| | | if (checkObjectClasses) |
| | | { |
| | | for (final AttributeType t : objectClass.getRequiredAttributes()) |
| | | for (final AttributeType t : objectClass.getDeclaredRequiredAttributes()) |
| | | { |
| | | final Attribute a = Attributes.emptyAttribute(AttributeDescription |
| | | .create(t)); |
| | | if (entry.containsAttribute(a, null)) |
| | | if (!entry.containsAttribute(a, null)) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | |
| | | { |
| | | final Attribute a = Attributes.emptyAttribute(AttributeDescription |
| | | .create(t)); |
| | | if (entry.containsAttribute(a, null)) |
| | | if (!entry.containsAttribute(a, null)) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // Check attributes contain an appropriate number of values. |
| | | if (checkAttributeValues) |
| | | // Check all attributes contain an appropriate number of values. |
| | | if (checkAttributeValues) |
| | | { |
| | | final int sz = attribute.size(); |
| | | |
| | | if (sz == 0) |
| | | { |
| | | final int sz = attribute.size(); |
| | | |
| | | if (sz == 0) |
| | | if (errorMessages != null) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | | final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_EMPTY_ATTRIBUTE |
| | | .get(entry.getName().toString(), t.getNameOrOID()); |
| | | errorMessages.add(message); |
| | | } |
| | | if (policy.checkAttributeValues().isReject()) |
| | | { |
| | | return false; |
| | | } |
| | | final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_EMPTY_ATTRIBUTE |
| | | .get(entry.getName().toString(), t.getNameOrOID()); |
| | | errorMessages.add(message); |
| | | } |
| | | else if (sz > 1 && t.isSingleValue()) |
| | | if (policy.checkAttributeValues().isReject()) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | | final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_SINGLE_VALUED_ATTRIBUTE |
| | | .get(entry.getName().toString(), t.getNameOrOID()); |
| | | errorMessages.add(message); |
| | | } |
| | | if (policy.checkAttributeValues().isReject()) |
| | | { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | else if (sz > 1 && t.isSingleValue()) |
| | | { |
| | | if (errorMessages != null) |
| | | { |
| | | final LocalizableMessage message = ERR_ENTRY_SCHEMA_AT_SINGLE_VALUED_ATTRIBUTE |
| | | .get(entry.getName().toString(), t.getNameOrOID()); |
| | | errorMessages.add(message); |
| | | } |
| | | if (policy.checkAttributeValues().isReject()) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | for (final AVA ava : rdn) |
| | | { |
| | | final AttributeType t = ava.getAttributeType(); |
| | | if (nameForm.isRequiredOrOptional(t)) |
| | | if (!nameForm.isRequiredOrOptional(t)) |
| | | { |
| | | if (nameFormWarnings != null) |
| | | { |