Response constructors

The final stage in any typical InfoSphere MDM transaction is to construct the response.

When you invoke InfoSphere® MDM Custom Domain Hub, you must supply a java.util.Map type object describing the transaction context. An example would look something like this:
    Map context = new HashMap();
    context.put("TargetApplication","tcrm");
    context.put("RequestType", "standard");
    context.put("ResponseType", "standard");
    context.put("Parser", "TCRMService");
    context.put("Constructor", "TCRMService");
    context.put("OperationType", "All");

One of the transaction context entries specifies a name that describes the response constructor you intend for InfoSphere MDM Custom Domain Hub to use.

Before OSGi

############################
# ResponseType
#
# ConstructorFactory.<TargetApplication property value>.<ResponseType property value>
#
# The key without the ResponseType property value can be used to define
# the default value if nothing was supplied.
#
ConstructorFactory.tcrm.standard=com.dwl.base.requestHandler.DWLConstructorFactory
ConstructorFactory.tcrm=com.dwl.base.requestHandler.DWLConstructorFactory
ConstructorFactory.tcrm.xml=com.dwl.base.requestHandler.DWLConstructorFactory
InfoSphere MDM Custom Domain Hub uses the transaction context, context.put("ResponseType", "standard"), to determine the response constructor factory to use. The standard factory is denoted by the property ConstructorFactory.tcrm.standard. The InfoSphere MDM Custom Domain Hub Default constructor factory then uses the value from the transaction context, context.put("Constructor", "TCRMService"), to determine the property setting called constructor.tcrm.TCRMService, to retrieve the correct constructor, as follows:
############################
# Constructor
#
# Constructor.<TargetApplication property value>.<Constructor property value>
#
# The key without the Constructor property value can be used to define
# the default value if nothing was supplied.
#
Constructor.tcrm.TCRMService=com.dwl.tcrm.coreParty.xmlHandler.XMLResponseConstructor
Constructor.tcrm=com.dwl.tcrm.coreParty.xmlHandler.XMLResponseConstructor
Constructor.tcrm.FederatedDeployment=com.ibm.mdm.common.federated.deployment.XMLFederatedResponseConstructorHelper

With OSGi

If you are reusing the default InfoSphere MDM Custom Domain Hub response constructor factory, but you have created your own response constructors, then you must use the following blueprint definitions in the bundle containing your response constructor(s):
<service id="ResponseConstructorFactory" 
	interface="com.dwl.base.requestHandler.interfaces.IResponseConstructorFactory">
	<service-properties>
		<entry key="constructor">
			<list>    
				<value>Constructor Name</value>  
				<value>. . .</value>  
			</list>
		</entry>
	</service-properties>  
	<bean 
		class="com.ibm.mdm.base.requestHandler.ResponseConstructorFactoryServiceImpl" >
		<property name="bpContainer" ref="blueprintContainer"></property>
		<property name="bpBundle" ref="blueprintBundle"></property>
	</bean>
</service> 

<bean id="Constructor Name" class="Your Constructor Class Name" scope="prototype" />
<bean id="..." class="Your ... Constructor Class Name" scope="prototype" />
This pattern is identical to the use for parsers shown previously. If you have created your own response constructor factory, here’s the blueprint definition you must include in the bundle containing your response constructor factory:
<service id="ResponseConstructorFactory" 
	interface="com.dwl.base.requestHandler.interfaces.IResponseConstructorFactory">
	<service-properties>					
		<entry key="constructor">
			<list>
				<value>Constructor Name </value>
				<value>...</value>
			</list>
		</entry>
	</service-properties>		
	<bean class="Your Response Constructor Factory implementing class" />
</service>

In this blueprint file definition, the constructor name is supplied in the transaction context, context.put("Constructor", "Constructor Name"). Your response constructor factory is responsible for locating and instantiating the response constructor. So long as your constructor class is visible to your constructor factory (is on the classpath), the factory will be able to create an instance of the constructor.

In the manifest files of your customized bundle project and the CBA project, import the following packages:
com.dwl.base.requestHandler.interfaces
com.dwl.tcrm.coreParty.xmlHandler
com.ibm.mdm.base.requestHandler
Then, export the com.dwl.base.requestHandler.interfaces.IResponseConstructorFactory service in your CBA project.


Last updated: 9 Dec 2016