|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.adminui.JSONCommunicationUtils
public final class JSONCommunicationUtils
provides different types of json-error- and -success-messages to be used for the communication within the admin-ui.
| Method Summary | |
|---|---|
static void |
jsonErrorMessage(ServiceRequest request)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonErrorMessage(ServiceRequest request,
net.sf.json.JSONObject error)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonErrorMessage(ServiceRequest request,
java.lang.String error)
adds a JSONOutputEvent to the current
ServiceRequest, which is a
HashMap<String, Object> containing "data.status =
false" and "errorTopic => errorTopic". |
static void |
jsonSuccessMessage(ServiceRequest request)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonSuccessMessage(ServiceRequest request,
net.sf.json.JSONObject jsonObject)
adds a JSONOutputEvent that indicates success to the current
ServiceRequest. |
static void |
jsonSuccessMessage(ServiceRequest request,
java.lang.String arrayName,
net.sf.json.JSONArray jsonArray)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonSuccessMessage(ServiceRequest request,
java.lang.String arrayName,
net.sf.json.JSONArray jsonArray,
long total)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonSuccessMessage(ServiceRequest request,
java.lang.String objectName,
net.sf.json.JSONObject jsonObject)
adds a JSONOutputEvent to the current
ServiceRequest. |
static void |
jsonSuccessMessage(ServiceRequest request,
java.lang.String parameterName,
java.lang.Object message)
adds a JSONOutputEvent to the current
ServiceRequest, which is a
HashMap<String, Object> containing "data.status =
true" and "parameterName => message". |
static void |
jsonSuccessParameterListMessage(ServiceRequest request,
java.util.List<Parameter> parameterList)
builds a JSON-response for a list of Parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void jsonErrorMessage(ServiceRequest request)
JSONOutputEvent to the current
ServiceRequest.
responds with Object: { status: false
request - the current ServiceRequest
public static void jsonErrorMessage(ServiceRequest request,
java.lang.String error)
JSONOutputEvent to the current
ServiceRequest, which is a
HashMap<String, Object> containing "data.status =
false" and "errorTopic => errorTopic".
request - the current ServiceRequesterror - the error
public static void jsonErrorMessage(ServiceRequest request,
net.sf.json.JSONObject error)
JSONOutputEvent to the current
ServiceRequest.
if (error != null) responds with Object: { status: false,
error: { JSONObject error } }
else if (error == null) responds with Object: { status:
false
request - the current ServiceRequesterror - the errorpublic static void jsonSuccessMessage(ServiceRequest request)
JSONOutputEvent to the current
ServiceRequest.
responds with Object: { status: true
request - the current ServiceRequest
public static void jsonSuccessMessage(ServiceRequest request,
net.sf.json.JSONObject jsonObject)
JSONOutputEvent that indicates success to the current
ServiceRequest.
Sets status=true for the passed JSONObject.
request - the current ServiceRequestjsonObject - the JSONObjects
public static void jsonSuccessMessage(ServiceRequest request,
java.lang.String objectName,
net.sf.json.JSONObject jsonObject)
JSONOutputEvent to the current
ServiceRequest.
if (objectName != null) responds with Object: { status: true
, objectName: { JSONObject jsonObject } }
else if (objectName == null) responds with Object: { status:
true
request - the current ServiceRequest *objectName - the JSONObject parameter namejsonObject - the JSONObjects
public static void jsonSuccessMessage(ServiceRequest request,
java.lang.String arrayName,
net.sf.json.JSONArray jsonArray)
JSONOutputEvent to the current
ServiceRequest.
if (arrayName != null) responds with Object: { status: true,
arrayName: { JSONArray jsonArray } }
else if (arrayName == null) responds with Object: { status:
true
request - the current ServiceRequestarrayName - the JSONArray namejsonArray - the JSONArrays
public static void jsonSuccessMessage(ServiceRequest request,
java.lang.String arrayName,
net.sf.json.JSONArray jsonArray,
long total)
JSONOutputEvent to the current
ServiceRequest.
if (arrayName != null) responds with Object: { status: true,
arrayName: { JSONArray jsonArray } }
else if (arrayName == null) responds with Object: { status:
true
request - the current ServiceRequestarrayName - the JSONArray namejsonArray - the JSONArraystotal - the total of results to be used (e.g. for paging)
public static void jsonSuccessMessage(ServiceRequest request,
java.lang.String parameterName,
java.lang.Object message)
JSONOutputEvent to the current
ServiceRequest, which is a
HashMap<String, Object> containing "data.status =
true" and "parameterName => message".
request - the current ServiceRequest *parameterName - the message parameter namemessage - the message
public static void jsonSuccessParameterListMessage(ServiceRequest request,
java.util.List<Parameter> parameterList)
Parameters.
request - the current ServiceRequestparameterList - the parameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||