|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.LDAPEntry
com.novell.ldap.LDAPSchema
public class LDAPSchema
Represents a schema entry that controls one or more entries held by a Directory Server.
LDAPSchema
Contains methods to parse schema attributes into
individual schema definitions, represented by subclasses of
LDAPSchemaElement
. Schema may be retrieved from a Directory server
with the fetchSchema method of LDAPConnection or by creating an LDAPEntry
containing schema attributes. The following sample code demonstrates how to
retrieve schema elements from LDAPSchema
.
.
.
LDAPSchema schema;
LDAPSchemaElement element;
// connect to the server
lc.connect( ldapHost, ldapPort );
lc.bind( ldapVersion, loginDN, password );
// read the schema from the directory
schema = lc.fetchSchema( lc.getSchemaDN() );
// retrieve the definition of common name
element = schema.getAttributeSchema( "cn" );
System.out.println("The attribute cn has an oid of " + element.getID());
.
.
.
Other sample code:
LDAPSchemaElement
,
LDAPConnection.fetchSchema(java.lang.String)
,
LDAPConnection.getSchemaDN()
,
Serialized FormField Summary | |
---|---|
(package private) static int |
ATTRIBUTE
An index into the the arrays schemaTypeNames, idTable, and nameTable |
(package private) static int |
DITCONTENT
An index into the the arrays schemaTypeNames, idTable, and nameTable |
(package private) static int |
DITSTRUCTURE
An index into the the arrays schemaTypeNames, idTable, and nameTable |
private java.util.HashMap[] |
idTable
The idTable hash on the oid (or integer ID for DITStructureRule) and is used for retrieving enumerations |
(package private) static int |
MATCHING
An index into the the arrays schemaTypeNames, idTable, and nameTable |
(package private) static int |
MATCHING_USE
An index into the the arrays schemaTypeNames, idTable, and nameTable |
(package private) static int |
NAME_FORM
An index into the the arrays schemaTypeNames, idTable, and nameTable |
private java.util.HashMap[] |
nameTable
The nameTable will hash on the names (if available). |
(package private) static int |
OBJECT_CLASS
An index into the the arrays schemaTypeNames, idTable, and nameTable |
(package private) static java.lang.String[] |
schemaTypeNames
The following lists the LDAP names of subschema attributes for schema elements (definitions): |
(package private) static int |
SYNTAX
An index into the the arrays schemaTypeNames, idTable, and nameTable |
Fields inherited from class com.novell.ldap.LDAPEntry |
---|
attrs, dn |
Constructor Summary | |
---|---|
LDAPSchema()
This constructor was added to support default Serialization |
|
LDAPSchema(LDAPEntry ent)
Constructs an LDAPSchema object from attributes of an LDAPEntry. |
Method Summary | |
---|---|
private void |
addElement(int schemaType,
LDAPSchemaElement element)
Adds the schema definition to the idList and nameList HashMaps. |
java.util.Enumeration |
getAttributeNames()
Returns an enumeration of attribute names. |
LDAPAttributeSchema |
getAttributeSchema(java.lang.String name)
Returns a particular attribute definition, or null if not found. |
java.util.Enumeration |
getAttributeSchemas()
Returns an enumeration of attribute definitions. |
java.util.Enumeration |
getDITContentRuleNames()
Returns an enumeration of DIT content rule names. |
LDAPDITContentRuleSchema |
getDITContentRuleSchema(java.lang.String name)
Returns a particular DIT content rule definition, or null if not found. |
java.util.Enumeration |
getDITContentRuleSchemas()
Returns an enumeration of DIT content rule definitions. |
java.util.Enumeration |
getDITStructureRuleNames()
Returns an enumeration of DIT structure rule names. |
LDAPDITStructureRuleSchema |
getDITStructureRuleSchema(int ID)
Returns a particular DIT structure rule definition, or null if not found. |
LDAPDITStructureRuleSchema |
getDITStructureRuleSchema(java.lang.String name)
Returns a particular DIT structure rule definition, or null if not found. |
java.util.Enumeration |
getDITStructureRuleSchemas()
Returns an enumeration of DIT structure rule definitions. |
java.util.Enumeration |
getMatchingRuleNames()
Returns an enumeration of matching rule names. |
LDAPMatchingRuleSchema |
getMatchingRuleSchema(java.lang.String name)
Returns a particular matching rule definition, or null if not found. |
java.util.Enumeration |
getMatchingRuleSchemas()
Returns an enumeration of matching rule definitions. |
java.util.Enumeration |
getMatchingRuleUseNames()
Returns an enumeration of matching rule use names. |
LDAPMatchingRuleUseSchema |
getMatchingRuleUseSchema(java.lang.String name)
Returns a particular matching rule use definition, or null if not found. |
java.util.Enumeration |
getMatchingRuleUseSchemas()
Returns an enumeration of matching rule use definitions. |
java.util.Enumeration |
getNameFormNames()
Returns an enumeration of name form names. |
LDAPNameFormSchema |
getNameFormSchema(java.lang.String name)
Returns a particular name form definition, or null if not found. |
java.util.Enumeration |
getNameFormSchemas()
Returns an enumeration of name form definitions. |
java.util.Enumeration |
getObjectClassNames()
Returns an enumeration of object class names. |
LDAPObjectClassSchema |
getObjectClassSchema(java.lang.String name)
Returns a particular object class definition, or null if not found. |
java.util.Enumeration |
getObjectClassSchemas()
Returns an enumeration of object class definitions. |
private LDAPSchemaElement |
getSchemaElement(int schemaType,
java.lang.String key)
This function abstracts retrieving LDAPSchemaElements from the local copy of schema in this LDAPSchema class. |
LDAPSyntaxSchema |
getSyntaxSchema(java.lang.String oid)
Returns a particular syntax definition, or null if not found. |
java.util.Enumeration |
getSyntaxSchemas()
Returns an enumeration of syntax definitions. |
private int |
getType(LDAPSchemaElement element)
This helper function returns a number that represents the type of schema definition the element represents. |
(package private) static LDAPXMLHandler |
getXMLHandler(java.lang.String tagname,
LDAPXMLHandler parenthandler)
This method return the LDAPHandler which handles the XML (DSML) tags for this class |
static java.lang.Object |
readDSML(java.io.InputStream input)
This method is used to deserialize the DSML encoded representation of this class. |
Methods inherited from class com.novell.ldap.LDAPEntry |
---|
compareTo, getAttribute, getAttributeSet, getAttributeSet, getDN, newLine, readExternal, toString, writeDSML, writeExternal |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.HashMap[] idTable
private java.util.HashMap[] nameTable
static final java.lang.String[] schemaTypeNames
static final int ATTRIBUTE
static final int OBJECT_CLASS
static final int SYNTAX
static final int NAME_FORM
static final int DITCONTENT
static final int DITSTRUCTURE
static final int MATCHING
static final int MATCHING_USE
Constructor Detail |
---|
public LDAPSchema()
public LDAPSchema(LDAPEntry ent)
The object is empty if the entry parameter contains no schema
attributes. The recognized schema attributes are the following:
"attributeTypes", "objectClasses", "ldapSyntaxes",
"nameForms", "dITContentRules", "dITStructureRules",
"matchingRules","matchingRuleUse"
ent
- An LDAPEntry containing schema information.Method Detail |
---|
private void addElement(int schemaType, LDAPSchemaElement element)
schemaType
- Type of schema definition, use one of the final
integers defined at the top of this class:
ATTRIBUTE, OBJECT_CLASS, SYNTAX, NAME_FORM,
DITCONTENT, DITSTRUCTURE, MATCHING, MATCHING_USEelement
- Schema element definition.private LDAPSchemaElement getSchemaElement(int schemaType, java.lang.String key)
getXXX(String name)
functions.
Note that the nameTable has all keys cast to Upper-case. This is so we can have a case-insensitive HashMap. The getXXX (String key) methods will also cast to uppercase.
The first character of a NAME string can only be an alpha character (see section 4.1 of rfc2252) Thus if the first character is a digit we can conclude it is an OID. Note that this digit is ASCII only.
schemaType
- Specifies which list is to be used in schema
lookup.key
- The key can be either an OID or a name string.public LDAPAttributeSchema getAttributeSchema(java.lang.String name)
name
- Name or OID of the attribute for which a definition is
to be returned.
public LDAPDITContentRuleSchema getDITContentRuleSchema(java.lang.String name)
name
- The name of the DIT content rule use for which a
definition is to be returned.
public LDAPDITStructureRuleSchema getDITStructureRuleSchema(java.lang.String name)
name
- The name of the DIT structure rule use for which a
definition is to be returned.
public LDAPDITStructureRuleSchema getDITStructureRuleSchema(int ID)
ID
- The ID of the DIT structure rule use for which a
definition is to be returned.
public LDAPMatchingRuleSchema getMatchingRuleSchema(java.lang.String name)
name
- The name of the matching rule for which a definition
is to be returned.
public LDAPMatchingRuleUseSchema getMatchingRuleUseSchema(java.lang.String name)
name
- The name of the matching rule use for which a definition
is to be returned.
public LDAPNameFormSchema getNameFormSchema(java.lang.String name)
name
- The name of the name form for which a definition
is to be returned.
public LDAPObjectClassSchema getObjectClassSchema(java.lang.String name)
name
- The name or OID of the object class for which a
definition is to be returned.
public LDAPSyntaxSchema getSyntaxSchema(java.lang.String oid)
oid
- The oid of the syntax for which a definition
is to be returned.
public java.util.Enumeration getAttributeSchemas()
public java.util.Enumeration getDITContentRuleSchemas()
public java.util.Enumeration getDITStructureRuleSchemas()
public java.util.Enumeration getMatchingRuleSchemas()
public java.util.Enumeration getMatchingRuleUseSchemas()
public java.util.Enumeration getNameFormSchemas()
public java.util.Enumeration getObjectClassSchemas()
public java.util.Enumeration getSyntaxSchemas()
public java.util.Enumeration getAttributeNames()
public java.util.Enumeration getDITContentRuleNames()
public java.util.Enumeration getDITStructureRuleNames()
public java.util.Enumeration getMatchingRuleNames()
public java.util.Enumeration getMatchingRuleUseNames()
public java.util.Enumeration getNameFormNames()
public java.util.Enumeration getObjectClassNames()
private int getType(LDAPSchemaElement element)
element
- A class extending LDAPSchemaElement.
public static java.lang.Object readDSML(java.io.InputStream input) throws java.io.IOException
input
- InputStream for the DSML formatted data.
java.io.IOException
- when serialization fails.static LDAPXMLHandler getXMLHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
tagname
- Name of the Root tag used to represent this class.parenthandler
- Parent LDAPXMLHandler for this tag.
|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |