public class ChangeControlBusinessObjectMediatorImpl extends AbstractBusinessObjectMediatorImpl implements ChangeControlBusinessObjectMediator
This change control mediator uses the CMMETADATA
table to store change
control information pertaining to business objects. It also uses the Locking Policy
configuration to maintain and check whether business objects are locked or not.
The purpose of the change control mediator is to capture and maintain change control information for a noun and identified changeable parts of the noun. However, the support for change control in the NVP programming model with EJBs captures this information at a database layer. By configuring the resource container and manager ids, it is possible for this change control mediator to respect the previous locking information while creating the new change control information at the appropriate business object level.
This change mediator has a dependency on the ChangeControlBusinessObjectPartMediatorImpl
class for handling individual noun parts that can have change control applied. Although this implementation
manages the change control information for the container business object, it will use this part
implementation to help create the metadata used to represent the individual change control for the noun part.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_ACTION
The change control metadata property of the action associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_LOGONID
The change control metadata property of the logon ID of the user who is associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_UNIQUEID
The change control metadata property of the person UniqueID of the user who is associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_IDENTIFIER
The change control metadata property of the task identifier of the task associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_NAME
The change control metadata property of the task localized name of the task associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_IDENTIIFER
The change control metadata property of the task group identifier of the task associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_NAME
The change control metadata property of the task group localized name of the task associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TIMESTAMP
The change control metadata property of the timestamp associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_IDENTIIFER
The change control metadata property of the workspace identifier of the workspace associated with the change control information.
|
static java.lang.String |
CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_NAME
The change control metadata property of the workspace localized name of the workspace associated with the change control information.
|
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_BOKEY1_UNIQUEIDPROPERTY
The change control mediator property that specifies the element of the object that represents the long value
that is stored in the
BOKEY1 column the the CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_BOKEY2_UNIQUEIDPROPERTY
The change control mediator property that specifies the element of the object that represents the long value
that is stored in the
BOKEY2 column the the CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_BOKEY3_UNIQUEIDPROPERTY
The change control mediator property that specifies the element of the object that represents the long value
that is stored in the
BOKEY3 column the the CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_BOKEY4_UNIQUEIDPROPERTY
The change control mediator property that specifies the element of the object that represents the long value
that is stored in the
BOKEY4 column the the CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_CHANGE_CONTROL_PART
The change control part mediator property that specifies the element of the isolated noun part
that can be locked.
|
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_LOCKDISABLED
The change control part mediator property value that indicates the mediator should not lock any records in
CMMETADATA table |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_RESOURCECONTAINERID
The change control mediator property that specifies the container ID used when querying
CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_RESOURCEMANAGERID
The change control mediator property that specifies the resource manager ID used when querying
CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_RESOURCEMANAGERIDS
The change control mediator property that specifies the resource manager IDs used when querying the
CMMETADATA table. |
static java.lang.String |
MEDIATOR_CONFIG_PARAMETER_UNIQUEIDPROPERTY
The change control mediator property that specifies the element of the business object that
is used to resolve the
CMMETADATA for the business object. |
ACTION_CREATE, ACTION_DELETE, ACTION_UPDATE
Constructor and Description |
---|
ChangeControlBusinessObjectMediatorImpl()
Creates an instance of a change control mediator that uses
CMMETADATA
to store the change control information. |
Modifier and Type | Method and Description |
---|---|
boolean |
canModify(java.lang.Object noun,
java.lang.Object nounPart)
This method return whether the part of the business object
specified can be modified or not.
|
java.util.List |
getChangeControlNounParts()
This method will return a list of XPath expressions, of type
java.lang.String , that represents the breakdown
of defined change control parts of the noun. |
java.lang.String[] |
getLockMetadata(java.lang.Object noun,
java.lang.Object nounPart)
This method returns a String[] holding the workspace,
task group, task and user responsible for the locking if this part
of the business object cannot be modified, or null otherwise.
|
java.util.Map |
getMetadata(java.lang.Object noun,
java.lang.Object nounPart)
This method will return the change control metadata that is associated
with the business objects specified.
|
void |
initialize(java.util.List aListNoun)
Initialize the change mediator with the nouns submitted for the change request
|
void |
initializeConfig(BusinessObjectMediatorConfig aConfig,
java.util.Map properties)
This method initializes the change control mediator by extract the configuration properties that
controls how the mediator will behave.
|
void |
lock(java.lang.Object noun,
java.lang.Object nounPart,
short action)
This method will obtain a lock for the given part of the business object.
|
void |
unlock(java.lang.Object noun,
java.lang.Object nounPart)
This method will release the lock for the given part of the business object.
|
public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_RESOURCECONTAINERID
CMMETADATA
table.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_LOCKDISABLED
CMMETADATA
tablepublic static final java.lang.String MEDIATOR_CONFIG_PARAMETER_RESOURCEMANAGERIDS
CMMETADATA
table. This includes all the possible resource managers used to store
change control information in the CMMETADATA
table. The first resource manager ID in this
comma separated list is the resource manager ID used to store the change control information.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_RESOURCEMANAGERID
CMMETADATA
table.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_UNIQUEIDPROPERTY
CMMETADATA
for the business object. This value
is stored in the appropriate BOKEY
column depending on whether the object
is the noun or individually controlled part.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_CHANGE_CONTROL_PART
public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_BOKEY1_UNIQUEIDPROPERTY
BOKEY1
column the the CMMETADATA
table.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_BOKEY2_UNIQUEIDPROPERTY
BOKEY2
column the the CMMETADATA
table.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_BOKEY3_UNIQUEIDPROPERTY
BOKEY3
column the the CMMETADATA
table.public static final java.lang.String MEDIATOR_CONFIG_PARAMETER_BOKEY4_UNIQUEIDPROPERTY
BOKEY4
column the the CMMETADATA
table.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_LOGONID
logonID
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_UNIQUEID
personUniqueID
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_IDENTIIFER
ContentContext.ACTIVITY_DATA_PARAM_WORKSPACENAME
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_NAME
workspaceName
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_IDENTIIFER
TaskContext.ACTIVITY_DATA_PARAM_TASKGROUP
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_NAME
taskGroupName
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_IDENTIFIER
TaskContext.ACTIVITY_DATA_PARAM_TASK
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_NAME
taskName
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_ACTION
action
.public static final java.lang.String CHANGE_CONTROL_METADATA_PROPERTY_NAME_TIMESTAMP
lastModified
.public ChangeControlBusinessObjectMediatorImpl()
CMMETADATA
to store the change control information.public void initialize(java.util.List aListNoun) throws java.lang.Exception
initialize
in interface ChangeControlBusinessObjectMediator
aListNoun
- The list of nouns containing the noun parts that have changes.java.lang.Exception
- Error while initializingpublic java.util.Map getMetadata(java.lang.Object noun, java.lang.Object nounPart)
This method will return the change control metadata that is associated with the business objects specified. If the specified noun part is classified as an individually controlled part, then the metadata pertains to that controlled part. Otherwise the change control metadata associated with the noun should be returned.
When change control metadata is found for the controlled part, the information that is returned consists of the person who created the information along with the workspace and task information about the change. The change control metadata included in the result includes the following properties.
CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_LOGONID
CHANGE_CONTROL_METADATA_PROPERTY_NAME_PERSON_UNIQUEID
CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_IDENTIIFER
CHANGE_CONTROL_METADATA_PROPERTY_NAME_WORKSPACE_NAME
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_IDENTIIFER
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASKGROUP_NAME
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_IDENTIFIER
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TASK_NAME
CHANGE_CONTROL_METADATA_PROPERTY_NAME_ACTION
CHANGE_CONTROL_METADATA_PROPERTY_NAME_TIMESTAMP
If no metadata exists for the controlled part or the business object, then
null
is returned.
getMetadata
in interface ChangeControlBusinessObjectMediator
noun
- The business object.nounPart
- The part of the business object to retrieve the change
control metadata for.public boolean canModify(java.lang.Object noun, java.lang.Object nounPart)
canModify
in interface ChangeControlBusinessObjectMediator
noun
- The business object.nounPart
- The part of the business object to determine its
lock status.public java.lang.String[] getLockMetadata(java.lang.Object noun, java.lang.Object nounPart)
noun
- The business object.nounPart
- The part of the business object to determine its
lock status.public void lock(java.lang.Object noun, java.lang.Object nounPart, short action) throws AbstractApplicationException
lock
in interface ChangeControlBusinessObjectMediator
noun
- The business object.nounPart
- The part of the business object to obtain a lock for.action
- The action that cause the lock to occur.AbstractApplicationException
- There was a problem obtaining the lock.
Typically this would happen because the lock already exists for the business object.public void unlock(java.lang.Object noun, java.lang.Object nounPart) throws AbstractApplicationException
unlock
in interface ChangeControlBusinessObjectMediator
noun
- The business object.nounPart
- The part of the business object to unlock.AbstractApplicationException
- There was a problem when attempting to unlock
the business object. This may be because the current the request does not
currently have the lock so it is not allowed to unlock it.public void initializeConfig(BusinessObjectMediatorConfig aConfig, java.util.Map properties)
CMMETADATA
table to maintain change control information pertaining to business objects. This data is also used to maintain
change control information when using the resource manager programming model to lock database records. The configuration
of this change control mediator correlates the how the business object metadata and the resource manager metadata
represents the same information.initializeConfig
in interface BusinessObjectMediator
initializeConfig
in class AbstractBusinessObjectMediatorImpl
aConfig
- The business object mediator configuration for the business object.properties
- The properties of the change control mediator.BusinessObjectMediator.initializeConfig(com.ibm.commerce.foundation.server.services.dataaccess.bom.config.BusinessObjectMediatorConfig, java.util.Map)
public java.util.List getChangeControlNounParts()
java.lang.String
, that represents the breakdown
of defined change control parts of the noun. At a minimum, the noun itself will always
have change control applied to it. However there are cases where the business object
can be broken down into further noun parts, and this method will return this additional breakdown
of the business object.getChangeControlNounParts
in interface ChangeControlBusinessObjectMediator