/** Default constructor. */
  public WAProjectWizard() {
    setWindowTitle(Messages.pWizWindowTitle);
    String zipFile = "";
    try {
      zipFile =
          String.format(
              "%s%s%s%s%s",
              PluginUtil.pluginFolder,
              File.separator,
              Messages.pluginId,
              File.separator,
              Messages.starterKitFileName);

      // Extract the WAStarterKitForJava.zip to temp dir
      waProjMgr = WindowsAzureProjectManager.create(zipFile);
      //	By deafult - disabling remote access
      //  when creating new project
      waProjMgr.setRemoteAccessAllRoles(false);
      waProjMgr.setClassPathInPackage("azure.lib.dir", PluginUtil.getAzureLibLocation());
      waRole = waProjMgr.getRoles().get(0);
      // remove http endpoint
      WindowsAzureEndpoint endpoint = waRole.getEndpoint(Messages.httpEp);
      if (endpoint != null) {
        endpoint.delete();
      }
    } catch (IOException e) {
      PluginUtil.displayErrorDialogAndLog(
          this.getShell(), Messages.pWizErrTitle, Messages.pWizErrMsg, e);
    } catch (Exception e) {
      errorTitle = Messages.adRolErrTitle;
      errorMessage = Messages.pWizErrMsgBox1 + Messages.pWizErrMsgBox2;
      PluginUtil.displayErrorDialogAndLog(this.getShell(), errorTitle, errorMessage, e);
    }
  }
  public static WindowsAzureRole configureKeyFeatures(
      WindowsAzureRole role, Map<String, Boolean> ftrMap) throws Exception {
    try {
      // Enable Key features
      // Session Affinity
      if (ftrMap.get("ssnAffChecked")) {
        WindowsAzureEndpoint httpEndPt = role.getEndpoint(httpEp);
        if (httpEndPt == null) {
          /*
           * server is not enabled.
           * hence create new endpoint
           * for session affinity.
           */
          if (role.isValidEndpoint(
              httpEp, WindowsAzureEndpointType.Input, HTTP_PRV_PORT, HTTP_PORT)) {
            httpEndPt =
                role.addEndpoint(httpEp, WindowsAzureEndpointType.Input, HTTP_PRV_PORT, HTTP_PORT);
          }
        }
        if (httpEndPt != null) {
          role.setSessionAffinityInputEndpoint(httpEndPt);
        }
      }

      // Caching
      if (ftrMap.get("cacheChecked")) {
        role.setCacheMemoryPercent(CACH_DFLTVAL);
        role.setCacheStorageAccountName(dashAuto);
      }

      // Remote Debugging
      if (ftrMap.get("debugChecked")) {
        if (role.isValidEndpoint(dbgEp, WindowsAzureEndpointType.Input, DEBUG_PORT, DEBUG_PORT)) {
          WindowsAzureEndpoint dbgEndPt =
              role.addEndpoint(dbgEp, WindowsAzureEndpointType.Input, DEBUG_PORT, DEBUG_PORT);
          if (dbgEndPt != null) {
            role.setDebuggingEndpoint(dbgEndPt);
            role.setStartSuspended(false);
          }
        }
      }

    } catch (Exception e) {
      throw new Exception(e.getMessage(), e);
    }
    return role;
  }