|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.bristleback.server.bristle.utils.BristleTokenFactory
public final class BristleTokenFactory
This utility class contains a huge amount of factory methods, used to create various types of token.
Created on: 2010-11-28 13:51:16
| Field Summary | |
|---|---|
static java.lang.String |
EXCEPTION_TYPE_PARAMETER
|
static java.lang.String |
EXCEPTION_VALUE_PARAMETER
|
static java.lang.String |
VALIDATION_EXCEPTION_ERROR_TYPE
|
static java.lang.String |
VALIDATION_EXCEPTION_ERRORS
|
static java.lang.String |
VALIDATION_EXCEPTION_FIELD_NAME
|
static java.lang.String |
VALIDATION_EXCEPTION_TYPE
|
| Method Summary | |
|---|---|
static org.jwebsocket.token.Token |
createExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType)
Creates a response token with filled exception type field, this token will be processed by client's callback onFailure() method. |
static org.jwebsocket.token.JSONToken |
createJsonExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType)
Creates a json exception response token with filled exception type field, this token will be processed by client's callback onFailure() method. |
static org.jwebsocket.token.JSONToken |
createJsonExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType,
org.json.JSONObject exceptionValue)
Creates a json exception response token with filled exception type and value field, this token will be processed by client's callback onFailure() method. |
static org.jwebsocket.token.JSONToken |
createJsonResponseToken(org.jwebsocket.token.Token request)
Creates a response JSONToken token, copying action name and request identification. |
static org.jwebsocket.token.JSONToken |
createJsonResponseToken(org.jwebsocket.token.Token request,
org.json.JSONArray json,
java.lang.String arrayFieldName)
Creates a response json token with content given in JSONArray parameter, copying action name and request identification. |
static org.jwebsocket.token.JSONToken |
createJsonResponseToken(org.jwebsocket.token.Token request,
org.json.JSONObject json)
Creates a response json token with content given in JSONObject parameter, copying action name and request identification. |
static org.jwebsocket.token.JSONToken |
createJsonToken(java.lang.String actionName)
Creates a JSONToken token with filled action name field. |
static org.jwebsocket.token.JSONToken |
createJsonToken(java.lang.String actionName,
org.json.JSONArray jsonArray,
java.lang.String arrayFieldName)
Creates a Json token using given json array. |
static org.jwebsocket.token.JSONToken |
createJsonToken(java.lang.String actionName,
org.json.JSONObject json)
Creates a json token with given json object inside and filled action name field. |
static org.jwebsocket.token.Token |
createResponseToken(org.jwebsocket.token.Token request)
Creates a response MapToken token, copying action name and request identification. |
static org.jwebsocket.token.Token |
createToken(java.lang.String actionName)
Creates a MapToken token with filled action name field. |
static org.jwebsocket.token.Token |
createValidationExceptionToken(org.jwebsocket.token.Token request,
BindingResult<?> result)
Creates a json response token with exception type "ValidationException". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VALIDATION_EXCEPTION_TYPE
public static final java.lang.String VALIDATION_EXCEPTION_ERRORS
public static final java.lang.String VALIDATION_EXCEPTION_FIELD_NAME
public static final java.lang.String VALIDATION_EXCEPTION_ERROR_TYPE
public static final java.lang.String EXCEPTION_TYPE_PARAMETER
public static final java.lang.String EXCEPTION_VALUE_PARAMETER
| Method Detail |
|---|
public static org.jwebsocket.token.JSONToken createJsonToken(java.lang.String actionName,
org.json.JSONObject json)
actionName - action namejson - json object
public static org.jwebsocket.token.JSONToken createJsonToken(java.lang.String actionName,
org.json.JSONArray jsonArray,
java.lang.String arrayFieldName)
actionName - action namejsonArray - json arrayarrayFieldName - name of json array inside parent json object.
public static org.jwebsocket.token.Token createToken(java.lang.String actionName)
MapToken token with filled action name field.
actionName - action name.
public static org.jwebsocket.token.JSONToken createJsonToken(java.lang.String actionName)
JSONToken token with filled action name field.
actionName - action name.
public static org.jwebsocket.token.Token createResponseToken(org.jwebsocket.token.Token request)
MapToken token, copying action name and request identification.
request - request token containing request identification and requested action name.
public static org.jwebsocket.token.JSONToken createJsonResponseToken(org.jwebsocket.token.Token request)
JSONToken token, copying action name and request identification.
request - request token containing request identification and requested action name.
public static org.jwebsocket.token.JSONToken createJsonResponseToken(org.jwebsocket.token.Token request,
org.json.JSONObject json)
request - request token containing request identification and requested action name.json - content of the response token.
public static org.jwebsocket.token.JSONToken createJsonResponseToken(org.jwebsocket.token.Token request,
org.json.JSONArray json,
java.lang.String arrayFieldName)
request - request token containing request identification and requested action name.json - content array of the response token.arrayFieldName - name under which given array is put.
public static org.jwebsocket.token.Token createExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType)
onFailure() method.
This exception token contains no exception value (only type),
but it can be added manually by setting token variable with key EXCEPTION_VALUE_PARAMETER.
request - request token containing request identification and requested action name.exceptionType - type of exception to thrown.
public static org.jwebsocket.token.JSONToken createJsonExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType,
org.json.JSONObject exceptionValue)
onFailure() method.
Exception value parameter is passed in parameter.
request - request token containing request identification and requested action name.exceptionType - type of exception to thrown.exceptionValue - value of exception.
public static org.jwebsocket.token.JSONToken createJsonExceptionToken(org.jwebsocket.token.Token request,
java.lang.String exceptionType)
onFailure() method.
This exception token contains no exception value (only type),
but it can be added manually by setting token variable with key EXCEPTION_VALUE_PARAMETER.
request - request token containing request identification and requested action name.exceptionType - type of exception to thrown.
public static org.jwebsocket.token.Token createValidationExceptionToken(org.jwebsocket.token.Token request,
BindingResult<?> result)
request - request token containing request identification and requested action name.result - binding operation result wrapper with not empty list of binding errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||