244 lines
15 KiB
HTML
244 lines
15 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="Proxy Support" />
|
|
<meta name="abstract" content="IBM Toolbox for Java includes proxy support for some classes. Proxy support is the processing that IBM Toolbox for Java needs to carry out a task on a Java virtual machine (JVM) when the application is on a different JVM." />
|
|
<meta name="description" content="IBM Toolbox for Java includes proxy support for some classes. Proxy support is the processing that IBM Toolbox for Java needs to carry out a task on a Java virtual machine (JVM) when the application is on a different JVM." />
|
|
<meta name="DC.Relation" scheme="URI" content="page1.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahh505.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzahh502.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="proxex1.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="proxex2.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="proxex3.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="proxies" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Proxy Support</title>
|
|
</head>
|
|
<body id="proxies"><a name="proxies"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Proxy Support</h1>
|
|
<div><p>IBM<sup>®</sup> Toolbox
|
|
for Java™ includes
|
|
proxy support for some classes. Proxy support is the processing that IBM Toolbox for Java needs
|
|
to carry out a task on a Java virtual machine (JVM) when the application
|
|
is on a different JVM.</p>
|
|
<div class="section"><p>Proxy support includes <a href="#proxies__usingencryption">using
|
|
the Secure Sockets Layer (SSL)</a> protocol to encrypt data.</p>
|
|
<p>The
|
|
proxy classes reside in jt400Proxy.jar, which ships with the rest of the IBM Toolbox
|
|
for Java.
|
|
The proxy classes, like the other classes in the IBM Toolbox for Java, comprise a set of platform independent Java classes
|
|
that can run on any computer with a <a href="jvm.htm#jvm">Java virtual
|
|
machine</a>. The proxy classes dispatch all method calls to a server application,
|
|
or proxy server. The full IBM Toolbox for Java classes are on the proxy server. When
|
|
a client uses a proxy class, the request is transferred to the proxy server
|
|
which creates and administers the real IBM Toolbox for Java objects.</p>
|
|
<p>Figure 1 shows how the
|
|
standard and proxy client connect to the server. The proxy server can be
|
|
the iSeries™ that
|
|
contains the data.</p>
|
|
<p><strong>Figure 1: How a standard client and a proxy client
|
|
connect to a server</strong></p>
|
|
<p><img src="rzahh505.gif" longdesc="rzahh505.htm" alt="Standard and proxy connections" /></p>
|
|
<p>An
|
|
application that uses proxy support performs more slowly than if it uses standard IBM Toolbox
|
|
for Java classes
|
|
due to the extra communication needed to support the smaller proxy classes.
|
|
Applications that make fewer method calls have less performance degradation.</p>
|
|
<p>Before
|
|
proxy support, the classes containing the public interface, all the classes
|
|
needed to process a request, and the application itself ran on the same JVM.
|
|
When using proxy support, the public interface must be with the application,
|
|
but classes for processing requests can run on a different JVM. Proxy support
|
|
does not change the public interface. The same program can run with either
|
|
the proxy version of IBM Toolbox for Java or the standard version.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Using the jt400Proxy.jar file</h4><p>The goal of the multiple-tier,
|
|
proxy scenario is to make the public interface jar file as small as possible,
|
|
so that downloading it from an applet takes less time. When you use the proxy
|
|
classes, you don't need to install the entire IBM Toolbox for Java on the client. Instead, use <a href="jar.htm#jar">AS400JarMaker</a> on
|
|
the jt400Proxy.jar file to include only the required components, which makes
|
|
the jar file as small as possible.</p>
|
|
<p>Figure 2 compares the size of the
|
|
proxy jar files with the standard jar files:</p>
|
|
<p><strong>Figure 2: Size comparison
|
|
of proxy jar files and standard jar files</strong></p>
|
|
<p><img src="rzahh502.gif" longdesc="rzahh502.htm" alt="Size comparison of proxy jar files and standard jar files" /></p>
|
|
<p>An
|
|
additional benefit is that proxy support requires you to have fewer ports
|
|
open through a firewall. With standard IBM Toolbox for Java, you must have multiple ports open.
|
|
This is because each IBM Toolbox for Java service uses a different port to communicate
|
|
with the server. For example, Command call uses a different port than JDBC,
|
|
which uses a different port than print, and so on. You must allow each of
|
|
these ports through the firewall. However, when using proxy support, all the
|
|
data flows through the same port.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Standard proxy and HTTP tunneling</h4><p>Two options are
|
|
available for running via a proxy: standard proxy and HTTP tunneling:</p>
|
|
<ul><li>Standard proxy is where the proxy client and proxy server communicate
|
|
by using a socket over a port. The default port is 3470. Change the default
|
|
port by using the <a href="javadoc/com/ibm/as400/access/ProxyServer.html#SETPORT(INT)"> setPort()</a> method on the ProxyServer class, or by using
|
|
the <tt>-port</tt> option when starting the proxy server. For example: <pre> java com.ibm.as400.access.ProxyServer -port 1234</pre>
|
|
</li>
|
|
<li>HTTP tunneling is where the proxy client and proxy server communicate
|
|
by way of the HTTP server. The IBM Toolbox for Java provides a servlet that handles the
|
|
proxy request. The proxy client calls the servlet by way of the HTTP server.
|
|
The advantage of tunneling is that you are not required to open an additional
|
|
port through the firewalls, because communication is by way of the HTTP port.
|
|
The disadvantage of tunneling is that it is slower than standard proxy.</li>
|
|
</ul>
|
|
<p>IBM Toolbox
|
|
for Java uses
|
|
the proxy server name to determine if standard proxy or tunneling proxy is
|
|
being used:</p>
|
|
<ul><li>For standard proxy, just use the server name. For example: <div class="p"><pre> com.ibm.as400.access.AS400.proxyServer=myServer</pre>
|
|
</div>
|
|
</li>
|
|
<li>For tunneling, use a URL to force the proxy client to use tunneling. For
|
|
example: <pre> com.ibm.as400.access.AS400.proxyServer=http://myServer</pre>
|
|
</li>
|
|
</ul>
|
|
<p>When running standard proxy, a socket connection exists between the
|
|
client and server. If that connection fails, the server cleans up resources
|
|
associated with that client.</p>
|
|
<p>When using HTTP tunneling, using the HTTP
|
|
protocol makes proxy connectionless. That is, a new connection is made for
|
|
each data flow. Because the protocol is connectionless, the server does not
|
|
know if the client application is no longer active. Consequently, the server
|
|
does not know when to clean up resources. The tunneling server solves this
|
|
problem by using a thread to clean up resources at a predetermined interval
|
|
(which is based on a timeout value).</p>
|
|
<p>At the end of the predetermined
|
|
interval, the thread runs and cleans up resources that have not been used
|
|
lately. Two <a href="systemproperties.htm#systemproperties">system properties</a> govern
|
|
the thread:</p>
|
|
<ul><li>com.ibm.as400.access.TunnelProxyServer. <a href="systemproperties.htm#systemproperties__proxy">clientCleanupInterval</a> is
|
|
how often, in seconds, the cleanup thread runs. The default is every two hours.</li>
|
|
<li>com.ibm.as400.access.TunnelProxyServer. <a href="systemproperties.htm#systemproperties__proxy">clientLifetime</a> is
|
|
how long, in seconds, a resource can be idle before it is cleaned up. The
|
|
default is 30 minutes.</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Using proxy server</h4><p>To use the proxy server implementation
|
|
of the IBM Toolbox
|
|
for Java classes,
|
|
complete the following steps:</p>
|
|
<ol><li>Run AS400ToolboxJarMaker on jt400Proxy.jar to discard classes that you
|
|
do not need. This step is optional but recommended.</li>
|
|
<li>Deliver jt400Proxy.jar to the client. For Java applets, you may be able to download
|
|
the jar file from the HTML server.</li>
|
|
<li>Determine what server you will use for the proxy server. <ul><li>For Java applications, the proxy server can be any computer.</li>
|
|
<li>For Java applets, the proxy server must be running on the
|
|
same computer as the HTTP server.</li>
|
|
</ul>
|
|
</li>
|
|
<li>Ensure that you have put jt400.jar in the CLASSPATH on the server.</li>
|
|
<li>Start the proxy server or use the proxy servlet: <ul><li>For standard proxy, start the proxy server by using the following command:
|
|
<div class="p"><pre> java com.ibm.as400.access.ProxyServer</pre>
|
|
</div>
|
|
</li>
|
|
<li>For tunneling proxy, configure your HTTP server to use the proxy servlet.
|
|
The servlet class name is com.ibm.as400.access.TunnelProxyServer and it is
|
|
contained in jt400.jar.</li>
|
|
</ul>
|
|
</li>
|
|
<li>On the client, set a <a href="systemproperties.htm#systemproperties">system
|
|
property</a> to identify the proxy server. IBM Toolbox for Java uses this system property to determine
|
|
if standard proxy or tunneling proxy is being used. <ul><li>For standard proxy, the property value is the name of the machine that
|
|
runs the proxy server. For example: <div class="p"><pre> com.ibm.as400.access.AS400.proxyServer=myServer</pre>
|
|
</div>
|
|
</li>
|
|
<li>For tunneling proxy, use a URL to force the proxy client to use tunneling.
|
|
For example: <div class="p"><pre> com.ibm.as400.access.AS400.proxyServer=http://myServer</pre>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>Run the client program.</li>
|
|
</ol>
|
|
<p>When you want to work with both the proxy classes and classes not
|
|
in jt400Proxy.jar, you can refer to jt400.jar instead of jt400Proxy.jar. jt400Proxy.jar
|
|
is a subset of the jt400.jar and, therefore, all of the proxy classes are
|
|
contained in the jt400.jar file.</p>
|
|
</div>
|
|
<div class="section" id="proxies__usingencryption"><a name="proxies__usingencryption"><!-- --></a><h4 class="sectiontitle">Using SSL</h4><p>When using proxy,
|
|
three options are available for encrypting data as it flows from the proxy
|
|
client to the target iSeries server. SSL algorithms are used to encrypt
|
|
data.</p>
|
|
<ol><li>The data flows between the proxy client and proxy server can be encrypted.</li>
|
|
<li>The data flows between the proxy server and target iSeries server can be encrypted.</li>
|
|
<li>Both one and two. The data flow between proxy client and proxy server,
|
|
and the flow between the proxy server and the target iSeries can be encrypted.</li>
|
|
</ol>
|
|
<p>See <a href="sslinfo.htm#sslinfo">Secure Sockets Layer</a> for
|
|
more information.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Examples: Using proxy servers</h4><p>The following are
|
|
three specific examples for using a proxy server with the steps listed above.</p>
|
|
<ul><li><a href="proxex1.htm#proxex1">Running a Java application using proxy support</a></li>
|
|
<li><a href="proxex2.htm#proxex2">Running a Java applet using proxy support</a></li>
|
|
<li><a href="proxex3.htm#proxex3">Running a Java application using tunneling proxy support.</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Classes enabled to work with proxy server</h4><p>Some IBM Toolbox
|
|
for Java classes
|
|
are enabled to work with the proxy server application. These include the following:</p>
|
|
<ul><li><a href="jdbc.htm#jdbc">JDBC</a></li>
|
|
<li><a href="rla.htm#rla">Record-level access</a></li>
|
|
<li><a href="ifs.htm#ifs">Integrated file system</a></li>
|
|
<li><a href="print.htm#print">Print</a></li>
|
|
<li><a href="dtaq.htm#dtaq">Data Queues</a></li>
|
|
<li><a href="cmdc.htm#cmdc">Command Call</a></li>
|
|
<li><a href="pgmc.htm#pgmc">Program Call</a></li>
|
|
<li><a href="spgcall.htm#spgcall">Service Program Call</a></li>
|
|
<li><a href="uspace.htm#uspace">User space</a></li>
|
|
<li><a href="dataarea.htm#dataarea">Data area</a></li>
|
|
<li><a href="as400obj.htm#as400obj">AS400 class</a></li>
|
|
<li><a href="ssl.htm#ssl">SecureAS400 class</a></li>
|
|
</ul>
|
|
<p>Other classes are not supported at this time by jt400Proxy. Also,
|
|
integrated file system permissions are not functional using only the proxy
|
|
jar file. However, you can use the <a href="jar.htm#jar">JarMaker</a> class
|
|
to include these classes from the jt400.jar file.</p>
|
|
<p><strong></strong></p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<ul class="ullinks">
|
|
<li class="ulchildlink"><strong><a href="rzahh505.htm">Long description of Figure 1: How a standard client and a proxy client connect to a server (rzahh505.gif)</a></strong><br />
|
|
</li>
|
|
<li class="ulchildlink"><strong><a href="rzahh502.htm">Long description of Figure 1: Size comparison of proxy jar files and standard jar files (rzahh502.gif)</a></strong><br />
|
|
</li>
|
|
<li class="ulchildlink"><strong><a href="proxex1.htm">Example: Running a Java application using Proxy Support</a></strong><br />
|
|
The following example shows you the steps to run a Java application
|
|
using proxy support. </li>
|
|
<li class="ulchildlink"><strong><a href="proxex2.htm">Example: Running a Java applet using proxy support</a></strong><br />
|
|
The following example shows you the steps to run a Java applet
|
|
using proxy support.</li>
|
|
<li class="ulchildlink"><strong><a href="proxex3.htm">Example: Running a Java application using Tunneling Proxy Support</a></strong><br />
|
|
The following example shows you the steps to run a Java application
|
|
using tunneling proxy support.</li>
|
|
</ul>
|
|
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="page1.htm" title="IBM Toolbox for Java is a set of Java classes that allow you to use Java programs to access data on your iSeries servers. You can use these classes to write client/server applications, applets, and servlets that work with data on your iSeries. You can also run Java applications that use the IBM Toolbox for Java classes on the iSeries Java virtual machine (JVM).">IBM Toolbox for Java</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |