All Packages Class Hierarchy This Package Previous Next Index
Class distinct.rpc.ClientSecureRPC
java.lang.Object
|
+----distinct.rpc.ClientGeneric
|
+----distinct.rpc.ClientSecureRPC
- public final class ClientSecureRPC
- extends ClientGeneric
Java implementation of Secure RPC protocol with AuthDes.
- See Also:
- ClientGeneric, AuthDes
-
ClientSecureRPC(ClientGeneric, AuthDes)
- Creates a Secure RPC protocol client and
initializes it with a protocol client object.
-
ClientSecureRPC(InetAddress, int, int, boolean, AuthDes)
- Creates a Secure RPC protocol client.
-
Call(int, int, int, XDRType, XDRType)
- Calls the server.
-
close()
- Closes the connection and frees the socket resource.
-
getServerTime()
- Returns the current system time of the server.
-
setCredential(Auth)
- Sets a new authenticator and (if it is of type AuthDes)
updates also the corresponding verifier.
-
setTimeout(int)
- Changes the timeout value for waiting on server replies (default is 25s).
ClientSecureRPC
public ClientSecureRPC(InetAddress host,
int prog,
int vers,
boolean stream,
AuthDes auth) throws RPCError, IOException
- Creates a Secure RPC protocol client.
- Parameters:
- host - The host on which the 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.
- auth - The AUTH_DES credential.
- Throws: JRPC. 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.
ClientSecureRPC
public ClientSecureRPC(ClientGeneric protocolp,
AuthDes auth)
- Creates a Secure RPC protocol client and
initializes it with a protocol client object.
- Parameters:
- protocolp - The protocol object that implements the client connection (of class ClientTCP or ClientUDP).
- auth - The AUTH_DES credential.
Call
public synchronized 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: JRPC. RPCError
- When the calls fails for any other reason.
- Overrides:
- Call in class ClientGeneric
close
public void close()
- Closes the connection and frees the socket resource.
- Overrides:
- close in class ClientGeneric
setTimeout
public void setTimeout(int timeout)
- Changes the timeout value for waiting on server replies (default is 25s).
- Parameters:
- timeout - The new timeout value in ms (0 means no timeout at all, -1 means immediate return).
- Overrides:
- setTimeout in class ClientGeneric
setCredential
public void setCredential(Auth credp)
- Sets a new authenticator and (if it is of type AuthDes)
updates also the corresponding verifier.
- Parameters:
- credp - The new AUTH_DES authenticator.
- Overrides:
- setCredential in class ClientGeneric
getServerTime
public int getServerTime()
- Returns the current system time of the server. Helpful (but not mandatory) for
time synchronization between Secure RPC clients and servers.
getServerTime() only works if the server run at least a portmapper (rpcbind)
server version 3.
- Returns:
- the time, measured in seconds, since midnight,
January 1, 1970 UTC. O if an error occurs.
All Packages Class Hierarchy This Package Previous Next Index