Package org.acplt.oncrpc

# Class OncRpcServerIdent

java.lang.Object
org.acplt.oncrpc.OncRpcServerIdent

All Implemented Interfaces:
  `XdrAble`

public class OncRpcServerIdent extends Object implements XdrAble
The class `OncRpcServerIdent` represents an tuple { program, version, protocol, port} uniquely identifying a particular ONC/RPC server on a given host. This information is used, for instance, as the ONC/RPC portmap PMAP_GETPORT call parameters.

An `OncRpcServerIdent` can be directly serialized into an encoding XDR stream (that is more political correct than "flushed down the toilet").

Version:
  $Revision: 1.1 $ $Date: 2003/08/13 12:03:41 $ $State: Exp $ $Locker: $
Author:
  Harald Albrecht

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`port`
The port number of the ONC/RPC server in question.
`int`
`program`
The program number of the ONC/RPC server in question.
`int`
`protocol`
The protocol used for communicating with the ONC/RPC server in question.
`int`
`version`
The program version number of the ONC/RPC server in question.

## Constructor Summary

Constructors
Constructor
Description
`OncRpcServerIdent()`
Constuct an `OncRpcServerIdent` object with senseless default values for the requested program number, version number, protocol type and port number.
`OncRpcServerIdent(int program, int version, int protocol, int port)`
Constructs an `OncRpcServerIdent` object with the requested program number, version number, protocol type and port number.
`OncRpcServerIdent(XdrDecodingStream xdr)`
Constructs an `OncRpcServerIdent` object and restores its state from the given XDR stream.

## Method Summary

Modifier and Type
Method
Description
`void`
`xdrDecode(XdrDecodingStream xdr)`
Decodes -- that is: deserializes -- an OncRpcServerIdent object from a XDR stream.
`void`
`xdrEncode(XdrEncodingStream xdr)`
Encodes -- that is: serializes -- an OncRpcServerIdent object into a XDR stream.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### program

public int program
The program number of the ONC/RPC server in question.

### version

public int version
The program version number of the ONC/RPC server in question.

### protocol

public int protocol
The protocol used for communicating with the ONC/RPC server in question. This can be one of the constants ("public final static int") defined in the `OncRpcProtocols` interface.

### port

public int port
The port number of the ONC/RPC server in question.

## Constructor Details

### OncRpcServerIdent

public OncRpcServerIdent()
Constuct an `OncRpcServerIdent` object with senseless default values for the requested program number, version number, protocol type and port number.

### OncRpcServerIdent

public OncRpcServerIdent(int program, int version, int protocol, int port)
Constructs an `OncRpcServerIdent` object with the requested program number, version number, protocol type and port number.

Parameters:
  `program` - Program number of the RPC program
  `version` - Version number of the RPC program
  `protocol` - Protocol type (transport mapping) used for the RPC communication
  `port` - Port number the RPC server is listening for clients

### OncRpcServerIdent

public OncRpcServerIdent(XdrDecodingStream xdr) throws OncRpcException, IOException
Constructs an `OncRpcServerIdent` object and restores its state from the given XDR stream.

Parameters:
  `xdr` - An XDR decoding stream
Throws:
  `OncRpcException` - Decoding the identifiers of the RPC server failed.
  `IOException` - IO error reading bytes from the XDR stream.

## Method Details

### xdrEncode

public void xdrEncode(XdrEncodingStream xdr) throws OncRpcException, IOException
Encodes -- that is: serializes -- an OncRpcServerIdent object into a XDR stream.

Specified by:
  `xdrEncode` in interface `XdrAble`
Parameters:
  `xdr` - An XDR encoding stream
Throws:
  `OncRpcException` - if an ONC/RPC error occurs.
  `IOException` - if an I/O error occurs.

### xdrDecode

public void xdrDecode(XdrDecodingStream xdr) throws OncRpcException, IOException
Decodes -- that is: deserializes -- an OncRpcServerIdent object from a XDR stream.

Specified by:
  `xdrDecode` in interface `XdrAble`
Parameters:
  `xdr` - An XDR decoding stream
Throws:
  `OncRpcException` - if an ONC/RPC error occurs.
  `IOException` - if an I/O error occurs.