--- /dev/null
+package jalview.ext.cipres;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.ngbw.directclient.CiApplication;
+import org.ngbw.directclient.CiClient;
+
+public class TreeJob
+{
+
+ private final CiClient cipresClient;
+
+ private final CiApplication app = CiApplication.getInstance();
+
+ private Map<String, Collection<String>> vParams = new HashMap<>();
+
+ private Map<String, String> inputParams = new HashMap<>();
+
+ private Map<String, String> metadata = new HashMap<>();
+
+ public TreeJob()
+ {
+ cipresClient = new CiClient(
+ app.getAppKey(), app.getUsername(), app.getPassword(),
+ app.getRestUrl()
+ );
+
+ }
+
+ public TreeJob(String alignmentFilePath)
+ {
+ cipresClient = new CiClient(
+ app.getAppKey(), app.getUsername(), app.getPassword(),
+ app.getRestUrl()
+ );
+ inputParams.put("infile_", alignmentFilePath);
+ }
+
+ /**
+ * Specifies a parameter about the input data for a CIPRES job with its value,
+ * for example the "infile_" parameter for the MSA file to calculate a tree
+ * from with file path as value.
+ *
+ * @param parameter
+ * @param value
+ */
+ public void addInputParameter(String parameter, String value)
+ {
+ inputParams.put(parameter, value);
+
+ }
+
+ /**
+ * Adds a CIPRES tool parameter that specifies job behaviour, for example
+ * "runtime_" with the maximum runtime (in hours) as value.
+ *
+ * @param parameter
+ * @param values
+ */
+ public void addToolParameters(String parameter, Collection<String> values)
+ {
+ vParams.put(parameter, values);
+ }
+
+ /**
+ * Adds a metadata tag to the job, for example "clientJobName" with the name
+ * that this job should be referred by as value. CIPRES highly recommends all
+ * jobs are given a clientJobId metadata header.
+ *
+ * @param metadataHeader
+ * @param value
+ */
+ public void addMetadata(String metadataHeader, String value)
+ {
+ metadata.put(metadataHeader, value);
+ }
+
+ public void clearAllParameters()
+ {
+ vParams.clear();
+ inputParams.clear();
+ metadata.clear();
+ }
+
+ public void clearInputParameters()
+ {
+ inputParams.clear();
+ }
+
+ public void clearToolsParameters()
+ {
+ vParams.clear();
+ }
+
+ public void clearMetadata()
+ {
+ metadata.clear();
+ }
+
+
+
+}