| | |
| | | * 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.core.DirectoryServer; |
| | | import org.opends.server.types.ByteString; |
| | | |
| | | 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.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | |
| | | public class BinarySyntax |
| | | extends AttributeSyntax |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.schema.BinarySyntax"; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | super(); |
| | | |
| | | assert debugConstructor(CLASS_NAME); |
| | | } |
| | | |
| | | |
| | |
| | | public void initializeSyntax(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeSyntax", |
| | | String.valueOf(configEntry)); |
| | | |
| | | defaultEqualityMatchingRule = |
| | | DirectoryServer.getEqualityMatchingRule(EMR_OCTET_STRING_OID); |
| | |
| | | */ |
| | | public String getSyntaxName() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getSyntaxName"); |
| | | |
| | | return SYNTAX_BINARY_NAME; |
| | | } |
| | |
| | | */ |
| | | public String getOID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getOID"); |
| | | |
| | | return SYNTAX_BINARY_OID; |
| | | } |
| | |
| | | */ |
| | | public String getDescription() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getDescription"); |
| | | |
| | | return SYNTAX_BINARY_DESCRIPTION; |
| | | } |
| | |
| | | */ |
| | | public EqualityMatchingRule getEqualityMatchingRule() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getEqualityMatchingRule"); |
| | | |
| | | return defaultEqualityMatchingRule; |
| | | } |
| | |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getOrderingMatchingRule"); |
| | | |
| | | return defaultOrderingMatchingRule; |
| | | } |
| | |
| | | */ |
| | | public SubstringMatchingRule getSubstringMatchingRule() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getSubstringMatchingRule"); |
| | | |
| | | return defaultSubstringMatchingRule; |
| | | } |
| | |
| | | */ |
| | | public ApproximateMatchingRule getApproximateMatchingRule() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getApproximateMatchingRule"); |
| | | |
| | | // There is no approximate matching rule by default. |
| | | return null; |
| | |
| | | public boolean valueIsAcceptable(ByteString value, |
| | | StringBuilder invalidReason) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "valueIsAcceptable", String.valueOf(value), |
| | | "java.lang.StringBuilder"); |
| | | |
| | | // All values will be acceptable for the binary syntax. |
| | | return true; |