Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
netscape.ldap.LDAPSchemaElement
public abstract class LDAPSchemaElement
extends java.lang.Object
implements java.io.Serializable
LDAPObjectClassSchema
,
LDAPAttributeSchema
, and LDAPMatchingRuleSchema
subclasses.
RFC 2252, Lightweight Directory Access Protocol (v3):
Attribute Syntax Definitions covers the types of information
that need to be specified in the definition of an object class,
attribute type, or matching rule. All of these schema elements
can specify the following information:
getQualifier
and
setQualifier
, and enumerated with
getQualifierNames
.
The LDAPSchemaElement
class implements methods that
you can use with different types of schema elements (object class
definitions, attribute type definitions, and matching rule definitions).
You can do the following:
Field Summary | |
static String | |
static String | |
static String | |
protected String[] | |
protected String | |
static int | |
protected static String | |
static int | |
protected static String | |
static int | |
protected static String | |
protected String | |
static int | |
protected static String | |
protected static String | |
static int | |
protected String | |
protected static Hashtable | |
protected String | |
protected Hashtable | |
protected String | |
static int | |
protected static String | |
static int |
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
void |
|
String[] |
|
protected String |
|
String |
|
String |
|
String |
|
String |
|
protected String |
|
String[] |
|
Enumeration |
|
String |
|
boolean |
|
void |
|
void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
protected void |
|
protected void |
|
protected void |
|
public static final String OBSOLETE
public static final String SUPERIOR
public static final String SYNTAX
protected String[] aliases
protected String attrName
public static final int binary
- Field Value:
- 2
protected static final String binaryString
public static final int ces
- Field Value:
- 4
protected static final String cesString
public static final int cis
- Field Value:
- 1
protected static final String cisString
protected String description
public static final int dn
- Field Value:
- 5
protected static final String dnString
protected static final String intString
public static final int integer
- Field Value:
- 6
protected String name
protected static Hashtable novalsTable
protected String oid
protected Hashtable properties
protected String rawValue
public static final int telephone
- Field Value:
- 3
protected static final String telephoneString
public static final int unknown
- Field Value:
- 0
protected LDAPSchemaElement()
Constructs a blank element.
protected LDAPSchemaElement(String name, String oid, String description)
Constructs a definition explicitly.
- Parameters:
name
- name of elementoid
- dotted-string object identifierdescription
- description of element
protected LDAPSchemaElement(String name, String oid, String description, String[] aliases)
Constructs a definition explicitly.
- Parameters:
name
- name of elementoid
- dotted-string object identifierdescription
- description of elementaliases
- names which are to be considered aliases for this element;null
if there are no aliases
public void add(LDAPConnection ld) throws LDAPException
Adds the current object class, attribute type, or matching rule definition to the schema at the root DSE. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP server
- Throws:
LDAPException
- if the specified definition cannot be added to the schema.
public void add(LDAPConnection ld, String dn) throws LDAPException
Adds the current object class, attribute type, or matching rule definition to the schema. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP serverdn
- the entry at which to add the schema definition
- Throws:
LDAPException
- if the specified definition cannot be added to the schema
public String[] getAliases()
Gets the aliases of the attribute, if any
- Returns:
- the aliases of the attribute, or
null
if it does not have any aliases
protected String getCustomValues()
Gets any qualifiers marked as custom (starting with "X-")
- Returns:
- string in RFC 2252 format, without a terminating ' '.
public String getDescription()
Gets the description of the object class, attribute type, or matching rule.
- Returns:
- the description of the object class, attribute type, or matching rule.
public String getID()
Gets the object ID (OID) of the object class, attribute type, or matching rule in dotted-string format (for example, "1.2.3.4").
- Returns:
- the OID of the object class, attribute type, or matching rule.
public String getName()
Gets the name of the object class, attribute type, or matching rule.
- Returns:
- the name of the object class, attribute type, or matching rule.
public String getOID()
Deprecated. Use
LDAPSchemaElement.getID()
Gets the object ID (OID) of the object class, attribute type, or matching rule in dotted-string format (for example, "1.2.3.4").
- Returns:
- the OID of the object class, attribute type, or matching rule.
protected String getOptionalValues(String[] names)
Gets qualifiers which may or may not be present
- Parameters:
names
- list of qualifiers to look up
- Returns:
- String in RFC 2252 format containing any values found, not terminated with ' '.
public String[] getQualifier(String name)
Gets the value of a qualifier which is not predefined.
- Parameters:
name
- name of qualifier
- Returns:
- value or values of qualifier;
null
if not present, a zero-length array if present but with no value.
public Enumeration getQualifierNames()
Gets an enumeration of all qualifiers which are not predefined.
- Returns:
- enumeration of qualifiers.
public String getValue()
Formats a String in the format defined in X.501 (see RFC 2252, Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions for a description of this format). 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 the "attributetypes" attribute are attribute type descriptions in this format.
- Returns:
- a formatted String for defining a schema element.
public boolean isObsolete()
Reports if the element is marked as obsolete.
- Returns:
true
if the element is defined as obsolete.
public void modify(LDAPConnection ld, LDAPSchemaElement newValue) throws LDAPException
Replaces a single value of the object class, attribute type, or matching rule definition in the schema at the root DSE. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP servernewValue
- the new value
- Throws:
LDAPException
- if the specified definition cannot be modified.
public void modify(LDAPConnection ld, LDAPSchemaElement newValue, String dn) throws LDAPException
Replaces a single value of the object class, attribute type, or matching rule definition in the schema. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP servernewValue
- the new valuedn
- the entry at which to modify the schema definition
- Throws:
LDAPException
- if the specified definition cannot be modified.
protected void parseValue(String raw)
Parses a raw schema value into OID, name, description, and a Hashtable of other qualifiers and values.
- Parameters:
raw
- a raw schema definition
public void remove(LDAPConnection ld) throws LDAPException
Removes the current object class, attribute type, or matching rule definition from the schema at the root DSE. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP server
- Throws:
LDAPException
- if the specified definition cannot be removed from the schema
public void remove(LDAPConnection ld, String dn) throws LDAPException
Removes the current object class, attribute type, or matching rule definition from the schema. Typically, most servers will require you to authenticate before allowing you to edit the schema.
- Parameters:
ld
- theLDAPConnection
object representing a connection to an LDAP serverdn
- the entry at which to remove the schema definition
- Throws:
LDAPException
- if the specified definition cannot be removed from the schema.
public void setQualifier(String name, String value)
Keeps track of qualifiers which are not predefined.
- Parameters:
name
- name of qualifiervalue
- value of qualifier. "" for no value,null
to remove the qualifier
public void setQualifier(String name, String[] values)
Keeps track of qualifiers which are not predefined.
- Parameters:
name
- name of qualifiervalues
- array of values
protected void update(LDAPConnection ld, int op, String name, String dn) throws LDAPException
Adds, removes or modifies the definition from a Directory.
- Parameters:
ld
- an open connection to a Directory Server. Typically the connection must have been authenticated to add a definition.op
- type of modification to makename
- name of attribute in the schema entry to modify
- Throws:
LDAPException
- if the definition can't be added/removed
protected void update(LDAPConnection ld, int op, LDAPAttribute attr, String dn) throws LDAPException
Adds, removes or modifies the definition from a Directory.
- Parameters:
ld
- an open connection to a Directory Server. Typically the connection must have been authenticated to add a definition.op
- type of modification to makeattr
- attribute in the schema entry to modify
- Throws:
LDAPException
- if the definition can't be added/removed
protected void update(LDAPConnection ld, int op, LDAPAttribute[] attrs, String dn) throws LDAPException
Adds, removes or modifies the definition from a Directory.
- Parameters:
ld
- an open connection to a Directory Server. Typically the connection must have been authenticated to add a definition.op
- type of modification to makeattrs
- attributes in the schema entry to modify
- Throws:
LDAPException
- if the definition can't be added/removed.