\r
import compbio.util.Util;\r
import compbio.util.annotation.Immutable;\r
+import compbio.engine.client.EngineUtil;\r
\r
@Immutable\r
public class ClusterJobId {\r
if (Util.isEmpty(jobId)) {\r
throw new NullPointerException("JobId must be provided!");\r
}\r
- if (compbio.engine.client.Util.isValidJobId(jobId)) {\r
- throw new IllegalArgumentException(\r
- "JobId is expected but taskid seems to be provided! "\r
- + jobId);\r
+ if (EngineUtil.isValidJobId(jobId)) {\r
+ throw new IllegalArgumentException("JobId is expected but taskid seems to be provided! " + jobId);\r
}\r
this.jobId = jobId;\r
}\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.PathValidator;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.cluster.drmaa.AsyncJobRunner;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.conf.DirectoryManager;\r
}\r
if (!PathValidator.isAbsolutePath(tmp_dir)) {\r
log.debug("local.tmp.directory path is relative! " + tmp_dir);\r
- tmp_dir = compbio.engine.client.Util.convertToAbsolute(tmp_dir);\r
+ tmp_dir = EngineUtil.convertToAbsolute(tmp_dir);\r
log.debug("local.tmp.directory path changed to absolute: " + tmp_dir);\r
}\r
return tmp_dir.trim();\r
if (Util.isEmpty(taskId)) {\r
throw new NullPointerException("TaskId must be provided!");\r
}\r
- if (!compbio.engine.client.Util.isValidJobId(taskId)) {\r
+ if (!EngineUtil.isValidJobId(taskId)) {\r
throw new InvalidParameterException("TaskId is not valid!");\r
}\r
return !taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX);\r
\r
public static String getWorkDirectory(String taskId) {\r
assert !compbio.util.Util.isEmpty(taskId);\r
- assert compbio.engine.client.Util.isValidJobId(taskId);\r
+ assert EngineUtil.isValidJobId(taskId);\r
log.info("Getting workdirectory for TaskID: " + taskId);\r
if (taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX)) {\r
return CLUSTER_WORK_DIRECTORY + File.separator + taskId;\r
import java.util.List;\r
\r
import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.util.annotation.Immutable;\r
\r
@Immutable\r
private final ConfiguredExecutable<?> cexecutable;\r
\r
public Job(String taskId, String jobId, ConfiguredExecutable<?> cexecutable) {\r
- if (!Util.isValidJobId(taskId)) {\r
+ if (!EngineUtil.isValidJobId(taskId)) {\r
throw new IllegalArgumentException("TaskId " + taskId\r
+ " is not valid!");\r
}\r
import org.apache.log4j.Logger;\r
\r
import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.EngineUtil;\r
\r
/**\r
* Submit jobs for execution\r
synchronized (submittedTasks) {\r
assert executable != null;\r
String taskId = executable.getTaskId();\r
- assert compbio.engine.client.Util.isValidJobId(taskId);\r
+ assert EngineUtil.isValidJobId(taskId);\r
submittedTasks.remove(taskId);\r
}\r
}\r
\r
public static void removeTask(String key) {\r
synchronized (submittedTasks) {\r
- if (compbio.engine.client.Util.isValidJobId(key)) {\r
+ if (EngineUtil.isValidJobId(key)) {\r
submittedTasks.remove(key);\r
} else {\r
log.error("Invalid key is given! " + key);\r
@Override\r
public String getCommand(ExecProvider provider)\r
throws UnsupportedRuntimeException {\r
- String command = compbio.engine.client.Util.getCommand(provider,\r
- exec.getClass());\r
+ String command = EngineUtil.getCommand(provider, exec.getClass());\r
if (Util.isEmpty(command)) {\r
throw new UnsupportedRuntimeException(\r
"Executable "\r
\r
@Override\r
public ExecProvider getSupportedRuntimes() {\r
- return compbio.engine.client.Util.getSupportedRuntimes(exec.getClass());\r
+ return EngineUtil.getSupportedRuntimes(exec.getClass());\r
}\r
\r
@Override\r
List<String> getFullPath(List<String> fileNames) {\r
List<String> files = new ArrayList<String>();\r
for (String fileName : fileNames) {\r
- files.add(compbio.engine.client.Util.getFullPath(workDirectory,\r
- fileName));\r
+ files.add(EngineUtil.getFullPath(workDirectory, fileName));\r
}\r
return files;\r
}\r
if (PathValidator.isAbsolutePath(path)) {\r
return path;\r
}\r
- return compbio.engine.client.Util.getFullPath(workDirectory, path);\r
+ return EngineUtil.getFullPath(workDirectory, path);\r
}\r
\r
@Override\r
import compbio.util.PropertyHelper;\r
import compbio.util.SysPrefs;\r
\r
-public final class Util {\r
+public final class EngineUtil {\r
\r
private static final PropertyHelper ph = PropertyHelperManager\r
.getPropertyHelper();\r
\r
- private static final Logger log = Logger.getLogger(Util.class);\r
+ private static final Logger log = Logger.getLogger(EngineUtil.class);\r
\r
public static boolean isValidJobId(final String key) {\r
if (compbio.util.Util.isEmpty(key)) {\r
String absolute = relativePath;\r
if (!PathValidator.isAbsolutePath(relativePath)) {\r
absolute = PropertyHelperManager.getLocalPath() + relativePath;\r
- Util.log.trace("Changing local path in enviromental variable to absolute: FROM "\r
+ EngineUtil.log.trace("Changing local path in enviromental variable to absolute: FROM "\r
+ relativePath + " TO " + absolute);\r
}\r
return absolute;\r
public static String getExecProperty(String propertySpec, Executable<?> exec) {\r
assert !compbio.util.Util.isEmpty(propertySpec);\r
assert exec != null;\r
- return Util.getExecProperty(propertySpec, exec.getClass());\r
+ return EngineUtil.getExecProperty(propertySpec, exec.getClass());\r
}\r
\r
public static String getExecProperty(String propertySpec, Class<?> clazz) {\r
try {\r
limits = ConfExecutable.getRunnerLimits(clazz);\r
} catch (FileNotFoundException e) {\r
- Util.log.warn("No limits are found for " + clazz + " executable! "\r
+ EngineUtil.log.warn("No limits are found for " + clazz + " executable! "\r
+ e.getLocalizedMessage(), e.getCause());\r
// its ok, limit may not be initialized\r
} catch (IOException e) {\r
- Util.log.warn("IO exception while attempting to read limits for "\r
+ EngineUtil.log.warn("IO exception while attempting to read limits for "\r
+ clazz + " executable! " + e.getLocalizedMessage(),\r
e.getCause());\r
}\r
\r
package compbio.engine.client;\r
\r
-import java.util.Arrays;\r
import java.util.Collections;\r
import java.util.Map;\r
\r
return property.contains(PROP_NAME_VALUE_SEPARATOR);\r
}\r
\r
-\r
-\r
/*\r
* This is a horrible hack, but it only requires to simplify configuration\r
* for users, could be removed at any time if proved to be a burden to\r
if (varName.equalsIgnoreCase(mafft_binaries)\r
|| varName.equalsIgnoreCase(fasta4mafft)\r
|| varName.equalsIgnoreCase(iupred_path)) {\r
- varValue = compbio.engine.client.Util\r
- .convertToAbsolute(varValue);\r
+ varValue = EngineUtil.convertToAbsolute(varValue);\r
}\r
}\r
vars.put(varName, varValue);\r
if (command.value == null) {\r
continue;\r
}\r
- String propertyPath = compbio.engine.client.Util.getExecProperty(\r
- command.name + ".path", getType());\r
+ String propertyPath = EngineUtil.getExecProperty(command.name + ".path", getType());\r
if (Util.isEmpty(propertyPath)) {\r
continue;\r
}\r
// necessary\r
continue;\r
}\r
- String absMatrixPath = compbio.engine.client.Util.convertToAbsolute(propertyPath);\r
+ String absMatrixPath = EngineUtil.convertToAbsolute(propertyPath);\r
command.value = absMatrixPath + File.separator + command.value;\r
cbuilder.setParam(command);\r
}\r
public LimitsManager<T> getLimits() {\r
synchronized (SkeletalExecutable.class) {\r
if (limits == null) {\r
- limits = compbio.engine.client.Util.getLimits(this.getType());\r
+ limits = EngineUtil.getLimits(this.getType());\r
}\r
}\r
return limits;\r
import compbio.engine.Cleaner;\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
@Override\r
public boolean cancelJob(String jobId) {\r
ClusterSession clustSession = ClusterSession.getInstance();\r
- return compbio.engine.cluster.drmaa.ClusterUtil.cancelJob(jobId,\r
+ return compbio.engine.cluster.drmaa.ClusterEngineUtil.cancelJob(jobId,\r
clustSession);\r
}\r
\r
public ConfiguredExecutable<?> getResults(String jobId)\r
throws ResultNotAvailableException {\r
\r
- assert Util.isValidJobId(jobId);\r
+ assert EngineUtil.isValidJobId(jobId);\r
\r
ClusterSession csession = ClusterSession.getInstance();\r
ConfiguredExecutable<?> exec;\r
import org.ggf.drmaa.Session;\r
\r
import compbio.engine.Configurator;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.JobExecutionException;\r
import compbio.metadata.JobStatus;\r
\r
-public class ClusterUtil {\r
+public class ClusterEngineUtil {\r
\r
- private static final Logger log = Logger.getLogger(ClusterUtil.class);\r
+ private static final Logger log = Logger.getLogger(ClusterEngineUtil.class);\r
\r
- public static final NumberFormat CLUSTER_STAT_IN_SEC = NumberFormat\r
- .getInstance();\r
+ public static final NumberFormat CLUSTER_STAT_IN_SEC = NumberFormat.getInstance();\r
\r
static {\r
CLUSTER_STAT_IN_SEC.setMinimumFractionDigits(4);\r
\r
public static final boolean cancelJob(final String jobId,\r
ClusterSession csession) {\r
- assert Util.isValidJobId(jobId);\r
+ assert EngineUtil.isValidJobId(jobId);\r
boolean cancelled = true;\r
Session session = csession.getSession();\r
try {\r
log.info("Job " + jobId + " is successfully cancelled");\r
- compbio.engine.client.Util.writeMarker(Configurator.getWorkDirectory(jobId),\r
- JobStatus.CANCELLED);\r
- session.control(ClusterSession.getClusterJobId(jobId).getJobId(),\r
- Session.TERMINATE);\r
+ EngineUtil.writeMarker(Configurator.getWorkDirectory(jobId), JobStatus.CANCELLED);\r
+ session.control(ClusterSession.getClusterJobId(jobId).getJobId(), Session.TERMINATE);\r
} catch (DrmaaException e) {\r
// Log silently\r
log.error("Job " + jobId + " cancellation failed!");\r
log.error("Cause: " + e.getLocalizedMessage(), e.getCause());\r
cancelled = false;\r
} catch (IOException e) {\r
- log.error(\r
- "Could not read JOBID file to determine cluster jobid for taskid: "\r
- + jobId + " Message: " + e.getLocalizedMessage(), e\r
- .getCause());\r
+ log.error("Could not read JOBID file to determine cluster jobid for taskid: "\r
+ + jobId + " Message: " + e.getLocalizedMessage(), e.getCause());\r
} finally {\r
- log\r
- .trace("Job "\r
- + jobId\r
- + " has been successfully removed from the cluster engine job list");\r
+ log.trace("Job " + jobId + " has been successfully removed from the cluster engine job list");\r
csession.removeJob(jobId);\r
}\r
return cancelled;\r
public static final JobInfo waitForResult(ClusterSession csession,\r
String jobId) throws JobExecutionException {\r
JobInfo jinfo = null;\r
- assert Util.isValidJobId(jobId);\r
+ assert EngineUtil.isValidJobId(jobId);\r
try {\r
jinfo = csession.waitForJob(jobId);\r
} catch (DrmaaException e) {\r
\r
import compbio.engine.ClusterJobId;\r
import compbio.engine.Job;\r
+import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.PathValidator;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.conf.PropertyHelperManager;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.ResultNotAvailableException;\r
+ taskDirectory;\r
assert !Util.isEmpty(jobId);\r
\r
- compbio.engine.client.Util.writeStatFile(executable.getWorkDirectory(),\r
- JobStatus.SUBMITTED.toString());\r
- compbio.engine.client.Util.writeFile(executable.getWorkDirectory(),\r
- JOBID, jobId, false);\r
+ EngineUtil.writeStatFile(executable.getWorkDirectory(), JobStatus.SUBMITTED.toString());\r
+ EngineUtil.writeFile(executable.getWorkDirectory(), JOBID, jobId, false);\r
log.debug("Adding taskId: " + taskDirectory + " to cluster job list");\r
- assert compbio.engine.client.Util.isValidJobId(taskDirectory);\r
+ assert EngineUtil.isValidJobId(taskDirectory);\r
jobs.add(new Job(taskDirectory, jobId, executable));\r
}\r
\r
public void removeJob(String taskId) {\r
assert !Util.isEmpty(taskId);\r
- assert compbio.engine.client.Util.isValidJobId(taskId);\r
+ assert EngineUtil.isValidJobId(taskId);\r
removeJobFromListbyTaskId(taskId);\r
}\r
\r
// Once the job has been waited for it will be finished\r
// Next time it will not be found in the session, so removed from the\r
// job list\r
- compbio.engine.client.Util.writeStatFile(\r
- compbio.engine.Configurator.getWorkDirectory(jobId),\r
- JobStatus.FINISHED.toString());\r
+ EngineUtil.writeStatFile(Configurator.getWorkDirectory(jobId), JobStatus.FINISHED.toString());\r
\r
return status;\r
}\r
public ConfiguredExecutable<?> getResults(String taskId)\r
throws DrmaaException, ResultNotAvailableException {\r
\r
- compbio.engine.client.Util.isValidJobId(taskId);\r
+ EngineUtil.isValidJobId(taskId);\r
try {\r
JobInfo status = waitForJob(taskId);\r
} catch (InvalidJobException e) {\r
// If task was not find in the list of jobs, than it must have been\r
// collected already\r
// Resurrect the job to find out there the output is\r
- exec = compbio.engine.client.Util.loadExecutable(taskId);\r
+ exec = EngineUtil.loadExecutable(taskId);\r
}\r
if (exec != null) {\r
- compbio.engine.client.Util.writeMarker(exec.getWorkDirectory(),\r
+ EngineUtil.writeMarker(exec.getWorkDirectory(),\r
JobStatus.COLLECTED);\r
}\r
return exec;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.PathValidator;\r
import compbio.engine.client.PipedExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.client.Executable.ExecProvider;\r
import compbio.metadata.JobExecutionException;\r
import compbio.metadata.JobStatus;\r
log.trace("Setting job environment to:" + env_variables);\r
Map<String, String> sysEnv = jobtempl.getJobEnvironment();\r
if (sysEnv != null && !sysEnv.isEmpty()) {\r
- Util.mergeEnvVariables(sysEnv, env_variables);\r
+ EngineUtil.mergeEnvVariables(sysEnv, env_variables);\r
} else {\r
sysEnv = env_variables;\r
}\r
ClusterJobId clusterJobId = ClusterSession.getClusterJobId(jobId);\r
switch (clustSession.getJobStatus(clusterJobId)) {\r
case Session.DONE:\r
- compbio.engine.client.Util.writeStatFile(Configurator.getWorkDirectory(jobId),\r
- JobStatus.FINISHED.toString());\r
-\r
+ EngineUtil.writeStatFile(Configurator.getWorkDirectory(jobId), JobStatus.FINISHED.toString());\r
return compbio.metadata.JobStatus.FINISHED;\r
- case Session.FAILED:\r
- compbio.engine.client.Util.writeMarker(Configurator.getWorkDirectory(jobId),\r
- JobStatus.FAILED);\r
\r
+ case Session.FAILED:\r
+ EngineUtil.writeMarker(Configurator.getWorkDirectory(jobId), JobStatus.FAILED);\r
return compbio.metadata.JobStatus.FAILED;\r
\r
case Session.RUNNING:\r
* cancelled, finished or failed.\r
*/\r
String workDir = Configurator.getWorkDirectory(jobId);\r
- if (Util.isMarked(workDir, JobStatus.FINISHED)\r
- || Util.isMarked(workDir, JobStatus.COLLECTED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.FINISHED)\r
+ || EngineUtil.isMarked(workDir, JobStatus.COLLECTED)) {\r
return JobStatus.FINISHED;\r
}\r
- if (Util.isMarked(workDir, JobStatus.CANCELLED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.CANCELLED)) {\r
return JobStatus.CANCELLED;\r
}\r
- if (Util.isMarked(workDir, JobStatus.FAILED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.FAILED)) {\r
return JobStatus.FAILED;\r
}\r
return JobStatus.UNDEFINED; \r
}\r
\r
JobInfo waitForJob(String jobId) throws JobExecutionException {\r
- assert Util.isValidJobId(jobId);\r
- return ClusterUtil.waitForResult(clustSession, jobId);\r
+ assert EngineUtil.isValidJobId(jobId);\r
+ return ClusterEngineUtil.waitForResult(clustSession, jobId);\r
}\r
\r
boolean cancelJob(String jobId) {\r
- assert Util.isValidJobId(jobId);\r
- return compbio.engine.cluster.drmaa.ClusterUtil.cancelJob(jobId,\r
+ assert EngineUtil.isValidJobId(jobId);\r
+ return compbio.engine.cluster.drmaa.ClusterEngineUtil.cancelJob(jobId,\r
clustSession);\r
}\r
\r
\r
import compbio.engine.client.ConfExecutable;\r
import compbio.engine.client.Executable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.util.Util;\r
\r
public class DirectoryManager {\r
}\r
\r
public static Class<Executable<?>> getClass(String taskId) {\r
- assert compbio.engine.client.Util.isValidJobId(taskId);\r
+ assert EngineUtil.isValidJobId(taskId);\r
String className = null;\r
if (taskId.startsWith(ConfExecutable.CLUSTER_TASK_ID_PREFIX)) {\r
className = taskId.substring(1, taskId.indexOf(DELIM));\r
try {\r
return (Class<Executable<?>>) Class.forName(className);\r
} catch (ClassNotFoundException e) {\r
- log.error(\r
- "Could not parse taskId " + taskId + " Message "\r
- + e.getLocalizedMessage(), e.getCause());\r
+ log.error("Could not parse taskId " + taskId + " Message " + e.getLocalizedMessage(), e.getCause());\r
}\r
return null;\r
}\r
import compbio.engine.Configurator;\r
import compbio.engine.SubmissionManager;\r
import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
@Override\r
public boolean cancelJob(String jobId) {\r
- Future<ConfiguredExecutable<?>> future = SubmissionManager\r
- .getTask(jobId);\r
+ Future<ConfiguredExecutable<?>> future = SubmissionManager.getTask(jobId);\r
// The job has already finished or cancelled.\r
if (future == null) {\r
log.debug("Did not find future for local job "\r
\r
@Override\r
public JobStatus getJobStatus(String jobId) {\r
- Future<ConfiguredExecutable<?>> future = SubmissionManager\r
- .getTask(jobId);\r
+ Future<ConfiguredExecutable<?>> future = SubmissionManager.getTask(jobId);\r
if (future == null) {\r
return LocalEngineUtil.getRecordedJobStatus(jobId);\r
}\r
Future<ConfiguredExecutable<?>> future = lrunner.getFuture();\r
\r
if (future == null) {\r
- throw new RuntimeException("Future is NULL for executable "\r
- + executable);\r
+ throw new RuntimeException("Future is NULL for executable " + executable);\r
}\r
SubmissionManager.addTask(executable, future);\r
return executable.getTaskId();\r
try {\r
cexec = future.get();\r
} catch (InterruptedException e) {\r
- log.error("Cannot clean up as calculation was not completed!"\r
- + e.getLocalizedMessage());\r
+ log.error("Cannot clean up as calculation was not completed!" + e.getLocalizedMessage());\r
} catch (ExecutionException e) {\r
- log.error("Cannot clean up due to ExecutionException "\r
- + e.getLocalizedMessage());\r
+ log.error("Cannot clean up due to ExecutionException " + e.getLocalizedMessage());\r
}\r
if (cexec == null) {\r
return false;\r
@Override\r
public ConfiguredExecutable<?> getResults(String taskId)\r
throws ResultNotAvailableException {\r
- if (!Util.isValidJobId(taskId)) {\r
+ if (!EngineUtil.isValidJobId(taskId)) {\r
// TODO should I be throwing something else?\r
throw new IllegalArgumentException(taskId);\r
}\r
// If task was not find in the list of jobs, than it must have been\r
// collected already\r
// Resurrect the job to find out there the output is\r
- ConfiguredExecutable<?> exec = compbio.engine.client.Util\r
- .loadExecutable(taskId);\r
+ ConfiguredExecutable<?> exec = EngineUtil.loadExecutable(taskId);\r
return exec;\r
}\r
return LocalEngineUtil.getResults(futureExec, taskId);\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.PathValidator;\r
import compbio.engine.client.PipedExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.client.Executable.ExecProvider;\r
import compbio.engine.local.StreamGobbler.OutputType;\r
import compbio.metadata.JobStatus;\r
pbuilder = new ProcessBuilder(params);\r
if (executable.getEnvironment() != null) {\r
log.debug("Setting command environment variables: " + pbuilder.environment());\r
- Util.mergeEnvVariables(pbuilder.environment(), executable.getEnvironment());\r
+ EngineUtil.mergeEnvVariables(pbuilder.environment(), executable.getEnvironment());\r
log.debug("Process environment:" + pbuilder.environment());\r
}\r
log.debug("Setting command: " + pbuilder.command());\r
\r
try {\r
log.info("Calculation started at " + System.nanoTime());\r
- Util.writeStatFile(confExec.getWorkDirectory(), JobStatus.STARTED.toString());\r
+ EngineUtil.writeStatFile(confExec.getWorkDirectory(), JobStatus.STARTED.toString());\r
proc = pbuilder.start();\r
\r
// store input command and program environment\r
// any error???\r
int exitVal = proc.waitFor();\r
log.info("Calculation completed at " + System.nanoTime());\r
- Util.writeStatFile(confExec.getWorkDirectory(), JobStatus.FINISHED.toString());\r
+ EngineUtil.writeStatFile(confExec.getWorkDirectory(), JobStatus.FINISHED.toString());\r
// Let streams to write for a little more\r
errorf.get(2, TimeUnit.SECONDS);\r
outputf.get(2, TimeUnit.SECONDS);\r
import compbio.engine.Configurator;\r
import compbio.engine.SubmissionManager;\r
import compbio.engine.client.ConfiguredExecutable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
\r
public static boolean cancelJob(Future<ConfiguredExecutable<?>> future,\r
String workDirectory) {\r
- compbio.engine.client.Util.writeMarker(workDirectory,\r
- JobStatus.CANCELLED);\r
+ EngineUtil.writeMarker(workDirectory, JobStatus.CANCELLED);\r
log.debug("Cancelling local job from work directory " + workDirectory);\r
return future.cancel(true);\r
}\r
// job has been removed from the task list\r
// but there may be status written to the disk\r
String workDir = Configurator.getWorkDirectory(jobId);\r
- if (Util.isMarked(workDir, JobStatus.FINISHED)\r
- || Util.isMarked(workDir, JobStatus.COLLECTED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.FINISHED)\r
+ || EngineUtil.isMarked(workDir, JobStatus.COLLECTED)) {\r
return JobStatus.FINISHED;\r
}\r
- if (Util.isMarked(workDir, JobStatus.CANCELLED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.CANCELLED)) {\r
return JobStatus.CANCELLED;\r
}\r
- if (Util.isMarked(workDir, JobStatus.FAILED)) {\r
+ if (EngineUtil.isMarked(workDir, JobStatus.FAILED)) {\r
return JobStatus.FAILED;\r
}\r
return JobStatus.UNDEFINED;\r
+ Configurator.getWorkDirectory(taskId)\r
+ " Job id is " + taskId);\r
}\r
- compbio.engine.client.Util.writeMarker(Configurator\r
- .getWorkDirectory(taskId), JobStatus.COLLECTED);\r
+ EngineUtil.writeMarker(Configurator.getWorkDirectory(taskId), JobStatus.COLLECTED);\r
} catch (InterruptedException e) {\r
// reassert threads interrupted status\r
Thread.currentThread().interrupt();\r
- compbio.engine.client.Util.writeMarker(Configurator\r
- .getWorkDirectory(taskId), JobStatus.FAILED);\r
+ EngineUtil.writeMarker(Configurator.getWorkDirectory(taskId), JobStatus.FAILED);\r
// Cancel the job\r
log.debug("Cancelling job due to Interruption");\r
future.cancel(true);\r
// this.cleanup(taskId);\r
} catch (ExecutionException e) {\r
// this.cleanup(taskId);\r
- compbio.engine.client.Util.writeMarker(Configurator\r
- .getWorkDirectory(taskId), JobStatus.FAILED);\r
- log.debug("Job execution exception: " + e.getLocalizedMessage(), e\r
- .getCause());\r
+ EngineUtil.writeMarker(Configurator .getWorkDirectory(taskId), JobStatus.FAILED);\r
+ log.debug("Job execution exception: " + e.getLocalizedMessage(), e.getCause());\r
// ExecutionException returned as thus Throwable needs unwrapping\r
LocalEngineUtil.launderThrowable(e.getCause());\r
} finally {\r
import compbio.engine.client.ConfExecutable;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.PresetManager;\r
import compbio.metadata.RunnerConfig;\r
\r
-public final class Util {\r
+public final class RunnerUtil {\r
\r
- public static Logger log = Logger.getLogger(Util.class);\r
+ public static Logger log = Logger.getLogger(RunnerUtil.class);\r
\r
public static synchronized <T> RunnerConfig<T> getSupportedOptions(\r
Class<? extends Executable<T>> clazz) {\r
throws UnknownFileFormatException, IOException, FileNotFoundException, NullPointerException {\r
assert !compbio.util.Util.isEmpty(workDirectory);\r
assert !compbio.util.Util.isEmpty(clustFile);\r
- File cfile = new File(compbio.engine.client.Util.getFullPath(workDirectory, clustFile));\r
+ File cfile = new File(EngineUtil.getFullPath(workDirectory, clustFile));\r
log.trace("CLUSTAL OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
if (!(cfile.exists() && cfile.length() > 0)) {\r
throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
FileNotFoundException, NullPointerException {\r
assert !compbio.util.Util.isEmpty(workDirectory);\r
assert !compbio.util.Util.isEmpty(clustFile);\r
- File cfile = new File(compbio.engine.client.Util.getFullPath(\r
- workDirectory, clustFile));\r
+ File cfile = new File(EngineUtil.getFullPath(workDirectory, clustFile));\r
log.trace("Jronn OUTPUT FILE PATH: " + cfile.getAbsolutePath());\r
if (!(cfile.exists() && cfile.length() > 0)) {\r
throw new FileNotFoundException("Result for the jobId " + workDirectory + " with file name " + clustFile + " is not found!");\r
assert !compbio.util.Util.isEmpty(workDirectory);\r
assert !compbio.util.Util.isEmpty(structFile);\r
// The stdout from RNAalifold\r
- File sFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, structFile));\r
+ File sFile = new File(EngineUtil.getFullPath( workDirectory, structFile));\r
// Base pair probability matrix (-p option)\r
- File aliFile = new File(compbio.engine.client.Util.getFullPath( workDirectory, "alifold.out"));\r
+ File aliFile = new File(EngineUtil.getFullPath( workDirectory, "alifold.out"));\r
// Check that stdout file exists\r
if(!(sFile.exists() && sFile.length() > 0)) {\r
throw new FileNotFoundException("Result for the jobId " + workDirectory + "with file name " + structFile + " is not found!");\r
import compbio.engine.client.CommandBuilder;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ResultNotAvailableException;\r
\r
/**\r
// no further actions is necessary\r
return settings;\r
}\r
- return compbio.engine.client.Util.convertToAbsolute(settings);\r
+ return EngineUtil.convertToAbsolute(settings);\r
}\r
\r
@Override\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
/**\r
* DisEMBL.py smooth_frame peak_frame join_frame fold_coils fold_hotloops\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
/**\r
* ./GlobPipe.py SmoothFrame DOMjoinFrame DOMpeakFrame DISjoinFrame DISpeakFrame\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.engine.client.EngineUtil;\r
\r
/**\r
* Command line\r
// no further actions is necessary\r
return settings;\r
}\r
- return compbio.engine.client.Util.convertToAbsolute(settings);\r
+ return EngineUtil.convertToAbsolute(settings);\r
}\r
\r
@Override\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.engine.client.Executable.ExecProvider;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public class ClustalO extends SkeletalExecutable<ClustalO> {\r
\r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.data.sequence.UnknownFileFormatException;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public class ClustalW extends SkeletalExecutable<ClustalW> {\r
\r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
/**\r
* \r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.data.sequence.UnknownFileFormatException;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public class Muscle extends SkeletalExecutable<Muscle> {\r
\r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public class Probcons extends SkeletalExecutable<Probcons>\r
implements\r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.engine.conf.PropertyHelperManager;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.util.PropertyHelper;\r
\r
public class Tcoffee extends SkeletalExecutable<Tcoffee>\r
public Alignment getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readClustalFile(workDirectory, getOutput());\r
+ return RunnerUtil.readClustalFile(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.engine.client.PipedExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public class RNAalifold extends SkeletalExecutable<RNAalifold> \r
implements PipedExecutable<RNAalifold> {\r
public RNAStructScoreManager getResults(String workDirectory)\r
throws ResultNotAvailableException {\r
try {\r
- return Util.readRNAStruct(workDirectory, getOutput());\r
+ return RunnerUtil.readRNAStruct(workDirectory, getOutput());\r
} catch (FileNotFoundException e) {\r
log.error(e.getMessage(), e.getCause());\r
throw new ResultNotAvailableException(e);\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.AllTestSuit;\r
import compbio.metadata.JobExecutionException;\r
import compbio.metadata.JobStatus;\r
status == JobStatus.PENDING || status == JobStatus.RUNNING);\r
JobInfo info = runner.getJobInfo();\r
\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.STARTED));\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
\r
ConfiguredExecutable<?> confExec = runner.waitForResult();\r
// At this point results are marked as collected\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
\r
assertNotNull("JobInfo is null", info);\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
.intValue();\r
assertEquals("Exit status is not 0", 0, exitsInt);\r
System.out.println(sm.getAllStats());\r
runner.cancelJob();\r
Thread.sleep(200); // give fs time to write a file\r
JobInfo info = runner.getJobInfo();\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.STARTED));\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
\r
} catch (JobSubmissionException e) {\r
\r
import org.testng.annotations.Test;\r
\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
\r
public class UtilTester {\r
\r
@Test\r
public void testParser() {\r
try {\r
- Number n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("11.0000");\r
+ Number n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.0000");\r
assertNotNull(n);\r
int t = n.intValue();\r
assertEquals(11, t);\r
- n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("11.2300");\r
+ n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("11.2300");\r
assertNotNull(n);\r
t = n.intValue();\r
assertEquals(11, t);\r
float f = n.floatValue();\r
assertEquals(11.23f, f);\r
- n = ClusterUtil.CLUSTER_STAT_IN_SEC.parse("0.0310");\r
+ n = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse("0.0310");\r
assertNotNull(n);\r
f = n.floatValue();\r
assertEquals(0.031f, f);\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.AllTestSuit;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
Executable<?> clustalr = lr.getResults(jobId);\r
assertNotNull(clustalr);\r
\r
- assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
- assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
JobStatus.STARTED));\r
- assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertTrue(Util.isMarked(confClustal1.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertFalse(Util.isMarked(confClustal1.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClustal1.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
} catch (JobSubmissionException e) {\r
e.printStackTrace();\r
assertNotNull(muscler);\r
Alignment al1 = muscler.getResults();\r
\r
- assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
JobStatus.STARTED));\r
- assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertTrue(Util.isMarked(muscler.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertFalse(Util.isMarked(muscler.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
- assertFalse(Util.isMarked(muscler.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(muscler.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
Alignment al2 = confMuscle.getResults();\r
assertNotNull(al1);\r
as.cancelJob(jobId);\r
assertTrue(as.getJobStatus(jobId) == JobStatus.CANCELLED);\r
\r
- assertTrue(Util.isMarked(confMuscle.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
// could be both\r
// assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
// Util.StatFileType.STARTED));\r
- assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertFalse(Util.isMarked(confMuscle.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confMuscle.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
// Executable<?> muscler = as.getResult(jobId);\r
// assertNotNull(muscler);\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.AllTestSuit;\r
import compbio.metadata.JobExecutionException;\r
import compbio.metadata.JobStatus;\r
lr.cancelJob();\r
// This call causes CancellationException to be thrown\r
Executable<?> clustalr = lr.waitForResult();\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.CANCELLED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.STARTED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.COLLECTED));\r
- assertTrue(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertTrue(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.FINISHED));\r
- assertFalse(Util.isMarked(confClust.getWorkDirectory(),\r
+ assertFalse(EngineUtil.isMarked(confClust.getWorkDirectory(),\r
JobStatus.SUBMITTED));\r
} catch (JobSubmissionException e) {\r
e.printStackTrace();\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
import compbio.metadata.PresetManager;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.util.FileWatcher;\r
import compbio.util.SysPrefs;\r
\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
\r
@Test(groups = {AllTestSuit.test_group_runner})\r
public void RunLocallyWithPreset() {\r
try {\r
- PresetManager<AACon> aaconPresets = Util.getPresets(AACon.class);\r
+ PresetManager<AACon> aaconPresets = RunnerUtil.getPresets(AACon.class);\r
assert aaconPresets != null;\r
ConfiguredExecutable<AACon> confAAcon = Configurator.configureExecutable(aacon, Executable.ExecProvider.Local);\r
Preset<AACon> quick = aaconPresets.getPresetByName("Quick conservation");\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
.intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
.intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
.intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
assertEquals(0, exitsInt);\r
//System.out.println(sm.getAllStats());\r
} catch (ParseException e) {\r
import compbio.engine.Configurator;\r
import compbio.engine.FilePuller;\r
import compbio.engine.SyncExecutor;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.client.ConfExecutable;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.Executable.ExecProvider;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.conf.RunnerConfigMarshaller;\r
\r
AsyncExecutor sexec = Configurator.getAsyncEngine(confal);\r
String jobId = sexec.submitJob(confal);\r
- String file = Util.getFullPath(confal.getWorkDirectory(), ClustalW.getStatFile());\r
+ String file = EngineUtil.getFullPath(confal.getWorkDirectory(), ClustalW.getStatFile());\r
FilePuller fw = FilePuller.newFilePuller(file, FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
int count = 0;\r
long position = 0;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
} catch (ParseException e) {\r
\r
AsyncExecutor sexec = Configurator.getAsyncEngine(confClustal);\r
String jobId = sexec.submitJob(confClustal);\r
- String file = Util.getFullPath(confClustal.getWorkDirectory(), ClustalW.getStatFile());\r
+ String file = EngineUtil.getFullPath(confClustal.getWorkDirectory(), ClustalW.getStatFile());\r
FilePuller fw = FilePuller.newFilePuller(file, FileWatcher.MIN_CHUNK_SIZE_BYTES);\r
int count = 0;\r
long position = 0;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
import compbio.engine.client.Executable.ExecProvider;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.conf.RunnerConfigMarshaller;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.runner.OptionCombinator;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.ClustalW;\r
import compbio.util.FileWatcher;\r
import compbio.util.SysPrefs;\r
ConfiguredExecutable<ClustalW> confClustal;\r
try {\r
confClustal = Configurator.configureExecutable(cl);\r
- Util.writeInput(seqs, confClustal);\r
+ RunnerUtil.writeInput(seqs, confClustal);\r
\r
LocalRunner lr = new LocalRunner(confClustal);\r
lr.executeJob();\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
} catch (ParseException e) {\r
AsyncExecutor sexec = Configurator.getAsyncEngine(cmafft,\r
ExecProvider.Local);\r
String jobId = sexec.submitJob(cmafft);\r
- FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.Util\r
+ FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.EngineUtil\r
.getFullPath(cmafft.getWorkDirectory(), cmafft.getError()),\r
256);\r
int count = 0;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits)\r
.intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
Executable.ExecProvider.Local);\r
AsyncExecutor sexec = Configurator.getAsyncEngine(cprobs);\r
String jobId = sexec.submitJob(cprobs);\r
- FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.Util\r
+ FilePuller fw = FilePuller.newFilePuller(compbio.engine.client.EngineUtil\r
.getFullPath(cprobs.getWorkDirectory(), cprobs.getError()),\r
256);\r
ConfiguredExecutable<?> al = sexec.getResults(jobId);\r
log.setLevel(Level.INFO);\r
}\r
\r
- RunnerConfig<Tcoffee> tcoffeeConfig = compbio.runner.Util.getSupportedOptions(Tcoffee.class);\r
+ RunnerConfig<Tcoffee> tcoffeeConfig = compbio.runner.RunnerUtil.getSupportedOptions(Tcoffee.class);\r
OptionCombinator tcoffeeOpc = null;\r
- PresetManager<Tcoffee> presets = compbio.runner.Util.getPresets(Tcoffee.class);\r
+ PresetManager<Tcoffee> presets = compbio.runner.RunnerUtil.getPresets(Tcoffee.class);\r
\r
@BeforeMethod(groups = { AllTestSuit.test_group_runner,\r
AllTestSuit.test_group_non_windows })\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.LocalRunner;\r
import compbio.metadata.PresetManager;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.util.FileWatcher;\r
import compbio.util.SysPrefs;\r
\r
public void RunOnCluster() {\r
assertFalse(SysPrefs.isWindows, "Cluster execution can only be in unix environment");\r
try {\r
- PresetManager<Jpred> jpredPreset = Util.getPresets(Jpred.class);\r
+ PresetManager<Jpred> jpredPreset = RunnerUtil.getPresets(Jpred.class);\r
assert jpredPreset != null;\r
ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(pred, Executable.ExecProvider.Cluster);\r
Preset<Jpred> conf = jpredPreset.getPresetByName("cluster configuration");\r
String exits = sm.getExitStatus();\r
assertNotNull("Exit status is null", exits);\r
// cut 4 trailing zeros from the number\r
- int exitsInt = ClusterUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
+ int exitsInt = ClusterEngineUtil.CLUSTER_STAT_IN_SEC.parse(exits).intValue();\r
assertEquals(0, exitsInt);\r
System.out.println(sm.getAllStats());\r
} catch (ParseException e) {\r
public void RunLocallyWithPreset() {\r
try {\r
ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(pred, Executable.ExecProvider.Local);\r
- PresetManager<Jpred> preset = Util.getPresets(Jpred.class);\r
+ PresetManager<Jpred> preset = RunnerUtil.getPresets(Jpred.class);\r
assert preset != null;\r
Preset<Jpred> conf = preset.getPresetByName("laptop configuration");\r
confpred.addParameters(conf.getOptions());\r
jpred.setInput(test_input);\r
jpred.setOutput(test_output);\r
ConfiguredExecutable<Jpred> confpred = Configurator.configureExecutable(jpred, Executable.ExecProvider.Local);\r
- PresetManager<Jpred> preset = Util.getPresets(Jpred.class);\r
+ PresetManager<Jpred> preset = RunnerUtil.getPresets(Jpred.class);\r
assert preset != null;\r
Preset<Jpred> conf = preset.getPresetByName("laptop configuration");\r
confpred.addParameters(conf.getOptions());\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.RunConfiguration;\r
-import compbio.engine.cluster.drmaa.ClusterUtil;\r
+import compbio.engine.cluster.drmaa.ClusterEngineUtil;\r
import compbio.engine.cluster.drmaa.JobRunner;\r
import compbio.engine.cluster.drmaa.StatisticManager;\r
import compbio.engine.local.AsyncLocalRunner;\r
@Override\r
protected void doGet(HttpServletRequest req, HttpServletResponse resp)\r
throws ServletException, IOException {\r
-\r
StringBuffer jabawspath = req.getRequestURL();\r
jabawspath = jabawspath.delete(jabawspath.lastIndexOf("/"), jabawspath.length());\r
String serverPath = jabawspath.toString();\r
+ System.out.println("Testing services at " + serverPath); \r
+ System.out.println(" Context Path is " + req.getContextPath()); \r
+ System.out.println(" Request URI is " + req.getRequestURI());\r
+ System.out.println(" Servlet Path is " + req.getServletPath());\r
+ System.out.println(" Path Info is " + req.getPathInfo());\r
\r
List<ServiceTestResult> testResults = new ArrayList<ServiceTestResult>();\r
\r
import org.apache.log4j.Logger;\r
\r
import compbio.engine.conf.PropertyHelperManager;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.stat.collector.ExecutionStatCollector;\r
import compbio.stat.collector.StatDB;\r
import compbio.util.PropertyHelper;\r
int clusterMaxRuntime = getClusterJobTimeOut();\r
\r
int localMaxRuntime = getLocalJobTimeOut();\r
- String localWorkDir = compbio.engine.client.Util.convertToAbsolute(getLocalJobDir());\r
+ String localWorkDir = EngineUtil.convertToAbsolute(getLocalJobDir());\r
\r
log.info("Initializing statistics collectors");\r
executor = Executors.newScheduledThreadPool(2);\r
import java.io.IOException;\r
import java.io.PrintWriter;\r
import java.net.ConnectException;\r
+import java.net.MalformedURLException;\r
+import java.net.URL;\r
import java.util.Arrays;\r
import java.util.List;\r
+import java.util.logging.Level;\r
\r
+import javax.xml.ws.Service;\r
import javax.xml.ws.WebServiceException;\r
\r
import compbio.data.msa.JABAService;\r
\r
private <T> boolean testSequenceAnnotationWS(\r
SequenceAnnotation<T> wservice, Services service) throws Exception {\r
- writer.print("Calling analyse.........");\r
+ writer.print("Calling annotation test.........");\r
\r
List<FastaSequence> input = loadSeqs(2);\r
if (service == Services.AAConWS ) {\r
\r
private void reportException(Exception e) {\r
writer.println(FAILED);\r
- writer.println("Exception while waiting for results. "\r
- + "Exception details are below:");\r
+ writer.println("Exception while waiting for results. Exception details are below:");\r
writer.println(e.getLocalizedMessage());\r
e.printStackTrace(writer);\r
}\r
}\r
\r
}\r
+ \r
+ /**\r
+ * Connects to a web service by the host and the service name web service type\r
+ * \r
+ * @param host\r
+ * the fully qualified name of JABAWS server including JABAWS\r
+ * context name e.g\r
+ * http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba\r
+ * @param service\r
+ * the name of the JABAWS service to connect to\r
+ * @return JABAService<T>\r
+ * @throws WebServiceException\r
+ * @throws ConnectException\r
+ * if fails to connect to the service on the host\r
+ */\r
+ private JABAService connect(String host, Services service)\r
+ throws WebServiceException, ConnectException {\r
+ URL url = null;\r
+ System.out.println ("Attempting to connect with " + service.toString() + "...");\r
+ try {\r
+ url = new URL(host + "/" + service.toString() + "?wsdl");\r
+ System.out.println ("URL: " + url.toString());\r
+ } catch (MalformedURLException e) {\r
+ e.printStackTrace();\r
+ }\r
+ Service serv = null;\r
+ try {\r
+ serv = service.getService(url, service.getServiceNamespace());\r
+ } catch (WebServiceException wse) {\r
+ wse.printStackTrace();\r
+ }\r
+ if (serv == null) {\r
+ throw new ConnectException("Could not connect to " + url + ". Is the server down?");\r
+ }\r
+ JABAService srv = service.getInterface(serv);\r
+ System.out.println ("Connected successfully!");\r
+ return srv;\r
+ }\r
\r
/**\r
* Test JABA web service\r
*/\r
public boolean checkService(Services service) throws ConnectException,\r
WebServiceException {\r
- JABAService ws = Jws2Client.connect(hostname, service);\r
+ JABAService ws = connect(hostname, service);\r
if (ws == null) {\r
String line = "Cannot estabilish the connection to host " + hostname + " with service ";\r
writer.println(line + service.toString());\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.ClustalO;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ClustalOWS")\r
public class ClustalOWS implements MsaWS<ClustalO> {\r
\r
private static Logger log = Logger.getLogger(ClustalOWS.class);\r
-\r
- private static final RunnerConfig<ClustalO> clustalOptions = Util.getSupportedOptions(ClustalO.class);\r
-\r
- private static final PresetManager<ClustalO> clustalPresets = Util.getPresets(ClustalO.class);\r
-\r
- private static final LimitsManager<ClustalO> limitMan = compbio.engine.client.Util.getLimits(new ClustalO().getType());\r
+ private static final RunnerConfig<ClustalO> clustalOptions = RunnerUtil.getSupportedOptions(ClustalO.class);\r
+ private static final PresetManager<ClustalO> clustalPresets = RunnerUtil.getPresets(ClustalO.class);\r
+ private static final LimitsManager<ClustalO> limitMan = EngineUtil.getLimits(new ClustalO().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.ClustalW;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ClustalWS")\r
public class ClustalWS implements MsaWS<ClustalW> {\r
\r
private static Logger log = Logger.getLogger(ClustalWS.class);\r
-\r
- private static final RunnerConfig<ClustalW> clustalOptions = Util.getSupportedOptions(ClustalW.class);\r
-\r
- private static final PresetManager<ClustalW> clustalPresets = Util.getPresets(ClustalW.class);\r
-\r
- private static final LimitsManager<ClustalW> limitMan = compbio.engine.client.Util.getLimits(new ClustalW().getType());\r
+ private static final RunnerConfig<ClustalW> clustalOptions = RunnerUtil.getSupportedOptions(ClustalW.class);\r
+ private static final PresetManager<ClustalW> clustalPresets = RunnerUtil.getPresets(ClustalW.class);\r
+ private static final LimitsManager<ClustalW> limitMan = EngineUtil.getLimits(new ClustalW().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
// compbio.dundee.ac.uk GA tracker\r
private static AnalyticsConfigData config = new AnalyticsConfigData("UA-5356328-1");\r
\r
- private static GoogleAnalyticsTracker TRACKER = new GoogleAnalyticsTracker(\r
- config);\r
+ private static GoogleAnalyticsTracker TRACKER = new GoogleAnalyticsTracker(config);\r
\r
static final boolean IS_GA_ENABLED = isGoogleAnalyticsEnabled();\r
\r
} else {\r
service_name = service.toString();\r
}\r
- TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name,\r
- service_name, "http://www.compbio.dundee.ac.uk",\r
- SERVER_ADDRESS, VERSION_TYPE);\r
+ TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name, service_name, "http://www.compbio.dundee.ac.uk", SERVER_ADDRESS, VERSION_TYPE);\r
TRACKER.resetSession();\r
}\r
+\r
+ static void reportUsage(Services service, String CLIENT_ADDRESS) {\r
+ String service_name = "UNKNOWN";\r
+ if (service == null) {\r
+ log.warn("GA: Services was NULL!");\r
+ } else {\r
+ service_name = service.toString();\r
+ }\r
+ TRACKER.trackPageViewFromReferrer("JABAWS/2.0/" + service_name, service_name, "http://www.compbio.dundee.ac.uk", CLIENT_ADDRESS, VERSION_TYPE);\r
+ TRACKER.resetSession();\r
+ }\r
+\r
}\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.LimitsManager;\r
import compbio.metadata.PresetManager;\r
import compbio.metadata.RunnerConfig;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
\r
public abstract class GenericMetadataService<T> {\r
\r
assert exec != null;\r
this.log = log;\r
this.exec = exec;\r
- this.limitMan = compbio.engine.client.Util.getLimits(exec.getType());\r
- this.aaconOptions = Util.getSupportedOptions((Class<? extends Executable<T>>) exec.getType());\r
- this.aaconPresets = Util.getPresets((Class<? extends Executable<T>>) exec.getType());\r
+ this.limitMan = EngineUtil.getLimits(exec.getType());\r
+ this.aaconOptions = RunnerUtil.getSupportedOptions((Class<? extends Executable<T>>) exec.getType());\r
+ this.aaconPresets = RunnerUtil.getPresets((Class<? extends Executable<T>>) exec.getType());\r
}\r
\r
ConfiguredExecutable<T> init(List<FastaSequence> sequences)\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.predictors.Jpred;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "JpredWS")\r
\r
private static Logger log = Logger.getLogger(JpredWS.class);\r
\r
- private static final RunnerConfig<Jpred> jpredOptions = Util.getSupportedOptions(Jpred.class);\r
- private static final PresetManager<Jpred> jpredPresets = Util.getPresets(Jpred.class);\r
- private static final LimitsManager<Jpred> limitMan = compbio.engine.client.Util.getLimits(new Jpred().getType());\r
+ private static final RunnerConfig<Jpred> jpredOptions = RunnerUtil.getSupportedOptions(Jpred.class);\r
+ private static final PresetManager<Jpred> jpredPresets = RunnerUtil.getPresets(Jpred.class);\r
+ private static final LimitsManager<Jpred> limitMan = EngineUtil.getLimits(new Jpred().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.Mafft;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MafftWS")\r
public class MafftWS implements MsaWS<Mafft> {\r
\r
private static Logger log = Logger.getLogger(MafftWS.class);\r
-\r
- private static final RunnerConfig<Mafft> mafftOptions = Util\r
- .getSupportedOptions(Mafft.class);\r
-\r
- private static final PresetManager<Mafft> mafftPresets = Util\r
- .getPresets(Mafft.class);\r
-\r
- private static final LimitsManager<Mafft> limitMan = compbio.engine.client.Util\r
- .getLimits(new Mafft().getType());\r
+ private static final RunnerConfig<Mafft> mafftOptions = RunnerUtil.getSupportedOptions(Mafft.class);\r
+ private static final PresetManager<Mafft> mafftPresets = RunnerUtil.getPresets(Mafft.class);\r
+ private static final LimitsManager<Mafft> limitMan = EngineUtil.getLimits(new Mafft().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
import compbio.engine.conf.PropertyHelperManager;\r
import compbio.engine.local.ExecutableWrapper;\r
import compbio.engine.local.LocalExecutorService;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.util.PropertyHelper;\r
\r
/**\r
}\r
\r
// configure local cleaner\r
- String localWorkDir = compbio.engine.client.Util.convertToAbsolute(getLocalJobDir());\r
+ String localWorkDir = EngineUtil.convertToAbsolute(getLocalJobDir());\r
int localDirLiveSpan = PropertyHelperManager.getIntProperty(ph.getProperty("local.jobdir.maxlifespan"));\r
int localCleaningRate = PropertyHelperManager.getIntProperty(ph.getProperty("local.jobdir.cleaning.frequency"));\r
boolean cleanLocalDir = PropertyHelperManager.getBooleanProperty(ph.getProperty("local.stat.collector.enable"));\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.Muscle;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MuscleWS")\r
public class MuscleWS implements MsaWS<Muscle> {\r
\r
private static Logger log = Logger.getLogger(MuscleWS.class);\r
-\r
- private static final RunnerConfig<Muscle> muscleOptions = Util\r
- .getSupportedOptions(Muscle.class);\r
-\r
- private static final PresetManager<Muscle> musclePresets = Util\r
- .getPresets(Muscle.class);\r
-\r
- private static final LimitsManager<Muscle> limitMan = compbio.engine.client.Util\r
- .getLimits(new Muscle().getType());\r
+ private static final RunnerConfig<Muscle> muscleOptions = RunnerUtil.getSupportedOptions(Muscle.class);\r
+ private static final PresetManager<Muscle> musclePresets = RunnerUtil.getPresets(Muscle.class);\r
+ private static final LimitsManager<Muscle> limitMan = EngineUtil.getLimits(new Muscle().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
List<String> params = WSUtil.getCommands(options,\r
Muscle.KEY_VALUE_SEPARATOR);\r
confMuscle.addParameters(params);\r
- return WSUtil.align(sequences, confMuscle, log, "customAlign",\r
- getLimit(""));\r
+ return WSUtil.align(sequences, confMuscle, log, "customAlign", getLimit(""));\r
}\r
\r
@Override\r
import compbio.engine.Configurator;\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.Probcons;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ProbconsWS")\r
\r
private static Logger log = Logger.getLogger(ProbconsWS.class);\r
\r
- private static final RunnerConfig<Probcons> probconsOptions = Util.getSupportedOptions(Probcons.class);\r
- private static final LimitsManager<Probcons> limitMan = compbio.engine.client.Util.getLimits(new Probcons().getType());\r
+ private static final RunnerConfig<Probcons> probconsOptions = RunnerUtil.getSupportedOptions(Probcons.class);\r
+ private static final LimitsManager<Probcons> limitMan = EngineUtil.getLimits(new Probcons().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
import org.apache.log4j.Logger;\r
\r
import compbio.engine.client.Executable.ExecProvider;\r
-import compbio.engine.client.Util;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.engine.conf.PropertyHelperManager;\r
import compbio.runner.disorder.IUPred;\r
import compbio.runner.msa.Muscle;\r
// Assume at least one of these is configured\r
// Do not even bother with cluster execution, sysadmins set the flag\r
// themselves\r
- String command = Util.getCommand(ExecProvider.Local, Muscle.class);\r
+ String command = EngineUtil.getCommand(ExecProvider.Local, Muscle.class);\r
if (compbio.util.Util.isEmpty(command)) {\r
- command = Util.getCommand(ExecProvider.Local, IUPred.class);\r
+ command = EngineUtil.getCommand(ExecProvider.Local, IUPred.class);\r
}\r
boolean isExec = true;\r
if (!compbio.util.Util.isEmpty(command)) {\r
import compbio.engine.client.ConfiguredExecutable;\r
import compbio.engine.client.Executable;\r
import compbio.engine.client.SkeletalExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.WrongParameterException;\r
-import compbio.runner.Util;\r
+import compbio.runner.RunnerUtil;\r
import compbio.runner.msa.Tcoffee;\r
\r
@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "TcoffeeWS")\r
public class TcoffeeWS implements MsaWS<Tcoffee> {\r
\r
private static Logger log = Logger.getLogger(TcoffeeWS.class);\r
-\r
- private static final RunnerConfig<Tcoffee> tcoffeeOptions = Util.getSupportedOptions(Tcoffee.class);\r
-\r
- private static final PresetManager<Tcoffee> tcoffeePresets = Util.getPresets(Tcoffee.class);\r
-\r
- private static final LimitsManager<Tcoffee> limitMan = compbio.engine.client.Util.getLimits(new Tcoffee().getType());\r
+ private static final RunnerConfig<Tcoffee> tcoffeeOptions = RunnerUtil.getSupportedOptions(Tcoffee.class);\r
+ private static final PresetManager<Tcoffee> tcoffeePresets = RunnerUtil.getPresets(Tcoffee.class);\r
+ private static final LimitsManager<Tcoffee> limitMan = EngineUtil.getLimits(new Tcoffee().getType());\r
\r
@Override\r
public String align(List<FastaSequence> sequences)\r
import compbio.engine.Configurator;\r
import compbio.engine.ProgressGetter;\r
import compbio.engine.client.ConfiguredExecutable;\r
+import compbio.engine.client.EngineUtil;\r
import compbio.metadata.ChunkHolder;\r
import compbio.metadata.JobStatus;\r
import compbio.metadata.JobSubmissionException;\r
\r
public static final void validateJobId(String jobId)\r
throws InvalidParameterException {\r
- if (!compbio.engine.client.Util.isValidJobId(jobId)) {\r
- throw new InvalidParameterException(\r
- "JobId is not provided or cannot be recognised! Given value: "\r
- + jobId);\r
+ if (!EngineUtil.isValidJobId(jobId)) {\r
+ throw new InvalidParameterException("JobId is not provided or cannot be recognised! Given value: " + jobId);\r
}\r
}\r
\r
public static final void validateFastaInput(List<FastaSequence> sequences)\r
throws JobSubmissionException {\r
if (sequences == null || sequences.isEmpty()) {\r
- throw new JobSubmissionException(\r
- "List of fasta sequences required but not provided! ");\r
+ throw new JobSubmissionException("List of fasta sequences required but not provided! ");\r
}\r
Set<String> names = new HashSet<String>();\r
for (FastaSequence fs : sequences) {\r
boolean unique = names.add(fs.getId());\r
if (!unique) {\r
throw new JobSubmissionException(\r
- "Input sequences must have unique names! \n"\r
- + "Sequence " + fs.getId() + " is a duplicate!");\r
+ "Input sequences must have unique names! \nSequence " + fs.getId() + " is a duplicate!");\r
}\r
if (fs.getLength() == 0) {\r
- throw new JobSubmissionException(\r
- "Sequence must not be empty! Sequence: " + fs.getId()\r
- + " was empty");\r
+ throw new JobSubmissionException("Sequence must not be empty! Sequence: " + fs.getId() + " was empty");\r
}\r
}\r
}\r
if (limit != null && limit.isExceeded(sequences)) {\r
throw LimitExceededException.newLimitExceeded(limit, sequences);\r
}\r
- compbio.runner.Util.writeInput(sequences, confExec);\r
+ compbio.runner.RunnerUtil.writeInput(sequences, confExec);\r
AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
String jobId = engine.submitJob(confExec);\r
reportUsage(confExec, logger);\r
if (limit != null && limit.isExceeded(sequences)) {\r
throw LimitExceededException.newLimitExceeded(limit, sequences);\r
}\r
- compbio.runner.Util.writeInput(sequences, confExec);\r
+ compbio.runner.RunnerUtil.writeInput(sequences, confExec);\r
AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
String jobId = engine.submitJob(confExec);\r
reportUsage(confExec, log);\r
if (limit != null && limit.isExceeded(sequences)) {\r
throw LimitExceededException.newLimitExceeded(limit, sequences);\r
}\r
- compbio.runner.Util.writeClustalInput(sequences, confExec, '-');\r
+ compbio.runner.RunnerUtil.writeClustalInput(sequences, confExec, '-');\r
AsyncExecutor engine = Configurator.getAsyncEngine(confExec);\r
String jobId = engine.submitJob(confExec);\r
reportUsage(confExec, log);\r