Class LDAPAttributeSchema
- java.lang.Object
-
- netscape.ldap.LDAPSchemaElement
-
- netscape.ldap.LDAPAttributeSchema
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
LDAPMatchingRuleSchema
,LDAPMatchingRuleUseSchema
public class LDAPAttributeSchema extends LDAPSchemaElement
The definition of an attribute type in the schema. RFC 2252, Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions covers the types of information to specify when defining an attribute type. According to the RFC, the description of an attribute type can include the following:- an OID identifying the attribute type
- a name identifying the attribute type
- a description of the attribute type
- the name of the parent attribute type
- the syntax used by the attribute (for example,
cis
orint
) - an indication of whether the attribute type is single-valued or multi-valued
When you construct an
LDAPAttributeSchema
object, you can specify these types of information as arguments to the constructor or in the AttributeTypeDescription format specified in RFC 2252. When an LDAP client searches an LDAP server for the schema, the server returns schema information as an object with attribute values in this format.There a number of additional optional description fields which are not explicitly accessible through LDAPAttributeSchema, but which can be managed with setQualifier, getQualifier, and getQualifierNames:
- EQUALITY
- ORDERING
- SUBSTR
- COLLECTIVE
- NO-USER-MODIFICATION
- USAGE
- OBSOLETE
To get the name, OID, and description of this attribute type definition, use the
getName
,getOID
, andgetDescription
methods inherited from the abstract classLDAPSchemaElement
. Optional and custom qualifiers are accessed withgetQualifier
andgetQualifierNames
fromLDAPSchemaElement
.To add or remove this attribute type definition from the schema, use the
add
andremove
methods, which this class inherits from theLDAPSchemaElement
abstract class.RFC 2252 defines AttributeTypeDescription as follows:
AttributeTypeDescription = "(" whsp numericoid whsp ; AttributeType identifier [ "NAME" qdescrs ] ; name used in AttributeType [ "DESC" qdstring ] ; description [ "OBSOLETE" whsp ] [ "SUP" woid ] ; derived from this other ; AttributeType [ "EQUALITY" woid ; Matching Rule name [ "ORDERING" woid ; Matching Rule name [ "SUBSTR" woid ] ; Matching Rule name [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3 [ "SINGLE-VALUE" whsp ] ; default multi-valued [ "COLLECTIVE" whsp ] ; default not collective [ "NO-USER-MODIFICATION" whsp ]; default user modifiable [ "USAGE" whsp AttributeUsage ]; default userApplications whsp ")" AttributeUsage = "userApplications" / "directoryOperation" / "distributedOperation" / ; DSA-shared "dSAOperation" ; DSA-specific, value depends on server
- Version:
- 1.0
- See Also:
LDAPSchemaElement
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COLLECTIVE
static java.lang.String
EQUALITY
static java.lang.String
NO_USER_MODIFICATION
static java.lang.String
ORDERING
static java.lang.String
SINGLE
static java.lang.String
SUBSTR
protected netscape.ldap.LDAPSyntaxSchemaElement
syntaxElement
static java.lang.String
USAGE
-
Fields inherited from class netscape.ldap.LDAPSchemaElement
aliases, attrName, binary, binaryString, ces, cesString, cis, cisString, description, dn, dnString, integer, intString, name, novalsTable, OBSOLETE, oid, properties, rawValue, SUPERIOR, SYNTAX, telephone, telephoneString, unknown
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LDAPAttributeSchema()
Constructs a blank element.LDAPAttributeSchema(java.lang.String raw)
Constructs an attribute type definition based on a description in the AttributeTypeDescription format.LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, int syntax, boolean single)
Constructs an attribute type definition, using the specified information.LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, java.lang.String syntaxString, boolean single)
Constructs an attribute type definition, using the specified information.LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, java.lang.String syntaxString, boolean single, java.lang.String superior, java.lang.String[] aliases)
Constructs an attribute type definition, using the specified information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getSuperior()
Gets the name of the attribute that this attribute inherits from, if any.int
getSyntax()
Gets the syntax of the schema elementjava.lang.String
getSyntaxString()
Gets the syntax of the attribute type in dotted-decimal format, for example "1.2.3.4.5"boolean
isSingleValued()
Determines if the attribute type is single-valued.java.lang.String
toString()
Gets the definition of the attribute type in a user friendly format.-
Methods inherited from class netscape.ldap.LDAPSchemaElement
add, add, getAliases, getCustomValues, getDescription, getID, getName, getOID, getOptionalValues, getQualifier, getQualifierNames, getValue, isObsolete, modify, modify, parseValue, remove, remove, setQualifier, setQualifier, update, update, update
-
-
-
-
Field Detail
-
EQUALITY
public static final java.lang.String EQUALITY
- See Also:
- Constant Field Values
-
ORDERING
public static final java.lang.String ORDERING
- See Also:
- Constant Field Values
-
SUBSTR
public static final java.lang.String SUBSTR
- See Also:
- Constant Field Values
-
SINGLE
public static final java.lang.String SINGLE
- See Also:
- Constant Field Values
-
COLLECTIVE
public static final java.lang.String COLLECTIVE
- See Also:
- Constant Field Values
-
NO_USER_MODIFICATION
public static final java.lang.String NO_USER_MODIFICATION
- See Also:
- Constant Field Values
-
USAGE
public static final java.lang.String USAGE
- See Also:
- Constant Field Values
-
syntaxElement
protected netscape.ldap.LDAPSyntaxSchemaElement syntaxElement
-
-
Constructor Detail
-
LDAPAttributeSchema
protected LDAPAttributeSchema()
Constructs a blank element.
-
LDAPAttributeSchema
public LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, int syntax, boolean single)
Constructs an attribute type definition, using the specified information.- Parameters:
name
- name of the attribute typeoid
- object identifier (OID) of the attribute type in dotted-string format (for example, "1.2.3.4")description
- description of attribute typesyntax
- syntax of this attribute type. The value of this argument can be one of the following:cis
(case-insensitive string)ces
(case-exact string)binary
(binary data)int
(integer)telephone
(telephone number -- identical to cis, but blanks and dashes are ignored during comparisons)dn
(distinguished name)
single
-true
if the attribute type is single-valued
-
LDAPAttributeSchema
public LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, java.lang.String syntaxString, boolean single)
Constructs an attribute type definition, using the specified information.- Parameters:
name
- name of the attribute typeoid
- object identifier (OID) of the attribute type in dotted-string format (for example, "1.2.3.4")description
- description of attribute typesyntaxString
- syntax of this attribute type in dotted-string format (for example, "1.2.3.4.5")single
-true
if the attribute type is single-valued
-
LDAPAttributeSchema
public LDAPAttributeSchema(java.lang.String name, java.lang.String oid, java.lang.String description, java.lang.String syntaxString, boolean single, java.lang.String superior, java.lang.String[] aliases)
Constructs an attribute type definition, using the specified information.- Parameters:
name
- name of the attribute typeoid
- object identifier (OID) of the attribute type in dotted-string format (for example, "1.2.3.4")description
- description of attribute typesyntaxString
- syntax of this attribute type in dotted-string format (for example, "1.2.3.4.5")single
-true
if the attribute type is single-valuedsuperior
- superior attribute as a name or OID;null
if there is no superioraliases
- names which are to be considered aliases for this attribute;null
if there are no aliases
-
LDAPAttributeSchema
public LDAPAttributeSchema(java.lang.String raw)
Constructs an attribute type definition based on a description in the AttributeTypeDescription format. For information on this format, (see RFC 2252, Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions. This is the format that LDAP servers and clients use to exchange schema information. (For example, when you search an LDAP server for its schema, the server returns an entry with the attributes "objectclasses" and "attributetypes". The values of "attributetypes" are attribute type descriptions in this format.)- Parameters:
raw
- definition of the attribute type in the AttributeTypeDescription format
-
-
Method Detail
-
isSingleValued
public boolean isSingleValued()
Determines if the attribute type is single-valued.- Returns:
true
if single-valued,false
if multi-valued.
-
getSuperior
public java.lang.String getSuperior()
Gets the name of the attribute that this attribute inherits from, if any.- Returns:
- the name of the attribute from which this attribute
inherits, or
null
if it does not have a superior.
-
getSyntax
public int getSyntax()
Gets the syntax of the schema element- Returns:
- one of the following values:
cis
(case-insensitive string)ces
(case-exact string)binary
(binary data)int
(integer)telephone
(telephone number -- identical to cis, but blanks and dashes are ignored during comparisons)dn
(distinguished name)unknown
(not a known syntax)
-
getSyntaxString
public java.lang.String getSyntaxString()
Gets the syntax of the attribute type in dotted-decimal format, for example "1.2.3.4.5"- Returns:
- The attribute syntax in dotted-decimal format.
-
toString
public java.lang.String toString()
Gets the definition of the attribute type in a user friendly format. This is the format that the attribute type definition uses when printing the attribute type or the schema.- Overrides:
toString
in classjava.lang.Object
- Returns:
- definition of the attribute type in a user friendly format.
-
-