コード例 #1
0
  /*
   * Save contents from selected cluster to Configuration object
   */
  private String saveClusterConfig() {
    String err = null;
    log.debug("Before saving config {}", config.toString());
    if (selectedConfig != null) {
      log.debug("Selected cluster {} configuration {}", selectedCluster, selectedConfig.toString());

      // save node id from selection in ECS case; in re-config case, save it from local config
      if (!isReConfig()) {
        if (nodeId == null) {
          err = InstallerConstants.CLUSTER_CONFIG_WARN_MSG;
          return err;
        }
        log.debug("This is ECS case, save node id '{}' from selection.", nodeId);
        config.setNodeId(nodeId);
      } else {
        log.debug(
            "This is re-config case, save id '{}' from local config.", localConfig.getNodeId());
        config.setNodeId(localConfig.getNodeId());
      }
      config.setNodeCount(selectedConfig.getNodeCount());
      config.getHwConfig().putAll(selectedConfig.getHwConfig());

      // clear network setting before putting new ones (node count may
      // changed)
      config.getNetworkIpv4Config().clear();
      config.getNetworkIpv6Config().clear();
      config.getNetworkIpv4Config().putAll(selectedConfig.getNetworkIpv4Config());
      config.getNetworkIpv6Config().putAll(selectedConfig.getNetworkIpv6Config());
      log.info("Saved config {}", config.toString());
    }
    return err;
  }
コード例 #2
0
 /*
  * Get the Configuration of selected cluster. Set the node id list based on
  * the nodes already been taken.
  * @param selectedCluster
  *        selected cluster label from GUI (e.g. "10.247.101.174 [2+1 (3 servers)]")
  */
 private void getConfiguration(String selectedCluster) {
   List<String> nodes = new ArrayList<String>();
   for (Configuration c : availabelClusters) {
     String selectedClusterVip =
         selectedCluster.split(InstallerConstants.CLUSTER_LABEL_DELIMITER)[0];
     if (selectedClusterVip.equals(c.getNetworkVip())) {
       nodes.add(c.getNodeId());
       selectedConfig = c;
     }
   }
   if (!isReConfig()) {
     resetVisibility();
     resetEnableDisable(nodes);
   }
 }