public class ResourceParams extends GCDefinitions
ResourceParams is an aggregation of GCValue objects.
The difference between ResourceParams and its parent class
GCDefinitions is that ResourceParams allows
GCVs of type "password-ref". It also differs in that it is constructed from a
definitions element that may come from an arbitrary location in a document
Methods are provided to parse an XML representation of Global Configuration Values and to serialize the contained collection of GCVs to an XML representation.
For user interface purposes the list of GCValue objects is ordered.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
defsList |
protected boolean |
modified |
DEFAULT_SEPARATOR, GC_CONFLICT_VALUE| Constructor and Description |
|---|
ResourceParams()
Construct an empty
ShimParams object. |
| Modifier and Type | Method and Description |
|---|---|
protected static com.novell.nds.dirxml.engine.gcv.GCList |
_construct(org.w3c.dom.Element element,
com.novell.nds.dirxml.engine.gcv.GCList list)
Populate a
GCDefinitions object and association GCValue objects
from a DOM XML element containing the XML representation. |
void |
addName(GCValue newValue)
Add a name to the defsList map.
|
void |
appendValue(GCValue value)
Add a GCV to the end of the current list of GCVs.
|
static ResourceParams |
constructResourceParams(org.w3c.dom.Element element)
Construct a
ShimParams object and association GCValue objects
from a DOM XML element containing the XML representation. |
GCValue |
getChildValue(java.lang.String name)
Get a
GCValue object that is a direct child of this instance by name. |
GCValue |
getValue(java.lang.String name)
Get a
GCValue object by name. |
boolean |
hasBeenModified()
Return
true if this instance has been modified. |
void |
insertValue(GCValue newValue,
GCValue insertionPoint)
Insert a GCV into the current list of GCVs.
|
void |
insertValue(GCValue newValue,
java.lang.String insertionPoint)
Insert a GCV into the current list of GCVs.
|
boolean |
isNameAllowed(java.lang.String name)
Check to see if a name is allowed.
|
java.util.Iterator |
iterator()
Return an
Iterator instance that can be used to iterate
through the list of GCVs. |
void |
removeName(GCValue oldValue)
Remove a name from the defsList map.
|
boolean |
removeValue(GCValue value)
Remove a GCV from the list of GCVs.
|
boolean |
removeValue(java.lang.String name)
Remove a GCV from the list of GCVs.
|
boolean |
removeValue(java.lang.String name,
boolean removeSubordinates)
Remove a GCV from the list of GCVs.
|
void |
replaceValue(GCValue newValue,
GCValue oldValue)
Insert a GCV into the current list of GCVs.
|
void |
resetModified()
Reset the modified flag for this instance such that
hasBeenModified()
will return false. |
java.util.Iterator |
shallowIterator()
Return an
Iterator instance that can be used to iterate
through the list of GCVs. |
org.w3c.dom.Document |
toXml()
Return the DOM XML representation of this
ShimParams object and associated
GCValue objects. |
org.w3c.dom.Element |
toXml(org.w3c.dom.Node parent)
Create the DOM XML representation of this
ShimParams object and associated
GCValue objects in an existing document. |
apply, apply, checkAllowedType, construct, construct, construct, construct, construct, localize, merge, toBytes, toXMLclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasBeenModified, resetModifiedaddName, appendValue, insertValue, insertValue, isNameAllowed, iterator, removeName, removeValue, removeValue, replaceValue, shallowIteratorpublic static ResourceParams constructResourceParams(org.w3c.dom.Element element) throws GCVException
ShimParams object and association GCValue objects
from a DOM XML element containing the XML representation.
Typically, the DOM element would be the result of parsing the value of the DirXML-Data attribute of a DirXML-Resource object
element - The definitions elementGCVException - thrown if XML is incorrect in any way.public org.w3c.dom.Element toXml(org.w3c.dom.Node parent)
throws GCVException
ShimParams object and associated
GCValue objects in an existing document.parent - the parent node for creating the definitions elementGCVException - thrown if XML creation fails because one or more GCVs
is incomplete.public org.w3c.dom.Document toXml()
throws GCVException
ShimParams object and associated
GCValue objects.toXml in class GCDefinitionsGCVException - thrown if XML creation fails because one or more GCVs
is incomplete.protected static com.novell.nds.dirxml.engine.gcv.GCList _construct(org.w3c.dom.Element element,
com.novell.nds.dirxml.engine.gcv.GCList list)
throws GCVException
GCDefinitions object and association GCValue objects
from a DOM XML element containing the XML representation.
Typically, the DOM element would be the result of parsing the value of the DirXML-ConfigValues attribute.
element - DOM elementdefinitions - the instance to populate.GCVException - thrown if XML is incorrect in any way.public boolean hasBeenModified()
true if this instance has been modified.
The instance is considered to have been modified if a change was made
that affects the persistent representation since:
resetModified() was last calledtrue or falseresetModified(),
#toXML(org.w3c.dom.Node)public void resetModified()
hasBeenModified()
will return false.hasBeenModified()public GCValue getValue(java.lang.String name)
GCValue object by name. This will do a deep
search for the GCV, meaning it will look at all descendant GCVs.name - the GCV name.GCValue object, or null if name not found.public GCValue getChildValue(java.lang.String name)
GCValue object that is a direct child of this instance by name.name - the GCV name.GCValue object, or null if name not found.public void appendValue(GCValue value) throws GCVArgumentException
appendValue in interface GCOwnervalue - GCValue object to add.GCVArgumentException - thrown if value has the same
name as a GCV already in the list.public void insertValue(GCValue newValue, java.lang.String insertionPoint) throws GCVArgumentException
insertValue in interface GCOwnernewValue - GCValue object to add.insertionPoint - name of GCV in front of which newValue is to
be inserted.GCVArgumentException - thrown if insertionPoint doesn't match the
name of any GCV in the list, or if the name of newValue matches the
name of a GCV already in the list.public void insertValue(GCValue newValue, GCValue insertionPoint) throws GCVArgumentException
insertValue in interface GCOwnernewValue - GCValue object to add.insertionPoint - GCV in front of which newValue is to
be inserted.GCVArgumentException - thrown if insertionPoint doesn't appear in
the list, or if the name of newValue matches the
name of a GCV already in the list.public void replaceValue(GCValue newValue, GCValue oldValue) throws GCVArgumentException
replaceValue in interface GCOwnernewValue - GCValue object to add.oldValue - GCV to be replaced (must not be null).GCVArgumentException - thrown if oldValue doesn't appear in
the list, or if the name of newValue matches the
name of another GCV already in the list.public boolean removeValue(java.lang.String name)
removeValue in interface GCOwnername - name of GCV to remove.true if name was found and removed,
false otherwise.public boolean removeValue(java.lang.String name,
boolean removeSubordinates)
name - name of GCV to remove.removeSubordinates - remove the subordinates if the provided gcv name is a group leadertrue if name was found and removed,
false otherwise.public boolean removeValue(GCValue value)
removeValue in interface GCOwnervalue - the GCV to remove.true if the GCV was found and removed,
false otherwise.public java.util.Iterator iterator()
Iterator instance that can be used to iterate
through the list of GCVs. The iterator returned will iterate through
all descendant GCValues, including those that are children of Groups.
The Iterator's next() method returns
GCValue instances.
iterator in interface GCOwnerIterator instance.shallowIterator()public java.util.Iterator shallowIterator()
Iterator instance that can be used to iterate
through the list of GCVs. The iterator returned will iterate through
only GCValues that are direct children of the GCDefinitions.
The Iterator's next() method returns
GCValue instances.
shallowIterator in interface GCOwnerIterator instance.iterator()public boolean isNameAllowed(java.lang.String name)
isNameAllowed in interface GCOwnername - the name to checktrue or falsepublic void addName(GCValue newValue) throws GCVArgumentException
GCParent.addName in interface GCOwnernewValue - new GCValueGCVArgumentExceptionpublic void removeName(GCValue oldValue)
GCParent.removeName in interface GCOwneroldValue - GCValue being removed.