|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--netscape.ldap.LDAPSchemaElement
Abstract class representing an element (such as an object class
definition, an attribute type definition, or a matching rule
definition) in the schema. The specific types of elements are
represented by the 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:
In addition, there are optional standard qualifiers for attribute
types (see LDAPAttributeSchema), and implementation-specific
qualifiers may be added. Non-standard qualifiers must have names
starting with X-, e.g. "X-OWNER 'John Jacobson'". Optional and
non-standard qualifiers can be accessed with 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:
LDAPObjectClassSchema
,
LDAPAttributeSchema
,
LDAPMatchingRuleSchema
Field Summary | |
protected java.lang.String[] |
aliases
|
protected java.lang.String |
attrName
|
static int |
binary
|
protected static java.lang.String |
binaryString
|
static int |
ces
|
protected static java.lang.String |
cesString
|
static int |
cis
|
protected static java.lang.String |
cisString
|
protected java.lang.String |
description
|
static int |
dn
|
protected static java.lang.String |
dnString
|
static int |
integer
|
protected static java.lang.String |
intString
|
protected java.lang.String |
name
|
protected static java.util.Hashtable |
novalsTable
|
static java.lang.String |
OBSOLETE
|
protected java.lang.String |
oid
|
protected java.util.Hashtable |
properties
|
protected java.lang.String |
rawValue
|
static java.lang.String |
SUPERIOR
|
static java.lang.String |
SYNTAX
|
static int |
telephone
|
protected static java.lang.String |
telephoneString
|
static int |
unknown
|
Constructor Summary | |
protected |
LDAPSchemaElement()
Constructs a blank element. |
protected |
LDAPSchemaElement(java.lang.String name,
java.lang.String oid,
java.lang.String description)
Constructs a definition explicitly. |
Method Summary | |
void |
add(LDAPConnection ld)
Adds the current object class, attribute type, or matching rule definition to the schema at the root DSE. |
void |
add(LDAPConnection ld,
java.lang.String dn)
Adds the current object class, attribute type, or matching rule definition to the schema. |
java.lang.String[] |
getAliases()
Gets the aliases of the attribute, if any |
protected java.lang.String |
getCustomValues()
Gets any qualifiers marked as custom (starting with "X-") |
java.lang.String |
getDescription()
Gets the description of the object class, attribute type, or matching rule. |
java.lang.String |
getName()
Gets the name of the object class, attribute type, or matching rule. |
java.lang.String |
getOID()
Gets the object ID (OID) of the object class, attribute type, or matching rule in dotted-string format (for example, "1.2.3.4"). |
protected java.lang.String |
getOptionalValues(java.lang.String[] names)
Gets qualifiers which may or may not be present |
java.lang.String[] |
getQualifier(java.lang.String name)
Gets the value of a qualifier which is not predefined. |
java.util.Enumeration |
getQualifierNames()
Gets an enumeration of all qualifiers which are not predefined. |
java.lang.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). |
boolean |
isObsolete()
Reports if the element is marked as obsolete. |
void |
modify(LDAPConnection ld,
LDAPSchemaElement newValue)
Replaces a single value of the object class, attribute type, or matching rule definition in the schema at the root DSE. |
void |
modify(LDAPConnection ld,
LDAPSchemaElement newValue,
java.lang.String dn)
Replaces a single value of the object class, attribute type, or matching rule definition in the schema. |
protected void |
parseValue(java.lang.String raw)
Parses a raw schema value into OID, name, description, and a Hashtable of other qualifiers and values. |
void |
remove(LDAPConnection ld)
Removes the current object class, attribute type, or matching rule definition from the schema at the root DSE. |
void |
remove(LDAPConnection ld,
java.lang.String dn)
Removes the current object class, attribute type, or matching rule definition from the schema. |
void |
setQualifier(java.lang.String name,
java.lang.String value)
Keeps track of qualifiers which are not predefined. |
void |
setQualifier(java.lang.String name,
java.lang.String[] values)
Keeps track of qualifiers which are not predefined. |
protected void |
update(LDAPConnection ld,
int op,
LDAPAttribute[] attrs,
java.lang.String dn)
Adds, removes or modifies the definition from a Directory. |
protected void |
update(LDAPConnection ld,
int op,
LDAPAttribute attr,
java.lang.String dn)
Adds, removes or modifies the definition from a Directory. |
protected void |
update(LDAPConnection ld,
int op,
java.lang.String name,
java.lang.String dn)
Adds, removes or modifies the definition from a Directory. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int unknown
public static final int cis
public static final int binary
public static final int telephone
public static final int ces
public static final int dn
public static final int integer
protected static final java.lang.String cisString
protected static final java.lang.String binaryString
protected static final java.lang.String telephoneString
protected static final java.lang.String cesString
protected static final java.lang.String intString
protected static final java.lang.String dnString
public static final java.lang.String OBSOLETE
public static final java.lang.String SUPERIOR
public static final java.lang.String SYNTAX
protected java.lang.String oid
protected java.lang.String name
protected java.lang.String description
protected java.lang.String attrName
protected java.lang.String rawValue
protected java.lang.String[] aliases
protected java.util.Hashtable properties
protected static java.util.Hashtable novalsTable
Constructor Detail |
protected LDAPSchemaElement()
protected LDAPSchemaElement(java.lang.String name, java.lang.String oid, java.lang.String description)
name
- name of elementoid
- dotted-string object identifierdescription
- description of elementMethod Detail |
public java.lang.String getName()
public java.lang.String getOID()
public java.lang.String getDescription()
protected void update(LDAPConnection ld, int op, LDAPAttribute attr, java.lang.String dn) throws LDAPException
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 modifyprotected void update(LDAPConnection ld, int op, LDAPAttribute[] attrs, java.lang.String dn) throws LDAPException
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 modifyprotected void update(LDAPConnection ld, int op, java.lang.String name, java.lang.String dn) throws LDAPException
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 modifypublic void add(LDAPConnection ld, java.lang.String dn) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP serverdn
- the entry at which to add the schema definitionpublic void add(LDAPConnection ld) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP serverpublic void modify(LDAPConnection ld, LDAPSchemaElement newValue, java.lang.String dn) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP servernewValue
- the new valuedn
- the entry at which to modify the schema definitionpublic void modify(LDAPConnection ld, LDAPSchemaElement newValue) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP servernewValue
- the new valuepublic void remove(LDAPConnection ld, java.lang.String dn) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP serverdn
- the entry at which to remove the schema definitionpublic void remove(LDAPConnection ld) throws LDAPException
ld
- the LDAPConnection
object representing
a connection to an LDAP serverpublic boolean isObsolete()
true if the element is defined as obsolete.
protected void parseValue(java.lang.String raw)
raw
- a raw schema definitionpublic java.lang.String getValue()
quotingBug
- true
if single quotes are to be
supplied around the SYNTAX and SUP valueprotected java.lang.String getOptionalValues(java.lang.String[] names)
names
- list of qualifiers to look upprotected java.lang.String getCustomValues()
public void setQualifier(java.lang.String name, java.lang.String value)
name
- name of qualifiervalue
- value of qualifier. "" for no value, null
to remove the qualifierpublic void setQualifier(java.lang.String name, java.lang.String[] values)
name
- name of qualifiervalues
- array of valuespublic java.lang.String[] getQualifier(java.lang.String name)
name
- name of qualifiernull
if not
present, a zero-length array if present but with no value.public java.util.Enumeration getQualifierNames()
public java.lang.String[] getAliases()
null
if
it does not have any aliases
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |