| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.schema; |
| | | |
| | |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.Error.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | import static org.opends.server.messages.SchemaMessages.*; |
| | |
| | | public class CaseExactIA5SubstringMatchingRule |
| | | extends SubstringMatchingRule |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.schema.CaseExactIA5SubstringMatchingRule"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(); |
| | | |
| | | assert debugConstructor(CLASS_NAME); |
| | | } |
| | | |
| | | |
| | |
| | | public void initializeMatchingRule(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeMatchingRule", |
| | | String.valueOf(configEntry)); |
| | | |
| | | // No initialization is required. |
| | | } |
| | |
| | | */ |
| | | public String getName() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getName"); |
| | | |
| | | return SMR_CASE_EXACT_IA5_NAME; |
| | | } |
| | |
| | | */ |
| | | public String getOID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getOID"); |
| | | |
| | | return SMR_CASE_EXACT_IA5_OID; |
| | | } |
| | |
| | | */ |
| | | public String getDescription() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getDescription"); |
| | | |
| | | // There is no standard description for this matching rule. |
| | | return null; |
| | |
| | | */ |
| | | public String getSyntaxOID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getSyntaxOID"); |
| | | |
| | | return SYNTAX_SUBSTRING_ASSERTION_OID; |
| | | } |
| | |
| | | public ByteString normalizeValue(ByteString value) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "normalizeValue", String.valueOf(value)); |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(value.stringValue().trim()); |
| | |
| | | public ByteString normalizeSubstring(ByteString substring) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "normalizeSubstring"); |
| | | |
| | | // In this case, the process for normalizing a substring is the same as |
| | | // normalizing a full value with the exception that it may include an |
| | |
| | | List<ByteString> subAnyElements, |
| | | ByteString subFinal) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "valueMatchesSubstring", |
| | | String.valueOf(value), String.valueOf(subInitial), |
| | | String.valueOf(subAnyElements), String.valueOf(subFinal)); |
| | | |
| | | |
| | | byte[] valueBytes = value.value(); |