Package org.apache.juneau.console.bus
Class BusRefusal
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.juneau.console.bus.BusRefusal
- All Implemented Interfaces:
Serializable
A named refusal from the bus: the session POST's
400/403/429/501 answers and the codec's
bus:bad-frame. The message is fixed server text; denied() lists the topic names the caller requested, which is the only caller input in a refusal.
Example:
- Since:
- 10.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intRetry-Afterseconds sent withbus:too-many-sessions. -
Constructor Summary
ConstructorsConstructorDescriptionBusRefusal(int status, String code, String message, List<String> denied, int retryAfterSeconds) Constructor. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
TOO_MANY_SESSIONS_RETRY_AFTER_SECONDS
Retry-Afterseconds sent withbus:too-many-sessions.- See Also:
-
-
Constructor Details
-
BusRefusal
public BusRefusal(int status, String code, String message, List<String> denied, int retryAfterSeconds) Constructor.- Parameters:
status- The HTTP status.code- Thebus:*code.message- Fixed server text.denied- The denied topics, forbus:topic-denied. Can benull .retryAfterSeconds-Retry-Afterseconds, or0for none.
-
-
Method Details
-
status
- Returns:
- The HTTP status.
-
code
- Returns:
- The
bus:*code.
-
denied
- Returns:
- The denied topics (empty unless
bus:topic-denied).
-
retryAfterSeconds
- Returns:
- The
Retry-Afterseconds, if any.
-
toJson
The refusal body:{code, message, denied?}.- Returns:
- A new map.
-