Package ch.ralscha.extdirectspring.bean.api

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


  }

  private String buildApiString(String apiNs, String actionNs, String remotingApiVar, String pollingUrlsVar,
      String routerUrl, String basePollUrl, String group, 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


  }

  private String buildApiJson(String apiNs, String actionNs, String remotingApiVar, 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

  private final static AtomicInteger id = new AtomicInteger();

  private final static ObjectMapper mapper = new ObjectMapper();

  private static RemotingApi api() {
    RemotingApi remotingApi = new RemotingApi("remoting", "/controller/router", null);
    remotingApi.addAction("simpleService",
        new Action("toUpperCase", 1, Boolean.FALSE));
    remotingApi.addAction("simpleService",
        new Action("echo", Arrays.asList("userId", "logLevel")));

    PollingProvider pollingProvider = new PollingProvider("simpleService", "poll",
        "poll");
    remotingApi.addPollingProvider(pollingProvider);

    remotingApi.addSseProvider("simpleService", "sse");
    return remotingApi;
  }
View Full Code Here

    remotingApi.addSseProvider("sseProvider", "message15");
    return remotingApi;
  }

  private static RemotingApi emptyGroupApis(String namespace) {
    RemotingApi remotingApi = new RemotingApi("remoting", "/router", namespace);
    remotingApi.addAction("remoteProviderSimple", new Action("method2", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method4b", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method6", 2,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method7", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method8", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method10", 9,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method11", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method11b", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method12", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method13", 9,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method14", 4,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderSimple", new Action("method15", 2,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method16", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method17", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method18", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method19", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method20", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method21", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method22", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method23", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method24", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method25", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method26", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method27", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method28", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method29", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method30", 0,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderStoreRead", new Action("method1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method3", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method8", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method9", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("methodFilter", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("methodMetadata", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderStoreModify", new Action("create1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("create2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("update1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("update2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("update3", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("create1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("create2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("update1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("update2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("update3", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("create1",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("create2",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("update1",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("update2",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("update3",
        1, Boolean.FALSE));

    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("create1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("create2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("update1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("update2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("update3", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderFormLoad", new Action("method2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method3", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method6", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method7", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderTreeLoad", new Action("method2", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method6", 1,
        Boolean.FALSE));

    remotingApi.addAction("formInfoController3", new Action("updateInfoJson", 1,
        Boolean.FALSE));
    remotingApi.addAction("formInfoController3", new Action("updateInfoJsonDirect",
        1, Boolean.FALSE));
    remotingApi.addAction("formInfoController3", new Action(
        "updateInfoJsonDirectError", 1, Boolean.FALSE));

    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage4", "message4"));

    remotingApi.addSseProvider("sseProvider", "message4");
    return remotingApi;
  }
View Full Code Here

    return result;
  }

  private static RemotingApi noApis(String namespace) {
    return new RemotingApi("remoting", "/router", namespace);
  }
View Full Code Here

  private static RemotingApi noApis(String namespace) {
    return new RemotingApi("remoting", "/router", namespace);
  }

  static RemotingApi group1Apis(String namespace) {
    RemotingApi remotingApi = new RemotingApi("remoting", "/router", namespace);
    remotingApi.addAction("remoteProviderSimple", new Action("method1", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method1", 1,
        Boolean.FALSE));
    return remotingApi;
  }
View Full Code Here

        Boolean.FALSE));
    return remotingApi;
  }

  static RemotingApi groupApisWithDoc(String namespace) {
    RemotingApi remotingApi = new RemotingApi("remoting", "/router", namespace);
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method1", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method2", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method3", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method4", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method5", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method6", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method7", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method8", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method9", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method10", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method11", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimpleDoc", new Action("method12", 0,
        Boolean.FALSE));
    return remotingApi;
  }
View Full Code Here

        Boolean.FALSE));
    return remotingApi;
  }

  private static RemotingApi group2Apis(String namespace, String url) {
    RemotingApi remotingApi = new RemotingApi("remoting", url, namespace);
    remotingApi.addAction("remoteProviderSimple", new Action("method3", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method6", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method7", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("update4",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi
        .addAction("formInfoController", new Action("upload", 0, Boolean.TRUE));
    remotingApi.addAction("uploadService", new Action("upload", 0, Boolean.TRUE));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage1", "message1"));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage2", "message2"));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider", "message6",
        "message6"));
    remotingApi.addSseProvider("sseProvider", "message1");
    remotingApi.addSseProvider("sseProvider", "message2");
    remotingApi.addSseProvider("sseProvider", "message6");
    return remotingApi;
  }
View Full Code Here

    remotingApi.addSseProvider("sseProvider", "message6");
    return remotingApi;
  }

  private static RemotingApi group1and2Apis(String namespace) {
    RemotingApi remotingApi = new RemotingApi("remoting", "/router", namespace);
    remotingApi.addAction("remoteProviderSimple", new Action("method1", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method1", 1,
        Boolean.FALSE));

    remotingApi.addAction("remoteProviderSimple", new Action("method3", 3,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method6", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method7", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyInterface", new Action("update4",
        1, Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("update4", 1,
        Boolean.FALSE));
    remotingApi
        .addAction("formInfoController", new Action("upload", 0, Boolean.TRUE));
    remotingApi.addAction("uploadService", new Action("upload", 0, Boolean.TRUE));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage1", "message1"));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage2", "message2"));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider", "message6",
        "message6"));
    remotingApi.addSseProvider("sseProvider", "message1");
    remotingApi.addSseProvider("sseProvider", "message2");
    remotingApi.addSseProvider("sseProvider", "message6");
    return remotingApi;
  }
View Full Code Here

  static RemotingApi group2Apis(String namespace) {
    return group2Apis(namespace, "/router");
  }

  private static RemotingApi group3Apis(String namespace) {
    RemotingApi remotingApi = new RemotingApi("remoting", "/router", namespace);
    remotingApi.addAction("remoteProviderSimple", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderSimple", new Action("method9", 0,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreRead", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModify", new Action("destroy", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifyArray", new Action("destroy", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderStoreModifySingle", new Action("destroy", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method1", 1,
        Boolean.FALSE));
    remotingApi.addAction("remoteProviderFormLoad", new Action("method5", 1,
        Boolean.FALSE));
    remotingApi.addAction("formInfoController", new Action("updateInfo", 0,
        Boolean.TRUE));
    remotingApi.addAction("formInfoController", new Action("updateInfoDirect", 0,
        Boolean.TRUE));
    remotingApi.addAction("formInfoController2", new Action("updateInfo1", 0,
        Boolean.TRUE));
    remotingApi.addAction("formInfoController2", new Action("updateInfo2", 0,
        Boolean.TRUE));
    remotingApi.addAction("remoteProviderTreeLoad", new Action("method3", 1,
        Boolean.FALSE));
    remotingApi.addPollingProvider(new PollingProvider("pollProvider",
        "handleMessage5", "message5"));
    remotingApi.addSseProvider("sseProvider", "message5");
    return remotingApi;
  }
View Full Code Here

TOP

Related Classes of ch.ralscha.extdirectspring.bean.api.RemotingApi

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.