| | |
| | | |
| | | |
| | | |
| | | import static com.sun.opends.sdk.messages.Messages.*; |
| | | import static com.sun.opends.sdk.messages.Messages.WARN_ATTR_SYNTAX_UUID_EXPECTED_DASH; |
| | | import static com.sun.opends.sdk.messages.Messages.WARN_ATTR_SYNTAX_UUID_EXPECTED_HEX; |
| | | import static com.sun.opends.sdk.messages.Messages.WARN_ATTR_SYNTAX_UUID_INVALID_LENGTH; |
| | | |
| | | import org.opends.sdk.ByteSequence; |
| | | import org.opends.sdk.ByteString; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines the uuidOrderingMatch matching rule defined in RFC |
| | | * 4530. This will be the default ordering matching rule for the UUID |
| | | * syntax. |
| | | * This class defines the uuidOrderingMatch matching rule defined in RFC 4530. |
| | | * This will be the default ordering matching rule for the UUID syntax. |
| | | */ |
| | | final class UUIDOrderingMatchingRuleImpl extends |
| | | AbstractOrderingMatchingRuleImpl |
| | | { |
| | | public ByteString normalizeAttributeValue(Schema schema, |
| | | ByteSequence value) throws DecodeException |
| | | public ByteString normalizeAttributeValue(final Schema schema, |
| | | final ByteSequence value) throws DecodeException |
| | | { |
| | | if (value.length() != 36) |
| | | { |
| | | final LocalizableMessage message = |
| | | WARN_ATTR_SYNTAX_UUID_INVALID_LENGTH.get(value.toString(), |
| | | value.length()); |
| | | final LocalizableMessage message = WARN_ATTR_SYNTAX_UUID_INVALID_LENGTH |
| | | .get(value.toString(), value.length()); |
| | | throw DecodeException.error(message); |
| | | } |
| | | |
| | |
| | | case 23: |
| | | if (c != '-') |
| | | { |
| | | final LocalizableMessage message = |
| | | WARN_ATTR_SYNTAX_UUID_EXPECTED_DASH.get(value.toString(), |
| | | i, String.valueOf(c)); |
| | | final LocalizableMessage message = WARN_ATTR_SYNTAX_UUID_EXPECTED_DASH |
| | | .get(value.toString(), i, String.valueOf(c)); |
| | | throw DecodeException.error(message); |
| | | } |
| | | builder.append(c); |
| | |
| | | builder.append('f'); |
| | | break; |
| | | default: |
| | | final LocalizableMessage message = |
| | | WARN_ATTR_SYNTAX_UUID_EXPECTED_HEX.get(value.toString(), |
| | | i, String.valueOf(value.byteAt(i))); |
| | | final LocalizableMessage message = WARN_ATTR_SYNTAX_UUID_EXPECTED_HEX |
| | | .get(value.toString(), i, String.valueOf(value.byteAt(i))); |
| | | throw DecodeException.error(message); |
| | | } |
| | | } |