com.distinct.rpc
Class Portmapper

java.lang.Object
  |
  +--com.distinct.rpc.JRPCServer
        |
        +--com.distinct.rpc.Portmapper
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class Portmapper
extends JRPCServer

The RPC Portmapper

See Also:
Serialized Form

Constructor Summary
Portmapper()
          Constructor that creates and starts the portmapper service.
 
Method Summary
 Auth DoAuth(int proc, Auth cred, Auth verf)
          Overwrite this method only if you want your server to check authentication (Default are no checks).
 boolean DoCall(int proc, XDRStream in, XDRStream out)
          Dispatcher Routine that handles the call requests.
 boolean IsBatched(int proc)
          Overwrite this method only if you want to implement batched RPCs.
static void main(java.lang.String[] args)
          Starts a stand-alone portmapper service (no parameters).
 
Methods inherited from class com.distinct.rpc.JRPCServer
DoVersionCheck, EnumerateConnections, getAddress, getCallVersion, getClientData, GetConnectionState, getPort, getVersion, isMultithreaded, isTCPServer, RegisterServer, RegisterServer, run, setClientData, setMultithreaded, setStreamed, StartTCP, StartTCP, StartUDP, StartUDP, Stop, UnregisterServer, UnregisterServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Portmapper

public Portmapper()
           throws RPCError
Constructor that creates and starts the portmapper service. If another already running portmapper is detected on the local host, then creation is aborted.

Throws:
RPCError - If the portmapper could not be started.
Method Detail

main

public static void main(java.lang.String[] args)
Starts a stand-alone portmapper service (no parameters).


DoCall

public boolean DoCall(int proc,
                      XDRStream in,
                      XDRStream out)
Dispatcher Routine that handles the call requests.

Overrides:
DoCall in class JRPCServer
Parameters:
proc - The index of the requested function.
in - read the input-parameter from this XDR stream.
out - write the return-parameter to this XDR stream.
Returns:
true, if the function with the index proc can be served, false otherwise.

DoAuth

public Auth DoAuth(int proc,
                   Auth cred,
                   Auth verf)
            throws RPCError
Overwrite this method only if you want your server to check authentication (Default are no checks). Throw an RPCAuthError exception to indicate an authentication failure.

Overrides:
DoAuth in class JRPCServer
Parameters:
proc - The ID of the requested function.
cred - Authentication parameter provided by the client.
verf - Verifier parameter provided by the client.
Returns:
Verifier to send back to the client with the response ("null" means AuthNull).
Throws:
RPCError - If the authentication fails.

IsBatched

public boolean IsBatched(int proc)
Overwrite this method only if you want to implement batched RPCs. Return true for all procedures that are called in batched mode (i.e. no reply message).

Overrides:
IsBatched in class JRPCServer
Parameters:
proc - The ID of the executed function.
Returns:
true if the procedure is called in batched mode.