public abstract class DefaultNSObject extends NSObject implements java.io.Serializable
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.
This class reads all attributes of an object into memory. It was designed for property books where one generally needs all the attributes. It's an expensive class to use if one only needs to read or modify a few attributes of an object.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Hashtable |
addedAttributeDefinitions
Running list of newly added attribute definitions.
|
protected AdminNamespace |
namespace
Namespace that can be used to get class definition
|
protected ObjectEntry |
objectEntry
The associated ObjectEntry.
|
addedAttributes, attributes, classDefinition, deletedAttributes, modifiedAttributes, propertyListeners, revision, shadowSign| Modifier | Constructor and Description |
|---|---|
protected |
DefaultNSObject(ObjectEntry objEntry,
java.util.Vector attributes,
long rev)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(ObjectAttribute attr)
Adds a newly valued attribute to the object.
|
boolean |
addAuxiliaryClassDefinition(ClassDefinition classDef,
ObjectAttribute[] attrs)
Adds an auxiliary class Definition.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds this listener to the listener list for this object.
|
protected void |
checkAdd(ObjectAttribute attr,
boolean isForAuxClass)
Checks to make sure an attribute can be added to this object.
|
void |
clearAddedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to add.
|
void |
clearAddedAttributeDefinitions()
Removes an attribute from the attributes to add.
|
void |
clearDeletedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to delete.
|
void |
clearModifiedAttribute(java.lang.String attrName)
Removes an attribute from the attributes to modify.
|
NSObject |
clone(ObjectEntry newIdentity)
Creates an exact duplicate of this NSObject but gives it a new identity.
|
boolean |
deleteAttribute(java.lang.String attrName)
Deletes a currently valued attribute of this object.
|
boolean |
deleteAuxiliaryClassDefinition(ClassDefinition classDef)
Deletes an auxiliary class definition.
|
java.util.Hashtable |
getAddedAttributeDefinitions()
Retrieves the attributes that have been added to the object.
|
java.lang.String[] |
getAddedAttributes()
Retrieves the attributes that have been added to the object.
|
ObjectAttribute |
getAttribute(java.lang.String attrName)
Retrieves a specific attribute of this object.
|
ObjectAttribute |
getAttribute(java.lang.String attrName,
AdminNamespaceExceptionReference aneRef,
ObjectEntry serverOE)
exclude
Retrieves a specific attribute from this object.
|
ObjectAttribute |
getAttribute(java.lang.String attrName,
int attrFlags,
AdminNamespaceExceptionReference aneRef,
ObjectEntry serverOE)
exclude
Retrieves a specific attribute from this object.
|
java.lang.String[] |
getAttributes()
Retrieves the names of the valued attributes of the object.
|
ClassDefinition[] |
getClassDefinitions()
Retrieves the schema class definition for the object.
|
java.lang.String[] |
getDeletedAttributes()
Retrieves the attributes that have been deleted from the object.
|
java.lang.String[] |
getMandatoryAttributes()
Retrieves the mandatory attributes of the object.
|
java.lang.String[] |
getModifiedAttributes()
Retrieves the attributes that have been modified in the object.
|
ObjectEntry |
getObjectEntry()
Retrieves the object entry representation of the object.
|
java.lang.String[] |
getOptionalAttributes()
Retrieves the optional attributes of the object.
|
long |
getRevision()
Retrieves the revision of the object.
|
java.lang.String[] |
getUnvaluedAttributes()
Retrieves the names of the attributes that are not valued.
|
boolean |
isAddPossible(ObjectAttribute attr,
boolean isForAuxClass)
Checks if the conditions are satisfied for adding an attributes.
|
boolean |
isAttributeMandatory(java.lang.String attrName)
Checks to see if a particular attribute is mandatory for the Object
Entry's schema class or its associated auxiliary classes.
|
boolean |
isAttributeOptional(java.lang.String attrName)
Checks to see if a particular attribute is optional for the Object
Entry's schema class or its associated auxiliary classes.
|
boolean |
isNamedBy(java.lang.String attrName)
Checks to see if a particular attribute is a naming for the Object
Entry's schema class or its associated auxiliary classes.
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
Callback for attribute modifications.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes this listener from the listener list for this object.
|
protected void |
setClassDefinition()
Sets the class definition for this object.
|
clone, getShadowSign, setShadowSignprotected ObjectEntry objectEntry
protected java.util.Hashtable addedAttributeDefinitions
protected AdminNamespace namespace
protected DefaultNSObject(ObjectEntry objEntry, java.util.Vector attributes, long rev)
objEntry - The object entry representation.attributes - Vector of ObjectAttributes or Strings if the attributes
are to be read later.rev - revision number of the object.public void addAttribute(ObjectAttribute attr) throws NamespaceException
addAttribute in class NSObjectattr - The valued attribute to be added.NamespaceException - Thrown when a condition occurs that disallowed the add.
This may be one of the following conditions.
public ObjectAttribute getAttribute(java.lang.String attrName)
getAttribute in class NSObjectattrName - The name of the attribute that is to be retrieved.public ObjectAttribute getAttribute(java.lang.String attrName, AdminNamespaceExceptionReference aneRef, ObjectEntry serverOE) throws SPIException, NamespaceException
getAttribute in class NSObjectattrName - The name of the attribute that is to be retrieved.aneRef - If null then any Exception that occurs will be thrown. If this parameter
is NOT null, then any Exception that occured will be returned in this
AdminNamespaceExceptionReference object and will NOT be thrown. Any ObjectAttribute
results (if any or if partial) will then be returned. This uses the USEEXCEPTIONREFERENCE
flag to return paritial results if available. If there are no ObjectAttribute results
then null will be returned.serverOE - the server to read from if read is necessary. If null then any server may be used.SPIExceptionNamespaceExceptionpublic ObjectAttribute getAttribute(java.lang.String attrName, int attrFlags, AdminNamespaceExceptionReference aneRef, ObjectEntry serverOE) throws SPIException, NamespaceException
getAttribute in class NSObjectattrName - The name of the attribute that is to be retrieved.attrFlags - Any attribute specific flags which needs to be passed.
Currently supported flags are:
GETATTR_CONTEXTSTATICVALUES - to only get static values (members) for dynamic groups
GETATTR_READFROMWRITABLEREPLICA - to cause the read to go to a writeable replica
GETATTR_USEEXCEPTIONREFERENCE - Use the lower level protocol's API that returns
partial results (dynamic group timeout) instead
of throwing an exception.aneRef - If null then any Exception that occurs will be thrown. If this parameter
is NOT null, then any Exception that occured will be returned in this
AdminNamespaceExceptionReference object and will NOT be thrown. Any ObjectAttribute
results (if any or if partial) will then be returned. This uses the USEEXCEPTIONREFERENCE
flag to return paritial results if available. If there are no ObjectAttribute results
then null will be returned.serverOE - the server to read from if read is necessary. If null then any server may be used.SPIExceptionNamespaceExceptionpublic boolean deleteAttribute(java.lang.String attrName)
throws NamespaceException
deleteAttribute in class NSObjectattrName - The attribute to be deleted from the object.NamespaceException - A condition occured which disallowed the delete:
public java.lang.String[] getAddedAttributes()
getAddedAttributes in class NSObjectpublic java.util.Hashtable getAddedAttributeDefinitions()
public java.lang.String[] getAttributes()
getAttributes in class NSObjectpublic java.lang.String[] getMandatoryAttributes()
getMandatoryAttributes in class NSObjectpublic java.lang.String[] getOptionalAttributes()
getOptionalAttributes in class NSObjectpublic java.lang.String[] getUnvaluedAttributes()
getUnvaluedAttributes in class NSObjectpublic ClassDefinition[] getClassDefinitions()
getClassDefinitions in class NSObjectpublic java.lang.String[] getDeletedAttributes()
getDeletedAttributes in class NSObjectpublic java.lang.String[] getModifiedAttributes()
getModifiedAttributes in class NSObjectpublic ObjectEntry getObjectEntry()
getObjectEntry in class NSObjectpublic long getRevision()
getRevision in class NSObjectpublic NSObject clone(ObjectEntry newIdentity) throws NamespaceException
clone in class NSObjectnewIdentity - The ObjectEntry whose identity is assumed.NamespaceException - NamespaceException.OBJECTTYPE_NOT_VALID is
thrown if the newIdentity's type is different from this.public boolean addAuxiliaryClassDefinition(ClassDefinition classDef, ObjectAttribute[] attrs) throws NamespaceException
addAuxiliaryClassDefinition in class NSObjectclassDef - The class definition to add.attrs - The attributes to add.
The only attributes that will be added are those that are not currently valued. If attributes are valued, please modify the value instead of trying to add the attribute.
NamespaceException - NamespaceException.MISSING_MANDATORY_ATTRIBUTENamespaceException - NamespaceException.NOT_AUXILIARY_CLASSNamespaceException - NamespaceException.CLASS_NOT_DEFINEDpublic boolean deleteAuxiliaryClassDefinition(ClassDefinition classDef) throws NamespaceException
deleteAuxiliaryClassDefinition in class NSObjectclassDef - The class definition to be deleted.NamespaceException - NamespaceException.NOT_AUXILIARY_CLASSNamespaceException - NamespaceException.CLASS_NOT_DEFINEDpublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerevent - The property change event that was registered for.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in class NSObjectlistener - The listener to be added.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in class NSObjectlistener - The listener to be removed.public void clearAddedAttribute(java.lang.String attrName)
clearAddedAttribute in class NSObjectattrName - The valued attribute to be removed from the add list.public void clearAddedAttributeDefinitions()
public void clearDeletedAttribute(java.lang.String attrName)
clearDeletedAttribute in class NSObjectattrName - The valued attribute to be removed from the delete list.public void clearModifiedAttribute(java.lang.String attrName)
clearModifiedAttribute in class NSObjectattrName - The valued attribute to be removed from the modify list.protected void checkAdd(ObjectAttribute attr, boolean isForAuxClass) throws NamespaceException
attr - The name of the attribute.isForAuxClass - Attribute is being added due to an Aux class association.NamespaceException - Can not add the attribute to this object.public boolean isAddPossible(ObjectAttribute attr, boolean isForAuxClass) throws NamespaceException
NSObjectisAddPossible in class NSObjectNamespaceExceptionpublic boolean isAttributeMandatory(java.lang.String attrName)
isAttributeMandatory in class NSObjectattrName - Name of the attribute to look for.public boolean isAttributeOptional(java.lang.String attrName)
isAttributeOptional in class NSObjectattrName - Name of the attribute to look for.public boolean isNamedBy(java.lang.String attrName)
protected void setClassDefinition()
setClassDefinition in class NSObject
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 ${TODAY} ${TSTAMP}.