Class CreditsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.lightstreamer.adapters.remote.MetadataException
com.lightstreamer.adapters.remote.CreditsException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConflictingSessionException
Thrown by the notify* methods in MetadataProvider if some functionality cannot be allowed
to the supplied User. This may occur if the user is not granted some resource or if the user
would exceed the granted amount. Different kinds of problems can be distinguished by an error code.
Both the error message detail and the error code will be forwarded by Lightstreamer Kernel to the Client.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreditsException
(int clientErrorCode, String msg) Constructs a CreditsException with supplied error code and message text.CreditsException
(int clientErrorCode, String msg, String userMsg) Constructs a CreditsException with supplied error code and message text to be forwarded to the Client. -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Gets the error code to be forwarded to the client.final String
Gets the error detail message to be forwarded to the client.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CreditsException
Constructs a CreditsException with supplied error code and message text.- Parameters:
clientErrorCode
- Error code that can be used to distinguish the kind of problem. It must be a negative integer, or zero to mean an unspecified problem.msg
- The detail message.
-
CreditsException
Constructs a CreditsException with supplied error code and message text to be forwarded to the Client. An internal error message text can also be specified.- Parameters:
clientErrorCode
- Error code that can be used to distinguish the kind of problem. It must be a negative integer, or zero to mean an unspecified problem.msg
- The detail message.userMsg
- A detail message to be forwarded to the Client. It can be null. The message should be in simple ASCII, otherwise it might be altered in order to be sent to the client; multiline text is also not allowed.
-
-
Method Details
-
getClientErrorCode
public final int getClientErrorCode()Gets the error code to be forwarded to the client.- Returns:
- the error code to be forwarded to the client.
-
getClientErrorMsg
Gets the error detail message to be forwarded to the client.- Returns:
- error detail message to be forwarded to the client.
-