com.novell.admin.ns.nds
Class NDSSchemaDefinition

java.lang.Object
  extended bycom.novell.admin.ns.SchemaDefinition
      extended bycom.novell.admin.ns.nds.NDSSchemaDefinition
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class NDSSchemaDefinition
extends SchemaDefinition

This class models the entire NDS schema.

All schema modifications should be made through this class. Cloned instances of this class can only be used for modeling. The only instance of this class that will result in actual NDS changes must be retrieved from the NDSSchema class.

See Also:
Schema.getSchemaDefinition(), Serialized Form

Field Summary
 
Fields inherited from class com.novell.admin.ns.SchemaDefinition
aliasAttributeNames, aliasClassNames, attributes, classes, expandedClasses, namespace, objectTypeCache
 
Constructor Summary
NDSSchemaDefinition(Schema schema, NamespaceSnapin ns)
          Constructor.
 
Method Summary
 void addAttributeDefinition(AttributeDefinition attrDef)
          Shortcut method to add AttributeDefinitions to the attribute hash table.
 void addClassDefinition(ClassDefinition classDef)
          Shortcut method to add ClassDefinitions to the classes hashtable.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a property change listener.
 void addVetoableChangeListener(java.beans.VetoableChangeListener l)
          Adds a change listener that can be vetoed.
 java.lang.Object clone()
          Creates an exact duplicate of this schema definition object.
 void generateExpandedDefinitions()
          Takes the set of unexpanded class definitions and creates a Hashmap of expanded class definitions.
 NDSClassDefinition getUnexpandedClassDefinition(java.lang.String className)
          Deprecated. Use SchemaDefinition.getRawClassDefinition() which returns the more generic ClassDefinition object.
 void putAttributeDefinition(AttributeDefinition attributeDef)
          Adds a new attribute definition to the schema.
 void putClassDefinition(ClassDefinition classDef)
          Adds a new class definition to the schema or replaces an existing definition with another.
 void refreshSchema()
          Forces the entire schema to be re-read from NDS.
 void removeAttributeDefinition(java.lang.String attrName)
          Removes an attribute definition from the schema.
 void removeClassDefinition(java.lang.String className)
          Removes a class definition from the schema.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a property change listener.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
          Removes a change listener that can be vetoed.
 
Methods inherited from class com.novell.admin.ns.SchemaDefinition
canContain, clearAttributes, clearClasses, clearObjectTypeCache, getAttributeDefinition, getAttributeDefinitions, getAuxiliaryClassDefinitions, getClassDefinition, getClassDefinitions, getClassesUsingAttribute, getContainmentClasses, getEffectiveClasses, getMandatoryAttributes, getNamingAttributes, getNumberOfAttributes, getNumberOfClasses, getObjectType, getOptionalAttributes, getRawClassDefinition, getSubClasses, getSuperClasses, isAttributeDefined, isClassDefined, translateAliasAttributeName, translateAliasClassName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NDSSchemaDefinition

public NDSSchemaDefinition(Schema schema,
                           NamespaceSnapin ns)
Constructor.

This constructor should NOT be used by applications. Applications should get the schema definition from the Schema Service implementation class.

Parameters:
schema - The NDS Schema Service class that factoried this.
Method Detail

addAttributeDefinition

public void addAttributeDefinition(AttributeDefinition attrDef)
Shortcut method to add AttributeDefinitions to the attribute hash table. //@internal

Parameters:
attrDef - The AttributeDefinition to put in the hashtable.

addClassDefinition

public void addClassDefinition(ClassDefinition classDef)
Shortcut method to add ClassDefinitions to the classes hashtable. //@internal

Parameters:
classDef - The ClassDefinitions to put in the hashtable.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener.

Parameters:
l - The listener.

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
Adds a change listener that can be vetoed.

Parameters:
l - The listener.

clone

public java.lang.Object clone()
Creates an exact duplicate of this schema definition object.

One side-effect of cloning is that no changes will ever be committed to NDS. Only the original definition object will cause changes to NDS. This allows for a "sandbox" metaphor.

Overrides:
clone in class SchemaDefinition
Returns:
A newly created NDSSchemaDefinition object.

generateExpandedDefinitions

public void generateExpandedDefinitions()
                                 throws NamespaceException
Takes the set of unexpanded class definitions and creates a Hashmap of expanded class definitions.

Expanded definitions contain all the inherited attributes and rules as opposed to just those defined by the immediate class. The inherited information includes: Superclasses Mandatory attributes Optional attributes Containmenet classes Naming attributes

Throws:
NamespaceException - Class not defined in schema.

getUnexpandedClassDefinition

public NDSClassDefinition getUnexpandedClassDefinition(java.lang.String className)
                                                throws NamespaceException
Deprecated. Use SchemaDefinition.getRawClassDefinition() which returns the more generic ClassDefinition object.

Looks up a specific class definition and returns it in raw (unexpanded) form.

A class in raw form lists only those attribute and class rules specified directly by the class, not the inherited ones.

Parameters:
className - The name of the class to look up.
Returns:
A valid LDAPClassDefinition in unexpanded form.
Throws:
NamespaceException - Class is not defined.

putAttributeDefinition

public void putAttributeDefinition(AttributeDefinition attributeDef)
                            throws NamespaceException,
                                   SPIException,
                                   java.beans.PropertyVetoException
Adds a new attribute definition to the schema.

If this instance is an original, changes will be committed to NDS.

Parameters:
attributeDef - The new attribute definition.
Throws:
NDSNamespaceException - Thrown when an existing attribute cannot be modified.
SPIException - Service provider threw an exception.
java.beans.PropertyVetoException - Thrown if someone vetoes the change.
NamespaceException

putClassDefinition

public void putClassDefinition(ClassDefinition classDef)
                        throws NamespaceException,
                               SPIException,
                               java.beans.PropertyVetoException
Adds a new class definition to the schema or replaces an existing definition with another.

If this instance is an original, changes will be committed to NDS.

Parameters:
classDef - The new class definition (unexpanded form).
Throws:
NamespaceException - Thrown when an attribute or superclass is not defined.
SPIException - The service provider threw an exception.
java.beans.PropertyVetoException - Thrown if someone vetoes the change.

refreshSchema

public void refreshSchema()
                   throws java.beans.PropertyVetoException
Forces the entire schema to be re-read from NDS.

Throws:
java.beans.PropertyVetoException - Thrown if someone vetoes the change.

removeAttributeDefinition

public void removeAttributeDefinition(java.lang.String attrName)
                               throws NamespaceException,
                                      SPIException,
                                      java.beans.PropertyVetoException
Removes an attribute definition from the schema.

If this instance is an original, the deletion will be committed to NDS.

Parameters:
attrName - The name of the attribute to be removed.
Throws:
NamespaceException - Thrown if the attribute is in use by a schema class.
SPIException - The service provider threw an exception.
java.beans.PropertyVetoException - Thrown if someone vetoes the change.

removeClassDefinition

public void removeClassDefinition(java.lang.String className)
                           throws NamespaceException,
                                  SPIException,
                                  java.beans.PropertyVetoException
Removes a class definition from the schema.

If this instance is an original, the deletion will be committed to NDS.

Parameters:
className - The name of the class that is to be removed.
Throws:
NamespaceException - Thrown if the class is in use by another schema class or the class is not defined.
SPIException - The service provider threw an exception.
java.beans.PropertyVetoException - Thrown if someone vetoes the change.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener.

Parameters:
l - The listener.

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Removes a change listener that can be vetoed.

Parameters:
l - The listener.


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.