Examples of ExchangeData


Examples of com.alu.e3.prov.restapi.ExchangeData

    }
  }

  protected void doGenJar(byte[] jarBytes, Api api, Map<Object, Object> variablesMap) throws Exception {
    ExchangeData data = (ExchangeData) variablesMap.get("exchange");

    String jarName = data.getProperties().get(ExchangeConstantKeys.E3_API_ID_ENCODED.toString()) + "-" + data.getProperties().get(ExchangeConstantKeys.E3_PROVISION_ID.toString()) + ".jar";

    File file = new File(workingDir + File.separator + archiveDir + File.separator + jarName);
    if (!file.getParentFile().exists()) {
      file.getParentFile().mkdirs();
    }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    this.setDefaultHttpsValue(api);

    // Set default TdrData
    this.setDefaultTdrValue(api);

    ExchangeData exchange = createExchange(api);

    if (canCreateJar) {
      // Deploy the api
      this.deployApi(api, exchange);
    }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    this.setDefaultHttpsValue(api);

    // Set default TdrData
    this.setDefaultTdrValue(api);

    ExchangeData exchange = createExchange(api);

    if (canCreateJar) {
      this.deployApi(api, exchange);
    }
    else {
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    com.alu.e3.data.model.Api api = dataManager.getApiById(apiId, true);

    dataManager.removeApi(apiId);

    ExchangeData exchange = createExchange(apiId);

    if (api.getApiDetail().isApiDeployed()) {
      this.deploymentManager.undeployApi(exchange, apiId);
    }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    com.alu.e3.data.model.Api api = dataManager.getApiById(apiId, true);

    Api apiWs = BeanConverterUtil.fromDataModel(api);

    ExchangeData exchange = createExchange(apiId);
    LogUtil.log(LOG, exchange, LogUtil.Phase.GET, "N/A");

    return apiWs;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    Set<String> apiIds = dataManager.getAllApiIds();
    if (apiIds != null)
      apiIdsList.addAll(apiIds);

    ExchangeData exchange = new ExchangeData();
    LogUtil.log(LOG, exchange, LogUtil.Phase.GETALL, "N/A");

    return apiIdsList;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

  //
  // Utility methods for logging
  //

  protected static ExchangeData createExchange(String apiId) {
    ExchangeData exchange = new ExchangeData();
    String provID = IDHelper.generateUID();
    String encodedApiID = IDHelper.encode(apiId);

    exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID.toString(), apiId);
    exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID_ENCODED.toString(), encodedApiID);
    exchange.getProperties().put(ExchangeConstantKeys.E3_PROVISION_ID.toString(), provID);

    return exchange;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

    return exchange;
  }

  protected static ExchangeData createExchange(Api api) {
    ExchangeData exchange = new ExchangeData();

    String provID = IDHelper.generateUID();

    String encodedApiID = null;
    String apiID = api.getId();
    if (apiID != null) {
      exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID_CREATION_MODE.toString(), ExchangeConstantKeys.E3_API_ID_CREATION_MODE_PROVIDED.toString());
      encodedApiID = IDHelper.encode(apiID);

      if (LOG.isDebugEnabled())
        LOG.debug("Found API ID: {}", apiID);

    } else {
      apiID = IDHelper.generateUID();
      encodedApiID = IDHelper.encode(apiID);

      api.setId(apiID);

      exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID_CREATION_MODE.toString(), ExchangeConstantKeys.E3_API_ID_CREATION_MODE_GENERATED.toString());

      if (LOG.isDebugEnabled())
        LOG.debug("Generating API ID is set to: {}", apiID);

    }

    exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID.toString(), api.getId());
    exchange.getProperties().put(ExchangeConstantKeys.E3_API_ID_ENCODED.toString(), encodedApiID);
    exchange.getProperties().put(ExchangeConstantKeys.E3_REQUEST_PAYLOAD.toString(), api);
    exchange.getProperties().put(ExchangeConstantKeys.E3_PROVISION_ID.toString(), provID);

    return exchange;
  }
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

      ((DataManager) apiService.getDataManager()).deployApi(api.getId(), oldJar);

      // mock deploymentManager scenario
      apiService.setDeploymentManager(new MockDeploymentManager.DeployKO());

      ExchangeData exchange = ApiService.createExchange(api);
      apiService.deployApi(api, exchange);

    } catch (RollbackException e) {
      assertEquals(ApplicationCodeConstants.ROLLBACK_FAILED, e.getErrorCode());
View Full Code Here

Examples of com.alu.e3.prov.restapi.ExchangeData

      byte[] oldJar = new byte[] { 0, 1 };     
      ((DataManager) apiService.getDataManager()).deployApi(api.getId(), oldJar);

      apiService.setDeploymentManager(new MockDeploymentManager.FirstDeployKoSecondDeployOkUndeployKo());

      ExchangeData exchange = ApiService.createExchange(api);
      apiService.deployApi(api, exchange);

    } catch (ProvisionException e) {
      assertEquals(1, e.getErrorCode());
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.