public void send(String payload, TransportReceiver receiver) { String result; try { if (DUMP_PAYLOAD) { System.out.println(">>> " + payload); } result = processor.process(payload); if (DUMP_PAYLOAD) { System.out.println("<<< " + result); } } catch (RuntimeException e) { e.printStackTrace(); receiver.onTransportFailure(new ServerFailure(e.getMessage())); return; } receiver.onTransportSuccess(result); } }
String payload = processor.process(jsonRequestString); if (DUMP_PAYLOAD) { System.out.println("<<< " + payload);
protected String process(SimpleRequestProcessor processor, HttpServletRequest request, HttpServletResponse response, String jsonRequestString) { return processor.process(jsonRequestString); }
/** * Process a payload sent by a RequestFactory client. * * @param payload the payload sent by the client * @return a payload to return to the client */ public String process(String payload) { RequestMessage req = AutoBeanCodex.decode(FACTORY, RequestMessage.class, payload).as(); AutoBean<ResponseMessage> responseBean = FACTORY.response(); try { process(req, responseBean.as()); } catch (ReportableException e) { // Create a new response envelope, since the state is unknown responseBean = FACTORY.response(); responseBean.as().setGeneralFailure(createFailureMessage(e).as()); } // Return a JSON-formatted payload return AutoBeanCodex.encode(responseBean).getPayload(); }
public void send(String payload, TransportReceiver receiver) { String result; try { if (DUMP_PAYLOAD) { System.out.println(">>> " + payload); } result = processor.process(payload); if (DUMP_PAYLOAD) { System.out.println("<<< " + result); } } catch (RuntimeException e) { e.printStackTrace(); receiver.onTransportFailure(new ServerFailure(e.getMessage())); return; } receiver.onTransportSuccess(result); } }
public void send(String payload, TransportReceiver receiver) { String result; try { if (DUMP_PAYLOAD) { System.out.println(">>> " + payload); } result = processor.process(payload); if (DUMP_PAYLOAD) { System.out.println("<<< " + result); } } catch (RuntimeException e) { e.printStackTrace(); receiver.onTransportFailure(new ServerFailure(e.getMessage())); return; } receiver.onTransportSuccess(result); } }
String payload = processor.process(jsonRequestString); if (DUMP_PAYLOAD) { System.out.println("<<< " + payload);
String payload = processor.process(jsonRequestString); if (DUMP_PAYLOAD) { System.out.println("<<< " + payload);
String payload = processor.process(jsonRequestString); if (DUMP_PAYLOAD) { System.out.println("<<< " + payload);
try { payloadLogger.info (">>> (process) User: "+getUser()+" Payload: "+jsonRequestString); payload = processor.process(jsonRequestString); response.setStatus(HttpServletResponse.SC_OK); response.setContentType(RequestFactory.JSON_CONTENT_TYPE_UTF8);
/** * Process a payload sent by a RequestFactory client. * * @param payload the payload sent by the client * @return a payload to return to the client */ public String process(String payload) { RequestMessage req = AutoBeanCodex.decode(FACTORY, RequestMessage.class, payload).as(); AutoBean<ResponseMessage> responseBean = FACTORY.response(); try { process(req, responseBean.as()); } catch (ReportableException e) { // Create a new response envelope, since the state is unknown responseBean = FACTORY.response(); responseBean.as().setGeneralFailure(createFailureMessage(e).as()); } // Return a JSON-formatted payload return AutoBeanCodex.encode(responseBean).getPayload(); }
/** * Process a payload sent by a RequestFactory client. * * @param payload the payload sent by the client * @return a payload to return to the client */ public String process(String payload) { RequestMessage req = AutoBeanCodex.decode(FACTORY, RequestMessage.class, payload).as(); AutoBean<ResponseMessage> responseBean = FACTORY.response(); try { process(req, responseBean.as()); } catch (ReportableException e) { // Create a new response envelope, since the state is unknown responseBean = FACTORY.response(); responseBean.as().setGeneralFailure(createFailureMessage(e).as()); } // Return a JSON-formatted payload return AutoBeanCodex.encode(responseBean).getPayload(); }
/** * Process a payload sent by a RequestFactory client. * * @param payload the payload sent by the client * @return a payload to return to the client */ public String process(String payload) { RequestMessage req = AutoBeanCodex.decode(FACTORY, RequestMessage.class, payload).as(); AutoBean<ResponseMessage> responseBean = FACTORY.response(); try { process(req, responseBean.as()); } catch (ReportableException e) { // Create a new response envelope, since the state is unknown responseBean = FACTORY.response(); responseBean.as().setGeneralFailure(createFailureMessage(e).as()); } // Return a JSON-formatted payload return AutoBeanCodex.encode(responseBean).getPayload(); }