* @throws IOException
* basic
*/
public void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
ProxyServerModel proxyInfo = store.getProxy();
String transientState = req.getParameter("transient_state");
try {
if (transientState != null) {
store.setReadOnlyMode(new Boolean(transientState));
}
} catch (Exception e) {
logger.error("Unable to set transient state with value: " + transientState, e);
}
resp.setContentType("application/json");
PrintWriter out = resp.getWriter();
try {
JSONObject responseObject = new JSONObject();
JSONObject messageObject = new JSONObject();
messageObject.put("proxy_enabled", Boolean.toString(proxyInfo.isProxyEnabled()));
messageObject.put("transient_state", store.getReadOnlyMode());
Long twistInfoId = store.getUniversalTwistInfoId();
TwistInfo twistInfo = store.getTwistInfoById(twistInfoId);
if (twistInfo != null) {
messageObject.put("twist_enabled", true);