com.novell.admin.ns
Class NSObject

java.lang.Object
  |
  +--com.novell.admin.ns.NSObject
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable
Direct Known Subclasses:
DefaultNSObject

public abstract class NSObject
extends java.lang.Object
implements java.lang.Cloneable, java.beans.PropertyChangeListener, java.io.Serializable

Memory model for objects stored in a namespace.

This model is provided for applications to access and modify all elements associated with a directory object. Elements such as attributes, flags, and schema for an object should be retrieved using this class.


Field Summary
protected  java.util.Vector addedAttributes
          Running list of newly valued attributes.
protected  java.util.Hashtable attributes
          Current list of mandatory and optional attributes.
protected  java.util.Vector classDefinition
          Class definition
protected  java.util.Vector deletedAttributes
          Running list of deleted attributes.
protected  java.util.Vector modifiedAttributes
          Running list of modified attributes.
protected  java.util.Vector propertyListeners
          List of registered Property Change Listeners
protected  long revision
          Revision of the object at the time of the directory read.
 
Constructor Summary
NSObject()
           
 
Method Summary
abstract  void addAttribute(ObjectAttribute attr)
          Adds a newly valued attribute to the object.
abstract  boolean addAuxiliaryClassDefinition(ClassDefinition classDef, ObjectAttribute[] attrs)
          Adds an auxiliary class Definition.
abstract  void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add this listener to the listener list for this object.
abstract  void clearAddedAttribute(java.lang.String attrName)
          Removes an attribute from the attributes to add.
abstract  void clearDeletedAttribute(java.lang.String attrName)
          Removes an attribute from the attributes to delete.
abstract  void clearModifiedAttribute(java.lang.String attrName)
          Removes an attribute from the attributes to modify.
 java.lang.Object clone()
          Creates an exact duplicate of this NSObject but discards all change info.
abstract  NSObject clone(com.novell.application.console.snapin.ObjectEntry newIdentity)
          Creates an exact duplicate of this NSObject but give it a new identity.
abstract  boolean deleteAttribute(java.lang.String attrName)
          Deletes a currently valued attribute of this object.
abstract  boolean deleteAuxiliaryClassDefinition(ClassDefinition classDef)
          Deletes an auxiliary class Definition.
abstract  java.lang.String[] getAddedAttributes()
          Retrieves the attributes that have been added to the object.
abstract  ObjectAttribute getAttribute(java.lang.String attrName)
          Retrieves a specific attribute of this object.
abstract  java.lang.String[] getAttributes()
          Retrieves the names of the valued attributes of the object.
abstract  ClassDefinition[] getClassDefinitions()
          Retrieves the schema class definition for the object.
abstract  java.lang.String[] getDeletedAttributes()
          Retrieves the attributes that have been deleted from the object.
abstract  java.lang.String[] getMandatoryAttributes()
          Retrieves the mandatory attributes of the object.
abstract  java.lang.String[] getModifiedAttributes()
          Retrieves the attributes that have been modified in the object.
abstract  com.novell.application.console.snapin.ObjectEntry getObjectEntry()
          Retrieves the object entry representation of the object.
abstract  java.lang.String[] getOptionalAttributes()
          Retrieves the optional attributes of the object.
abstract  long getRevision()
          Retrieves the revision of the object.
abstract  java.lang.String[] getUnvaluedAttributes()
          Retrieves the names of the attributes that are not valued.
abstract  boolean isAttributeMandatory(java.lang.String attrName)
          Checks to see if a particular attribute is mandatory for the Object Entry's schema class or any associated auxiliary classes.
abstract  boolean isAttributeOptional(java.lang.String attrName)
          Checks to see if a particular attribute is optional for the Object Entry's schema class or any associated auxiliary classes.
abstract  boolean isNamedBy(java.lang.String attrName)
          Checks to see if a particular attribute is a naming for the Object Entry's schema class or any associated auxiliary classes.
abstract  void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove this listener from the listener list for this object.
protected abstract  void setClassDefinition()
          Sets the class definition for this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

revision

protected long revision
Revision of the object at the time of the directory read.

classDefinition

protected java.util.Vector classDefinition
Class definition

attributes

protected java.util.Hashtable attributes
Current list of mandatory and optional attributes.

addedAttributes

protected java.util.Vector addedAttributes
Running list of newly valued attributes.

deletedAttributes

protected java.util.Vector deletedAttributes
Running list of deleted attributes.

modifiedAttributes

protected java.util.Vector modifiedAttributes
Running list of modified attributes.

propertyListeners

protected java.util.Vector propertyListeners
List of registered Property Change Listeners
Constructor Detail

NSObject

public NSObject()
Method Detail

addAttribute

public abstract void addAttribute(ObjectAttribute attr)
                           throws NamespaceException
Adds a newly valued attribute to the object.
Parameters:
attr - The valued attribute to be added.
Throws:
NamespaceException - A condition occured which disallowed the add.

getAttribute

public abstract ObjectAttribute getAttribute(java.lang.String attrName)
Retrieves a specific attribute of this object.
Parameters:
attrName - The name of the attribute that is to be retrieved.
Returns:
The ObjectAttribute named by 'attrName' if found, null otherwise.

