public interface ChangeControlBusinessObjectMediator extends BusinessObjectMediator
The Change Control Business Object Mediator is responsible for resolving the current state of business objects and whether they can be modified or not. The change control mediator returns change metadata associated with a specified business object as well as providing the ability to lock and unlock business objects. The purpose of the change control mediator is to consult the control system to validate whether the change on the business object should be permitted.
The client of the change control mediator is the logic that is modifying the business objects. The clients should validate whether the object can be modified as well as obtain the lock when modifying the objects.
Modifier and Type | Field and Description |
---|---|
static short |
ACTION_CREATE
The constant that represents the create action when locking a business object.
|
static short |
ACTION_DELETE
The constant that represents the delete action when locking a business object.
|
static short |
ACTION_UPDATE
The constant that represents the update action when locking a business object.
|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canModify(java.lang.Object noun,
java.lang.Object nounPart)
This method returns whether the part of the business object
specified can be modified or not.
|
java.util.List |
getChangeControlNounParts()
This method returns a list of XPath expressions relative to the noun that represents the breakdown
of individual changeable parts of the noun.
|
java.util.Map |
getMetadata(java.lang.Object noun,
java.lang.Object nounPart)
This method returns the change control metadata that is associated
with the business objects specified.
|
void |
initialize(java.util.List aListNoun)
Initializes the change control mediator to load any up front information pertaining
to the objects used in the current request.
|
void |
lock(java.lang.Object noun,
java.lang.Object nounPart,
short action)
This method obtains a lock for the given part of the business object.
|
void |
unlock(java.lang.Object noun,
java.lang.Object nounPart)
This method releases the lock for the given part of the business object.
|
initializeConfig
static final java.lang.String COPYRIGHT
static final short ACTION_CREATE
static final short ACTION_UPDATE
static final short ACTION_DELETE
void initialize(java.util.List aListNoun) throws java.lang.Exception
aListNoun
- The list of nouns that is involved with the current request.
The objects in the list is the actual noun objects used in the current request.
There are cases where the list is empty or the nouns passed specified are going to be
created as a result of the operation. There may not be existing change
control information about the object. Initialization should not assume certain values of
the business object are populated or information about the object already exists.java.lang.Exception
- Error while initializing which causes the request to stop executing.
This exception will typically pertain to the configuration and resolving the up front
change control information of the given nouns.java.util.Map getMetadata(java.lang.Object noun, java.lang.Object nounPart)
This method returns the change control metadata that is associated with the business objects specified. If the specified noun part is classified as an individual changable, then the metadata is pertaining to that changable part. Otherwise the change control metadata associated with the noun should be returned.
If no metadata exists for the changeable part or the business object, thennull
or an empty map can be returned.noun
- The containing business object.nounPart
- The part of the business object to retrieve the change
control metadata for.boolean canModify(java.lang.Object noun, java.lang.Object nounPart)
noun
- The containing business object.nounPart
- The part of the business object to determine its
modification status.void lock(java.lang.Object noun, java.lang.Object nounPart, short action) throws AbstractApplicationException
noun
- The containing business object.nounPart
- The part of the business object to obtain a lock for.action
- The action that caused the lock to occur. The value for the action should
either one of the ACTION
constants defined in this interface. The value
should be either ACTION_CREATE
, ACTION_UPDATE
or ACTION_DELETE
.AbstractApplicationException
- There was a problem obtaining the lock.
Typically this would because the lock already exists for the business object.void unlock(java.lang.Object noun, java.lang.Object nounPart) throws AbstractApplicationException
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.java.util.List getChangeControlNounParts()