org.apache.directory.shared.ldap.schema
Interface AttributeType

All Superinterfaces:
SchemaObject
All Known Implementing Classes:
AbstractAttributeType

public interface AttributeType
extends SchemaObject

An attributeType specification. attributeType specifications describe the nature of attributes within the directory. The attributeType specification's properties are accessible through this interface.

According to ldapbis [MODELS]:

  4.1.2. Attribute Types
  
    Attribute Type definitions are written according to the ABNF:
  
      AttributeTypeDescription = LPAREN WSP
          numericoid                   ; object identifier
          [ SP "NAME" SP qdescrs ]     ; short names (descriptors)
          [ SP "DESC" SP qdstring ]    ; description
          [ SP "OBSOLETE" ]            ; not active
          [ SP "SUP" SP oid ]          ; supertype
          [ SP "EQUALITY" SP oid ]     ; equality matching rule
          [ SP "ORDERING" SP oid ]     ; ordering matching rule
          [ SP "SUBSTR" SP oid ]       ; substrings matching rule
          [ SP "SYNTAX" SP noidlen ]   ; value syntax
          [ SP "SINGLE-VALUE" ]        ; single-value
          [ SP "COLLECTIVE" ]          ; collective
          [ SP "NO-USER-MODIFICATION" ]; not user modifiable
          [ SP "USAGE" SP usage ]      ; usage
          extensions WSP RPAREN        ; extensions
  
      usage = "userApplications"     / ; user
              "directoryOperation"   / ; directory operational
              "distributedOperation" / ; DSA-shared operational
              "dSAOperation"           ; DSA-specific operational
  
    where:
      [numericoid] is object identifier assigned to this attribute type;
      NAME [qdescrs] are short names (descriptors) identifying this
          attribute type;
      DESC [qdstring] is a short descriptive string;
      OBSOLETE indicates this attribute type is not active;
      SUP oid specifies the direct supertype of this type;
      EQUALITY, ORDERING, SUBSTRING provide the oid of the equality,
          ordering, and substrings matching rules, respectively;
      SYNTAX identifies value syntax by object identifier and may suggest
          a minimum upper bound;
      COLLECTIVE indicates this attribute type is collective [X.501];
      NO-USER-MODIFICATION indicates this attribute type is not user
          modifiable;
      USAGE indicates the application of this attribute type; and
      [extensions] describe extensions.
  
    Each attribute type description must contain at least one of the SUP
    or SYNTAX fields.
  
    Usage of userApplications, the default, indicates that attributes of
    this type represent user information.  That is, they are user
    attributes.
  
    COLLECTIVE requires usage userApplications.  Use of collective
    attribute types in LDAP is not discussed in this technical
    specification.
  
    A usage of directoryOperation, distributedOperation, or dSAOperation
    indicates that attributes of this type represent operational and/or
    administrative information.  That is, they are operational attributes.
  
    directoryOperation usage indicates that the attribute of this type is
    a directory operational attribute.  distributedOperation usage
    indicates that the attribute of this DSA-shared usage operational
    attribute.  dSAOperation usage indicates that the attribute of this
    type is a DSA-specific operational attribute.
  
    NO-USER-MODIFICATION requires an operational usage.
  
    Note that the [AttributeTypeDescription] does not list the matching
    rules which can be used with that attribute type in an extensibleMatch
    search filter.  This is done using the 'matchingRuleUse' attribute
    described in Section 4.1.4.
  
    This document refines the schema description of X.501 by requiring
    that the SYNTAX field in an [AttributeTypeDescription] be a string
    representation of an object identifier for the LDAP string syntax
    definition with an optional indication of the suggested minimum bound
    of a value of this attribute.
  
    A suggested minimum upper bound on the number of characters in a value
    with a string-based syntax, or the number of bytes in a value for all
    other syntaxes, may be indicated by appending this bound count inside
    of curly braces following the syntax's OBJECT IDENTIFIER in an
  
    Attribute Type Description.  This bound is not part of the syntax name
    itself.  For instance, "1.3.6.4.1.1466.0{64}" suggests that server
    implementations should allow a string to be 64 characters long,
    although they may allow longer strings.  Note that a single character
    of the Directory String syntax may be encoded in more than one octet
    since UTF-8 is a variable-length encoding.
 

Version:
$Rev: 379008 $
Author:
Apache Directory Project
See Also:
RFC 2252 Section 4.2, ldapbis [MODELS], DescriptionUtils.getDescription(AttributeType)

Method Summary
 MatchingRule getEquality()
          Gets the MatchingRule for this AttributeType used for equality matching.
 int getLength()
          Gets a length limit for this AttributeType.
 MatchingRule getOrdering()
          Gets the MatchingRule for this AttributeType used for ordering.
 MatchingRule getSubstr()
          Gets the MatchingRule for this AttributeType used for substring matching.
 AttributeType getSuperior()
          Gets the name of the superior class for this AttributeType.
 Syntax getSyntax()
          The Syntax for this AttributeType's values.
 UsageEnum getUsage()
          Determines the usage for this AttributeType.
 boolean isCanUserModify()
          Gets whether or not this AttributeType can be modified by a user.
 boolean isCollective()
          Gets whether or not this AttributeType is a collective attribute.
 boolean isSingleValue()
          Gets whether or not this AttributeType is single-valued.
 
Methods inherited from interface org.apache.directory.shared.ldap.schema.SchemaObject
getDescription, getName, getNames, getOid, isObsolete
 

Method Detail

isSingleValue

public boolean isSingleValue()
Gets whether or not this AttributeType is single-valued.

Returns:
true if only one value can exist for this AttributeType, false otherwise

isCanUserModify

public boolean isCanUserModify()
Gets whether or not this AttributeType can be modified by a user.

Returns:
true if users can modify it, false if only the directory can.

isCollective

public boolean isCollective()
Gets whether or not this AttributeType is a collective attribute.

Returns:
true if the attribute is collective, false otherwise

getUsage

public UsageEnum getUsage()
Determines the usage for this AttributeType.

Returns:
a type safe UsageEnum

getSuperior

public AttributeType getSuperior()
                          throws javax.naming.NamingException
Gets the name of the superior class for this AttributeType.

Returns:
the super class for this AttributeType
Throws:
javax.naming.NamingException - if there is a failure to resolve the superior

getSyntax

public Syntax getSyntax()
                 throws javax.naming.NamingException
The Syntax for this AttributeType's values.

Returns:
the value syntax
Throws:
javax.naming.NamingException - if there is a failure to resolve the syntax

getLength

public int getLength()
Gets a length limit for this AttributeType.

Returns:
the length of the attribute

getEquality

public MatchingRule getEquality()
                         throws javax.naming.NamingException
Gets the MatchingRule for this AttributeType used for equality matching.

Returns:
the equality matching rule
Throws:
javax.naming.NamingException - if there is a failure to resolve the matchingRule

getOrdering

public MatchingRule getOrdering()
                         throws javax.naming.NamingException
Gets the MatchingRule for this AttributeType used for ordering.

Returns:
the ordering matching rule
Throws:
javax.naming.NamingException - if there is a failure to resolve the matchingRule

getSubstr

public MatchingRule getSubstr()
                       throws javax.naming.NamingException
Gets the MatchingRule for this AttributeType used for substring matching.

Returns:
the substring matching rule
Throws:
javax.naming.NamingException - if there is a failure to resolve the matchingRule


Copyright © 2003-2006 . All Rights Reserved.