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 TypeMethodDescriptionvoidbooleanGets theWsAuthenticationHandlerassigned to this endpointvoidhandleDBKeysByOrderQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleDBKeysListQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleDBKeysQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleDBKeysSearchQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleDBQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleDBValuesByOrderQuery(ChannelHandlerContext ctx, WebSocketFrame frame, JSONObject jso) voidhandleFrame(ChannelHandlerContext ctx, WebSocketFrame frame) Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandlerreturnedtrueinthashCode()voidpanelNotification(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 isnullvoidpanelNotification(String type, String message) voidpanelNotification(String type, String message, String title) voidpanelNotification(String type, String message, String title, Integer timeout) voidpanelNotification(String type, String message, String title, Integer timeout, Integer extendedTimeout) voidpanelNotification(String type, String message, String title, Integer timeout, Integer extendedTimeout, Boolean progressBar) register()Registers thisWsFrameHandlerwith theWebSocketFrameHandlervoidSends an ack response to a WS queryvoidSends an array response to a WS queryvoidsendJSONToAll(String jsonString) voidsendObject(String uniqueID, Map<String, Object> obj) Sends an object response to a WS query
-
Constructor Details
-
WsPanelHandler
-
-
Method Details
-
register
Description copied from interface:WsFrameHandlerRegisters thisWsFrameHandlerwith theWebSocketFrameHandler- Specified by:
registerin interfaceWsFrameHandler- Returns:
-
getAuthHandler
Description copied from interface:WsFrameHandlerGets theWsAuthenticationHandlerassigned to this endpoint- Specified by:
getAuthHandlerin interfaceWsFrameHandler- Returns:
- An
WsAuthenticationHandler
-
handleFrame
Description copied from interface:WsFrameHandlerHandles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandlerreturnedtrue- Specified by:
handleFramein interfaceWsFrameHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionframe- TheWebSocketFrameto 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- TheChannelHandlerContexttype- The type of notification to show. Valid values:success,error,warning,info. Invalid values are treated asinfomessage- The message content of the notificationtitle- The title of the notification.nullor empty string for no titletimeout- The timeout before the notification automatically closes.nullfor default;0to not close until theXis clickedextendedTimeout- The timeout before the notification automatically closes, if the user hover over it with their mouse. This should be longer thantimeoutbecause the timer is shared.nullfor default;0to not close until theXis clickedprogressBar-trueto show a progress bar indicating the time remaining intimeoutuntil the notification closes automatically;falseto explicitly disable the progress bar on this notification;nullfor 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
-