org.apache.hadoop.portmap
Class RpcProgramPortmap

java.lang.Object
  extended by org.apache.hadoop.oncrpc.RpcProgram
      extended by org.apache.hadoop.portmap.RpcProgramPortmap
All Implemented Interfaces:
PortmapInterface

public class RpcProgramPortmap
extends RpcProgram
implements PortmapInterface

An rpcbind request handler.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.portmap.PortmapInterface
PortmapInterface.Procedure
 
Field Summary
static int PROGRAM
           
static int VERSION
           
 
Fields inherited from class org.apache.hadoop.oncrpc.RpcProgram
RPCB_PORT
 
Constructor Summary
RpcProgramPortmap()
           
 
Method Summary
 XDR dump(int xid, XDR in, XDR out)
          This procedure enumerates all entries in the port mapper's database.
 XDR getport(int xid, XDR in, XDR out)
          Given a program number "prog", version number "vers", and transport protocol number "prot", this procedure returns the port number on which the program is awaiting call requests.
 XDR handleInternal(RpcCall rpcCall, XDR in, XDR out, InetAddress client, org.jboss.netty.channel.Channel channel)
          Handle an RPC request.
protected  boolean isIdempotent(RpcCall call)
           
 XDR nullOp(int xid, XDR in, XDR out)
          This procedure does no work.
 void register(PortmapMapping mapping)
          Register the program with Portmap or Rpcbind
 XDR set(int xid, XDR in, XDR out)
          When a program first becomes available on a machine, it registers itself with the port mapper program on the same machine.
 XDR unset(int xid, XDR in, XDR out)
          When a program becomes unavailable, it should unregister itself with the port mapper program on the same machine.
 
Methods inherited from class org.apache.hadoop.oncrpc.RpcProgram
getPort, handle, register, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROGRAM

public static final int PROGRAM
See Also:
Constant Field Values

VERSION

public static final int VERSION
See Also:
Constant Field Values
Constructor Detail

RpcProgramPortmap

public RpcProgramPortmap()
Method Detail

nullOp

public XDR nullOp(int xid,
                  XDR in,
                  XDR out)
Description copied from interface: PortmapInterface
This procedure does no work. By convention, procedure zero of any protocol takes no parameters and returns no results.

Specified by:
nullOp in interface PortmapInterface

set

public XDR set(int xid,
               XDR in,
               XDR out)
Description copied from interface: PortmapInterface
When a program first becomes available on a machine, it registers itself with the port mapper program on the same machine. The program passes its program number "prog", version number "vers", transport protocol number "prot", and the port "port" on which it awaits service request. The procedure returns a boolean reply whose value is "TRUE" if the procedure successfully established the mapping and "FALSE" otherwise. The procedure refuses to establish a mapping if one already exists for the tuple "(prog, vers, prot)".

Specified by:
set in interface PortmapInterface

unset

public XDR unset(int xid,
                 XDR in,
                 XDR out)
Description copied from interface: PortmapInterface
When a program becomes unavailable, it should unregister itself with the port mapper program on the same machine. The parameters and results have meanings identical to those of "PMAPPROC_SET". The protocol and port number fields of the argument are ignored.

Specified by:
unset in interface PortmapInterface

getport

public XDR getport(int xid,
                   XDR in,
                   XDR out)
Description copied from interface: PortmapInterface
Given a program number "prog", version number "vers", and transport protocol number "prot", this procedure returns the port number on which the program is awaiting call requests. A port value of zeros means the program has not been registered. The "port" field of the argument is ignored.

Specified by:
getport in interface PortmapInterface

dump

public XDR dump(int xid,
                XDR in,
                XDR out)
Description copied from interface: PortmapInterface
This procedure enumerates all entries in the port mapper's database. The procedure takes no parameters and returns a list of program, version, protocol, and port values.

Specified by:
dump in interface PortmapInterface

register

public void register(PortmapMapping mapping)
Description copied from class: RpcProgram
Register the program with Portmap or Rpcbind

Overrides:
register in class RpcProgram

handleInternal

public XDR handleInternal(RpcCall rpcCall,
                          XDR in,
                          XDR out,
                          InetAddress client,
                          org.jboss.netty.channel.Channel channel)
Description copied from class: RpcProgram
Handle an RPC request.

Specified by:
handleInternal in class RpcProgram
Parameters:
rpcCall - RPC call that is received
in - xdr with cursor at reading the remaining bytes of a method call
out - xdr output corresponding to Rpc reply
client - making the Rpc request
channel - connection over which Rpc request is received
Returns:
response xdr response

isIdempotent

protected boolean isIdempotent(RpcCall call)
Specified by:
isIdempotent in class RpcProgram


Copyright © 2009 The Apache Software Foundation