|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.acplt.oncrpc.server.OncRpcServerStub org.acplt.oncrpc.apps.jportmap.jportmap
public class jportmap
The class jportmap
implements a Java-based ONC/RPC port mapper,
speaking the widely deployed protocol version 2.
This class can be either used stand-alone (a static main
is
provided for this purpose) or as part of an application. In this case you
should check first for another portmap already running before starting your
own one.
Field Summary | |
---|---|
java.net.InetAddress[] |
locals
List of IP addresses assigned to this host. |
static int |
PMAP_PORT
Well-known port where the portmap process can be found on Internet hosts. |
static int |
PMAP_PROGRAM
Program number of the portmapper as defined in RFC 1832. |
static int |
PMAP_VERSION
Program version number of the portmapper as defined in RFC 1832. |
java.util.Vector |
servers
The list of registrated servers. |
Fields inherited from class org.acplt.oncrpc.server.OncRpcServerStub |
---|
info, shutdownSignal, transports |
Constructor Summary | |
---|---|
jportmap()
Create a new portmap instance, create the transport registration information and UDP and TCP-based transports, which will be bound later to port 111. |
Method Summary | |
---|---|
void |
dispatchOncRpcCall(OncRpcCallInformation call,
int program,
int version,
int procedure)
Dispatch incomming ONC/RPC calls to the individual handler functions. |
(package private) OncRpcGetPortResult |
getPort(OncRpcServerIdent params)
Lookup port for (program, version, protocol). |
(package private) boolean |
isLocalAddress(java.net.InetAddress addr)
Checks whether the address given belongs to one of the local addresses of this host. |
(package private) OncRpcDumpResult |
listServers()
Return list of registered ONC/RPC servers. |
static void |
main(java.lang.String[] args)
Create an instance of an ONC/RPC portmapper and run it. |
(package private) XdrBoolean |
setPort(OncRpcServerIdent params)
Register a port number for a particular (program, version, protocol). |
(package private) XdrBoolean |
unsetPort(OncRpcServerIdent params)
Deregister all port settings for a particular (program, version) for all transports (TCP, UDP, ...). |
Methods inherited from class org.acplt.oncrpc.server.OncRpcServerStub |
---|
close, getCharacterEncoding, register, run, run, setCharacterEncoding, stopRpcProcessing, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.net.InetAddress[] locals
public java.util.Vector servers
public static final int PMAP_PORT
public static final int PMAP_PROGRAM
public static final int PMAP_VERSION
Constructor Detail |
---|
public jportmap() throws OncRpcException, java.io.IOException
OncRpcException
java.io.IOException
Method Detail |
---|
OncRpcGetPortResult getPort(OncRpcServerIdent params)
params
- server identification (program, version, protocol) to
look up. The port field is not used.
0
, if no server is registered for (program, protocol).XdrBoolean setPort(OncRpcServerIdent params)
params
- (program, version, protocol, port) to register.
true
if registration succeeded.XdrBoolean unsetPort(OncRpcServerIdent params)
params
- (program, version) to deregister. The protocol and port
fields are not used.
true
if deregistration succeeded.OncRpcDumpResult listServers()
boolean isLocalAddress(java.net.InetAddress addr)
addr
- IP address to check.
true
if address specified belongs to one of the
local addresses of this host.public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure) throws OncRpcException, java.io.IOException
dispatchOncRpcCall
in interface OncRpcDispatchable
call
- The ONC/RPC call, with references to the transport and
XDR streams to use for retrieving parameters and sending replies.program
- the portmap's program number, 100000version
- the portmap's protocol version, 2procedure
- the procedure to call.
OncRpcException
- if an ONC/RPC error occurs.
java.io.IOException
- if an I/O error occurs.OncRpcCallInformation
public static void main(java.lang.String[] args)
run()
method without any parameters,
but instead supply it the transports to handle. Registration and
deregistration is not necessary and not possible.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |