public class SimpleRestInterceptor extends AtmosphereInterceptorAdapter
InvokationOrder.PRIORITY| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROTOCOL_DETACHED_KEY
Deprecated.
always use detached mode
|
protected static java.lang.String |
REQUEST_DISPATCHED |
protected static java.lang.String |
REQUEST_ID |
static java.lang.String |
X_ATMOSPHERE_SIMPLE_REST_PROTOCOL_DETACHED
Deprecated.
always use detached mode
|
static java.lang.String |
X_REQUEST_KEY
The internal header consisting of the {tracking-id}#{request-id}
|
AFTER_DEFAULT, BEFORE_DEFAULT, FIRST_BEFORE_DEFAULT| Constructor and Description |
|---|
SimpleRestInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(AtmosphereConfig config)
Configure an AtmosphereFramework object.
|
protected AtmosphereRequest |
createAtmosphereRequest(AtmosphereRequest request,
java.lang.String body) |
protected byte[] |
createResponse(AtmosphereResponse response,
byte[] payload) |
protected static boolean |
getBoolean(org.json.JSONObject obj,
java.lang.String key) |
protected java.lang.String |
getHeartbeatBroadcasterName() |
protected java.lang.String |
getHeartbeatTemplate() |
protected java.lang.Object[] |
getHeartbeatTemplateArguments() |
protected static java.lang.String |
getString(org.json.JSONObject obj,
java.lang.String key) |
Action |
inspect(AtmosphereResource r)
Invoked before an
AtmosphereResource gets dispatched to AtmosphereHandler. |
protected static boolean |
isJSONObject(byte[] b) |
protected static boolean |
isLastResponse(AtmosphereRequest request,
AtmosphereResponse response) |
protected static org.json.JSONObject |
parseJsonPart(java.io.Reader reader) |
protected static byte[] |
quote(byte[] b) |
destroy, postInspect, priority, toStringpublic static final java.lang.String PROTOCOL_DETACHED_KEY
public static final java.lang.String X_ATMOSPHERE_SIMPLE_REST_PROTOCOL_DETACHED
public static final java.lang.String X_REQUEST_KEY
protected static final java.lang.String REQUEST_DISPATCHED
protected static final java.lang.String REQUEST_ID
public void configure(AtmosphereConfig config)
AtmosphereConfigAwareconfigure in interface AtmosphereConfigAwareconfigure in class AtmosphereInterceptorAdapterconfig - AtmosphereConfigpublic Action inspect(AtmosphereResource r)
AtmosphereInterceptorAtmosphereResource gets dispatched to AtmosphereHandler.inspect in interface AtmosphereInterceptorinspect in class AtmosphereInterceptorAdapterr - a AtmosphereResourceAction.CONTINUE or Action.SUSPEND
to dispatch the AtmosphereResource to other AtmosphereInterceptor or AtmosphereHandler.
Return Action.TYPE.CANCELLED to stop the processing.protected java.lang.String getHeartbeatBroadcasterName()
protected java.lang.String getHeartbeatTemplate()
protected java.lang.Object[] getHeartbeatTemplateArguments()
protected AtmosphereRequest createAtmosphereRequest(AtmosphereRequest request, java.lang.String body) throws java.io.IOException
java.io.IOExceptionprotected byte[] createResponse(AtmosphereResponse response, byte[] payload)
protected static boolean isLastResponse(AtmosphereRequest request, AtmosphereResponse response)
protected static boolean isJSONObject(byte[] b)
protected static byte[] quote(byte[] b)
protected static org.json.JSONObject parseJsonPart(java.io.Reader reader)
throws org.json.JSONException
org.json.JSONExceptionprotected static java.lang.String getString(org.json.JSONObject obj,
java.lang.String key)
protected static boolean getBoolean(org.json.JSONObject obj,
java.lang.String key)
Copyright © 2024. All Rights Reserved.