org.acplt.oncrpc
Class OncRpcClientAuth

java.lang.Object
  extended by org.acplt.oncrpc.OncRpcClientAuth
Direct Known Subclasses:
OncRpcClientAuthNone, OncRpcClientAuthUnix

public abstract class OncRpcClientAuth
extends java.lang.Object

The OncRpcClientAuth class is the base class for handling all protocol issues of ONC/RPC authentication on the client side. As it stands, it does not do very much with the exception of defining the contract for the behaviour of derived classes with respect to protocol handling issues.

Authentication on the client side can be done as follows: just create an authentication object and hand it over to the ONC/RPC client object.

 OncRpcClientAuth auth = new OncRpcClientAuthUnix(
                                 "marvin@ford.prefect",
                                 42, 1001, new int[0]);
 client.setAuth(auth);
 
The authentication AUTH_UNIX will handle shorthand credentials (of type AUTH_SHORT transparently). If you do not set any authentication object after creating an ONC/RPC client object, AUTH_NONE is used automatically.


Constructor Summary
OncRpcClientAuth()
           
 
Method Summary
protected abstract  boolean canRefreshCred()
          Indicates whether the ONC/RPC authentication credential can be refreshed.
protected abstract  void xdrDecodeVerf(XdrDecodingStream xdr)
          Decodes ONC/RPC authentication information in form of a verifier when receiving an ONC/RPC reply message.
protected abstract  void xdrEncodeCredVerf(XdrEncodingStream xdr)
          Encodes ONC/RPC authentication information in form of a credential and a verifier when sending an ONC/RPC call message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OncRpcClientAuth

public OncRpcClientAuth()
Method Detail

xdrEncodeCredVerf

protected abstract void xdrEncodeCredVerf(XdrEncodingStream xdr)
                                   throws OncRpcException,
                                          java.io.IOException
Encodes ONC/RPC authentication information in form of a credential and a verifier when sending an ONC/RPC call message.

Parameters:
xdr - XDR stream where to encode the credential and the verifier to.
Throws:
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

xdrDecodeVerf

protected abstract void xdrDecodeVerf(XdrDecodingStream xdr)
                               throws OncRpcException,
                                      java.io.IOException
Decodes ONC/RPC authentication information in form of a verifier when receiving an ONC/RPC reply message.

Parameters:
xdr - XDR stream from which to receive the verifier sent together with an ONC/RPC reply message.
Throws:
OncRpcAuthenticationException - if the received verifier is not kosher.
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

canRefreshCred

protected abstract boolean canRefreshCred()
Indicates whether the ONC/RPC authentication credential can be refreshed.

Returns:
true, if the credential can be refreshed