LDAP Classes
Implements Java LDAP

com.novell.ldap
Class LDAPAttributeSchema

java.lang.Object
  extended bycom.novell.ldap.LDAPAttribute
      extended bycom.novell.ldap.LDAPSchemaElement
          extended bycom.novell.ldap.LDAPAttributeSchema
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Externalizable, java.io.Serializable

public class LDAPAttributeSchema
extends LDAPSchemaElement

The definition of an attribute type in the schema.

LDAPAttributeSchema is used to discover an attribute's syntax, and add or delete an attribute definition. RFC 2252, "Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions" contains a description of the information on the LDAP representation of schema. draft-sermerseim-nds-ldap-schema-02, "LDAP Schema for NDS" defines the schema descriptions and non-standard syntaxes used by Novell eDirectory.

Sample Code: ExtendSchema.java

See Also:
LDAPSchema, Serialized Form

Field Summary
static int DIRECTORY_OPERATION
          Indicates that the attribute usage is for directory operations.
static int DISTRIBUTED_OPERATION
          Indicates that the attribute usage is for distributed operational attributes.
static int DSA_OPERATION
          Indicates that the attribute usage is for local operational attributes.
static int USER_APPLICATIONS
          Indicates that the attribute usage is for ordinary application or user data.
 
Fields inherited from class com.novell.ldap.LDAPSchemaElement
description, hashQualifier, names, obsolete, oid, qualifier
 
Constructor Summary
LDAPAttributeSchema()
          This constructor was added to support default Serialization
LDAPAttributeSchema(java.lang.String raw)
          Constructs an attribute definition from the raw string value returned on a directory query for "attributetypes".
LDAPAttributeSchema(java.lang.String[] names, java.lang.String oid, java.lang.String description, java.lang.String syntaxString, boolean single, java.lang.String superior, boolean obsolete, java.lang.String equality, java.lang.String ordering, java.lang.String substring, boolean collective, boolean isUserModifiable, int usage)
          Constructs an attribute definition for adding to or deleting from a directory's schema.
 
Method Summary
protected  java.lang.String formatString()
          Returns a string in a format suitable for directly adding to a directory, as a value of the particular schema element attribute.
 java.lang.String getEqualityMatchingRule()
          Returns the matching rule for this attribute.
 java.lang.String getOrderingMatchingRule()
          Returns the ordering matching rule for this attribute.
 java.lang.String getSubstringMatchingRule()
          Returns the substring matching rule for this attribute.
 java.lang.String getSuperior()
          Returns the name of the attribute type which this attribute derives from, or null if there is no superior attribute.
 java.lang.String getSyntaxString()
          Returns the object identifer of the syntax of the attribute, in dotted numerical format.
 int getUsage()
          Returns the usage of the attribute.
 boolean isCollective()
          Returns true if the attribute is a collective attribute.
 boolean isSingleValued()
          Returns true if the attribute is single-valued.
 boolean isUserModifiable()
          Returns false if the attribute is read-only.
static java.lang.Object readDSML(java.io.InputStream input)
          This method is used to deserialize the DSML encoded representation of this class.
protected  void setDeserializedValues(java.io.BufferedInputStream istream)
           
protected  void writeValue(java.lang.StringBuffer buff)
           
protected  void writeValue(java.io.Writer out)
           
 
Methods inherited from class com.novell.ldap.LDAPSchemaElement
addValue, addValue, getDescription, getID, getNames, getQualifier, getQualifierNames, isObsolete, removeValue, removeValue, setQualifier, toString
 
Methods inherited from class com.novell.ldap.LDAPAttribute
addBase64Value, addBase64Value, addBase64Value, addURLValue, addURLValue, addValue, clone, compareTo, getBaseName, getBaseName, getByteValue, getByteValueArray, getByteValues, getLangSubtype, getName, getStringValue, getStringValueArray, getStringValues, getSubtypes, getSubtypes, hasSubtype, hasSubtypes, readExternal, removeValue, setValue, size, writeDSML, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

USER_APPLICATIONS

public static final int USER_APPLICATIONS
Indicates that the attribute usage is for ordinary application or user data.

See Also:
Constant Field Values

DIRECTORY_OPERATION

public static final int DIRECTORY_OPERATION
Indicates that the attribute usage is for directory operations. Values are vendor specific.

See Also:
Constant Field Values

DISTRIBUTED_OPERATION

public static final int DISTRIBUTED_OPERATION
Indicates that the attribute usage is for distributed operational attributes. These hold server (DSA) information that is shared among servers holding replicas of the entry.

See Also:
Constant Field Values

DSA_OPERATION

public static final int DSA_OPERATION
Indicates that the attribute usage is for local operational attributes. These hold server (DSA) information that is local to a server.

