/**
  * Remove a version from the local repository
  *
  * @param version to remove
  */
 public void removeVersion(final SoftwareVersion version) throws LocalRepositoryException {
   final String prefix = "removeVersion=" + version + ": ";
   _log.debug(prefix);
   final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_REMOVE, version.toString()};
   exec(prefix, cmd);
   _log.info(prefix + "Success!");
 }
 /**
  * Change the bootloader default to the new version and reboot.
  *
  * @param version - the new target version
  */
 public void setCurrentVersion(final SoftwareVersion version) throws LocalRepositoryException {
   final String prefix = "setCurrentVersion(): to=" + version + ": ";
   _log.debug(prefix);
   final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_SET_DEFAULT, version.toString()};
   exec(prefix, cmd);
   _log.info(prefix + "Success");
 }
  /**
   * write given ipsec state to local file system.
   *
   * @param ipsecStatus
   * @throws LocalRepositoryException
   */
  public void syncIpsecStatusToLocal(String ipsecStatus) throws LocalRepositoryException {
    final String prefix = "syncIpsecStateToLocal(): ";
    _log.debug(prefix);

    final String[] cmd = {_IPSECTOOL_CMD, IPSEC_SYNC_STATUS, ipsecStatus};
    exec(prefix, cmd);
    _log.info(prefix + "Success!");
  }
  /** * Use current zk snapshot as base for future operations */
  public void rebaseZkSnapshot() throws LocalRepositoryException {
    final String prefix = "rebase zk snapshot()";
    _log.debug(prefix);

    final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_REBASE_ZK_SNAPSHOT};
    exec(prefix, cmd);
    _log.info(prefix + " Success");
  }
  /** * Purge old data revisions from local */
  public void purgeDataRevision() throws LocalRepositoryException {
    final String prefix = "purgeDataRevision(): ";
    _log.debug(prefix);

    final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_PURGE_DATA_REVISION};
    exec(prefix, cmd);
    _log.info(prefix + " Success");
  }
  /**
   * * Update SSL property
   *
   * @param state
   * @throws LocalRepositoryException
   */
  public void setSslPropertyInfo(PropertyInfoExt state) throws LocalRepositoryException {
    final String prefix = "setSslPropertyInfo(): to=" + state;
    _log.debug(prefix);

    final Path tmpFilePath = FileSystems.getDefault().getPath(SSL_PROPERTY_TMP);
    createTmpFile(tmpFilePath, state.toString(false), prefix);

    try {
      final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_SET_SSL_PROPS, SSL_PROPERTY_TMP};
      exec(prefix, cmd);
      _log.info(prefix + "Success");
    } finally {
      cleanupTmpFile(tmpFilePath);
    }
  }
  /**
   * * Update property
   *
   * @param state
   * @throws LocalRepositoryException
   */
  public void setOverrideProperties(PropertyInfoExt state) throws LocalRepositoryException {
    final String prefix = "setOverrideProperties(): to=" + state;
    _log.debug(prefix);

    final Path tmpFilePath = FileSystems.getDefault().getPath(TMP_CONFIG_USER_CHANGED_PROPS_PATH);
    createTmpFile(tmpFilePath, state.toString(false), prefix);

    try {
      final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_SET_OPROPS, TMP_CONFIG_USER_CHANGED_PROPS_PATH};
      exec(prefix, cmd);
      _log.info(prefix + "Success");
    } finally {
      cleanupTmpFile(tmpFilePath);
    }
  }
  /**
   * * Update data revision properties to local
   *
   * @param localRevisionProps
   * @throws LocalRepositoryException
   */
  public void setDataRevisionPropertyInfo(PropertyInfoExt localRevisionProps)
      throws LocalRepositoryException {
    final String prefix =
        String.format("setDataRevisionPropertyInfo(): to=%s ", localRevisionProps);
    _log.debug(prefix);

    final Path tmpFilePath = FileSystems.getDefault().getPath(DATA_REVISION_TMP);
    createTmpFile(tmpFilePath, localRevisionProps.toString(false), prefix);

    try {
      final String[] cmd = {_SYSTOOL_CMD, _SYSTOOL_SET_DATA_REVISION, DATA_REVISION_TMP};
      exec(prefix, cmd);
      _log.info(prefix + " Success");
    } finally {
      cleanupTmpFile(tmpFilePath);
    }
  }