|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.console.models.ConfigurationPropertiedObjectEditor
public class ConfigurationPropertiedObjectEditor
This class serves as both a PropertiedObjectEditor and a UserTransaction for the editing of ComponentObjects and the PropertyDefinitions associated to them through their ComponentType.
This class fronts a ConfigurationObjectEditor, and a ConfigurationAdminAPIFacade. It can be used in one of two ways (corresponding to the two contstructors).
The first way is to use the no-arg
constructor
. This
implementation will then support transactions through the
UserTransaction
API, which this object also implements, and which
PropertiedObjectPanel
uses automatically.
The second way to use this implementation is to use the
second constructor
which takes a ModificationActionQueue
parameter. This allows a client to control the transactional
nature of this implementation - the client can manually manage the list
of Action objects in the ModificationActionQueue, and execute them
as a transaction whenever the client deems it appropriate. Automatic
transactional support will be disabled in this implementation;
the methods implementing the
UserTransaction
interface will be disabled.
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 | |
---|---|
protected ComponentObject |
assertComponentObject(PropertiedObject obj)
|
void |
begin()
Create a new transaction and associate it with this object. |
void |
commit()
Complete the transaction associated with this object. |
UserTransaction |
createReadTransaction()
Create a new instance of a UserTransaction that may be used to read information. |
UserTransaction |
createWriteTransaction()
Create a new instance of a UserTransaction that may be used to write and/or update information. |
UserTransaction |
createWriteTransaction(java.lang.Object source)
Create a new instance of a UserTransaction that may be used to write and/or update information. |
java.util.List |
getAllowedValues(PropertiedObject obj,
PropertyDefinition def)
Get the allowed values for the property on the specified object. |
protected ConfigurationAdminAPI |
getConfigurationAPI()
|
protected ConfigurationManager |
getConfigurationManager()
|
protected ConfigurationObjectEditor |
getEditor()
|
PropertyAccessPolicy |
getPolicy()
|
java.util.List |
getPropertyDefinitions(PropertiedObject obj)
Obtain the list of PropertyDefinitions that apply to the specified object's type. |
java.lang.Object |
getSource()
Return the (optional) reference to the object that is considered the source of the transaction represented by this object. |
int |
getStatus()
Obtain the status of the transaction represented by this object. |
java.lang.Object |
getValue(PropertiedObject obj,
PropertyDefinition def)
Obtain from the specified PropertiedObject the property value that corresponds to the specified PropertyDefinition. |
protected boolean |
isAutomaticTransaction()
|
boolean |
isReadOnly(PropertiedObject obj)
Return whether this editor may be used to set property values on the specified PropertiedObject. |
boolean |
isReadOnly(PropertiedObject obj,
PropertyDefinition def)
|
boolean |
isValidValue(PropertiedObject obj,
PropertyDefinition def,
java.lang.Object value)
Return whether the specified value is considered valid. |
void |
reset(PropertiedObject obj)
|
void |
rollback()
Roll back the transaction associated with this object. |
protected java.util.List |
setIsModifiable(java.util.Collection componentTypeDefns,
ConfigurationID id)
This method will resolve whether or not the PropertyDefinitions in the list of passed in ComponentTypeDefinitions should be modifiable or not. |
void |
setPolicy(PropertyAccessPolicy policy)
|
void |
setReadOnly(PropertiedObject obj,
boolean readOnly)
|
void |
setReadOnly(PropertiedObject obj,
PropertyDefinition def,
boolean readOnly)
|
void |
setRollbackOnly()
Modify the transaction associated with this object such that the only possible outcome of the transaction is to roll back the transaction. |
void |
setTransactionTimeout(int seconds)
Modify the value of the timeout value that is associated with the transactions represented by 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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.util.List getPropertyDefinitions(PropertiedObject obj)
getPropertyDefinitions
in interface PropertiedObjectEditor
obj
- the propertied object for which the PropertyDefinitions are
to be obtained; may not be null
java.lang.AssertionError
- if obj
is nullpublic java.util.List getAllowedValues(PropertiedObject obj, PropertyDefinition def)
getAllowedValues
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be obtained;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be returned; may not be null
#hasAllowedValues
public boolean isReadOnly(PropertiedObject obj)
isReadOnly
in interface PropertiedObjectEditor
isReadOnly
in interface PropertyAccessPolicy
obj
- the propertied object; may not be null
java.lang.AssertionError
- if obj
is nullpublic java.lang.Object getValue(PropertiedObject obj, PropertyDefinition def)
getValue
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be obtained;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be returned; may not be null
java.lang.AssertionError
- if either of obj
or def
is nullpublic boolean isValidValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
isValidValue
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be validated;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be validated; may not be nullvalue
- the proposed value for the property, which may be a collection if
the property is multi-valued, or may be null if the multiplicity
includes "0"
java.lang.AssertionError
- if either of obj
or def
is nullpublic void setValue(PropertiedObject obj, PropertyDefinition def, java.lang.Object value)
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.
setValue
in interface PropertiedObjectEditor
obj
- the propertied object whose property value is to be set;
may not be nulldef
- the reference to the PropertyDefinition describing the
property whose value is to be changed; may not be nullvalue
- 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.
java.lang.IllegalArgumentException
- if the value does not correspond
to the PropertyDefinition requirements.
java.lang.AssertionError
- if either of obj
or def
is nullpublic PropertyAccessPolicy getPolicy()
getPolicy
in interface PropertiedObjectEditor
public void setPolicy(PropertyAccessPolicy policy)
setPolicy
in interface PropertiedObjectEditor
public boolean isReadOnly(PropertiedObject obj, PropertyDefinition def)
isReadOnly
in interface PropertyAccessPolicy
public void setReadOnly(PropertiedObject obj, PropertyDefinition def, boolean readOnly)
setReadOnly
in interface PropertyAccessPolicy
public void setReadOnly(PropertiedObject obj, boolean readOnly)
setReadOnly
in interface PropertyAccessPolicy
public void reset(PropertiedObject obj)
reset
in interface PropertyAccessPolicy
public UserTransaction createReadTransaction()
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createReadTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction()
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createWriteTransaction
in interface UserTransactionFactory
public UserTransaction createWriteTransaction(java.lang.Object source)
The returned transaction object will not be bound to an underlying
system transaction until begin()
is called on the returned
object.
createWriteTransaction
in interface UserTransactionFactory
source
- the object that is considered to be the source of the transaction;
may be null
public int getStatus() throws TransactionException
TransactionStatus.STATUS_UNKNOWN
for automatic transaction mode (indicating there might be a transaction), or
TransactionStatus.STATUS_NO_TRANSACTION
if this object is not in automatic transaction mode.
getStatus
in interface UserTransaction
TransactionException
public void begin() throws TransactionException
begin
in interface UserTransaction
TransactionNotSupportedException
- if the current thread is already
associated with a transaction and the manager does not support
nested system transactions.
TransactionException
public void setTransactionTimeout(int seconds) throws TransactionException
setTransactionTimeout
in interface UserTransaction
seconds
- The value of the timeout in seconds. If the value is
zero, the transaction service restores the default value.
java.lang.IllegalStateException
- Thrown if this object is not associated with a transaction
TransactionException
public void setRollbackOnly() throws TransactionException
setRollbackOnly
in interface UserTransaction
java.lang.IllegalStateException
- Thrown if this object is not
associated with a transaction.
TransactionException
public void commit() throws TransactionException
commit
in interface UserTransaction
java.lang.IllegalStateException
- Thrown if this object is not
associated with a transaction.
TransactionException
public void rollback() throws TransactionException
rollback
in interface UserTransaction
java.lang.IllegalStateException
- Thrown if this object is not
associated with a transaction.
TransactionException
public java.lang.Object getSource() throws TransactionException
getSource
in interface UserTransaction
TransactionException
protected boolean isAutomaticTransaction()
protected ComponentObject assertComponentObject(PropertiedObject obj)
protected ConfigurationObjectEditor getEditor()
protected java.util.List setIsModifiable(java.util.Collection componentTypeDefns, ConfigurationID id)
componentTypeDefns
- list of ComponentTypeDefns to be interrogatedid
- the ConfigurationID of the object being edited by this editor.
protected ConfigurationAdminAPI getConfigurationAPI()
protected ConfigurationManager getConfigurationManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |