netscape.ldap

Class LDAPDITContentRuleSchema

Implemented Interfaces:
java.io.Serializable

public class LDAPDITContentRuleSchema
extends LDAPSchemaElement

The definition of a DIT content rule in the schema. RFC 2252, Lightweight Directory Access Protocol (v3): DIT Content Rule Description covers the types of information to specify when defining a DIT content rule. According to the RFC, the description of a DIT content rule can include the following:

When you construct an LDAPDITContentRuleSchema 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 are a number of additional optional description fields which are not explicitly accessible through LDAPDITContentRuleSchema, but which can be managed with setQualifier, getQualifier, and getQualifierNames:

To get the name, OID, and description of this DIT content rule , use the getName, getOID, and getDescription methods inherited from the abstract class LDAPSchemaElement. Optional and custom qualifiers are accessed with getQualifier and getQualifierNames from LDAPSchemaElement.

To add or remove this attribute type definition from the schema, use the add and remove methods, which this class inherits from the LDAPSchemaElement abstract class.

RFC 2252 defines DITContentRuleDescription as follows:

    DITContentRuleDescription = "("
        numericoid   ; Structural ObjectClass identifier
        [ "NAME" qdescrs ]
        [ "DESC" qdstring ]
        [ "OBSOLETE" ]
        [ "AUX" oids ]    ; Auxiliary ObjectClasses
        [ "MUST" oids ]   ; AttributeType identifiers
        [ "MAY" oids ]    ; AttributeType identifiers
        [ "NOT" oids ]    ; AttributeType identifiers
       ")"
 
Version:
1.0
See Also:
LDAPSchemaElement, Serialized Form

Field Summary

static String
AUX
static String
MAY
static String
MUST
static String
NOT

Fields inherited from class netscape.ldap.LDAPSchemaElement

OBSOLETE, SUPERIOR, SYNTAX, aliases, attrName, binary, binaryString, ces, cesString, cis, cisString, description, dn, dnString, intString, integer, name, novalsTable, oid, properties, rawValue, telephone, telephoneString, unknown

Constructor Summary

LDAPDITContentRuleSchema()
Constructs a blank element.
LDAPDITContentRuleSchema(String raw)
Constructs a DIT content rule definition based on a description in the DITContentRuleDescription format.
LDAPDITContentRuleSchema(String name, String oid, String description, boolean obsolete, String[] auxiliary, String[] required, String[] optional, String[] precluded)
Constructs a DIT content rule definition, using the specified information.

Method Summary

String[]
getAuxiliaryClasses()
Gets the names of the auxiliary object classes allowed in this content rule.
String[]
getOptionalAttributes()
Gets the names of optional attributes allowed in this content rule.
String[]
getPrecludedAttributes()
Gets the names of the precluded attributes for this content rule.
String[]
getRequiredAttributes()
Gets the names of the required attributes for this content rule.
String
getValue()
Prepares a value in RFC 2252 format for submission to a server
String
toString()
Gets the definition of the rule in a user friendly format.
protected String
vectorToList(Vector vals)
Creates a list within parentheses, with $ as delimiter

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 Details

AUX

public static final String AUX

MAY

public static final String MAY

MUST

public static final String MUST

NOT

public static final String NOT

Constructor Details

LDAPDITContentRuleSchema

protected LDAPDITContentRuleSchema()
Constructs a blank element.

LDAPDITContentRuleSchema

public LDAPDITContentRuleSchema(String raw)
Constructs a DIT content rule definition based on a description in the DITContentRuleDescription format. For information on this format, (see RFC 2252, Lightweight Directory Access Protocol (v3): DIT Content Rule Description. 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 DIT content rule in the DITContentRuleDescription format

LDAPDITContentRuleSchema

public LDAPDITContentRuleSchema(String name,
                                String oid,
                                String description,
                                boolean obsolete,
                                String[] auxiliary,
                                String[] required,
                                String[] optional,
                                String[] precluded)
Constructs a DIT content rule definition, using the specified information.
Parameters:
name - name of the attribute type
oid - object identifier (OID) of the attribute type in dotted-string format (for example, "1.2.3.4")
description - description of attribute type
obsolete - true if the rule is obsolete
auxiliary - a list of auxiliary object classes allowed for an entry to which this content rule applies. These may either be specified by name or numeric oid.
required - a list of user attribute types that an entry to which this content rule applies must contain in addition to its normal set of mandatory attributes. These may either be specified by name or numeric oid.
optional - a list of user attribute types that an entry to which this content rule applies may contain in addition to its normal set of optional attributes. These may either be specified by name or numeric oid.
precluded - a list consisting of a subset of the optional user attribute types of the structural and auxiliary object classes which are precluded from an entry to which this content rule applies. These may either be specified by name or numeric oid.

Method Details

getAuxiliaryClasses

public String[] getAuxiliaryClasses()
Gets the names of the auxiliary object classes allowed in this content rule.
Returns:
the names of auxiliary object classes allowed in this content rule.

getOptionalAttributes

public String[] getOptionalAttributes()
Gets the names of optional attributes allowed in this content rule.
Returns:
the names of optional attributes allowed in this content rule.

getPrecludedAttributes

public String[] getPrecludedAttributes()
Gets the names of the precluded attributes for this content rule.
Returns:
the names of the precluded attributes for this content rule.

getRequiredAttributes

public String[] getRequiredAttributes()
Gets the names of the required attributes for this content rule.
Returns:
the names of the required attributes for this content rule.

getValue

public String getValue()
Prepares a value in RFC 2252 format for submission to a server
Overrides:
getValue in interface LDAPSchemaElement
Returns:
a String ready for submission to an LDAP server.

toString

public String toString()
Gets the definition of the rule in a user friendly format. This is the format that the rule definition uses when printing the attribute type or the schema.
Returns:
definition of the rule in a user friendly format.

vectorToList

protected String vectorToList(Vector vals)
Creates a list within parentheses, with $ as delimiter
Parameters:
vals - values for list
Returns:
a String with a list of values.