com.wm.app.b2b.client
Class BaseContext

java.lang.Object
  extended by com.wm.app.b2b.client.BaseContext
Direct Known Subclasses:
Context, TContext

public abstract class BaseContext
extends java.lang.Object

**************************************************************************************** This abstract class is the superclass of Context and TContext. You use the members of this class specify the way in which the client interacts with a server (for example, whether it uses HTTP or HTTPS, whether it sends data in binary or XML format, how requests are handled in a clustered environment) and to obtain information about the state of the client's current connection to a server. ***************************************************************************************


Field Summary
static int NO_SSL
          **************************************************************************************** Constant used to indicate no SSL encryption.
static int RPC_BIN
          **************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods binary RPC transport.
static int RPC_IDAT
          **************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods IData transport.
static int RPC_XML
          **************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods XML transport.
static int SSL_128
          **************************************************************************************** Constant used to indicate 128-bit SSL encryption.
static int SSL_40
          **************************************************************************************** Constant used to indicate 40-bit SSL encryption.
 
Constructor Summary
BaseContext()
          *************************************************************************************** Constructs a BaseContext object and sets it to the binary RPC transport type.
 
Method Summary
static int getSSLSupport()
          *************************************************************************************** Returns the strength of the encryption key.
 boolean isClusteredEnv()
          *************************************************************************************** Indicates whether this object is currently connected to a clustered environment.
 boolean isConnected()
          *************************************************************************************** Indicates whether the context has successfully connected to a server.
 boolean isSecure()
          *************************************************************************************** Indicates whether this object is using a secure connection to the server.
 void setAllowRedir(boolean val)
          *************************************************************************************** Specifies whether requests from this object can be redirected (that is, passed to another server in the target server’s cluster).
 void setAuthentication(java.lang.String user, java.lang.String pass)
          *************************************************************************************** Specifies the authentication credentials (user name and password) that will be used when this object submits a request to the webMethods Integration Server.
 void setFixedUri(java.lang.String uri)
          *************************************************************************************** Specifies the Uniform Resource Identifier (URI) of the CGI script that must be used to access the webMethods Integration Server (IS).
 void setProxy(java.lang.String host, java.lang.String user, java.lang.String pass)
          *************************************************************************************** Specifies the HTTP proxy server (if any) that will be used to communicate with the webMethods Integration Server.
 void setRetryServer(java.lang.String retryServer)
          *************************************************************************************** Specifies the retry server.
 void setSecure(boolean sec)
          *************************************************************************************** Specifies whether this client will use HTTP or HTTPS to communicate with the webMethods Integration Server.
 void setSecureProxy(java.lang.String host, java.lang.String user, java.lang.String pass)
          *************************************************************************************** Specifies the HTTPS proxy server (if any) that will be used to communicate with the webMethods Integration Server.
 void setSSLCertificates(KeyAndCert kac)
          Specifies that Integration Server obtain private keys and certificate chains from an object in memory.
 void setSSLCertificates(java.lang.String privKey, java.lang.String[] certs)
          *************************************************************************************** Specifies the certificates and keys that will be used to create an SSL connection.
 void setSSLCertificates(java.lang.String cert, java.lang.String privKey, java.lang.String cacert)
          Deprecated. Replaced by setSSLCertificates(String, String[])
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_SSL

public static final int NO_SSL
**************************************************************************************** Constant used to indicate no SSL encryption.

See Also:
SSL_128, ****************************************************************************************, Constant Field Values

SSL_128

public static final int SSL_128
**************************************************************************************** Constant used to indicate 128-bit SSL encryption.

See Also:
SSL_40, ****************************************************************************************, Constant Field Values

SSL_40

public static final int SSL_40
**************************************************************************************** Constant used to indicate 40-bit SSL encryption.

See Also:
SSL_128, ****************************************************************************************, Constant Field Values

RPC_BIN

public static final int RPC_BIN
**************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods binary RPC transport.

See Also:
RPC_XML, ****************************************************************************************, Constant Field Values

RPC_XML

public static final int RPC_XML
**************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods XML transport.

See Also:
RPC_BIN, ****************************************************************************************, Constant Field Values

RPC_IDAT

public static final int RPC_IDAT
**************************************************************************************** Constant used to indicate that data is to be sent to the server using webMethods IData transport.

See Also:
RPC_BIN, ****************************************************************************************, Constant Field Values
Constructor Detail

BaseContext

public BaseContext()
*************************************************************************************** Constructs a BaseContext object and sets it to the binary RPC transport type. ***************************************************************************************

Method Detail

isClusteredEnv

public boolean isClusteredEnv()
*************************************************************************************** Indicates whether this object is currently connected to a clustered environment.

Returns:
true if this object is connected to a clustered environment; false otherwise. ***************************************************************************************

setAllowRedir

public void setAllowRedir(boolean val)
*************************************************************************************** Specifies whether requests from this object can be redirected (that is, passed to another server in the target server’s cluster).

Parameters:
val - A boolean specifying whether redirection is permitted as follows.
Set val to…
To…
true Allow unlimited redirection
false Prevent redirection
***************************************************************************************

setRetryServer

