org.opends.server.schema
Class AttributeTypeSyntax

java.lang.Object
  extended by org.opends.server.api.AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
      extended by org.opends.server.schema.AttributeTypeSyntax
All Implemented Interfaces:
ConfigurationChangeListener<AttributeTypeDescriptionAttributeSyntaxCfg>

public class AttributeTypeSyntax
extends AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
implements ConfigurationChangeListener<AttributeTypeDescriptionAttributeSyntaxCfg>

This class defines the attribute type description syntax, which is used to hold attribute type definitions in the server schema. The format of this syntax is defined in RFC 2252.


Constructor Summary
AttributeTypeSyntax()
          Creates a new instance of this syntax.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(AttributeTypeDescriptionAttributeSyntaxCfg configuration)
          Applies the configuration changes to this change listener.
static AttributeType decodeAttributeType(ByteString value, Schema schema, boolean allowUnknownElements)
          Decodes the contents of the provided ASN.1 octet string as an attribute type definition according to the rules of this syntax.
 ApproximateMatchingRule getApproximateMatchingRule()
          Retrieves the default approximate matching rule that will be used for attributes with this syntax.
 java.lang.String getDescription()
          Retrieves a description for this attribute syntax.
 EqualityMatchingRule getEqualityMatchingRule()
          Retrieves the default equality matching rule that will be used for attributes with this syntax.
 java.lang.String getOID()
          Retrieves the OID for this attribute syntax.
 OrderingMatchingRule getOrderingMatchingRule()
          Retrieves the default ordering matching rule that will be used for attributes with this syntax.
 SubstringMatchingRule getSubstringMatchingRule()
          Retrieves the default substring matching rule that will be used for attributes with this syntax.
 java.lang.String getSyntaxName()
          Retrieves the common name for this attribute syntax.
 void initializeSyntax(AttributeTypeDescriptionAttributeSyntaxCfg configuration)
          Initializes this attribute syntax based on the information in the provided configuration entry.
 boolean isConfigurationChangeAcceptable(AttributeTypeDescriptionAttributeSyntaxCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
static boolean isStripSyntaxMinimumUpperBound()
          Boolean that indicates that the minimum upper bound value should be stripped from the Attrbute Type Syntax Description.
 boolean valueIsAcceptable(ByteString value, MessageBuilder invalidReason)
          Indicates whether the provided value is acceptable for use in an attribute with this syntax.
 
Methods inherited from class org.opends.server.api.AttributeSyntax
equals, finalizeSyntax, hashCode, isConfigurationAcceptable, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeTypeSyntax

public AttributeTypeSyntax()
Creates a new instance of this syntax. Note that the only thing that should be done here is to invoke the default constructor for the superclass. All initialization should be performed in the initializeSyntax method.

Method Detail

initializeSyntax

public void initializeSyntax(AttributeTypeDescriptionAttributeSyntaxCfg configuration)
                      throws ConfigException,
                             InitializationException
Initializes this attribute syntax based on the information in the provided configuration entry.

Specified by:
initializeSyntax in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Parameters:
configuration - The configuration to use to initialize this attribute syntax.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

getSyntaxName

public java.lang.String getSyntaxName()
Retrieves the common name for this attribute syntax.

Specified by:
getSyntaxName in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The common name for this attribute syntax.

getOID

public java.lang.String getOID()
Retrieves the OID for this attribute syntax.

Specified by:
getOID in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The OID for this attribute syntax.

getDescription

public java.lang.String getDescription()
Retrieves a description for this attribute syntax.

Specified by:
getDescription in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
A description for this attribute syntax.

getEqualityMatchingRule

public EqualityMatchingRule getEqualityMatchingRule()
Retrieves the default equality matching rule that will be used for attributes with this syntax.

Specified by:
getEqualityMatchingRule in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The default equality matching rule that will be used for attributes with this syntax, or null if equality matches will not be allowed for this type by default.

getOrderingMatchingRule

public OrderingMatchingRule getOrderingMatchingRule()
Retrieves the default ordering matching rule that will be used for attributes with this syntax.

Specified by:
getOrderingMatchingRule in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The default ordering matching rule that will be used for attributes with this syntax, or null if ordering matches will not be allowed for this type by default.

getSubstringMatchingRule

public SubstringMatchingRule getSubstringMatchingRule()
Retrieves the default substring matching rule that will be used for attributes with this syntax.

Specified by:
getSubstringMatchingRule in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The default substring matching rule that will be used for attributes with this syntax, or null if substring matches will not be allowed for this type by default.

getApproximateMatchingRule

public ApproximateMatchingRule getApproximateMatchingRule()
Retrieves the default approximate matching rule that will be used for attributes with this syntax.

Specified by:
getApproximateMatchingRule in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Returns:
The default approximate matching rule that will be used for attributes with this syntax, or null if approximate matches will not be allowed for this type by default.

valueIsAcceptable

public boolean valueIsAcceptable(ByteString value,
                                 MessageBuilder invalidReason)
Indicates whether the provided value is acceptable for use in an attribute with this syntax. If it is not, then the reason may be appended to the provided buffer.

Specified by:
valueIsAcceptable in class AttributeSyntax<AttributeTypeDescriptionAttributeSyntaxCfg>
Parameters:
value - The value for which to make the determination.
invalidReason - The buffer to which the invalid reason should be appended.
Returns:
true if the provided value is acceptable for use with this syntax, or false if not.

decodeAttributeType

public static AttributeType decodeAttributeType(ByteString value,
                                                Schema schema,
                                                boolean allowUnknownElements)
                                         throws DirectoryException
Decodes the contents of the provided ASN.1 octet string as an attribute type definition according to the rules of this syntax. Note that the provided octet string value does not need to be normalized (and in fact, it should not be in order to allow the desired capitalization to be preserved).

Parameters:
value - The ASN.1 octet string containing the value to decode (it does not need to be normalized).
schema - The schema to use to resolve references to other schema elements.
allowUnknownElements - Indicates whether to allow values that reference a superior attribute type which are not defined in the server schema. This should only be true when called by valueIsAcceptable.
Returns:
The decoded attribute type definition.
Throws:
DirectoryException - If the provided value cannot be decoded as an attribute type definition.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(AttributeTypeDescriptionAttributeSyntaxCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<AttributeTypeDescriptionAttributeSyntaxCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(AttributeTypeDescriptionAttributeSyntaxCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<AttributeTypeDescriptionAttributeSyntaxCfg>
Parameters:
configuration - The new configuration containing the changes.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed change is acceptable, or false if it is not.

isStripSyntaxMinimumUpperBound

public static boolean isStripSyntaxMinimumUpperBound()
Boolean that indicates that the minimum upper bound value should be stripped from the Attrbute Type Syntax Description.

Returns:
True if the minimum upper bound value should be stripped.