com.novell.admin.ns.nds
Class NDSSchemaDefinition

java.lang.Object
  |
  +--com.novell.admin.ns.SchemaDefinition
        |
        +--com.novell.admin.ns.DefaultSchemaDefinition
              |
              +--com.novell.admin.ns.nds.NDSSchemaDefinition
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class NDSSchemaDefinition
extends DefaultSchemaDefinition

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()

Fields inherited from class com.novell.admin.ns.SchemaDefinition
attributes, classes
 
Constructor Summary
NDSSchemaDefinition(NDSSchema schema)
          Constructor.
 
Method Summary
 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.
 ClassDefinition getClassDefinition(java.lang.String className)
          Returns a specific class definition in expanded form.
 ClassDefinition[] getContainmentClasses(java.lang.String className)
          Retrieves all containment classes for a specific class type.
 ClassDefinition[] getEffectiveClasses(java.lang.String parentClass)
          Retrieves the effective classes in expanded form that may be instantiated relative to another class type.
 AttributeDefinition[] getMandatoryAttributes(java.lang.String className)
          Retrieves all mandatory attributes for a specific class.
 AttributeDefinition[] getNamingAttributes(java.lang.String className)
          Retrieves all naming attributes for a specific class.
 AttributeDefinition[] getOptionalAttributes(java.lang.String className)
          Retrieves all optional attributes for a specific class.
 ClassDefinition[] getSubClasses(java.lang.String className)
          Retrieves all classes that derive from a specific class type.
 ClassDefinition[] getSuperClasses(java.lang.String className)
          Retrieves all classes from which a specific class inherits.
 NDSClassDefinition getUnexpandedClassDefinition(java.lang.String className)
          Returns a specific class definition in unexpanded form.
 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.DefaultSchemaDefinition
canContain, equals, getAttributeDefinition, getAttributeDefinitions, getAuxiliaryClassDefinitions, getClassDefinitions, getClassesUsingAttribute, getNumberOfAttributes, getNumberOfClasses, isAttributeDefined, isClassDefined
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NDSSchemaDefinition

public NDSSchemaDefinition(NDSSchema schema)
Constructor.

This constructor should not be used by applications. Applications should get the schema definition from the SchemaService implementation class.

Parameters:
schema - The NDS Schema Service class that created the definition.
Method Detail

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.

putAttributeDefinition

public void putAttributeDefinition(AttributeDefinition attributeDef)
                            throws NDSNamespaceException,
                                   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.

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.
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.

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.

getEffectiveClasses

public ClassDefinition[] getEffectiveClasses(java.lang.String parentClass)
Retrieves the effective classes in expanded form that may be instantiated relative to another class type.
Parameters:
parentClass - The name of the parent class.
Returns:
An array of ClassDefinition objects representing those class types that can be instantiated as children of the parent class.
Overrides:
getEffectiveClasses in class DefaultSchemaDefinition

getUnexpandedClassDefinition

public NDSClassDefinition getUnexpandedClassDefinition(java.lang.String className)
                                                throws NamespaceException
Returns a specific class definition in unexpanded form.
Parameters:
className - The name of the class to retrieve.
Returns:
A valid NDSClassDefinition in unexpanded form.
Throws:
NamespaceException - Thrown if the class is not defined.

getClassDefinition

public ClassDefinition getClassDefinition(java.lang.String className)
                                   throws NamespaceException
Returns a specific class definition in expanded form.
Parameters:
className - The name of the class to retrieve.
Returns:
A valid NDSClassDefinition in expanded form.
Throws:
NamespaceException - Thrown if the class is not defined in schema.
Overrides:
getClassDefinition in class DefaultSchemaDefinition

getSuperClasses

public ClassDefinition[] getSuperClasses(java.lang.String className)
                                  throws NamespaceException
Retrieves all classes from which a specific class inherits.

The class definitions returned are in unexpanded form.

Parameters:
className - The name of the subclass.
Returns:
An array of unexpanded ClassDefinition objects representing the super classes.
Throws:
NamespaceException - Thrown if the class is not defined in schema.

getContainmentClasses

public ClassDefinition[] getContainmentClasses(java.lang.String className)
                                        throws NamespaceException
Retrieves all containment classes for a specific class type.

The class definitions returned are in unexpanded form.

Parameters:
className - The name of the class.
Returns:
An array of unexpanded ClassDefinition objects that may contain the class named by className.
Throws:
NamespaceException - Thrown if the class is not defined in the schema.
Overrides:
getContainmentClasses in class DefaultSchemaDefinition

getSubClasses

public ClassDefinition[] getSubClasses(java.lang.String className)
Retrieves all classes that derive from a specific class type.

The class definitions returned are in unexpanded form.

Parameters:
className - The name of the super class.
Returns:
An array of unexpanded ClassDefinition objects representing the immediate subclasses.

getNamingAttributes

public AttributeDefinition[] getNamingAttributes(java.lang.String className)
                                          throws NamespaceException
Retrieves all naming attributes for a specific class.
Parameters:
className - The name of the class.
Returns:
An array of AttributeDefinition objects representing the naming attributes of the specified class.
Throws:
NamespaceException - Thrown if the class is not defined in the schema.

getOptionalAttributes

public AttributeDefinition[] getOptionalAttributes(java.lang.String className)
                                            throws NamespaceException
Retrieves all optional attributes for a specific class.
Parameters:
className - The name of the class.
Returns:
An array of AttributeDefinition objects representing the optional attributes of the specified class.
Throws:
NamespaceException - Thrown if the class not defined in schema.

getMandatoryAttributes

public AttributeDefinition[] getMandatoryAttributes(java.lang.String className)
                                             throws NamespaceException
Retrieves all mandatory attributes for a specific class.
Parameters:
className - The name of the class.
Returns:
An array of AttributeDefinition objects representing the mandatory attributes of the specified class.
Throws:
NamespaceException - Thrown if the class is not defined in the schema.

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.

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

addVetoableChangeListener

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

removeVetoableChangeListener

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

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener.
Parameters:
l - The listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener.
Parameters:
l - The listener.


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated December 17 2003 1746.