public void setRetryServer(java.lang.String retryServer)
*************************************************************************************** Specifies the retry server. The retry server is the one that is used when a client connects to a server in a cluster and the requested server is down. If a retry server has been specified, an attempt will automatically be made to connect the client to the retry server.

Parameters:
retryServer - A String specifying the retry server in the form: hostname:portNumber. ***************************************************************************************

setSecure

public void setSecure(boolean sec)
*************************************************************************************** Specifies whether this client will use HTTP or HTTPS to communicate with the webMethods Integration Server. (Note: If it will use HTTPS, make sure the Integration Server is configured to listen for the HTTPS protocol.)

Parameters:
sec - A boolean that specifies whether the client will use HTTPS as follows.
Set sec to…
To…
true Use HTTPS
false Use HTTP
See Also:
***************************************************************************************

isSecure

public boolean isSecure()
*************************************************************************************** Indicates whether this object is using a secure connection to the server.

Returns:
true if this object is using a secure connection; false otherwise.
See Also:
***************************************************************************************

isConnected

public boolean isConnected()
*************************************************************************************** Indicates whether the context has successfully connected to a server.

Returns:
true if the context has successfully connected to a server; false otherwise. ***************************************************************************************

setFixedUri

public void setFixedUri(java.lang.String uri)
*************************************************************************************** Specifies the Uniform Resource Identifier (URI) of the CGI script that must be used to access the webMethods Integration Server (IS). Normally IS clients use HTTP POSTs in the form: "http://host:port/invoke/folder/service" to invoke services on an Integration Server. However, in cases where the Integration Server resides behind a web server and is accessed via a remote CGI script, a client must specify the URI that points to the CGI script.

Parameters:
uri - A String that specifies the URI of the CGI script. ***************************************************************************************

setProxy

public void setProxy(java.lang.String host,
                     java.lang.String user,
                     java.lang.String pass)
*************************************************************************************** Specifies the HTTP proxy server (if any) that will be used to communicate with the webMethods Integration Server.

Note: User name and password are optional and can be null.

Parameters:
host - A String that specifies the HTTP proxy in the form: hostname:portNumber.
user - A String specifying the user name that this object will use to access the proxy server.
pass - A String specifying the password that this object will use to access the proxy server.
See Also:
***************************************************************************************

setSecureProxy

public void setSecureProxy(java.lang.String host,
                           java.lang.String user,
                           java.lang.String pass)
*************************************************************************************** Specifies the HTTPS proxy server (if any) that will be used to communicate with the webMethods Integration Server.

Note: User name and password are optional and can be null.

Parameters:
host - A String that specifies the HTTPS proxy in the form: hostname:portNumber.
user - A String specifying the user name that this object will use to access the proxy server.
pass - A String specifying the password that this object will use to access the proxy server.
See Also:
***************************************************************************************

setAuthentication

public void setAuthentication(java.lang.String user,
                              java.lang.String pass)
*************************************************************************************** Specifies the authentication credentials (user name and password) that will be used when this object submits a request to the webMethods Integration Server.

Parameters:
user - A String specifying the user name.
pass - A String specifying the user password. ***************************************************************************************

setSSLCertificates

public void setSSLCertificates(java.lang.String cert,
                               java.lang.String privKey,
                               java.lang.String cacert)
Deprecated. Replaced by setSSLCertificates(String, String[])

*************************************************************************************** Specifies the certificates and keys that will be used to create an SSL connection. When you specify these arguments, you can either specify their fully-qualified file names or names that are relative to the webMethods home directory.

Parameters:
cert - A String specifying the location of the client's certificate.
privKey - A String specifying the location of the client's private key.
cacert - A String specifying the location of the Certificate Authority (CA) that signed the client's certificate. ***************************************************************************************

setSSLCertificates

public void setSSLCertificates(java.lang.String privKey,
                               java.lang.String[] certs)
*************************************************************************************** Specifies the certificates and keys that will be used to create an SSL connection. When specifying certificates and key files, you can specify their fully-qualified file names or names that are relative to the webMethods home directory.

Parameters:
privKey - A String specifying the location of the private key that corresponds to the public key in your certificate.
certs - A String [] specifying the locations of all the certificates in your certificate chain. Your certificate must appear as the first element in this array. For example if you own a certificate that has been signed by XYZ' Authority which in turn was signed by Verisign's Authority, your certificate chain is comprised of three certificates: your certificate, XYZ's certificate, and Verisign's certificate. In certs, these must appear in the following order:
  • Your certificate (at index 0)
  • XYZ's certificate (at index 1)
  • Verisign's certificate (at index 2)
***************************************************************************************

setSSLCertificates

public void setSSLCertificates(KeyAndCert kac)
Specifies that Integration Server obtain private keys and certificate chains from an object in memory.

You can create a KeyAndCert object as follows:

new KeyAndCert(X509Certificate[] cc, PrivateKey pk);

Make sure to include enttoolkit.jar in the client classpath.

Parameters:
kac - a KeyAndCert object that represents a key and certificate chain

getSSLSupport

public static int getSSLSupport()
*************************************************************************************** Returns the strength of the encryption key.

Returns:
An int containing one of the following values: NO_SSL, SSL_40 or SSL_128.
See Also:
NO_SSL, SSL_40, ***************************************************************************************