Package com.mockey.model

Examples of com.mockey.model.ProxyServerModel


   * @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);
View Full Code Here


      this.setAttribute(rootElement, "default_service_plan_id", ""
          + store.getDefaultServicePlanId());
    }

    // Proxy settings
    ProxyServerModel psm = store.getProxy();
    if (psm != null) {
      Element proxyElement = document.createElement("proxy_settings");
      proxyElement.setAttribute("proxy_url", psm.getProxyUrl());
      proxyElement.setAttribute("proxy_enabled",
          "" + psm.isProxyEnabled());
      rootElement.appendChild(proxyElement);
    }

    // SERVICE LIST
    // logger.debug("Building non-reference, full definition? " +
View Full Code Here

   * @throws IOException
   *             basic
   */
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    ProxyServerModel proxyInfo = store.getProxy();
    req.setAttribute("proxyInfo", proxyInfo);

    RequestDispatcher dispatch = req.getRequestDispatcher("/proxy_setup.jsp");
    dispatch.forward(req, resp);
  }
View Full Code Here

   *             basic
   * @throws IOException
   *             basic
   */
  public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    ProxyServerModel proxyInfo = new ProxyServerModel();

    proxyInfo.setProxyPassword(req.getParameter("proxyPassword"));
    proxyInfo.setProxyUsername(req.getParameter("proxyUsername"));
    proxyInfo.setProxyUrl(req.getParameter("proxyUrl"));
    String enabled = req.getParameter("proxyEnabled");
    boolean proxyEnabled = false;
    try {
      proxyEnabled = Boolean.parseBoolean(enabled);
    } catch (Exception e) {
      e.printStackTrace();
    }
    proxyInfo.setProxyEnabled(proxyEnabled);
    store.setProxy(proxyInfo);
    JSONObject responseObject = new JSONObject();
    JSONObject successMessage = new JSONObject();

    try {
View Full Code Here

    // STEP #2. PROXY SETTINGS
    // If the proxy settings are _empty_, then set the incoming
    // proxy settings. Otherwise, call out a merge conflict.
    //
    ProxyServerModel proxyServerModel = store.getProxy();
    if (proxyServerModel.hasSettings()) {
      mergeResults.addConflictMsg("Proxy settings NOT set from incoming file.");
    } else {
      store.setProxy(mockServiceStoreTemporary.getProxy());
      mergeResults.addAdditionMsg("Proxy settings set.");
    }
View Full Code Here

  public void deleteEverything() {
    initHistoryStore();
    mockServiceStore = new OrderedMap<Service>();
    servicePlanStore = new OrderedMap<ServicePlan>();
    twistInfoStore = new OrderedMap<TwistInfo>();
    this.proxyInfoBean = new ProxyServerModel();
    this.globalFilterTag = "";
    this.defaultServicePlanId = null;
    this.universalErrorServiceId = null;
    this.universalErrorScenarioId = null;
    this.writeMemoryToFile();
View Full Code Here

TOP

Related Classes of com.mockey.model.ProxyServerModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.