Class XmlConfig

java.lang.Object
net.sf.basedb.opengrid.config.XmlConfig

public class XmlConfig extends Object
Helper class for reading cluster configuration settings from an XML file. Each cluster is configured in a <cluster> element. The following attributes are used to configure a ConnectionInfo instance: address (required) port (optional, defaults to: 22/SSH) fingerprint (required) user (required) password (optional, if not specified password authentication is disabled) The <key-file> child element can be used for private key authentication. The value should be the path to a file containing the private key. The 'type' attribute specifies the key type. If not specified, auto-detection will be attempted. The following attributes are supported: type ('OpenSSH', 'OpenSSHv1', 'PuTTY', 'PKCS5' or PKCS8') password (needed if the private key file is password protected) Child elements are used for creating a ClusterConfig instance: <job-folder> (required) <tmp-folder>, <tmp-folder-debug> (optional, defauls to ${TMPDIR}) <date-command> (optional, the command must return date+time in format 2016-11-25 14:18:27, defaults to: date +'%Y-%m-%d %T') <host-info-command> (optional) <opengrid-info-command> (optional) <job-agent-id> (optional) <nodes> (optional, should contain one or more <node name="..." /> child elements)
Since:
1.0
Author:
nicklas
  • Field Details

  • Constructor Details

    • XmlConfig

      public XmlConfig()
      Create a new configuration instance.
  • Method Details

    • readFromResource

      public void readFromResource(String path)
      Read cluster configuration from a resource on the class path.
    • getClusters

      public List<OpenGridCluster> getClusters()
      Get all clusters loaded so far.
    • readTextFile

      private String readTextFile(File f) throws IOException
      Throws:
      IOException