See Also:
Constant Field Values
Constructor Detail

LDAPAttributeSchema

public LDAPAttributeSchema()
This constructor was added to support default Serialization


LDAPAttributeSchema

public LDAPAttributeSchema(java.lang.String[] names,
                           java.lang.String oid,
                           java.lang.String description,
                           java.lang.String syntaxString,
                           boolean single,
                           java.lang.String superior,
                           boolean obsolete,
                           java.lang.String equality,
                           java.lang.String ordering,
                           java.lang.String substring,
                           boolean collective,
                           boolean isUserModifiable,
                           int usage)
Constructs an attribute definition for adding to or deleting from a directory's schema.

Parameters:
names - Names of the attribute.

oid - Object identifer of the attribute, in dotted numerical format.

description - Optional description of the attribute.

syntaxString - Object identifer of the syntax of the attribute, in dotted numerical format.

single - True if the attribute is to be single-valued.

superior - Optional name of the attribute type which this attribute type derives from; null if there is no superior attribute type.

obsolete - True if the attribute is obsolete.

equality - Optional matching rule name; null if there is not an equality matching rule for this attribute.

ordering - Optional matching rule name; null if there is not an ordering matching rule for this attribute.

substring - Optional matching rule name; null if there is not a substring matching rule for this attribute.

collective - True of this attribute is a collective attribute

isUserModifiable - False if this attribute is a read-only attribute

usage - Describes what the attribute is used for. Must be one of the following: USER_APPLICATIONS, DIRECTORY_OPERATION, DISTRIBUTED_OPERATION or DSA_OPERATION.

LDAPAttributeSchema

public LDAPAttributeSchema(java.lang.String raw)
Constructs an attribute definition from the raw string value returned on a directory query for "attributetypes".

Parameters:
raw - The raw string value returned on a directory query for "attributetypes".
Method Detail

getSyntaxString

public java.lang.String getSyntaxString()
Returns the object identifer of the syntax of the attribute, in dotted numerical format.

Returns:
The object identifer of the attribute's syntax.

getSuperior

public java.lang.String getSuperior()
Returns the name of the attribute type which this attribute derives from, or null if there is no superior attribute.

Returns:
The attribute's superior attribute, or null if there is none.

isSingleValued

public boolean isSingleValued()
Returns true if the attribute is single-valued.

Returns:
True if the attribute is single-valued; false if the attribute is multi-valued.

getEqualityMatchingRule

public java.lang.String getEqualityMatchingRule()
Returns the matching rule for this attribute.

Returns:
The attribute's equality matching rule; null if it has no equality matching rule.

getOrderingMatchingRule

public java.lang.String getOrderingMatchingRule()
Returns the ordering matching rule for this attribute.

Returns:
The attribute's ordering matching rule; null if it has no ordering matching rule.

getSubstringMatchingRule

public java.lang.String getSubstringMatchingRule()
Returns the substring matching rule for this attribute.

Returns:
The attribute's substring matching rule; null if it has no substring matching rule.

isCollective

public boolean isCollective()
Returns true if the attribute is a collective attribute.

Returns:
True if the attribute is a collective; false if the attribute is not a collective attribute.

isUserModifiable

public boolean isUserModifiable()
Returns false if the attribute is read-only.

Returns:
False if the attribute is read-only; true if the attribute is read-write.

getUsage

public int getUsage()
Returns the usage of the attribute.

Returns:
One of the following values: USER_APPLICATIONS, DIRECTORY_OPERATION, DISTRIBUTED_OPERATION or DSA_OPERATION.

formatString

protected java.lang.String formatString()
Returns a string in a format suitable for directly adding to a directory, as a value of the particular schema element attribute.

Specified by:
formatString in class LDAPSchemaElement
Returns:
A string representation of the attribute's definition.

setDeserializedValues

protected void setDeserializedValues(java.io.BufferedInputStream istream)
                              throws java.io.IOException
Overrides:
setDeserializedValues in class LDAPAttribute
Throws:
java.io.IOException

writeValue

protected void writeValue(java.io.Writer out)
                   throws java.io.IOException
Overrides:
writeValue in class LDAPAttribute
Throws:
java.io.IOException

writeValue

protected void writeValue(java.lang.StringBuffer buff)
Overrides:
writeValue in class LDAPAttribute

readDSML

public static java.lang.Object readDSML(java.io.InputStream input)
                                 throws java.io.IOException
This method is used to deserialize the DSML encoded representation of this class.

Parameters:
input - InputStream for the DSML formatted data.
Returns:
Deserialized form of this class.
Throws:
java.io.IOException - when serialization fails.

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000