All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distinct.rpc.ClientHTTP

java.lang.Object
   |
   +----distinct.rpc.ClientGeneric
           |
           +----distinct.rpc.ClientHTTP

public class ClientHTTP
extends ClientGeneric
Implementation of the RPC protocol via HTTP.

See Also:
ClientGeneric

Constructor Index

 o ClientHTTP(String, String, String, int, int, boolean)
Creates a new HTTP protocol object.

Method Index

 o Call(int, int, int, XDRType, XDRType)
Calls the server.
 o close()
Closes the connection and frees the socket resource.
 o setTimeout(int)
Changes the timeout value for waiting on server replies (default is 25s).

Constructors

 o ClientHTTP
 public ClientHTTP(String host,
                   String gateway,
                   String rpchost,
                   int prog,
                   int vers,
                   boolean stream) throws RPCError, IOException
Creates a new HTTP protocol object. Requires the "rpcgw" CGI-script on the server to perform the real call.

Parameters:
host - The hostname of the node on which the HTTP-server lives.
gateway - The filename of the "rpcgw" CGI-script that translates the HTTP request into an RPC call.
rpchost - The name of the host on which the real RPC server lives.
prog - The program ID of the server as defined in the .x IDL file.
vers - The program version of the server as defined in the .x IDL file.
stream - true for a TCP connection, false for UDP.
Throws: RPCError
When the port can not be found in the portmapper (perhaps there is even no portmapper running).
Throws: IOException
When the socket could not be opened.

Methods

 o Call
 public void Call(int prog,
                  int vers,
                  int proc,
                  XDRType in,
                  XDRType out) throws RPCError, IOException
Calls the server.

Parameters:
prog - The program ID of the server as defined in the .x IDL file.
vers - The program version of the server as defined in the .x IDL file.
proc - The ID of the request function as defined in the .x IDL file.
in - The input parameter (as it has to be marshalled it must be derived from XDRType).
out - The output parameter (as it has to be marshalled it must be derived from XDRType).
Throws: IOException
When the call fails because the socket connetion fails.
Throws: RPCError
When the calls fails for any other reason.
Overrides:
Call in class ClientGeneric
 o close
 public void close()
Closes the connection and frees the socket resource.

Overrides:
close in class ClientGeneric
 o setTimeout
 public void setTimeout(int timeout)
Changes the timeout value for waiting on server replies (default is 25s).

Parameters:
timeout - The new timeout value (0 means not timeout at all).
Overrides:
setTimeout in class ClientGeneric

All Packages  Class Hierarchy  This Package  Previous  Next  Index