com.ibm.vap.ccfadapter.ims
Class IMSAdapter
java.lang.Object
|
+--com.ibm.vap.generic.ServerAdapter
|
+--com.ibm.vap.ccfadapter.CCFAdapter
|
+--com.ibm.vap.ccfadapter.ims.IMSAdapter
- public class IMSAdapter
- extends CCFAdapter
This server adapter class is used by the VisualAge Pacbase Runtime to communicate with
the server using IMS Connect/CCF connector.
This class implements the ServerAdapter methods using the Common Connector Framework interface for IMS Connect
delivered by IBM. All you need is to set up the IMS Connect environment, instantiate IMSAdapter class and
sets it as the current proxy adapter.
Sample code :
// Prepare the infrastructure
com.ibm.connector.connectionmanager.ConnectionManager cm = new com.ibm.connector.connectionmanager.ConnectionManager();
com.ibm.connector.infrastructure.RuntimeContext rc = new com.ibm.connector.infrastructure.RuntimeContext();
rc.setConnectionManager(cm);
com.ibm.connector.infrastructure.java.JavaRuntimeContext.setCurrent(rc);
// Instanciate the connection spec
com.ibm.connector.imstoc.IMSConnectionSpec connectionSpec = new com.ibm.connector.imstoc.IMSConnectionSpec();
connectionSpec.setConnectionTimeout(80);
connectionSpec.setHostName("xxx.xxx.xxx.xxx.xxx");
connectionSpec.setMaxConnections(10);
connectionSpec.setMinConnections(1);
connectionSpec.setPortNumber(4000);
// Configure the logon info items
com.ibm.connector.imstoc.IMSLogonInfoItems imslogon = new com.ibm.connector.imstoc.IMSLogonInfoItems(rc.getLogonInfo(), connectionSpec);
imslogon.setUser("USER");
imslogon.setPassword("PASSWORD");
imslogon.setGroup("GROUP");
com.ibm.connector.imstoc.IMSCommunication communication = (com.ibm.connector.imstoc.IMSCommunication)connectionSpec.createCommunication();
communication.connect();
com.ibm.connector.imstoc.IMSInteractionSpec interactionSpec = new com.ibm.connector.imstoc.IMSInteractionSpec();
interactionSpec.setDataStoreName("DATASTORE");
interactionSpec.setRASTraceLevel(15);
interactionSpec.setSyncLevel(com.ibm.connector.imstoc.IMSInteractionSpecProperties.SYNC_LEVEL_NONE);
interactionSpec.setMode(com.ibm.connector.InteractionSpecModeProperties.MODE_SEND_RECEIVE);
// Instanciate the adapter class
try {
com.ibm.vap.ccfadapter.ims.IMSAdapter imsa = new com.ibm.vap.ccfadapter.ims.IMSAdapter(connectionSpec, interactionSpec);
imsa.setHostCodePage("Cp037");
imsa.setTransactionName("TRANS");
imsa.setCommareaLength(8192);
// Instantiate a Vap Proxy and set the adapter class
com.ibm.vap.generated.proxies.CustomerProxyLv proxy = new com.ibm.vap.generated.proxies.CustomerProxyLv();
proxy.setServerAdapter(imsa);
proxy.selectInstances();
return proxy.rows();
} catch (com.ibm.vap.generic.CommunicationError ce) {
return ce.getMessage();
} catch (com.ibm.vap.generic.SystemError se) {
return se.getMessage();
}
- Since:
- 3.0v06
- See Also:
ServerAdapter
Constructor Summary |
IMSAdapter()
|
IMSAdapter(com.ibm.vap.ccfadapter.ims.ConnectionSpec cs,
com.ibm.vap.ccfadapter.ims.InteractionSpec is)
|
Methods inherited from class com.ibm.vap.ccfadapter.CCFAdapter |
addPropertyChangeListener,
disconnect,
getCommareaLength,
getConnectionSpec,
getHostCodePage,
getInteractionSpec,
getProperty,
removePropertyChangeListener,
requireRequester,
setCommareaLength,
setConnectionSpec,
setHostCodePage,
setInteractionSpec,
setProperty |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
IMSAdapter
public IMSAdapter()
IMSAdapter
public IMSAdapter(com.ibm.vap.ccfadapter.ims.ConnectionSpec cs,
com.ibm.vap.ccfadapter.ims.InteractionSpec is)
getTransactionName
public java.lang.String getTransactionName()
setTransactionName
public void setTransactionName(java.lang.String tn)
Licensed Materials - Property of IBM - 5655-F37 - (C) Copyright IBM Corp. 1983, 2003. All Rights Reserved.
IBM, VisualAge and Pacbase are trademarks of International Business Machines Corporation registered in the United States, other countries, or both.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States,other countries, or both.
Other company, product or service names may be the trademarks or service marks of others.