| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.opends.server.api.AbstractMatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | |
| | | * |
| | | * @return The normalized version of the provided value. |
| | | * |
| | | * @throws DirectoryException If the provided value is invalid according to |
| | | * @throws DecodeException If the provided value is invalid according to |
| | | * the associated attribute syntax. |
| | | */ |
| | | @Override |
| | | public ByteString normalizeAttributeValue(ByteSequence value) |
| | | throws DirectoryException |
| | | throws DecodeException |
| | | { |
| | | try |
| | | { |
| | |
| | | switch (DirectoryServer.getSyntaxEnforcementPolicy()) |
| | | { |
| | | case REJECT: |
| | | throw de; |
| | | |
| | | throw DecodeException.error(de.getMessageObject(), de); |
| | | case WARN: |
| | | logger.error(de.getMessageObject()); |
| | | return value.toByteString(); |
| | | |
| | | default: |
| | | return value.toByteString(); |
| | | break; |
| | | } |
| | | return value.toByteString(); |
| | | } |
| | | } |
| | | |