org.opends.server.api
Class AttributeSyntax<T extends AttributeSyntaxCfg>

java.lang.Object
  extended by org.opends.server.api.AttributeSyntax<T>
Type Parameters:
T - The type of configuration handled by this attribute syntax.
Direct Known Subclasses:
AbsoluteSubtreeSpecificationSyntax, AciSyntax, AttributeTypeSyntax, AuthPasswordSyntax, BinarySyntax, BitStringSyntax, BooleanSyntax, CertificateListSyntax, CertificatePairSyntax, CertificateSyntax, CountryStringSyntax, DeliveryMethodSyntax, DirectoryStringSyntax, DistinguishedNameSyntax, DITContentRuleSyntax, DITStructureRuleSyntax, EnhancedGuideSyntax, FaxNumberSyntax, FaxSyntax, GeneralizedTimeSyntax, GuideSyntax, IA5StringSyntax, IntegerSyntax, JPEGSyntax, LDAPSyntaxDescriptionSyntax, MatchingRuleSyntax, MatchingRuleUseSyntax, NameAndOptionalUIDSyntax, NameFormSyntax, NumericStringSyntax, ObjectClassSyntax, OctetStringSyntax, OIDSyntax, OtherMailboxSyntax, PostalAddressSyntax, PresentationAddressSyntax, PrintableStringSyntax, ProtocolInformationSyntax, RelativeSubtreeSpecificationSyntax, RFC3672SubtreeSpecificationSyntax, SubstringAssertionSyntax, SupportedAlgorithmSyntax, TelephoneNumberSyntax, TeletexTerminalIdentifierSyntax, TelexNumberSyntax, UserPasswordSyntax, UTCTimeSyntax, UUIDSyntax

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=false)
public abstract class AttributeSyntax<T extends AttributeSyntaxCfg>
extends java.lang.Object

This class defines the set of methods and structures that must be implemented by a Directory Server module that implements an attribute syntax.


Constructor Summary
AttributeSyntax()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether the provided object is equal to this attribute syntax.
 void finalizeSyntax()
          Performs any finalization that may be necessary for this attribute syntax.
abstract  ApproximateMatchingRule getApproximateMatchingRule()
          Retrieves the default approximate matching rule that will be used for attributes with this syntax.
abstract  java.lang.String getDescription()
          Retrieves a description for this attribute syntax.
abstract  EqualityMatchingRule getEqualityMatchingRule()
          Retrieves the default equality matching rule that will be used for attributes with this syntax.
abstract  java.lang.String getOID()
          Retrieves the OID for this attribute syntax.
abstract  OrderingMatchingRule getOrderingMatchingRule()
          Retrieves the default ordering matching rule that will be used for attributes with this syntax.
abstract  SubstringMatchingRule getSubstringMatchingRule()
          Retrieves the default substring matching rule that will be used for attributes with this syntax.
abstract  java.lang.String getSyntaxName()
          Retrieves the common name for this attribute syntax.
 int hashCode()
          Retrieves the hash code for this attribute syntax.
abstract  void initializeSyntax(T configuration)
          Initializes this attribute syntax based on the information in the provided configuration entry.
 boolean isConfigurationAcceptable(AttributeSyntaxCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this attribute syntax.
 java.lang.String toString()
          Retrieves a string representation of this attribute syntax in the format defined in RFC 2252.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this attribute syntax in the format defined in RFC 2252 to the provided buffer.
abstract  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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeSyntax

public AttributeSyntax()
Method Detail

initializeSyntax

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

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.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(AttributeSyntaxCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this attribute syntax. It should be possible to call this method on an uninitialized attribute syntax instance in order to determine whether the syntax would be able to use the provided configuration.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Parameters:
configuration - The attribute syntax configuration for which to make the determination.
unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
Returns:
true if the provided configuration is acceptable for this attribute syntax, or false if not.

finalizeSyntax

public void finalizeSyntax()
Performs any finalization that may be necessary for this attribute syntax. By default, no finalization is performed.


getSyntaxName

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

Returns:
The common name for this attribute syntax.

getOID

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

Returns:
The OID for this attribute syntax.

getDescription

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

Returns:
A description for this attribute syntax.

getEqualityMatchingRule

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

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 abstract OrderingMatchingRule getOrderingMatchingRule()
Retrieves the default ordering matching rule that will be used for attributes with this syntax.

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 abstract SubstringMatchingRule getSubstringMatchingRule()
Retrieves the default substring matching rule that will be used for attributes with this syntax.

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 abstract ApproximateMatchingRule getApproximateMatchingRule()
Retrieves the default approximate matching rule that will be used for attributes with this syntax.

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 abstract 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.

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.

hashCode

public final int hashCode()
Retrieves the hash code for this attribute syntax. It will be calculated as the sum of the characters in the OID.

Overrides:
hashCode in class java.lang.Object
Returns:
The hash code for this attribute syntax.

equals

public final boolean equals(java.lang.Object o)
Indicates whether the provided object is equal to this attribute syntax. The provided object will be considered equal to this attribute syntax only if it is an attribute syntax with the same OID.

Overrides:
equals in class java.lang.Object
Parameters:
o - The object for which to make the determination.
Returns:
true if the provided object is equal to this attribute syntax, or false if it is not.

toString

public final java.lang.String toString()
Retrieves a string representation of this attribute syntax in the format defined in RFC 2252.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this attribute syntax in the format defined in RFC 2252.

toString

public final void toString(java.lang.StringBuilder buffer)
Appends a string representation of this attribute syntax in the format defined in RFC 2252 to the provided buffer.

Parameters:
buffer - The buffer to which the information should be appended.