Examples of RemotingApi


Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  private String buildApiString(final String apiNs, final String actionNs, final String remotingApiVar,
      final String pollingUrlsVar, final String routerUrl, final String basePollUrl, final String group,
      final boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    remotingApi.setTimeout(routerController.getConfiguration().getTimeout());
    remotingApi.setMaxRetries(routerController.getConfiguration().getMaxRetries());

    Object enableBuffer = routerController.getConfiguration().getEnableBuffer();
    if (enableBuffer instanceof String && StringUtils.hasText((String) enableBuffer)) {
      String enableBufferString = (String) enableBuffer;
      if (enableBufferString.equalsIgnoreCase("true")) {
        remotingApi.setEnableBuffer(true);
      } else if (enableBufferString.equalsIgnoreCase("false")) {
        remotingApi.setEnableBuffer(false);
      } else {
        Integer enableBufferMs = NumberUtils.parseNumber(enableBufferString, Integer.class);
        remotingApi.setEnableBuffer(enableBufferMs);
      }
    } else if (enableBuffer instanceof Number || enableBuffer instanceof Boolean) {
      remotingApi.setEnableBuffer(enableBuffer);
    }

    buildRemotingApi(remotingApi, group);

    StringBuilder sb = new StringBuilder();

    if (StringUtils.hasText(apiNs)) {
      sb.append("Ext.ns('");
      sb.append(apiNs);
      sb.append("');");
    }

    if (debug) {
      sb.append("\n\n");
    }

    if (StringUtils.hasText(actionNs)) {
      sb.append("Ext.ns('");
      sb.append(actionNs);
      sb.append("');");

      if (debug) {
        sb.append("\n\n");
      }
    }

    String jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);

    if (StringUtils.hasText(apiNs)) {
      sb.append(apiNs).append(".");
    }
    sb.append(remotingApiVar).append(" = ");
    sb.append(jsonConfig);
    sb.append(";");

    if (debug) {
      sb.append("\n\n");
    }

    List<PollingProvider> pollingProviders = remotingApi.getPollingProviders();
    if (!pollingProviders.isEmpty()) {

      if (StringUtils.hasText(apiNs)) {
        sb.append(apiNs).append(".");
      }
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiJson(final String apiNs, final String actionNs, final String remotingApiVar,
      final String routerUrl, final String group, final boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    if (StringUtils.hasText(apiNs)) {
      remotingApi.setDescriptor(apiNs + "." + remotingApiVar);
    } else {
      remotingApi.setDescriptor(remotingApiVar);
    }

    buildRemotingApi(remotingApi, group);

    return routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  private String buildApiString(String apiNs, String actionNs, String remotingApiVar, String pollingUrlsVar,
      String sseVar, String routerUrl, String basePollUrl, String baseSseUrl, String group, boolean debug,
      boolean doc) {

    RemotingApi remotingApi = new RemotingApi(routerController.getConfiguration().getProviderType(), routerUrl,
        actionNs);

    remotingApi.setTimeout(routerController.getConfiguration().getTimeout());
    remotingApi.setMaxRetries(routerController.getConfiguration().getMaxRetries());

    Object enableBuffer = routerController.getConfiguration().getEnableBuffer();
    if (enableBuffer instanceof String && StringUtils.hasText((String) enableBuffer)) {
      String enableBufferString = (String) enableBuffer;
      if (enableBufferString.equalsIgnoreCase("true")) {
        remotingApi.setEnableBuffer(true);
      } else if (enableBufferString.equalsIgnoreCase("false")) {
        remotingApi.setEnableBuffer(false);
      } else {
        Integer enableBufferMs = NumberUtils.parseNumber(enableBufferString, Integer.class);
        remotingApi.setEnableBuffer(enableBufferMs);
      }
    } else if (enableBuffer instanceof Number || enableBuffer instanceof Boolean) {
      remotingApi.setEnableBuffer(enableBuffer);
    }

    buildRemotingApi(remotingApi, group);

    StringBuilder sb = new StringBuilder();

    if (StringUtils.hasText(apiNs)) {
      sb.append("Ext.ns('");
      sb.append(apiNs);
      sb.append("');");
    }

    if (debug) {
      sb.append("\n\n");
    }

    if (StringUtils.hasText(actionNs)) {
      sb.append("Ext.ns('");
      sb.append(actionNs);
      sb.append("');");

      if (debug) {
        sb.append("\n\n");
      }
    }

    String jsonConfig;
    if (!doc) {
      jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
    } else {
      ObjectMapper mapper = new ObjectMapper();
      mapper.addMixInAnnotations(RemotingApi.class, RemotingApiMixin.class);
      try {
        jsonConfig = mapper.writer().withDefaultPrettyPrinter().writeValueAsString(remotingApi);
      } catch (JsonProcessingException e) {
        jsonConfig = null;
        LogFactory.getLog(ApiController.class).info("serialize object to json", e);
      }
    }

    if (StringUtils.hasText(apiNs)) {
      sb.append(apiNs).append(".");
    }
    sb.append(remotingApiVar).append(" = ");
    sb.append(jsonConfig);
    sb.append(";");

    List<PollingProvider> pollingProviders = remotingApi.getPollingProviders();
    if (!pollingProviders.isEmpty()) {

      if (debug) {
        sb.append("\n\n");
      }

      if (StringUtils.hasText(apiNs)) {
        sb.append(apiNs).append(".");
      }
      sb.append(pollingUrlsVar).append(" = {");
      if (debug) {
        sb.append("\n");
      }

      for (int i = 0; i < pollingProviders.size(); i++) {
        if (debug) {
          sb.append("  ");
        }

        sb.append("\"");
        sb.append(pollingProviders.get(i).getEvent());
        sb.append("\"");
        sb.append(" : \"").append(basePollUrl).append("/");
        sb.append(pollingProviders.get(i).getBeanName());
        sb.append("/");
        sb.append(pollingProviders.get(i).getMethod());
        sb.append("/");
        sb.append(pollingProviders.get(i).getEvent());
        sb.append("\"");
        if (i < pollingProviders.size() - 1) {
          sb.append(",");
          if (debug) {
            sb.append("\n");
          }
        }
      }
      if (debug) {
        sb.append("\n");
      }
      sb.append("};");
    }

    Map<String, List<String>> sseProviders = remotingApi.getSseProviders();
    if (!sseProviders.isEmpty()) {

      if (debug) {
        sb.append("\n\n");
      }
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiJson(String apiNs, String actionNs, String remotingApiVar, String routerUrl, String group,
      boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerController.getConfiguration().getProviderType(), routerUrl,
        actionNs);

    if (StringUtils.hasText(apiNs)) {
      remotingApi.setDescriptor(apiNs + "." + remotingApiVar);
    } else {
      remotingApi.setDescriptor(remotingApiVar);
    }

    buildRemotingApi(remotingApi, group);

    return routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiString(String apiNs, String actionNs, String remotingApiVar, final String pollingUrlsVar,
      String routerUrl, String basePollUrl, String group, final boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    remotingApi.setTimeout(routerController.getConfiguration().getTimeout());
    remotingApi.setMaxRetries(routerController.getConfiguration().getMaxRetries());

    Object enableBuffer = routerController.getConfiguration().getEnableBuffer();
    if (enableBuffer instanceof String && StringUtils.hasText((String) enableBuffer)) {
      String enableBufferString = (String) enableBuffer;
      if (enableBufferString.equalsIgnoreCase("true")) {
        remotingApi.setEnableBuffer(true);
      } else if (enableBufferString.equalsIgnoreCase("false")) {
        remotingApi.setEnableBuffer(false);
      } else {
        Integer enableBufferMs = NumberUtils.parseNumber(enableBufferString, Integer.class);
        remotingApi.setEnableBuffer(enableBufferMs);
      }
    } else if (enableBuffer instanceof Number || enableBuffer instanceof Boolean) {
      remotingApi.setEnableBuffer(enableBuffer);
    }

    buildRemotingApi(remotingApi, group);

    StringBuilder sb = new StringBuilder();

    if (StringUtils.hasText(apiNs)) {
      sb.append("Ext.ns('");
      sb.append(apiNs);
      sb.append("');");
    }

    if (debug) {
      sb.append("\n\n");
    }

    if (StringUtils.hasText(actionNs)) {
      sb.append("Ext.ns('");
      sb.append(actionNs);
      sb.append("');");

      if (debug) {
        sb.append("\n\n");
      }
    }

    String jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);

    if (StringUtils.hasText(apiNs)) {
      sb.append(apiNs).append(".");
    }
    sb.append(remotingApiVar).append(" = ");
    sb.append(jsonConfig);
    sb.append(";");

    if (debug) {
      sb.append("\n\n");
    }

    List<PollingProvider> pollingProviders = remotingApi.getPollingProviders();
    if (!pollingProviders.isEmpty()) {

      if (StringUtils.hasText(apiNs)) {
        sb.append(apiNs).append(".");
      }
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiJson(String apiNs, String actionNs, String remotingApiVar, final String routerUrl,
      String group, boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    if (StringUtils.hasText(apiNs)) {
      remotingApi.setDescriptor(apiNs + "." + remotingApiVar);
    } else {
      remotingApi.setDescriptor(remotingApiVar);
    }

    buildRemotingApi(remotingApi, group);

    return routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiString(String apiNs, String actionNs, String remotingApiVar, String pollingUrlsVar,
      String sseVar, String routerUrl, String basePollUrl, String baseSseUrl, String group, boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerController.getConfiguration().getProviderType(), routerUrl,
        actionNs);

    remotingApi.setTimeout(routerController.getConfiguration().getTimeout());
    remotingApi.setMaxRetries(routerController.getConfiguration().getMaxRetries());

    Object enableBuffer = routerController.getConfiguration().getEnableBuffer();
    if (enableBuffer instanceof String && StringUtils.hasText((String) enableBuffer)) {
      String enableBufferString = (String) enableBuffer;
      if (enableBufferString.equalsIgnoreCase("true")) {
        remotingApi.setEnableBuffer(true);
      } else if (enableBufferString.equalsIgnoreCase("false")) {
        remotingApi.setEnableBuffer(false);
      } else {
        Integer enableBufferMs = NumberUtils.parseNumber(enableBufferString, Integer.class);
        remotingApi.setEnableBuffer(enableBufferMs);
      }
    } else if (enableBuffer instanceof Number || enableBuffer instanceof Boolean) {
      remotingApi.setEnableBuffer(enableBuffer);
    }

    buildRemotingApi(remotingApi, group);

    StringBuilder sb = new StringBuilder();

    if (StringUtils.hasText(apiNs)) {
      sb.append("Ext.ns('");
      sb.append(apiNs);
      sb.append("');");
    }

    if (debug) {
      sb.append("\n\n");
    }

    if (StringUtils.hasText(actionNs)) {
      sb.append("Ext.ns('");
      sb.append(actionNs);
      sb.append("');");

      if (debug) {
        sb.append("\n\n");
      }
    }

    String jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);

    if (StringUtils.hasText(apiNs)) {
      sb.append(apiNs).append(".");
    }
    sb.append(remotingApiVar).append(" = ");
    sb.append(jsonConfig);
    sb.append(";");

    List<PollingProvider> pollingProviders = remotingApi.getPollingProviders();
    if (!pollingProviders.isEmpty()) {

      if (debug) {
        sb.append("\n\n");
      }

      if (StringUtils.hasText(apiNs)) {
        sb.append(apiNs).append(".");
      }
      sb.append(pollingUrlsVar).append(" = {");
      if (debug) {
        sb.append("\n");
      }

      for (int i = 0; i < pollingProviders.size(); i++) {
        if (debug) {
          sb.append("  ");
        }

        sb.append("\"");
        sb.append(pollingProviders.get(i).getEvent());
        sb.append("\"");
        sb.append(" : \"").append(basePollUrl).append("/");
        sb.append(pollingProviders.get(i).getBeanName());
        sb.append("/");
        sb.append(pollingProviders.get(i).getMethod());
        sb.append("/");
        sb.append(pollingProviders.get(i).getEvent());
        sb.append("\"");
        if (i < pollingProviders.size() - 1) {
          sb.append(",");
          if (debug) {
            sb.append("\n");
          }
        }
      }
      if (debug) {
        sb.append("\n");
      }
      sb.append("};");
    }

    Map<String, List<String>> sseProviders = remotingApi.getSseProviders();
    if (!sseProviders.isEmpty()) {

      if (debug) {
        sb.append("\n\n");
      }
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiJson(String apiNs, String actionNs, String remotingApiVar, String routerUrl, String group,
      boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerController.getConfiguration().getProviderType(), routerUrl,
        actionNs);

    if (StringUtils.hasText(apiNs)) {
      remotingApi.setDescriptor(apiNs + "." + remotingApiVar);
    } else {
      remotingApi.setDescriptor(remotingApiVar);
    }

    buildRemotingApi(remotingApi, group);

    return routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  private String buildApiString(final String apiNs, final String actionNs, final String remotingApiVar,
      final String pollingUrlsVar, final String routerUrl, final String basePollUrl, final String group,
      final boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    remotingApi.setTimeout(routerController.getConfiguration().getTimeout());
    remotingApi.setMaxRetries(routerController.getConfiguration().getMaxRetries());

    Object enableBuffer = routerController.getConfiguration().getEnableBuffer();
    if (enableBuffer instanceof String && StringUtils.hasText((String) enableBuffer)) {
      String enableBufferString = (String) enableBuffer;
      if (enableBufferString.equalsIgnoreCase("true")) {
        remotingApi.setEnableBuffer(true);
      } else if (enableBufferString.equalsIgnoreCase("false")) {
        remotingApi.setEnableBuffer(false);
      } else {
        Integer enableBufferMs = NumberUtils.parseNumber(enableBufferString, Integer.class);
        remotingApi.setEnableBuffer(enableBufferMs);
      }
    } else if (enableBuffer instanceof Number || enableBuffer instanceof Boolean) {
      remotingApi.setEnableBuffer(enableBuffer);
    }

    buildRemotingApi(remotingApi, group);

    StringBuilder sb = new StringBuilder();

    if (StringUtils.hasText(apiNs)) {
      sb.append("Ext.ns('");
      sb.append(apiNs);
      sb.append("');");
    }

    if (debug) {
      sb.append("\n\n");
    }

    if (StringUtils.hasText(actionNs)) {
      sb.append("Ext.ns('");
      sb.append(actionNs);
      sb.append("');");

      if (debug) {
        sb.append("\n\n");
      }
    }

    String jsonConfig = routerController.getJsonHandler().writeValueAsString(remotingApi, debug);

    if (StringUtils.hasText(apiNs)) {
      sb.append(apiNs).append(".");
    }
    sb.append(remotingApiVar).append(" = ");
    sb.append(jsonConfig);
    sb.append(";");

    if (debug) {
      sb.append("\n\n");
    }

    List<PollingProvider> pollingProviders = remotingApi.getPollingProviders();
    if (!pollingProviders.isEmpty()) {

      if (StringUtils.hasText(apiNs)) {
        sb.append(apiNs).append(".");
      }
View Full Code Here

Examples of ch.ralscha.extdirectspring.bean.api.RemotingApi

  }

  private String buildApiJson(final String apiNs, final String actionNs, final String remotingApiVar,
      final String routerUrl, final String group, final boolean debug) {

    RemotingApi remotingApi = new RemotingApi(routerUrl, actionNs);

    if (StringUtils.hasText(apiNs)) {
      remotingApi.setDescriptor(apiNs + "." + remotingApiVar);
    } else {
      remotingApi.setDescriptor(remotingApiVar);
    }

    buildRemotingApi(remotingApi, group);

    return routerController.getJsonHandler().writeValueAsString(remotingApi, debug);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.