org.opends.server.schema
Class UserPasswordSyntax

java.lang.Object
  extended by org.opends.server.api.AttributeSyntax<AttributeSyntaxCfg>
      extended by org.opends.server.schema.UserPasswordSyntax

public class UserPasswordSyntax
extends AttributeSyntax<AttributeSyntaxCfg>

This class defines an attribute syntax used for storing values that have been encoded using a password storage scheme. The format for attribute values with this syntax is the concatenation of the following elements in the given order:


Constructor Summary
UserPasswordSyntax()
          Creates a new instance of this syntax.
 
Method Summary
static java.lang.String[] decodeUserPassword(java.lang.String userPasswordValue)
          Decodes the provided user password value into its component parts.
 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(AttributeSyntaxCfg configuration)
          Initializes this attribute syntax based on the information in the provided configuration entry.
static boolean isEncoded(ByteString value)
          Indicates whether the provided value is encoded using the user password syntax.
 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

UserPasswordSyntax

public UserPasswordSyntax()
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(AttributeSyntaxCfg configuration)
                      throws ConfigException
Initializes this attribute syntax based on the information in the provided configuration entry.

Specified by:
initializeSyntax in class AttributeSyntax<AttributeSyntaxCfg>
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.

getSyntaxName

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

Specified by:
getSyntaxName in class AttributeSyntax<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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<AttributeSyntaxCfg>
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.

decodeUserPassword

public static java.lang.String[] decodeUserPassword(java.lang.String userPasswordValue)
                                             throws DirectoryException
Decodes the provided user password value into its component parts.

Parameters:
userPasswordValue - The user password value to be decoded.
Returns:
A two-element string array whose elements are the storage scheme name (in all lowercase characters) and the encoded value, in that order.
Throws:
DirectoryException - If a problem is encountered while attempting to decode the value.

isEncoded

public static boolean isEncoded(ByteString value)
Indicates whether the provided value is encoded using the user password syntax.

Parameters:
value - The value for which to make the determination.
Returns:
true if the value appears to be encoded using the user password syntax, or false if not.