Package org.acplt.oncrpc
Class OncRpcException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.acplt.oncrpc.OncRpcException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
OncRpcAuthenticationException,OncRpcProgramNotRegisteredException,OncRpcTimeoutException
public class OncRpcException extends java.lang.ExceptionThe classOncRpcExceptionindicates ONC/RPC conditions that a reasonable application might want to catch. We follow here the notation established by the Java environment that exceptions can be caught while errors usually can't. Because we don't want to throw our applications out of the virtual machine (should I mock here "out of the window"?), we only define exceptions.The class
OncRpcExceptionalso defines a set of ONC/RPC error codes as defined by RFC 1831. Note that all these error codes are solely used on the client-side or server-side, but never transmitted over the wire. For error codes transmitted over the network, refer toOncRpcAcceptStatusandOncRpcRejectStatus.- Version:
- $Revision: 1.3 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $
- Author:
- Harald Albrecht
- See Also:
Exception, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmessageSpecific detail about thisOncRpcException, like a detailed error message.private intreasonSpecific detail (reason) about thisOncRpcException, like the ONC/RPC error code, as defined by theRPC_xxxconstants of this interface.static intRPC_AUTHERRORThe ONC/RPC server did not accept the authentication sent by the client.static intRPC_BUFFEROVERFLOWA buffer overflow occured with an encoding XDR stream.static intRPC_BUFFERUNDERFLOWA buffer underflow occured with an decoding XDR stream.static intRPC_CANNOTREGISTERIndicates that a server could not register a transport with the ONC/RPC port mapper.static intRPC_CANTDECODEARGSThe ONC/RPC server could not decode the arguments sent within the call message.static intRPC_CANTDECODERESThe client can not decode the result from the remote procedure call.static intRPC_CANTENCODEARGSThe client can not encode the argments to be sent for the remote procedure call.static intRPC_CANTRECVInformation to be decoded can not be received.static intRPC_CANTSENDEncoded information can not be sent.static intRPC_FAILEDA generic ONC/RPC exception occured.static intRPC_PMAPFAILUREThe portmapper could not be contacted at the given host.static intRPC_PROCUNAVAILThe given procedure is not available at the ONC/RPC server.static intRPC_PROGNOTREGISTEREDThe requested program is not registered with the given host.static intRPC_PROGUNAVAILThe ONC/RPC server does not support this particular program.static intRPC_PROGVERSMISMATCHThe ONC/RPC server does not support this particular version of the program.static intRPC_SUCCESSThe remote procedure call was carried out successfully.static intRPC_SYSTEMERRORThe ONC/RPC server encountered a system error and thus was not able to carry out the requested remote function call successfully.static intRPC_TIMEDOUTThe remote procedure call timed out.static intRPC_UNKNOWNPROTOThe caller specified an unknown/unsupported IP protocol.static intRPC_VERSMISMATCHONC/RPC versions of server and client are not compatible.static intRPC_WRONGMESSAGEEither a ONC/RPC server or client received the wrong type of ONC/RPC message when waiting for a request or reply.private static longserialVersionUIDDefines the serial version UID forOncRpcException.
-
Constructor Summary
Constructors Constructor Description OncRpcException()Constructs anOncRpcExceptionwith a reason ofRPC_FAILED.OncRpcException(int r)Constructs anOncRpcExceptionwith the specified detail reason.OncRpcException(int r, java.lang.String s)Constructs anOncRpcExceptionwith the specified detail reason and message.OncRpcException(java.lang.String s)Constructs anOncRpcExceptionwith the specified detail message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetMessage()Returns the error message string of this ONC/RPC object.intgetReason()Returns the error reason of this ONC/RPC exception object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Defines the serial version UID forOncRpcException.- See Also:
- Constant Field Values
-
RPC_SUCCESS
public static final int RPC_SUCCESS
The remote procedure call was carried out successfully.- See Also:
- Constant Field Values
-
RPC_CANTENCODEARGS
public static final int RPC_CANTENCODEARGS
The client can not encode the argments to be sent for the remote procedure call.- See Also:
- Constant Field Values
-
RPC_CANTDECODERES
public static final int RPC_CANTDECODERES
The client can not decode the result from the remote procedure call.- See Also:
- Constant Field Values
-
RPC_CANTSEND
public static final int RPC_CANTSEND
Encoded information can not be sent.- See Also:
- Constant Field Values
-
RPC_CANTRECV
public static final int RPC_CANTRECV
Information to be decoded can not be received.- See Also:
- Constant Field Values
-
RPC_TIMEDOUT
public static final int RPC_TIMEDOUT
The remote procedure call timed out.- See Also:
- Constant Field Values
-
RPC_VERSMISMATCH
public static final int RPC_VERSMISMATCH
ONC/RPC versions of server and client are not compatible.- See Also:
- Constant Field Values
-
RPC_AUTHERROR
public static final int RPC_AUTHERROR
The ONC/RPC server did not accept the authentication sent by the client. Bad girl/guy!- See Also:
- Constant Field Values
-
RPC_PROGUNAVAIL
public static final int RPC_PROGUNAVAIL
The ONC/RPC server does not support this particular program.- See Also:
- Constant Field Values
-
RPC_PROGVERSMISMATCH
public static final int RPC_PROGVERSMISMATCH
The ONC/RPC server does not support this particular version of the program.- See Also:
- Constant Field Values
-
RPC_PROCUNAVAIL
public static final int RPC_PROCUNAVAIL
The given procedure is not available at the ONC/RPC server.- See Also:
- Constant Field Values
-
RPC_CANTDECODEARGS
public static final int RPC_CANTDECODEARGS
The ONC/RPC server could not decode the arguments sent within the call message.- See Also:
- Constant Field Values
-
RPC_SYSTEMERROR
public static final int RPC_SYSTEMERROR
The ONC/RPC server encountered a system error and thus was not able to carry out the requested remote function call successfully.- See Also:
- Constant Field Values
-
RPC_UNKNOWNPROTO
public static final int RPC_UNKNOWNPROTO
The caller specified an unknown/unsupported IP protocol. Currently, onlyOncRpcProtocols.ONCRPC_TCPandOncRpcProtocols.ONCRPC_UDPare supported.- See Also:
- Constant Field Values
-
RPC_PMAPFAILURE
public static final int RPC_PMAPFAILURE
The portmapper could not be contacted at the given host.- See Also:
- Constant Field Values
-
RPC_PROGNOTREGISTERED
public static final int RPC_PROGNOTREGISTERED
The requested program is not registered with the given host.- See Also:
- Constant Field Values
-
RPC_FAILED
public static final int RPC_FAILED
A generic ONC/RPC exception occured. Shit happens...- See Also:
- Constant Field Values
-
RPC_BUFFEROVERFLOW
public static final int RPC_BUFFEROVERFLOW
A buffer overflow occured with an encoding XDR stream. This happens if you use UDP-based (datagram-based) XDR streams and you try to encode more data than can fit into the sending buffers.- See Also:
- Constant Field Values
-
RPC_BUFFERUNDERFLOW
public static final int RPC_BUFFERUNDERFLOW
A buffer underflow occured with an decoding XDR stream. This happens if you try to decode more data than was sent by the other communication partner.- See Also:
- Constant Field Values
-
RPC_WRONGMESSAGE
public static final int RPC_WRONGMESSAGE
Either a ONC/RPC server or client received the wrong type of ONC/RPC message when waiting for a request or reply. Currently, only the decoding methods of the classesOncRpcCallMessageandOncRpcReplyMessagethrow exceptions with this reason.- See Also:
- Constant Field Values
-
RPC_CANNOTREGISTER
public static final int RPC_CANNOTREGISTER
Indicates that a server could not register a transport with the ONC/RPC port mapper.- See Also:
- Constant Field Values
-
reason
private int reason
Specific detail (reason) about thisOncRpcException, like the ONC/RPC error code, as defined by theRPC_xxxconstants of this interface.
-
message
private java.lang.String message
Specific detail about thisOncRpcException, like a detailed error message.
-
-
Constructor Detail
-
OncRpcException
public OncRpcException()
Constructs anOncRpcExceptionwith a reason ofRPC_FAILED.
-
OncRpcException
public OncRpcException(java.lang.String s)
Constructs anOncRpcExceptionwith the specified detail message.- Parameters:
s- The detail message.
-
OncRpcException
public OncRpcException(int r, java.lang.String s)Constructs anOncRpcExceptionwith the specified detail reason and message. For possible reasons, see below.- Parameters:
r- The detail reason.s- The detail message.
-
OncRpcException
public OncRpcException(int r)
Constructs anOncRpcExceptionwith the specified detail reason. The detail message is derived automatically from the reason.- Parameters:
r- The reason. This can be one of the constants -- oops, that should be "public final static integers" -- defined in this interface.
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
Returns the error message string of this ONC/RPC object.- Overrides:
getMessagein classjava.lang.Throwable- Returns:
- The error message string of this
OncRpcExceptionobject if it was created either with an error message string or an ONC/RPC error code.
-
-