netbula.ORPC
Class ClientGeneric
java.lang.Objectnetbula.ORPC.ClientGeneric
public class ClientGeneric
extends java.lang.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.
ClientGeneric()- Construct a ClientGeneric object
|
ClientGeneric(InetAddress inetAddress, int prog, int ver, int port, String proto)- Construct a generic RPC client object
|
ClientGeneric(String hostname, String proto, int port, int prog, int ver)- Construct a generic RPC client object
|
ClientGeneric(String host_or_url, int prog, int ver, String proto)- Construct a generic RPC client object
|
void | call(int proc, XDT inarg, XDT outarg)- Make an RPC call via the underlying RPC client handle.
|
void | call_proc0()- Ping the RPC by calling procedure 0
|
boolean | close()- Close the RPC connection
|
boolean | connect()- Connect to the RPC server
|
Auth | getAuth()
|
RPCClient | getClient()
|
void | setAuth(Auth a)- Set authentication
|
void | setClient(RPCClient c)- Set the underlying client handle to a bound RPCClient object
|
void | setServer(String host, int proto)- 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.
|
void | setTimeout(int timeout)- Set the timeout value (in milliseconds) for the RPC calls
|
ClientGeneric
public ClientGeneric()
Construct a ClientGeneric object
ClientGeneric
public ClientGeneric(InetAddress inetAddress,
int prog,
int ver,
int port,
String proto)
throws rpc_errConstruct a generic RPC client object
inetAddress - Address of the server machineprog - program number of the RPC servicever - version number of the RPC serviceport - port number of the RPC serviceproto - "tcp" or "udp" only (no http)
ClientGeneric
public ClientGeneric(String hostname,
String proto,
int port,
int prog,
int ver)
throws rpc_errConstruct a generic RPC client object
hostname - name of the server machineproto - "tcp" or "udp" only (no http)port - port number of the RPC serviceprog - program number of the RPC servicever - version number of the RPC service
ClientGeneric
public ClientGeneric(String host_or_url,
int prog,
int ver,
String proto)
throws rpc_errConstruct a generic RPC client object
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 servicever - version number of the RPC serviceproto - "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.
call
public void call(int proc,
XDT inarg,
XDT outarg)
throws rpc_errMake 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.
proc - Procecure number of the RPCinarg - Input argumentoutarg - Output which holds the results from the server
call_proc0
public void call_proc0()
throws rpc_errPing the RPC by calling procedure 0
close
public boolean close()
Close the RPC connection
connect
public boolean connect()
throws rpc_errConnect to the RPC server
getAuth
public Auth getAuth()
getClient
public RPCClient getClient()
- The underlying RPCClient object
setAuth
public void setAuth(Auth a)
Set authentication
setClient
public void setClient(RPCClient c)
Set the underlying client handle to a bound RPCClient object
setServer
public void setServer(String host,
int proto)
throws rpc_errWhen 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.
host - Remote server hostnameproto - Ask the proxy to use a particular protocol
setTimeout
public void setTimeout(int timeout)
Set the timeout value (in milliseconds) for the RPC calls