com.novell.admin.ns
Class ClassDefinition

java.lang.Object
  extended bycom.novell.admin.ns.ClassDefinition
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DefaultClassDefinition, LDAPClassDefinition, NDSClassDefinition

public abstract class ClassDefinition
extends java.lang.Object
implements java.io.Serializable

This class represents the schema definition for a particular class.

Objects of this type are immutablem and any extensions to this class must enforce the immutable nature.

See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList aliasNames
          List of alias names.
protected  boolean auxiliary
           
protected  java.util.ArrayList classContainmentNameList
          List of classes that may contain this class.
protected  java.lang.String className
          Name of the class.
protected  boolean container
          Flags associated with this class.
protected  boolean effective
           
protected  boolean expanded
          Expanded flag means the tables above contain inherited attributes and classes in addition to the ones defined directly by the class.
protected  java.util.HashMap mandatoryAttributeTable
          Table of mandatory attributes.
protected  java.util.HashMap namingAttributeTable
          Table of naming attributes.
protected  boolean nonRemove
           
protected  java.util.HashMap optionalAttributeTable
          Table of optional attributes.
protected  SchemaDefinition schemaDef
          Reference to the SchemaDefinition object for this class.
protected  java.util.ArrayList superClassNameList
          List of classes that this class extends.
 
Constructor Summary
ClassDefinition(java.lang.String name, java.lang.String[] classContainmentNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes)
          Constructs a ClassDefinition object for a class.
ClassDefinition(java.lang.String name, java.lang.String[] classContainmentNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes, boolean container, boolean effective, boolean nonRemove, boolean auxiliary)
          Constructs a ClassDefinition object for a class.
ClassDefinition(java.lang.String name, java.lang.String[] aliasArray, java.lang.String[] classContainmentNames, java.lang.String[] superClassNames, AttributeDefinition[] mandatoryAttributes, AttributeDefinition[] namingAttributes, AttributeDefinition[] optionalAttributes, boolean container, boolean effective, boolean nonRemove, boolean auxiliary, SchemaDefinition schemaDef)
          Constructs a ClassDefinition object for a class.
 
Method Summary
 boolean canBeContainedBy(java.lang.String parentClass)
          Checks to see if this class can be contained by another.
 java.lang.String[] getAliasNames()
          Retrieves the alias names of the schema class.
 java.lang.String[] getContainmentClasses()
          Retrieves the classes that this class can be contained in.
 boolean getExpanded()
          Tests to see if this class definition is expanded or not.
 AttributeDefinition[] getMandatoryAttributes()
          Retrieves the mandatory attributes of the schema class.
 java.lang.String getName()
          Retrieves the name of the schema class.
 AttributeDefinition[] getNamingAttributes()
          Retrieves the naming attributes of the schema class.
 AttributeDefinition[] getOptionalAttributes()
          Retrieves the optional attributes of the schema class.
 java.lang.String[] getSuperClasses()
          Retrieves the super classes of this schema class.
 boolean isAttributeMandatory(java.lang.String attrName)
          Checks to see if a particular attribute is mandatory.
 boolean isAttributeOptional(java.lang.String attrName)
          Checks to see if a particular attribute is optional.
 boolean isAuxiliary()
          Tests to see if this is an Auxiliary class.
 boolean isClassUsingAttribute(java.lang.String attrName)
          Checks to see if a particular attribute is being used by this class.
 boolean isContainer()
          Tests to see if this is a container class.
 boolean isEffective()
          Tests to see if this is an effective class.
 boolean isInheritedFrom(java.lang.String className)
          Check to see if this is inherited from another specific class.
 boolean isNamedBy(java.lang.String attrName)
          Checks to see if an attribute is listed as a naming attribute.
 boolean isNonRemovable()
          Tests to see if this is an effective class.
 boolean isNonRemoveable()
          Tests to see if this is an effective class.
 void setExpanded(boolean expanded)
          Set the expanded flag.
 java.lang.String toString()
          Retrieves the name of the schema class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aliasNames

protected java.util.ArrayList aliasNames
List of alias names.


