com.metamatrix.console.models
Class ResourcePropertiedObjectEditor

java.lang.Object
  extended by com.metamatrix.console.models.ConfigurationPropertiedObjectEditor
      extended by com.metamatrix.console.models.ResourcePropertiedObjectEditor
All Implemented Interfaces:
PropertiedObjectEditor, PropertyAccessPolicy, UserTransaction, UserTransactionFactory, StringUtil.Constants

public class ResourcePropertiedObjectEditor
extends ConfigurationPropertiedObjectEditor

Created on Jun 11, 2002 This propertied object editor is for internal resources. The internal resources is not designed like the configuration framework to used propertied objects. So this editor is used to present to the client the look of using propertied objects. Also, internal resources do not have the concept of operational and next startup configurations.


Field Summary
 
Fields inherited from interface com.metamatrix.common.object.PropertiedObjectEditor
NO_VALUE
 
Fields inherited from interface com.metamatrix.common.object.PropertyAccessPolicy
DEFAULT_READ_ONLY_PRIVILEGE
 
Fields inherited from interface com.metamatrix.core.util.StringUtil.Constants
CARRIAGE_RETURN, CARRIAGE_RETURN_CHAR, DBL_SPACE, DOT, DOT_CHAR, EMPTY_STRING, EMPTY_STRING_ARRAY, LINE_FEED, LINE_FEED_CHAR, NEW_LINE, NEW_LINE_CHAR, PATTERN_BACK_SLASH, PATTERN_QUESTION, PATTERN_STAR, SPACE, SPACE_CHAR, TAB, TAB_CHAR
 
Method Summary
 void apply()
          Implmented for the purpose of the console to control the commit via the apply button.
 void begin()
          Create a new transaction and associate it with this object.
 void commit()
          Complete the transaction associated with this object.
 java.util.List getAllowedValues(PropertiedObject obj, PropertyDefinition def)
          Get the allowed values for the property on the specified object.
protected  ConfigurationObjectEditor getEditor()
           
 java.util.List getPropertyDefinitions(PropertiedObject obj)
          Obtain the list of PropertyDefinitions that apply to the specified object's type.
 void rollback()
          Roll back the transaction associated with this object.
 void setValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
          Set on the specified PropertiedObject the value defined by the specified PropertyDefinition.
 
Methods inherited from class com.metamatrix.console.models.ConfigurationPropertiedObjectEditor
assertComponentObject, createReadTransaction, createWriteTransaction, createWriteTransaction, getConfigurationAPI, getConfigurationManager, getPolicy, getSource, getStatus, getValue, isAutomaticTransaction, isReadOnly, isReadOnly, isValidValue, reset, setIsModifiable, setPolicy, setReadOnly, setReadOnly, setRollbackOnly, setTransactionTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEditor

protected ConfigurationObjectEditor getEditor()
Overrides:
getEditor in class ConfigurationPropertiedObjectEditor

begin

public void begin()
           throws TransactionException
Description copied from class: ConfigurationPropertiedObjectEditor
Create a new transaction and associate it with this object.

Specified by:
begin in interface UserTransaction
Overrides:
begin in class ConfigurationPropertiedObjectEditor
Throws:
TransactionNotSupportedException - if the current thread is already associated with a transaction and the manager does not support nested system transactions.
TransactionException

rollback

public void rollback()
              throws TransactionException
Description copied from class: ConfigurationPropertiedObjectEditor
Roll back the transaction associated with this object. When this method completes, the thread becomes associated with no transaction.

Specified by:
rollback in interface UserTransaction
Overrides:
rollback in class ConfigurationPropertiedObjectEditor
Throws:
TransactionException

getAllowedValues

public java.util.List getAllowedValues(PropertiedObject obj,
                                       PropertyDefinition def)
Get the allowed values for the property on the specified object. By default, this implementation simply returns the allowed values in the supplied PropertyDefinition instance.

Specified by:
getAllowedValues in interface PropertiedObjectEditor
Overrides:
getAllowedValues in class ConfigurationPropertiedObjectEditor
Parameters:
obj - the propertied object whose property value is to be obtained; may not be null
def - the reference to the PropertyDefinition describing the property whose value is to be returned; may not be null
Returns:
the unmodifiable list of allowed values for this property, or an empty set if the values do not have to conform to a fixed set.
See Also:
#hasAllowedValues

getPropertyDefinitions

public java.util.List getPropertyDefinitions(PropertiedObject obj)
Obtain the list of PropertyDefinitions that apply to the specified object's type.

Specified by:
getPropertyDefinitions in interface PropertiedObjectEditor
Overrides:
getPropertyDefinitions in class ConfigurationPropertiedObjectEditor
Parameters:
obj - the propertied object for which the PropertyDefinitions are to be obtained; may not be null
Returns:
an unmodifiable list of the PropertyDefinition objects that define the properties for the object; never null but possibly empty
Throws:
java.lang.AssertionError - if obj is null

setValue

public void setValue(PropertiedObject obj,
                     PropertyDefinition def,
                     java.lang.Object value)
Set on the specified PropertiedObject the value defined by the specified PropertyDefinition. If null is passed in as the value parameter, this implementation will take that to mean that the value is reverting to its default value. In this case, the default value will be stored as the value; the value entry in the config database will NOT be deleted, but will be assigned the default value.

Specified by:
setValue in interface PropertiedObjectEditor
Overrides:
setValue in class ConfigurationPropertiedObjectEditor
Parameters:
obj - the propertied object whose property value is to be set; may not be null
def - the reference to the PropertyDefinition describing the property whose value is to be changed; may not be null
value - the new value for the property; the cardinality and type must conform PropertyDefinition. If null, this will be interpreted as reverting to the default value.
Throws:
java.lang.IllegalArgumentException - if the value does not correspond to the PropertyDefinition requirements.
java.lang.AssertionError - if either of obj or def is null

commit

public void commit()
            throws TransactionException
Complete the transaction associated with this object. When this method completes, the thread becomes associated with no transaction.

Specified by:
commit in interface UserTransaction
Overrides:
commit in class ConfigurationPropertiedObjectEditor
Throws:
java.lang.IllegalStateException - Thrown if this object is not associated with a transaction.
TransactionException

apply

public void apply()
           throws TransactionException
Implmented for the purpose of the console to control the commit via the apply button.

Throws:
TransactionException


Copyright © 2009. All Rights Reserved.