netbula.ORPC

Class RPCClient

Known Direct Subclasses:
ClientHTTP, InetRPCClient

public abstract class RPCClient
extends java.lang.Object

Abstract base class of all RPC client classes.

Field Summary

static int
IPPROTO_TCP
static int
IPPROTO_UDP

Constructor Summary

RPCClient()

Method Summary

abstract void
call(int proc, XDT inarg, XDT outarg)
Call an RPC procedure.
void
call_proc0()
Ping the server by calling procedure 0
abstract boolean
close()
Close the connection to the RPC server.
abstract boolean
connect()
Connect to the RPC server.
protected void
finalize()
Auth
getAuth()
Get the authenticator for this RPC connection
int
getRpcProgramNumber()
int
getRpcProtocol()
int
getRpcVersionNumber()
void
setAuth(Auth au)
Set the authenticator for this RPC connection
static int
setConnectionTimeout(int timeout)
Set the timeout value in milliseconds for connecting to the RPC server.
void
setRpcProgramNumber(int prog_no)
void
setRpcProtocol(int proto)
void
setRpcVersionNumber(int vno)
void
setServer(String host, int proto)
Closes existing connection and connect to another server.
int
setTimeout(int timeout)
Set the timeout value for the RPC calls

Field Details

IPPROTO_TCP

public static final int IPPROTO_TCP
Field Value:
6

IPPROTO_UDP

public static final int IPPROTO_UDP
Field Value:
17

Constructor Details

RPCClient

public RPCClient()

Method Details

call

public abstract void call(int proc,
                          XDT inarg,
                          XDT outarg)
            throws rpc_err
Call an RPC procedure. This is an abstract method to be implemented for different RPC transports.
Parameters:
proc - Procedure number
inarg - Input argument to be sent over
outarg - Output argument to hold results from server

call_proc0

public void call_proc0()
            throws rpc_err
Ping the server by calling procedure 0

close

public abstract boolean close()
Close the connection to the RPC server.

connect

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

finalize

protected void finalize()

getAuth

public Auth getAuth()
Get the authenticator for this RPC connection
See Also:
Auth

getRpcProgramNumber

public int getRpcProgramNumber()

getRpcProtocol

public int getRpcProtocol()

getRpcVersionNumber

public int getRpcVersionNumber()

setAuth

public void setAuth(Auth au)
Set the authenticator for this RPC connection
See Also:
Auth

setConnectionTimeout

public static int setConnectionTimeout(int timeout)
Set the timeout value in milliseconds for connecting to the RPC server. The connection timeout value is shared by all client objects.
Parameters:
timeout - Timeout value in milliseconds.

setRpcProgramNumber

public void setRpcProgramNumber(int prog_no)

setRpcProtocol

public void setRpcProtocol(int proto)

setRpcVersionNumber

public void setRpcVersionNumber(int vno)

setServer

public void setServer(String host,
                      int proto)
            throws rpc_err
Closes existing connection and connect to another server.
Parameters:
host - Server hostname
proto - Protocol

setTimeout

public int setTimeout(int timeout)
Set the timeout value for the RPC calls
Parameters:
timeout - Timeout value in milliseconds.