com.novell.nds.dirxml.engine.gcv
Class EngineControls

java.lang.Object
  extended by com.novell.nds.dirxml.engine.gcv.GCDefinitions
      extended by com.novell.nds.dirxml.engine.gcv.EngineControls
All Implemented Interfaces:
GCOwner, ConfigElement

public class EngineControls
extends GCDefinitions

Class encapsulating DirXML Engine control values.

Each engine control value must have a localized display name in EngineControl.properties, and, if it has a description, a localized description string in EngineControl.properties.

The DirXML Engine will initially set the display names and descriptions to their US English values from the base EngineControl.properties file. User Agents (i.e., the UI) are responsible for localizing the display names and descriptions by calling localize(Locale locale) with the appropriate Locale instance.

User Agents must not create new GCValue instances. Only the DirXML Engine is allowed to create engine control values. The User Agents are restricted to allowing users to change the GCValue instances' values and writing the serialized XML back to the DirXML-EngineControlValues attribute. (The DirXML Engine will initially populate the attribute with all supported control values).


Field Summary
protected  List defsList
           
static String LOC_REF_ALLOW_EVENT_LOOPBACK_DESC
           
static String LOC_REF_ALLOW_EVENT_LOOPBACK_NAME
           
static String LOC_REF_COMBINE_TEMPLATE_VALUES_DESC
           
static String LOC_REF_COMBINE_TEMPLATE_VALUES_NAME
           
static String LOC_REF_DN_VALUE_FORM_DESC
           
static String LOC_REF_DN_VALUE_FORM_NAME
           
static String LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_DESC
           
static String LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_NAME
           
static String LOC_REF_MAX_MIGRATE_COUNT_DESC
           
static String LOC_REF_MAX_MIGRATE_COUNT_NAME
           
static String LOC_REF_MAX_REPLICATION_WAIT_DESC
           
static String LOC_REF_MAX_REPLICATION_WAIT_NAME
           
static String LOC_REF_PWD_SYNC_STATUS_DESC
           
static String LOC_REF_PWD_SYNC_STATUS_NAME
           
static String LOC_REF_RENAME_FORM_DESC
           
static String LOC_REF_RENAME_FORM_NAME
           
static String LOC_REF_RETRY_INTERVAL_DESC
           
static String LOC_REF_RETRY_INTERVAL_NAME
           
static String LOC_REF_REVERT_CALCULATED_VALUES_DESC
           
static String LOC_REF_REVERT_CALCULATED_VALUES_NAME
           
static String LOC_REF_SET_CREATORS_NAME_DESC
           
static String LOC_REF_SET_CREATORS_NAME_NAME
           
static String LOC_REF_USE_PASSWORD_EVENT_VALUES_DESC
           
static String LOC_REF_USE_PASSWORD_EVENT_VALUES_NAME
           
static String LOC_REF_USE_PENDING_ASSOC_DESC
           
static String LOC_REF_USE_PENDING_ASSOC_NAME
           
static String LOC_REF_XSLT_BROKEN_MODE_DESC
           
static String LOC_REF_XSLT_BROKEN_MODE_NAME
           
protected  boolean modified
           
 
Fields inherited from class com.novell.nds.dirxml.engine.gcv.GCDefinitions
DEFAULT_SEPARATOR, GC_CONFLICT_VALUE
 
Constructor Summary
EngineControls()
          Construct an empty GCEngineDefintions object.
 
Method Summary
protected static com.novell.nds.dirxml.engine.gcv.GCList _construct(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 EngineControls constructFromBytes(byte[] bytes)
          Construct a GCEngineDefinitions object and associated GCValue objects from an array of bytes containing the serialized XML representation.
protected static EngineControls constructFromBytes(byte[] bytes, EngineControls controls)
          Populate a GCEngineDefinitions object and associated GCValue objects from an array of bytes containing the serialized XML representation.
static EngineControls constructFromDocument(Document document)
          Construct a GCEngineDefinitions object and association GCValue objects from a DOM XML document containing the XML representation.
static EngineControls constructFromDocument(Document document, EngineControls controls)
          Populate a GCEngineDefinitions object and association GCValue objects from a DOM XML document containing the XML representation.
 GCValue getChildValue(String name)
          Get a GCValue object that is a direct child of this instance by name.
 GCValue getValue(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, String insertionPoint)
          Insert a GCV into the current list of GCVs.
 boolean isNameAllowed(String name)
          Check to see if a name is allowed.
 Iterator iterator()
          Return an Iterator instance that can be used to iterate through the list of GCVs.
 void localize(Locale locale)
          Localize the display names and descriptions of the engine control values in this instance.
 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(String name)
          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.
 Iterator shallowIterator()
          Return an Iterator instance that can be used to iterate through the list of GCVs.
 
Methods inherited from class com.novell.nds.dirxml.engine.gcv.GCDefinitions
apply, apply, checkAllowedType, construct, construct, construct, construct, construct, localize, merge, toBytes, toXml, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.novell.nds.dirxml.util.ConfigElement
hasBeenModified, resetModified
 
Methods inherited from interface com.novell.nds.dirxml.engine.gcv.GCOwner
addName, appendValue, insertValue, insertValue, isNameAllowed, iterator, removeName, removeValue, removeValue, replaceValue, shallowIterator
 

Field Detail

LOC_REF_RETRY_INTERVAL_NAME

public static final String LOC_REF_RETRY_INTERVAL_NAME
See Also:
Constant Field Values

LOC_REF_RETRY_INTERVAL_DESC

public static final String LOC_REF_RETRY_INTERVAL_DESC
See Also:
Constant Field Values

LOC_REF_DN_VALUE_FORM_NAME

public static final String LOC_REF_DN_VALUE_FORM_NAME
See Also:
Constant Field Values

LOC_REF_DN_VALUE_FORM_DESC

public static final String LOC_REF_DN_VALUE_FORM_DESC
See Also:
Constant Field Values

LOC_REF_MAX_REPLICATION_WAIT_NAME

public static final String LOC_REF_MAX_REPLICATION_WAIT_NAME
See Also:
Constant Field Values

LOC_REF_MAX_REPLICATION_WAIT_DESC

public static final String LOC_REF_MAX_REPLICATION_WAIT_DESC
See Also:
Constant Field Values

LOC_REF_XSLT_BROKEN_MODE_NAME

public static final String LOC_REF_XSLT_BROKEN_MODE_NAME
See Also:
Constant Field Values

LOC_REF_XSLT_BROKEN_MODE_DESC

public static final String LOC_REF_XSLT_BROKEN_MODE_DESC
See Also:
Constant Field Values

LOC_REF_MAX_MIGRATE_COUNT_NAME

public static final String LOC_REF_MAX_MIGRATE_COUNT_NAME
See Also:
Constant Field Values

LOC_REF_MAX_MIGRATE_COUNT_DESC

public static final String LOC_REF_MAX_MIGRATE_COUNT_DESC
See Also:
Constant Field Values

LOC_REF_SET_CREATORS_NAME_NAME

public static final String LOC_REF_SET_CREATORS_NAME_NAME
See Also:
Constant Field Values

LOC_REF_SET_CREATORS_NAME_DESC

public static final String LOC_REF_SET_CREATORS_NAME_DESC
See Also:
Constant Field Values

LOC_REF_RENAME_FORM_NAME

public static final String LOC_REF_RENAME_FORM_NAME
See Also:
Constant Field Values

LOC_REF_RENAME_FORM_DESC

public static final String LOC_REF_RENAME_FORM_DESC
See Also:
Constant Field Values

LOC_REF_USE_PENDING_ASSOC_NAME

public static final String LOC_REF_USE_PENDING_ASSOC_NAME
See Also:
Constant Field Values

LOC_REF_USE_PENDING_ASSOC_DESC

public static final String LOC_REF_USE_PENDING_ASSOC_DESC
See Also:
Constant Field Values

LOC_REF_USE_PASSWORD_EVENT_VALUES_NAME

public static final String LOC_REF_USE_PASSWORD_EVENT_VALUES_NAME
See Also:
Constant Field Values

LOC_REF_USE_PASSWORD_EVENT_VALUES_DESC

public static final String LOC_REF_USE_PASSWORD_EVENT_VALUES_DESC
See Also:
Constant Field Values

LOC_REF_PWD_SYNC_STATUS_NAME

public static final String LOC_REF_PWD_SYNC_STATUS_NAME
See Also:
Constant Field Values

LOC_REF_PWD_SYNC_STATUS_DESC

public static final String LOC_REF_PWD_SYNC_STATUS_DESC
See Also:
Constant Field Values

LOC_REF_COMBINE_TEMPLATE_VALUES_NAME

public static final String LOC_REF_COMBINE_TEMPLATE_VALUES_NAME
See Also:
Constant Field Values

LOC_REF_COMBINE_TEMPLATE_VALUES_DESC

public static final String LOC_REF_COMBINE_TEMPLATE_VALUES_DESC
See Also:
Constant Field Values

LOC_REF_ALLOW_EVENT_LOOPBACK_NAME

public static final String LOC_REF_ALLOW_EVENT_LOOPBACK_NAME
See Also:
Constant Field Values

LOC_REF_ALLOW_EVENT_LOOPBACK_DESC

public static final String LOC_REF_ALLOW_EVENT_LOOPBACK_DESC
See Also:
Constant Field Values

LOC_REF_REVERT_CALCULATED_VALUES_NAME

public static final String LOC_REF_REVERT_CALCULATED_VALUES_NAME
See Also:
Constant Field Values

LOC_REF_REVERT_CALCULATED_VALUES_DESC

public static final String LOC_REF_REVERT_CALCULATED_VALUES_DESC
See Also:
Constant Field Values

LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_NAME

public static final String LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_NAME
See Also:
Constant Field Values

LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_DESC

public static final String LOC_REF_MAX_DRV_SHUTDOWN_TIMEOUT_DESC
See Also:
Constant Field Values

defsList

protected List defsList

modified

protected boolean modified
Constructor Detail

EngineControls

public EngineControls()
Construct an empty GCEngineDefintions object.

Only the DirXML Engine must use this constructor.

Method Detail

constructFromBytes

public static EngineControls constructFromBytes(byte[] bytes)
                                         throws GCVException
Construct a GCEngineDefinitions object and associated GCValue objects from an array of bytes containing the serialized XML representation.

Typically, the array of bytes would come from the value of the DirXML-EngineControlValues attribute.

Parameters:
bytes - byte array containing serialized XML.
Throws:
GCVException - thrown if XML is incorrect in any way.

constructFromBytes

protected static EngineControls constructFromBytes(byte[] bytes,
                                                   EngineControls controls)
                                            throws GCVException
Populate a GCEngineDefinitions object and associated GCValue objects from an array of bytes containing the serialized XML representation.

Typically, the array of bytes would come from the value of the DirXML-EngineControlValues attribute.

Parameters:
bytes - byte array containing serialized XML.
controls - EngineControls to populate.
Throws:
GCVException - thrown if XML is incorrect in any way.

constructFromDocument

public static EngineControls constructFromDocument(Document document)
                                            throws GCVException
Construct a GCEngineDefinitions object and association GCValue objects from a DOM XML document containing the XML representation.

Typically, the DOM document would be the result of parsing the value of the DirXML-EngineControlValues attribute.

Parameters:
document - DOM document
Throws:
GCVException - thrown if XML is incorrect in any way.

constructFromDocument

public static EngineControls constructFromDocument(Document document,
                                                   EngineControls controls)
                                            throws GCVException
Populate a GCEngineDefinitions object and association GCValue objects from a DOM XML document containing the XML representation.

Typically, the DOM document would be the result of parsing the value of the DirXML-EngineControlValues attribute.

Parameters:
document - DOM document
controls - EngineControls to populate.
Throws:
GCVException - thrown if XML is incorrect in any way.

localize

public void localize(Locale locale)
Localize the display names and descriptions of the engine control values in this instance.

Parameters:
locale - a Locale object describing the locale for the localized strings to retrieve.

_construct

protected static com.novell.nds.dirxml.engine.gcv.GCList _construct(Element element,
                                                                    com.novell.nds.dirxml.engine.gcv.GCList list)
                                                             throws GCVException
Populate a 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.

Parameters:
element - DOM element
definitions - the instance to populate.
Throws:
GCVException - thrown if XML is incorrect in any way.

hasBeenModified

public boolean hasBeenModified()
Return 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:

  1. The instance was constructed from an XML representation.
  2. resetModified() was last called

Returns:
true or false
See Also:
resetModified(), #toXML(org.w3c.dom.Node)

resetModified

public void resetModified()
Reset the modified flag for this instance such that hasBeenModified() will return false.

See Also:
hasBeenModified()

getValue

public GCValue getValue(String name)
Get a GCValue object by name. This will do a deep search for the GCV, meaning it will look at all descendant GCVs.

Parameters:
name - the GCV name.
Returns:
GCValue object, or null if name not found.

getChildValue

public GCValue getChildValue(String name)
Get a GCValue object that is a direct child of this instance by name.

Parameters:
name - the GCV name.
Returns:
GCValue object, or null if name not found.

appendValue

public void appendValue(GCValue value)
                 throws GCVArgumentException
Add a GCV to the end of the current list of GCVs.

Specified by:
appendValue in interface GCOwner
Parameters:
value - GCValue object to add.
Throws:
GCVArgumentException - thrown if value has the same name as a GCV already in the list.

insertValue

public void insertValue(GCValue newValue,
                        String insertionPoint)
                 throws GCVArgumentException
Insert a GCV into the current list of GCVs.

Specified by:
insertValue in interface GCOwner
Parameters:
newValue - GCValue object to add.
insertionPoint - name of GCV in front of which newValue is to be inserted.
Throws:
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.

insertValue

public void insertValue(GCValue newValue,
                        GCValue insertionPoint)
                 throws GCVArgumentException
Insert a GCV into the current list of GCVs.

Specified by:
insertValue in interface GCOwner
Parameters:
newValue - GCValue object to add.
insertionPoint - GCV in front of which newValue is to be inserted.
Throws:
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.

replaceValue

public void replaceValue(GCValue newValue,
                         GCValue oldValue)
                  throws GCVArgumentException
Insert a GCV into the current list of GCVs.

Specified by:
replaceValue in interface GCOwner
Parameters:
newValue - GCValue object to add.
oldValue - GCV to be replaced (must not be null).
Throws:
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.

removeValue

public boolean removeValue(String name)
Remove a GCV from the list of GCVs.

Specified by:
removeValue in interface GCOwner
Parameters:
name - name of GCV to remove.
Returns:
true if name was found and removed, false otherwise.

removeValue

public boolean removeValue(GCValue value)
Remove a GCV from the list of GCVs.

Specified by:
removeValue in interface GCOwner
Parameters:
value - the GCV to remove.
Returns:
true if the GCV was found and removed, false otherwise.

iterator

public Iterator iterator()
Return an 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.

Specified by:
iterator in interface GCOwner
Returns:
an Iterator instance.
See Also:
shallowIterator()

shallowIterator

public Iterator shallowIterator()
Return an 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.

Specified by:
shallowIterator in interface GCOwner
Returns:
an Iterator instance.
See Also:
iterator()

isNameAllowed

public boolean isNameAllowed(String name)
Check to see if a name is allowed.

Specified by:
isNameAllowed in interface GCOwner
Parameters:
name - the name to check
Returns:
true or false

addName

public void addName(GCValue newValue)
             throws GCVArgumentException
Add a name to the defsList map. This is designed to be called from GCParent.

Specified by:
addName in interface GCOwner
Parameters:
newValue - new GCValue
Throws:
GCVArgumentException

removeName

public void removeName(GCValue oldValue)
Remove a name from the defsList map. This is designed to be called from GCParent.

Specified by:
removeName in interface GCOwner
Parameters:
oldValue - GCValue being removed.