All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netbula.ORPC.ClientGeneric

java.lang.Object
   |
   +----netbula.ORPC.ClientGeneric

public class ClientGeneric
extends Object
The ClientGeneric class is a wrapper for ClientTCP, ClientUDP and ClientHTTP classes. This class is used in the jrpcgen generated client code to call the server. Normally, one does not use this class directly.


Constructor Index

 o ClientGeneric(InetAddress, int, int, int, String)
Construct a generic RPC client object
 o ClientGeneric(String, int, int, String)
Construct a generic RPC client object

Method Index

 o call(int, XDT, XDT)
Make an RPC call via the underlying RPC client handle.
 o call_proc0()
Ping the RPC by calling procedure 0
 o close()
Close the RPC connection
 o connect()
Connect to the RPC server
 o getAuth()
 o getClient()
 o setAuth(Auth)
Set authentication
 o setClient(RPCClient)
Set the underlying client handle to a bound RPCClient object
 o setServer(String, int)
When HTTP protocol is used, and the servlet/CGI is a proxy to a real RPC server, call this function to set the hostname of the real server and protocol to use for it.
 o setTimeout(int)
Set the timeout value (in milliseconds) for the RPC calls

Constructors

 o ClientGeneric
 public ClientGeneric(InetAddress inetAddress,
                      int prog,
                      int ver,
                      int port,
                      String proto) throws rpc_err
Construct a generic RPC client object

Parameters:
inetAddress - Address of the server machine
prog - program number of the RPC service
ver - version number of the RPC service
port - port number of the RPC service
proto - "tcp" or "udp" only (no http)
 o ClientGeneric
 public ClientGeneric(String host_or_url,
                      int prog,
                      int ver,
                      String proto) throws rpc_err
Construct a generic RPC client object

Parameters:
host_or_url - hostname.domain of the server machine, or the URL of the servlet or CGI program if proto is "http".
prog - program number of the RPC service
ver - version number of the RPC service
proto - "tcp" , "udp" or "http". For "http", one should call setServer() function to set the remote RPC server name, if the servlet/CGI is a proxy.

Methods

 o setServer
 public void setServer(String host,
                       int proto) throws rpc_err
When HTTP protocol is used, and the servlet/CGI is a proxy to a real RPC server, call this function to set the hostname of the real server and protocol to use for it. Note: the servlet/CGI may perform translation of the hostname.

Parameters:
host - Remote server hostname
proto - Ask the proxy to use a particular protocol
See Also:
RpcProxyServlet
 o call_proc0
 public void call_proc0() throws rpc_err
Ping the RPC by calling procedure 0

 o connect
 public boolean connect() throws rpc_err
Connect to the RPC server

 o setAuth
 public void setAuth(Auth a)
Set authentication

 o getAuth
 public Auth getAuth()
 o call
 public void call(int proc,
                  XDT inarg,
                  XDT outarg) throws rpc_err
Make an RPC call via the underlying RPC client handle. Normally, one does not use this low level function, but use the jrpcgen generated RPC client interface instead.

Parameters:
proc - Procecure number of the RPC
inarg - Input argument
outarg - Output which holds the results from the server
 o close
 public boolean close()
Close the RPC connection

 o getClient
 public RPCClient getClient()
Returns:
The underlying RPCClient object
 o setClient
 public void setClient(RPCClient c)
Set the underlying client handle to a bound RPCClient object

 o setTimeout
 public void setTimeout(int timeout)
Set the timeout value (in milliseconds) for the RPC calls


All Packages  Class Hierarchy  This Package  Previous  Next  Index