Class CreditsException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.lightstreamer.interfaces.metadata.CreditsException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ConflictingSessionException
public class CreditsException extends java.lang.Exception
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CreditsException(int clientErrorCode, java.lang.String msg)
Constructs a CreditsException with supplied error code and message text.CreditsException(int clientErrorCode, java.lang.String msg, java.lang.String userMsg)
Constructs a CreditsException with supplied error code and message text to be forwarded to the Client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getClientErrorCode()
Returns the error code to be forwarded to the client.java.lang.String
getClientErrorMsg()
Returns the error detail message to be forwarded to the client.
-
-
-
Constructor Detail
-
CreditsException
public CreditsException(int clientErrorCode, @Nullable java.lang.String msg, @Nullable java.lang.String userMsg)
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.
-
CreditsException
public CreditsException(int clientErrorCode, @Nullable java.lang.String msg)
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.
-
-
Method Detail
-
getClientErrorCode
public int getClientErrorCode()
Returns the error code to be forwarded to the client.- Returns:
- error code or zero to mean an unspecified error.
-
getClientErrorMsg
@Nullable public java.lang.String getClientErrorMsg()
Returns the error detail message to be forwarded to the client. If the message is not in simple ASCII or is in multiline format, the real text sent to the client might be altered.- Returns:
- error detail message. It can be null.
-
-