com.ibm.vap.ccfadapter
Class CCFAdapter

java.lang.Object
  |
  +--com.ibm.vap.generic.ServerAdapter
        |
        +--com.ibm.vap.ccfadapter.CCFAdapter
Direct Known Subclasses:
IMSAdapter

public class CCFAdapter
extends com.ibm.vap.generic.ServerAdapter

This server adapter class is used by the VisualAge Pacbase Runtime to communicate with the server using CCF connectors through supported protocols.

This class implements the ServerAdapter methods using the Common Connector Framework interface delivered by IBM. You may then use any connector classes that implements this interface to communicate with the server. In the following exemple we use the CICS Connector (com.ibm.connector.cics.*). The InteractionSpec that retains all interaction-relevant attributes of a CCF Connector, such as a program name or interaction mode, needs to be instantiate an setup by the user. The ConnectionSpec that holds all connection-relevant attributes of a CCF Connector, such as host name, port number, and timeout specifications, needs also to be instatiate an setup by the user. Then you will need to instantiate ccfAdapter class and set it as the current proxy adapter.

Sample code :

	// Instantiate the InteractionSpec class
	com.ibm.connector.cics.ECIInteractionSpec is = new com.ibm.connector.cics.ECIInteractionSpec();
	is.setCICSELUW(false);
	is.setPassword("USERPWD");
	is.setProgramName("CLECIN");
	is.setTPNTransactionName(true);
	is.setTransactionName("VEC1");
	is.setUserid("USERID");
	is.setMode(com.ibm.connector.InteractionSpecModeProperties.MODE_SEND_RECEIVE);

	//Instantiate the ConnectionSpec class
	com.ibm.connector.cics.CICSConnectionSpec cs = new com.ibm.connector.cics.CICSConnectionSpec();
	cs.setCICSServer("CICSSTMV");
	cs.setConnectionTimeout(80);
	cs.setUnusedTimeout(30);
	cs.setURL("tcp://9.100.400.170:2000");

	try {
		// Instantiate an Adpater class
		com.ibm.vap.ccfadapter.CCFAdapter ccfAdapter = new com.ibm.vap.ccfadapter.CCFAdapter(cs,is);
		ccfAdapter.setCommareaLength(8192);
		ccfAdapter.setHostCodePage("Cp1147");
		// 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(ccfAdapter);
		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:
2.5v11
See Also:
ServerAdapter

Constructor Summary
CCFAdapter()
          Default constructor.
CCFAdapter(com.ibm.vap.ccfadapter.ConnectionSpec cs, com.ibm.vap.ccfadapter.InteractionSpec is)
          Full constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void disconnect()
          Frees resources used for the communication by this server adapter (connections, buffers, etc).
 int getCommareaLength()
          retrieves the messageLength attribut.
 com.ibm.vap.ccfadapter.ConnectionSpec getConnectionSpec()
          retrieves the connectionSpec attribut.
 java.lang.String getHostCodePage()
          retrieves the hsot code page attribut.
 com.ibm.vap.ccfadapter.InteractionSpec getInteractionSpec()
          retrieves the interactionSpec attribut.
 java.lang.Object getProperty(java.lang.String name)
          Returns the communication parameter for the specified String name.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 com.ibm.vap.generic.Requester requireRequester()
          Returns an instance of requester associated to this server adapter.
 void setCommareaLength(int newValue)
          Sets the commareaLength attribut.
 void setConnectionSpec(com.ibm.vap.ccfadapter.ConnectionSpec newValue)
          Sets the connectionSpec attribut.
 void setHostCodePage(java.lang.String newValue)
          Sets the host code page attribut.
 void setInteractionSpec(com.ibm.vap.ccfadapter.InteractionSpec newValue)
          Sets the interactionFactory attribut.
 void setProperty(java.lang.String name, java.lang.Object newValue)
          Sets a communication parameter of specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CCFAdapter

public CCFAdapter()
Default constructor.

CCFAdapter

public CCFAdapter(com.ibm.vap.ccfadapter.ConnectionSpec cs,
                  com.ibm.vap.ccfadapter.InteractionSpec is)
Full constructor.
Parameters:
cs - com.ibm.connector.ConnectionSpec
is - com.ibm.connector.InteractionSpec
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)

disconnect

public void disconnect()
Frees resources used for the communication by this server adapter (connections, buffers, etc). This method is never called by the VisualAge Pacbase Runtime, but is used by the adapter when changing the connectionSpec instance and it can be used by the client program.
Overrides:
disconnect in class com.ibm.vap.generic.ServerAdapter

getCommareaLength

public int getCommareaLength()
retrieves the messageLength attribut.
Returns:
the commarea length

getConnectionSpec

public com.ibm.vap.ccfadapter.ConnectionSpec getConnectionSpec()
retrieves the connectionSpec attribut.
Returns:
com.ibm.connector.ConnectionSpec

getHostCodePage

public java.lang.String getHostCodePage()
retrieves the hsot code page attribut.
Returns:
the value of the host encoding page code

getInteractionSpec

public com.ibm.vap.ccfadapter.InteractionSpec getInteractionSpec()
retrieves the interactionSpec attribut.
Returns:
com.ibm.connector.interactionSpec

getProperty

public java.lang.Object getProperty(java.lang.String name)
Returns the communication parameter for the specified String name. This method can be overriden by the specific server adapter. It is the responsibility of the specific server adapter to return the property value or throw a communication exception.
Overrides:
getProperty in class com.ibm.vap.generic.ServerAdapter
Parameters:
name - the property name
Returns:
the property value

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)

requireRequester

public com.ibm.vap.generic.Requester requireRequester()
                                               throws com.ibm.vap.generic.CommunicationError
Returns an instance of requester associated to this server adapter. The returned requester is initialized using the properties set in this server adapter.
Overrides:
requireRequester in class com.ibm.vap.generic.ServerAdapter
Returns:
a requester which can be used to send/receive requests
Throws:
com.ibm.vap.generic.CommunicationError - if a CCFRequester can't be instantiate

setCommareaLength

public void setCommareaLength(int newValue)
Sets the commareaLength attribut.
Parameters:
length - of the commarea

setConnectionSpec

public void setConnectionSpec(com.ibm.vap.ccfadapter.ConnectionSpec newValue)
Sets the connectionSpec attribut.
Parameters:
com.ibm.connector.ConnectionSpec -  

setHostCodePage

public void setHostCodePage(java.lang.String newValue)
Sets the host code page attribut.
Parameters:
the - value of the host encoding page code

setInteractionSpec

public void setInteractionSpec(com.ibm.vap.ccfadapter.InteractionSpec newValue)
Sets the interactionFactory attribut.
Parameters:
com.ibm.connector.InteractionSpec -  

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object newValue)
Sets a communication parameter of specified name. This method can be overriden by a specific server adapter. It is the responsibility of the specific server adapter set the property value or throw a communication exception.
Overrides:
setProperty in class com.ibm.vap.generic.ServerAdapter
Parameters:
name - the property name
newValue - the property value


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.