auxiliary

protected boolean auxiliary

classContainmentNameList

protected java.util.ArrayList classContainmentNameList
List of classes that may contain this class. ArrayList of String objects.


className

protected java.lang.String className
Name of the class.


container

protected boolean container
Flags associated with this class.


effective

protected boolean effective

expanded

protected boolean expanded
Expanded flag means the tables above contain inherited attributes and classes in addition to the ones defined directly by the class. Use the expanded definition to determine the effective properties of a class. Use the unexpanded definition for making modifications to the schema.


mandatoryAttributeTable

protected java.util.HashMap mandatoryAttributeTable
Table of mandatory attributes. (AttributeDefinition objects).


namingAttributeTable

protected java.util.HashMap namingAttributeTable
Table of naming attributes. (AttributeDefinition objects).


nonRemove

protected boolean nonRemove

optionalAttributeTable

protected java.util.HashMap optionalAttributeTable
Table of optional attributes. (AttributeDefinition objects).


schemaDef

protected SchemaDefinition schemaDef
Reference to the SchemaDefinition object for this class. This reference is used to look up alias names. May be null.


superClassNameList

protected java.util.ArrayList superClassNameList
List of classes that this class extends. ArrayList of String objects.

Constructor Detail

ClassDefinition

public ClassDefinition(java.lang.String name,
                       java.lang.String[] classContainmentNames,
                       AttributeDefinition[] mandatoryAttributes,
                       AttributeDefinition[] namingAttributes,
                       AttributeDefinition[] optionalAttributes)
Constructs a ClassDefinition object for a class.

Parameters:
name - The name of the schema class.
classContainmentNames - Names of classes that this class can be contained by.
mandatoryAttributes - Array of mandatory attribute definitions. This array may either be 'null' or empty if there are no mandatory attributes.
namingAttributes - Array of naming attribute definitions.
optionalAttributes - Array of optional attributes definitions. This array may either be 'null' or empty if there are no optional attributes.

ClassDefinition

public ClassDefinition(java.lang.String name,
                       java.lang.String[] classContainmentNames,
                       AttributeDefinition[] mandatoryAttributes,
                       AttributeDefinition[] namingAttributes,
                       AttributeDefinition[] optionalAttributes,
                       boolean container,
                       boolean effective,
                       boolean nonRemove,
                       boolean auxiliary)
Constructs a ClassDefinition object for a class.

Parameters:
name - The name of the schema class.
classContainmentNames - Names of classes that this class can be contained by.
mandatoryAttributes - Array of mandatory attribute definitions. This array may either be 'null' or empty if there are no mandatory attributes.
namingAttributes - Array of naming attribute definitions.
optionalAttributes - Array of optional attributes definitions. This array may either be 'null' or empty if there are no optional attributes.
container - Flag indicating a container class.
effective - Flag indicating an effective class.
nonRemove - Flag indicating a non-removeable class.
auxiliary - Flag indicating an auxiliary class.

ClassDefinition

public ClassDefinition(java.lang.String name,
                       java.lang.String[] aliasArray,
                       java.lang.String[] classContainmentNames,
                       java.lang.String[] superClassNames,
                       AttributeDefinition[] mandatoryAttributes,
                       AttributeDefinition[] namingAttributes,
                       AttributeDefinition[] optionalAttributes,
                       boolean container,
                       boolean effective,
                       boolean nonRemove,
                       boolean auxiliary,
                       SchemaDefinition schemaDef)
Constructs a ClassDefinition object for a class.

Parameters:
name - The name of the schema class.
aliasArray - The alternate names which can be used to access the class.
classContainmentNames - Names of classes that this class can be contained by.
superClassNames - Names of classes this class inherits from.
mandatoryAttributes - Array of mandatory attribute definitions. This array may either be 'null' or empty if there are no mandatory attributes.
namingAttributes - Array of naming attribute definitions.
optionalAttributes - Array of optional attributes definitions. This array may either be 'null' or empty if there are no optional attributes.
container - Flag indicating a container class.
effective - Flag indicating an effective class.
nonRemove - Flag indicating a non-removeable class.
auxiliary - Flag indicating an auxiliary class.
schemaDef - Reference to the SchemaDefinition object for this class.
Method Detail

canBeContainedBy

public boolean canBeContainedBy(java.lang.String parentClass)
Checks to see if this class can be contained by another.

This call should be done with an expanded class definition in order to properly test inherited containment rules.

This method cannot check that the parent class is a container. The preferred method is SchemaDefinition.canContain(parentClass, childClass)

If no containment rules have been given, we assume containment is possible.

Parameters:
parentClass - name of the class to check. Must be the standard class name, not an alias.
Returns:
True if the parentClass can contain this class, false otherwise.

getAliasNames

public java.lang.String[] getAliasNames()
Retrieves the alias names of the schema class.

Returns:
String array of the alias names.

getContainmentClasses

public java.lang.String[] getContainmentClasses()
Retrieves the classes that this class can be contained in.

Returns:
Array of the containment class names.

getExpanded

public boolean getExpanded()
Tests to see if this class definition is expanded or not. An expanded definition contains inherited attributes and classes as well, not just the ones defined directly by the schema for that class.

Returns:
true if this class definition is expanded, false otherwise.

getMandatoryAttributes

public AttributeDefinition[] getMandatoryAttributes()
Retrieves the mandatory attributes of the schema class.

Returns:
Array of the mandatory attributes.

getName

public java.lang.String getName()
Retrieves the name of the schema class.

Returns:
String - The class name.

getNamingAttributes

public AttributeDefinition[] getNamingAttributes()
Retrieves the naming attributes of the schema class.

Returns:
Array of the naming attribute definitions.

getOptionalAttributes

public AttributeDefinition[] getOptionalAttributes()
Retrieves the optional attributes of the schema class.

Returns:
Array of the optional attributes.

getSuperClasses

public java.lang.String[] getSuperClasses()
Retrieves the super classes of this schema class.

Returns:
Array of the super class names.

isAttributeMandatory

public boolean isAttributeMandatory(java.lang.String attrName)
Checks to see if a particular attribute is mandatory.

Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is mandatory, false otherwise.

isAttributeOptional

public boolean isAttributeOptional(java.lang.String attrName)
Checks to see if a particular attribute is optional.

Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is optional, false otherwise.

isAuxiliary

public boolean isAuxiliary()
Tests to see if this is an Auxiliary class.

Returns:
true if the class definition indicates it's an Auxiliary class, false otherwise.

isClassUsingAttribute

public boolean isClassUsingAttribute(java.lang.String attrName)
Checks to see if a particular attribute is being used by this class.

Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is used by this class, false otherwise.

isContainer

public boolean isContainer()
Tests to see if this is a container class.

Returns:
True if this object is a container, false otherwise.

isEffective

public boolean isEffective()
Tests to see if this is an effective class.

Returns:
True if an object of this type can be created, false otherwise.

isInheritedFrom

public boolean isInheritedFrom(java.lang.String className)
Check to see if this is inherited from another specific class.

Parameters:
className - name of the class to check.
Returns:
true if className is a super class this class, false otherwise.

isNamedBy

public boolean isNamedBy(java.lang.String attrName)
Checks to see if an attribute is listed as a naming attribute.

Parameters:
attrName - name of the attribute being looked for.
Returns:
true if attribute is found as a naming attribute, false otherwise.

isNonRemovable

public boolean isNonRemovable()
Tests to see if this is an effective class.

Returns:
True if an object of this type can be created, false otherwise.

isNonRemoveable

public boolean isNonRemoveable()
Tests to see if this is an effective class. This method is left in for backwards compatibility with for old misspelled methods.

Returns:
True if an object of this type can be created, false otherwise.

setExpanded

public void setExpanded(boolean expanded)
Set the expanded flag. For internal use only.

Parameters:
expanded - true if this class definition is expanded, false otherwise.

toString

public java.lang.String toString()
Retrieves the name of the schema class.

Returns:
A String representing the class name.


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.