All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class distinct.rpc.Pmap

java.lang.Object
   |
   +----distinct.rpc.Pmap

public class Pmap
extends Object
implements XDRType
Interface to the portmapper.


Variable Index

 o PMAPPORT
 o PMAPPROC_CALLIT
 o PMAPPROC_DUMP
 o PMAPPROC_GETPORT
 o PMAPPROC_NULL
 o PMAPPROC_SET
 o PMAPPROC_UNSET
 o PMAPPROG
 o PMAPVERS
 o PMAPVERS_ORIG
 o PMAPVERS_PROTO

Constructor Index

 o Pmap()
 o Pmap(int, int, int, int)
Creates a portmapper entry.

Method Index

 o getPort(InetAddress)
Requests the portnumber of an entry in the portmapper of a given host and sets the portnumber of the server in the Pmap object.
 o indirectCall(InetAddress, int, XDRType, XDRType, int)
Calls a server via RPCBind's INDIRECT interface (and also sets the portnumber of the server in the Pmap object).
 o remoteCall(InetAddress, int, XDRType, XDRType, int)
Calls a server via the Portmapper's CALLIT interface (and also sets the portnumber of the server in the Pmap object).
 o set(InetAddress)
Registeres an entry in the portmapper of a given host.
This method creates a temporary UDP client for calling the portmapper.
 o unset(InetAddress)
Unregisteres an entry in the portmapper of a given host.
 o xdr_decode(XDRStream)
Decodes a portmapper entry in compliance to RFC 1832 (XDR).
 o xdr_encode(XDRStream)
Encodes a portmapper entry in compliance to RFC 1832 (XDR).

Variables

 o PMAPPORT
 public static final int PMAPPORT
 o PMAPPROG
 public static final int PMAPPROG
 o PMAPVERS
 public static final int PMAPVERS
 o PMAPVERS_PROTO
 public static final int PMAPVERS_PROTO
 o PMAPVERS_ORIG
 public static final int PMAPVERS_ORIG
 o PMAPPROC_NULL
 public static final int PMAPPROC_NULL
 o PMAPPROC_SET
 public static final int PMAPPROC_SET
 o PMAPPROC_UNSET
 public static final int PMAPPROC_UNSET
 o PMAPPROC_GETPORT
 public static final int PMAPPROC_GETPORT
 o PMAPPROC_DUMP
 public static final int PMAPPROC_DUMP
 o PMAPPROC_CALLIT
 public static final int PMAPPROC_CALLIT

Constructors

 o Pmap
 public Pmap()
 o Pmap
 public Pmap(int progp,
             int versp,
             int protp,
             int portp)
Creates a portmapper entry.

Parameters:
progp - The program ID.
versp - The version of the program.
protp - The protocol identifier (JRPC.kIPPROTO_TCP or JRPC.kIPPROTO_UDP).
portp - The port number.

Methods

 o xdr_encode
 public void xdr_encode(XDRStream xdrs)
Encodes a portmapper entry in compliance to RFC 1832 (XDR).

Parameters:
xdrs - The XDR output stream.
 o xdr_decode
 public void xdr_decode(XDRStream xdrs) throws RPCError
Decodes a portmapper entry in compliance to RFC 1832 (XDR).

Parameters:
xdrs - The XDR input stream.
 o set
 public boolean set(InetAddress host)
Registeres an entry in the portmapper of a given host.
This method creates a temporary UDP client for calling the portmapper.

Parameters:
host - The host where the portmapper lives.
Returns:
true on success
 o unset
 public boolean unset(InetAddress host)
Unregisteres an entry in the portmapper of a given host. This method creates a temporary UDP client for calling the portmapper.

Parameters:
host - The host where the portmapper lives.
Returns:
true on success
 o getPort
 public int getPort(InetAddress host)
Requests the portnumber of an entry in the portmapper of a given host and sets the portnumber of the server in the Pmap object. This method creates a temporary UDP client for calling the portmapper.

Parameters:
host - The host where the portmapper lives.
Returns:
The port number on success, 0 on error.
 o remoteCall
 public int remoteCall(InetAddress host,
                       int proc,
                       XDRType in,
                       XDRType out,
                       int timeout) throws RPCError, IOException
Calls a server via the Portmapper's CALLIT interface (and also sets the portnumber of the server in the Pmap object). This method creates a temporary UDP client for calling the portmapper. In case of any error at the remote site, the Portmapper sends no reply at all (only the timeout will terminate the call).

Parameters:
host - The host where the portmapper lives.
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).
timeout - The timeout value for this call in ms (0 means no timeout at all, -1 means immediate return).
Returns:
The port number on success, 0 on error.
Throws: IOException
When the call fails because the socket connetion fails.
Throws: RPCError
When the calls fails for any other reason.
 o indirectCall
 public int indirectCall(InetAddress host,
                         int proc,
                         XDRType in,
                         XDRType out,
                         int timeout) throws RPCError, IOException
Calls a server via RPCBind's INDIRECT interface (and also sets the portnumber of the server in the Pmap object). This method creates a temporary UDP client for calling RPCBind. In case of an error at the remote site, RPCBind reports back an error-code.

Parameters:
host - The host where the portmapper lives.
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).
timeout - The timeout value for this call in ms (0 means no timeout at all, -1 means immediate return).
Returns:
The port number on success, 0 on error.
Throws: IOException
When the call fails because the socket connetion fails.
Throws: RPCError
When the calls fails for any other reason.

All Packages  Class Hierarchy  This Package  Previous  Next  Index