Class OncRpcClientAuth

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

public abstract class OncRpcClientAuth extends 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.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:40 $ $State: Exp $ $Locker: $
Author:
Harald Albrecht
  • Constructor Details

    • OncRpcClientAuth

      public OncRpcClientAuth()
  • Method Details

    • xdrEncodeCredVerf

      protected abstract void xdrEncodeCredVerf(XdrEncodingStream xdr) throws OncRpcException, 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.
      IOException - if an I/O error occurs.
    • xdrDecodeVerf

      protected abstract void xdrDecodeVerf(XdrDecodingStream xdr) throws OncRpcException, 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.
      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