Package org.apache.juneau.console.bus
Interface BusSession
public interface BusSession
One page's bridge session. Created by the session POST; reused across reconnects within the grace period.
The session's capability id is deliberately not on this interface: it never leaves the bus module except in the
session POST response, and toString() redacts it.
Example:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionA value captured byBusPolicy.Builder.sessionAttributes(java.util.function.Function)at session open.bridgeId()The bridge id from the page contract (C1 id pattern).The downstream topics and patterns this session was granted, in request order.booleanWhether a transport connection is currently attached.The name of the request principal recorded when the session was opened.The transport requested by the session POST.upstream()The upstream topics this session was granted (WebSocket sessions only), in request order.
-
Method Details
-
bridgeId
The bridge id from the page contract (C1 id pattern).- Returns:
- The bridge id. Never
null .
-
transport
The transport requested by the session POST.- Returns:
"sse"or"websocket".
-
principalName
The name of the request principal recorded when the session was opened.- Returns:
- The principal name, or
null when the request was anonymous.
-
attribute
A value captured byBusPolicy.Builder.sessionAttributes(java.util.function.Function)at session open.- Parameters:
name- The attribute name.- Returns:
- The value, or
null if absent.
-
downstream
Set<String> downstream()The downstream topics and patterns this session was granted, in request order.- Returns:
- An unmodifiable set.
-
upstream
The upstream topics this session was granted (WebSocket sessions only), in request order.- Returns:
- An unmodifiable set.
-
isConnected
boolean isConnected()Whether a transport connection is currently attached.- Returns:
true while a stream or socket is connected.
-