deleteAttribute

public abstract boolean deleteAttribute(java.lang.String attrName)
                                 throws NamespaceException
Deletes a currently valued attribute of this object.
Parameters:
attr - The attribute to be deleted from the object.
Returns:
true if attribute was deleted, false if attribute was not found.
Throws:
NamespaceException - A condition occured that disallowed the delete.

getAddedAttributes

public abstract java.lang.String[] getAddedAttributes()
Retrieves the attributes that have been added to the object.
Returns:
A String array of the added attributes.

getAttributes

public abstract java.lang.String[] getAttributes()
Retrieves the names of the valued attributes of the object.
Returns:
A String array of all the attributes.

getMandatoryAttributes

public abstract java.lang.String[] getMandatoryAttributes()
Retrieves the mandatory attributes of the object.
Returns:
A String array of all mandatory attributes.

getOptionalAttributes

public abstract java.lang.String[] getOptionalAttributes()
Retrieves the optional attributes of the object.
Returns:
A String array of all optional attributes.

getUnvaluedAttributes

public abstract java.lang.String[] getUnvaluedAttributes()
Retrieves the names of the attributes that are not valued.
Returns:
A String array of attribute names that are not valued.

getClassDefinitions

public abstract ClassDefinition[] getClassDefinitions()
Retrieves the schema class definition for the object.
Returns:
The schema class definition.

getDeletedAttributes

public abstract java.lang.String[] getDeletedAttributes()
Retrieves the attributes that have been deleted from the object.
Returns:
A String array of the attributes that were deleted.

getModifiedAttributes

public abstract java.lang.String[] getModifiedAttributes()
Retrieves the attributes that have been modified in the object.
Returns:
A String array of the attributes that were modified.

getObjectEntry

public abstract com.novell.application.console.snapin.ObjectEntry getObjectEntry()
Retrieves the object entry representation of the object.
Returns:
The objectEntry used to name this object.

getRevision

public abstract long getRevision()
Retrieves the revision of the object.
Returns:
The revision.

clone

public abstract NSObject clone(com.novell.application.console.snapin.ObjectEntry newIdentity)
                        throws NamespaceException
Creates an exact duplicate of this NSObject but give it a new identity.
Parameters:
newIdentity - The ObjectEntry whos identity is assumed.
Returns:
A new NSObject.
Throws:
NamespaceException - NamespaceException.OBJECTTYPE_NOT_VALID is thrown if the newIdentity's type is different from this.

clone

public java.lang.Object clone()
Creates an exact duplicate of this NSObject but discards all change info.
Returns:
new NSObject as an Object type.
Overrides:
clone in class java.lang.Object

addPropertyChangeListener

public abstract void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add this listener to the listener list for this object.
Parameters:
listener - The listener to be added.

removePropertyChangeListener

public abstract void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove this listener from the listener list for this object.
Parameters:
listener - The listener to be removed.

clearAddedAttribute

public abstract void clearAddedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to add.
Parameters:
attr - The valued attribute to be removed from the add list.

clearDeletedAttribute

public abstract void clearDeletedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to delete.
Parameters:
attrName - The valued attribute to be removed from the delete list.

clearModifiedAttribute

public abstract void clearModifiedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to modify.
Parameters:
attrName - The valued attribute to be removed from the modify list.

isAttributeMandatory

public abstract boolean isAttributeMandatory(java.lang.String attrName)
Checks to see if a particular attribute is mandatory for the Object Entry's schema class or any associated auxiliary classes.
Parameters:
attrName - Name of the attribute to look for.
Returns:
True if attribute is mandatory, false otherwise.

isAttributeOptional

public abstract boolean isAttributeOptional(java.lang.String attrName)
Checks to see if a particular attribute is optional for the Object Entry's schema class or any associated auxiliary classes.
Parameters:
attrName - Name of the attribute to look for.
Returns:
true if attribute is optional, false otherwise.

isNamedBy

public abstract boolean isNamedBy(java.lang.String attrName)
Checks to see if a particular attribute is a naming for the Object Entry's schema class or any associated auxiliary classes.
Parameters:
attrName - Name of the attribute to look for.
Returns:
true if attribute is naming, false otherwise.

addAuxiliaryClassDefinition

public abstract boolean addAuxiliaryClassDefinition(ClassDefinition classDef,
                                                    ObjectAttribute[] attrs)
                                             throws NamespaceException
Adds an auxiliary class Definition.
Parameters:
classDef - The class definition to add.
attrs - The attributes to add.
Returns:
true if all attributes where added, false otherwise.
Throws:
NamespaceException - The association of the aux class failed.

deleteAuxiliaryClassDefinition

public abstract boolean deleteAuxiliaryClassDefinition(ClassDefinition classDef)
                                                throws NamespaceException
Deletes an auxiliary class Definition.
Parameters:
classDef - The class definition to add.
Returns:
true Class got deleted, false otherwise.
Throws:
NamespaceException - The deletion of the auxiliary class failed.

setClassDefinition

protected abstract void setClassDefinition()
Sets the class definition for this object.


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.