Package org.acplt.oncrpc
Class OncRpcException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.acplt.oncrpc.OncRpcException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OncRpcAuthenticationException,OncRpcProgramNotRegisteredException,OncRpcTimeoutException
The class
OncRpcException indicates 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 OncRpcException also 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 to
OncRpcAcceptStatus and OncRpcRejectStatus.
- Version:
- $Revision: 1.3 $ $Date: 2008/01/02 15:13:35 $ $State: Exp $ $Locker: $
- Author:
- Harald Albrecht
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe ONC/RPC server did not accept the authentication sent by the client.static final intA buffer overflow occured with an encoding XDR stream.static final intA buffer underflow occured with an decoding XDR stream.static final intIndicates that a server could not register a transport with the ONC/RPC port mapper.static final intThe ONC/RPC server could not decode the arguments sent within the call message.static final intThe client can not decode the result from the remote procedure call.static final intThe client can not encode the argments to be sent for the remote procedure call.static final intInformation to be decoded can not be received.static final intEncoded information can not be sent.static final intA generic ONC/RPC exception occured.static final intThe portmapper could not be contacted at the given host.static final intThe given procedure is not available at the ONC/RPC server.static final intThe requested program is not registered with the given host.static final intThe ONC/RPC server does not support this particular program.static final intThe ONC/RPC server does not support this particular version of the program.static final intThe remote procedure call was carried out successfully.static final intThe ONC/RPC server encountered a system error and thus was not able to carry out the requested remote function call successfully.static final intThe remote procedure call timed out.static final intThe caller specified an unknown/unsupported IP protocol.static final intONC/RPC versions of server and client are not compatible.static final intEither a ONC/RPC server or client received the wrong type of ONC/RPC message when waiting for a request or reply. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs anOncRpcExceptionwith a reason ofRPC_FAILED.OncRpcException(int r) Constructs anOncRpcExceptionwith the specified detail reason.OncRpcException(int r, String s) Constructs anOncRpcExceptionwith the specified detail reason and message.Constructs anOncRpcExceptionwith the specified detail message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the error message string of this ONC/RPC object.intReturns the error reason of this ONC/RPC exception object.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
RPC_SUCCESS
public static final int RPC_SUCCESSThe remote procedure call was carried out successfully.- See Also:
-
RPC_CANTENCODEARGS
public static final int RPC_CANTENCODEARGSThe client can not encode the argments to be sent for the remote procedure call.- See Also:
-
RPC_CANTDECODERES
public static final int RPC_CANTDECODERESThe client can not decode the result from the remote procedure call.- See Also:
-
RPC_CANTSEND
public static final int RPC_CANTSENDEncoded information can not be sent.- See Also:
-
RPC_CANTRECV
public static final int RPC_CANTRECVInformation to be decoded can not be received.- See Also:
-
RPC_TIMEDOUT
public static final int RPC_TIMEDOUTThe remote procedure call timed out.- See Also:
-
RPC_VERSMISMATCH
public static final int RPC_VERSMISMATCHONC/RPC versions of server and client are not compatible.- See Also:
-
RPC_AUTHERROR
public static final int RPC_AUTHERRORThe ONC/RPC server did not accept the authentication sent by the client. Bad girl/guy!- See Also:
-
RPC_PROGUNAVAIL
public static final int RPC_PROGUNAVAILThe ONC/RPC server does not support this particular program.- See Also:
-
RPC_PROGVERSMISMATCH
public static final int RPC_PROGVERSMISMATCHThe ONC/RPC server does not support this particular version of the program.- See Also:
-
RPC_PROCUNAVAIL
public static final int RPC_PROCUNAVAILThe given procedure is not available at the ONC/RPC server.- See Also:
-
RPC_CANTDECODEARGS
public static final int RPC_CANTDECODEARGSThe ONC/RPC server could not decode the arguments sent within the call message.- See Also:
-
RPC_SYSTEMERROR
public static final int RPC_SYSTEMERRORThe ONC/RPC server encountered a system error and thus was not able to carry out the requested remote function call successfully.- See Also:
-
RPC_UNKNOWNPROTO
public static final int RPC_UNKNOWNPROTOThe caller specified an unknown/unsupported IP protocol. Currently, onlyOncRpcProtocols.ONCRPC_TCPandOncRpcProtocols.ONCRPC_UDPare supported.- See Also:
-
RPC_PMAPFAILURE
public static final int RPC_PMAPFAILUREThe portmapper could not be contacted at the given host.- See Also:
-
RPC_PROGNOTREGISTERED
public static final int RPC_PROGNOTREGISTEREDThe requested program is not registered with the given host.- See Also:
-
RPC_FAILED
public static final int RPC_FAILEDA generic ONC/RPC exception occured. Shit happens...- See Also:
-
RPC_BUFFEROVERFLOW
public static final int RPC_BUFFEROVERFLOWA 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:
-
RPC_BUFFERUNDERFLOW
public static final int RPC_BUFFERUNDERFLOWA 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:
-
RPC_WRONGMESSAGE
public static final int RPC_WRONGMESSAGEEither 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:
-
RPC_CANNOTREGISTER
public static final int RPC_CANNOTREGISTERIndicates that a server could not register a transport with the ONC/RPC port mapper.- See Also:
-
-
Constructor Details
-
OncRpcException
public OncRpcException()Constructs anOncRpcExceptionwith a reason ofRPC_FAILED. -
OncRpcException
Constructs anOncRpcExceptionwith the specified detail message.- Parameters:
s- The detail message.
-
OncRpcException
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 Details
-
getMessage
Returns the error message string of this ONC/RPC object.- Overrides:
getMessagein classThrowable- Returns:
- The error message string of this
OncRpcExceptionobject if it was created either with an error message string or an ONC/RPC error code.
-
getReason
public int getReason()Returns the error reason of this ONC/RPC exception object.
-