public interface BusinessObjectMediator
The main function of a business object mediator is to call ID resolver to resolve keys and also determine whether it is a new object or an existing object.
The business object mediator will call the configured DataWriter
to write
the data out to the data store.
The business object builder will call the business object mediator in the following sequence:
init()
- initialize the business object mediator.preProcess()
- Pre-process the data.execute()
- Resolve the ID in the data object and call the
DataWriter.insert()
or DataWriter.update()
to write out the data.postProcess()
- Post process the data.close()
- Close the business object mediator.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The internal copyright field.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
This method will perform cleanup on the business object mediator.
|
void |
execute(java.lang.Object obj)
This method will resolve identifiers for the populated data object and
call the configured data writer to write the data out to the data store.
|
ConfigProperties |
getConfigProperties()
Returns the instance of the
ConfigProperties of the BusinessObjectWriter . |
void |
init()
This method performs some initialization for the business object mediator.
|
ConfigProperties |
initConfig(org.w3c.dom.Node businessObjectMediatorNode,
ConfigProperties parentConfigProperties)
This method parses the
BusinessObjectMediator xml node read in from the business object configuration file
and stores the configuration in memory. |
void |
postProcess()
This method performs any post processing of the data after the data has been written to the data store.
|
void |
preProcess(java.lang.Object obj)
This method performs any pre-processing of the data if needed.
|
void |
setConfigProperties(ConfigProperties aConfigProperties)
Sets the configuration properties for this business object mediator.
|
static final java.lang.String COPYRIGHT
ConfigProperties getConfigProperties()
Returns the instance of the ConfigProperties
of the BusinessObjectWriter
.
Call this method when you need to get specific properties from the configuration properties.
void setConfigProperties(ConfigProperties aConfigProperties)
Sets the configuration properties for this business object mediator.
This method is not normally called unless overriding the configuration properties for this business object mediator is required.
aConfigProperties
- The configuration properties for this business object mediator.void init() throws DataLoadException
This method performs some initialization for the business object mediator.
DataLoadException
- An application exception will be thrown if there was a problem initializing the business object mediator.ConfigProperties initConfig(org.w3c.dom.Node businessObjectMediatorNode, ConfigProperties parentConfigProperties) throws DataLoadException
This method parses the BusinessObjectMediator
xml node read in from the business object configuration file
and stores the configuration in memory.
businessObjectMediatorNode
- The BusinessObjectMediator
xml node read in from the business object configuration file.parentConfigProperties
- The configuration properties for the parent business object builder of this data reader.DataLoadException
- An application exception will be thrown if there was a problem initializing the configuration for the business object mediator.void preProcess(java.lang.Object obj) throws DataLoadException
This method performs any pre-processing of the data if needed.
This method normally does not have any function. Implement this method only if any pre-processing of the populated data object is needed.
obj
- The data object data load with input data read in from the data reader.DataLoadException
- An application exception will be thrown is there was a problem preproccessing the data from the data object.void execute(java.lang.Object obj) throws DataLoadException
This method will resolve identifiers for the populated data object and call the configured data writer to write the data out to the data store.
obj
- The populated and pre-processed data object.DataLoadException
- An application exception will be thrown is there was a problem resolving the IDs or writing the data.void postProcess() throws DataLoadException
This method performs any post processing of the data after the data has been written to the data store.
This method normally does not have any function. Implement this method only if any post processing of the data loaded is needed.
DataLoadException
- An application exception will be thrown is there was a problem post processing the loaded data.void close() throws DataLoadException
This method will perform cleanup on the business object mediator. It will attempt to close all of the data writers configured for this business object mediator.
DataLoadException
- An application exception will be thrown if there was a problem closing the business object mediator or its data writers.