Package tv.phantombot.panel
Class WsPanelHandler
java.lang.Object
tv.phantombot.panel.WsPanelHandler
- All Implemented Interfaces:
WsFrameHandler
- Author:
- gmt2001
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
Gets theWsAuthenticationHandler
assigned to this endpointvoid
handleDBKeysByOrderQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleDBKeysListQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleDBKeysQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleDBKeysSearchQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleDBQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleDBValuesByOrderQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) void
handleFrame
(ChannelHandlerContext ctx, WebSocketFrame frame) Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandler
returnedtrue
int
hashCode()
void
panelNotification
(ChannelHandlerContext ctx, String type, String message, String title, Integer timeout, Integer extendedTimeout, Boolean progressBar) Sends a toastr notification to the panel The notification is sent to all currently authenticated users on the panel if the parameter ctx isnull
void
panelNotification
(String type, String message) void
panelNotification
(String type, String message, String title) void
panelNotification
(String type, String message, String title, Integer timeout) void
panelNotification
(String type, String message, String title, Integer timeout, Integer extendedTimeout) void
panelNotification
(String type, String message, String title, Integer timeout, Integer extendedTimeout, Boolean progressBar) register()
Registers thisWsFrameHandler
with theWebSocketFrameHandler
void
Sends an ack response to a WS queryvoid
Sends an array response to a WS queryvoid
sendJSONToAll
(String jsonString) void
sendObject
(String uniqueID, Map<String, Object> obj) Sends an object response to a WS query
-
Constructor Details
-
WsPanelHandler
-
-
Method Details
-
register
Description copied from interface:WsFrameHandler
Registers thisWsFrameHandler
with theWebSocketFrameHandler
- Specified by:
register
in interfaceWsFrameHandler
- Returns:
-
getAuthHandler
Description copied from interface:WsFrameHandler
Gets theWsAuthenticationHandler
assigned to this endpoint- Specified by:
getAuthHandler
in interfaceWsFrameHandler
- Returns:
- An
WsAuthenticationHandler
-
handleFrame
Description copied from interface:WsFrameHandler
Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandler
returnedtrue
- Specified by:
handleFrame
in interfaceWsFrameHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionframe
- TheWebSocketFrame
to process
-
handleDBQuery
-
handleDBKeysQuery
-
handleDBKeysListQuery
-
handleDBKeysByOrderQuery
public void handleDBKeysByOrderQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) -
handleDBValuesByOrderQuery
public void handleDBValuesByOrderQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) -
handleDBKeysSearchQuery
public void handleDBKeysSearchQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) -
sendJSONToAll
-
doAudioHooksUpdate
public void doAudioHooksUpdate() -
panelNotification
-
panelNotification
-
panelNotification
-
panelNotification
-
panelNotification
-
panelNotification
public void panelNotification(ChannelHandlerContext ctx, String type, String message, String title, Integer timeout, Integer extendedTimeout, Boolean progressBar) Sends a toastr notification to the panel The notification is sent to all currently authenticated users on the panel if the parameter ctx isnull
- Parameters:
ctx
- TheChannelHandlerContext
type
- The type of notification to show. Valid values:success
,error
,warning
,info
. Invalid values are treated asinfo
message
- The message content of the notificationtitle
- The title of the notification.null
or empty string for no titletimeout
- The timeout before the notification automatically closes.null
for default;0
to not close until theX
is clickedextendedTimeout
- The timeout before the notification automatically closes, if the user hover over it with their mouse. This should be longer thantimeout
because the timer is shared.null
for default;0
to not close until theX
is clickedprogressBar
-true
to show a progress bar indicating the time remaining intimeout
until the notification closes automatically;false
to explicitly disable the progress bar on this notification;null
for default
-
sendAck
Sends an ack response to a WS query- Parameters:
uniqueID
- The ID the callback is registered under, sent by the requester
-
sendObject
Sends an object response to a WS query- Parameters:
uniqueID
- The ID the callback is registered under, sent by the requesterobj
- A map of key/value pairs to send
-
sendArray
Sends an array response to a WS query- Parameters:
uniqueID
- The ID the callback is registered under, sent by the requesterobj
- A list of values to send
-
hashCode
public int hashCode() -
equals
-