public class GripControl extends Object
| Constructor and Description |
|---|
GripControl() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createGripChannelHeader(List<Channel> channels)
Create a GRIP channel header for the specified channels.
|
static String |
createHold(String mode,
List<Channel> channels,
Response response,
int timeout)
Create GRIP hold instructions for the specified parameters including a timeout.
|
static String |
createHoldResponse(List<Channel> channels)
Create a GRIP hold response for HTTP long-polling.
|
static String |
createHoldResponse(List<Channel> channels,
Response response)
Create a GRIP hold response for HTTP long-polling.
|
static String |
createHoldResponse(List<Channel> channels,
Response response,
int timeout)
Create a GRIP hold response for HTTP long-polling.
|
static String |
createHoldStream(List<Channel> channels)
Create a GRIP hold stream for HTTP streaming.
|
static String |
createHoldStream(List<Channel> channels,
Response response)
Create a GRIP hold stream for HTTP streaming.
|
static List<WebSocketEvent> |
decodeWebSocketEvents(String body)
Decode the request body into an array of WebSocketEvent instances.
|
static String |
encodeWebSocketEvents(List<WebSocketEvent> webSocketEvents)
Encode the specified array of WebSocketEvent instances.
|
static Map<String,Object> |
parseGripUri(String uri)
Parse the specified GRIP URI into a config object.
|
static boolean |
validateSig(String token,
String key)
Validate the specified JWT token and key.
|
static String |
webSocketControlMessage(String type)
Generate a WebSocket control message with the specified type and optional arguments.
|
static String |
webSocketControlMessage(String type,
Map<String,Object> args)
Generate a WebSocket control message with the specified type and optional arguments.
|
public static String createHold(String mode, List<Channel> channels, Response response, int timeout)
public static String createHoldResponse(List<Channel> channels)
public static String createHoldResponse(List<Channel> channels, Response response)
public static String createHoldResponse(List<Channel> channels, Response response, int timeout)
public static String createHoldStream(List<Channel> channels)
public static String createHoldStream(List<Channel> channels, Response response)
public static String createGripChannelHeader(List<Channel> channels)
public static String webSocketControlMessage(String type)
public static String webSocketControlMessage(String type, Map<String,Object> args)
public static Map<String,Object> parseGripUri(String uri) throws UnsupportedEncodingException, MalformedURLException
public static boolean validateSig(String token, String key)
public static String encodeWebSocketEvents(List<WebSocketEvent> webSocketEvents)
public static List<WebSocketEvent> decodeWebSocketEvents(String body)
Copyright © 2015. All rights reserved.