Package com.alu.e3.installer.model

Examples of com.alu.e3.installer.model.Configuration


    if(allowedHttpMethods==null || allowedHttpMethods.isEmpty())
      return;

    Object methodheader = exchange.getIn().getHeader(Exchange.HTTP_METHOD);
    if(methodheader == null){
      throw new GatewayException(GatewayExceptionCode.HTTP_METHOD, "No HTTP Method");
    }
   
    for(String m : allowedHttpMethods){
      if(m.equals(methodheader.toString().toLowerCase())){
        return;
      }
    }
   
    throw new GatewayException(GatewayExceptionCode.HTTP_METHOD, "Method "+methodheader.toString()+" not allowed");
  }
View Full Code Here


    this.apiId = apiId;
  }

  @Override
  public Producer createProducer() throws Exception {
    return new IpWhiteListProducer(this, dataManager, apiId);
  }
View Full Code Here

  {
    ServletContextHandler context = new ServletContextHandler(server, "/",
        ServletContextHandler.NO_SECURITY | ServletContextHandler.NO_SESSIONS);
    context.setConnectorNames(new String[] {connector.getName()});

    DispatchingContinuationServlet servlet = new DispatchingContinuationServlet();
    servlet.setDispatcher(new TreeDispatcher<HttpConsumer>());
    Long timeout = endpoint.getContinuationTimeout() != null ? endpoint
        .getContinuationTimeout() : getContinuationTimeout();
    if (timeout != null) {
      servlet.setContinuationTimeout(timeout);
    }

    ServletHolder holder = new ServletHolder();
    holder.setServlet(servlet);
    context.addServlet(holder, "/*");
 
View Full Code Here

    assertEquals(3, configurations.size());
    assertNotNull(configurations.get("E3ManagerMaster"));
    assertNotNull(configurations.get("E3ManagerSlave"));
    assertNotNull(configurations.get("E3Gateway"));
   
    Configuration cfg = null;
   
    // E3Manager Master dummy configurations
    List<Configuration> e3MgrMstrConfigs = configurations.get("E3ManagerMaster");
    assertEquals(2, e3MgrMstrConfigs.size());
   
    cfg = e3MgrMstrConfigs.get(0);
    assertNotNull(null, cfg.getName());
    assertEquals("file:///tmp/E3.zip", cfg.getPackageUrl());
    assertEquals("bin/install.sh manager-master", cfg.getInstallerCmd());
    assertEquals("bin/sanitycheck.sh manager", cfg.getSanityCheckCmd());
   
    cfg = e3MgrMstrConfigs.get(1);
    assertNotNull(null, cfg.getName());
    assertEquals("file:///tmp/E3ManagerAddOn.zip", cfg.getPackageUrl());
    assertEquals("bin/install.sh", cfg.getInstallerCmd());
    assertEquals("bin/sanitycheck.sh", cfg.getSanityCheckCmd());

    // E3Manager Slave dummy configurations
    List<Configuration> e3MgrSlaveConfigs = configurations.get("E3ManagerSlave");
    cfg = e3MgrSlaveConfigs.get(0);
    assertNotNull(null, cfg.getName());
    assertEquals("file:///tmp/E3.zip", cfg.getPackageUrl());
    assertEquals("bin/install.sh manager-slave", cfg.getInstallerCmd());
    assertEquals("bin/sanitycheck.sh manager", cfg.getSanityCheckCmd());
   
    // E3Gateway dummy configurations
    List<Configuration> e3GtwConfigs = configurations.get("E3Gateway");
    cfg = e3GtwConfigs.get(0);
    assertNotNull(null, cfg.getName());
    assertEquals("file:///tmp/E3.zip", cfg.getPackageUrl());
    assertEquals("bin/install.sh gateway", cfg.getInstallerCmd());
    assertEquals("bin/sanitycheck.sh gateway", cfg.getSanityCheckCmd());
   
  }
View Full Code Here

      }
      for(int i = 0; i < nodes.getLength(); i++)
      {
        Element el = (Element) nodes.item(i);

        Configuration config = new Configuration();
        config.setPackageUrl(el.getAttribute("packageURL"));
        config.setInstallerCmd(el.getAttribute("installerCmd"));
        config.setSanityCheckCmd(el.getAttribute("sanityCheckCmd"));
        config.setGenerateNatureCmd(el.getAttribute("generateNatureCmd"));
        config.setType(el.getAttribute("type"));
        config.setName(el.getAttribute("name"));
        config.setVersion(el.getAttribute("version"));
       
        // stores this new configuration in the configuration map to be returned
        storeConfiguration(configurations, config);
       
        if(logger.isDebugEnabled()) {
          logger.debug(config.toString());
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here

    if (LOG.isDebugEnabled())
      LOG.debug("Update API ID: {}", apiId);

    // check API ID same in Pay-load/URL
    if (api == null || api.getId() == null)
      throw new WebApplicationException(new ProvisionException(ApplicationCodeConstants.API_ID_NOT_PROVIDED, "API ID missing in the body for Update operation"));

    if (!api.getId().equals(apiId))
      throw new WebApplicationException(new ProvisionException(ApplicationCodeConstants.API_ID_MISMATCH, "API ID not the same in URL vs Body for Update operation: +" + apiId + "/" + apiId));

    Action action = new Action() {
      protected Object doAction(Object... params) {
        try {
          apiService.update(api);
View Full Code Here

    Action action = new Action() {

      protected Object doAction(Object... params) {
        try {
          Api api = apiService.get(apiId);
          return new ApiResponse(ApiResponse.SUCCESS, api);

        } catch (ProvisionException e) {
          throw new WebApplicationException(e);
        }
View Full Code Here

    provisionData.setValidation(fromDataModel(api.getValidation()));
    provisionData.setHeaderTransEnabled(api.getHeaderTransEnabled());
    provisionData.setInternal(api.getInternal());
   
    ApiProxySettings proxySettings = null;
   
    if(api.isUseGlobalProxy()){
      proxySettings = new ApiProxySettings();
      proxySettings.setGlobalProxy(new ApiProxySettings.GlobalProxy());
    }else if(api.getForwardProxy() != null){
      proxySettings = new ApiProxySettings();
      proxySettings.setLocalProxy(fromDataModel(api.getForwardProxy()));
    }
    provisionData.setProxySettings(proxySettings);
   
    return provisionData;
  }
View Full Code Here

        try {
          apiService.create(api);
        } catch (ProvisionException e) {
          throw new WebApplicationException(e);
        }
        return new ApiResponse(ApiResponse.SUCCESS, api.getId());
      }
    };

    return execute(action, (Object) null);
   
View Full Code Here

    Action action = new Action() {
      protected Object doAction(Object... params) {
        try {
          apiService.update(api);
          return new ApiResponse(ApiResponse.SUCCESS, apiId);

        } catch (ProvisionException e) {
          throw new WebApplicationException(e);
        }
      }
View Full Code Here

TOP

Related Classes of com.alu.e3.installer.model.Configuration

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.