Package org.apache.stratos.adc.mgt.dao

Examples of org.apache.stratos.adc.mgt.dao.DataCartridge


        repo.setRepoName(resultSet.getString("REPO_NAME"));
        cartridge.setRepository(repo);
        cartridge.setHostName(resultSet.getString("HOSTNAME"));
        int dataCartridgeId = resultSet.getInt("DATA_CARTRIDGE_ID");
        if (dataCartridgeId != 0) {
          DataCartridge dataCartridge = new DataCartridge();
          dataCartridge.setDataCartridgeType(resultSet.getString("TYPE"));
          dataCartridge.setPassword(resultSet.getString("PASSWORD"));
          dataCartridge.setUserName(resultSet.getString("USER_NAME"));
          cartridge.setDataCartridge(dataCartridge);
        }
        subscribedCartridgeList.add(cartridge);
      }
    } catch (Exception s) {
View Full Code Here


      cartridgeSubscription.setRepository(repo);
    }

    int dataCartridgeId = resultSet.getInt("DATA_CARTRIDGE_ID");
    if (dataCartridgeId != 0) {
      DataCartridge dataCartridge = new DataCartridge();
      dataCartridge.setDataCartridgeType(resultSet.getString("TYPE"));
      dataCartridge.setPassword(resultSet.getString("PASSWORD"));
      dataCartridge.setUserName(resultSet.getString("USER_NAME"));
      cartridgeSubscription.setDataCartridge(dataCartridge);
    }
    cartridgeSubscription.setPortMappings(getPortMappings(resultSet.getInt("SUBSCRIPTION_ID")));
    cartridgeSubscription.setTenantId(resultSet.getInt("TENANT_ID"));
    cartridgeSubscription.setState(resultSet.getString("STATE"));
View Full Code Here

        String mgtClusterDomain = "";
        String mgtClusterSubDomain = CartridgeConstants.DEFAULT_MGT_SUBDOMAIN;
        CartridgeSubscription subscription = null;
        String mysqlPassword = null;
        Repository repository = null;
        DataCartridge dataCartridge = null;
        String cartName = (alias != null && alias.trim().length() > 0) ? alias : cartridgeType;
        String payloadZipFileName = "/tmp/" + UUID.randomUUID().toString() + ".zip";

    log.info("Subscribing tenant [" + tenantId + "] with username [" + username + "] Cartridge Alias " + alias
        + ", Cartridge Type: " + cartridgeType + ", Repo URL: " + repoURL + ", Policy: " + policy);
   
    // Assign auto scaling only when necessary.
    // Muti-tenant cartridge may not need a policy.
    Policy autoScalingPolicy = null;
   
    CartridgeInfo cartridgeInfo;
    try {
      cartridgeInfo = getServiceClient().getCartridgeInfo(cartridgeType);
    } catch (UnregisteredCartridgeException e) {
      String message = cartridgeType
          + " is not a valid cartridge type. Please try again with a valid cartridge type.";
      log.error(message);
      throw e;
    } catch (Exception e) {
      String message = "Error getting info for " + cartridgeType;
      log.error(message, e);
      throw new ADCException(message, e);
    }

    validateCartridgeAlias(cartName, cartridgeType);
   

        if (cartridgeType.equals(CartridgeConstants.MYSQL_CARTRIDGE_NAME)) {
         
          autoScalingPolicy = PolicyHolder.getInstance().getDefaultPolicy();
         
          if (autoScalingPolicy == null) {
            throw new PolicyException("Could not load default auto-scaling policy.");
          }
          if (log.isDebugEnabled()) {
          log.debug("Selected Policy: " + new Gson().toJson(autoScalingPolicy));
        }
         
            dataCartridge = new DataCartridge();
            mysqlPassword = generatePassword();
            dataCartridge.setPassword(mysqlPassword);
            dataCartridge.setDataCartridgeType(cartridgeType);
            dataCartridge.setUserName(CartridgeConstants.MYSQL_DEFAULT_USER);
            clusterDomain = getDynamicClusterDomain(cartridgeType, cartName, cartridgeInfo);

            registerService(cartridgeType,
                    clusterDomain,
                    clusterSubDomain,
View Full Code Here

TOP

Related Classes of org.apache.stratos.adc.mgt.dao.DataCartridge

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.