import java.io.FileInputStream;\r
import java.io.FileOutputStream;\r
import java.io.IOException;\r
-import java.io.OutputStream;\r
import java.io.PrintWriter;\r
import java.io.Writer;\r
import java.net.ConnectException;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.data.sequence.UnknownFileFormatException;\r
import compbio.metadata.JobSubmissionException;\r
+import compbio.metadata.JobStatus;\r
import compbio.metadata.Option;\r
+import compbio.metadata.Limit;\r
import compbio.metadata.Preset;\r
+import compbio.metadata.PresetManager;\r
import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.WrongParameterException;\r
import compbio.util.FileUtil;\r
IOHelper.writeOut(writer, alignment);\r
writer.close();\r
}\r
+ AlignmentMetadata md = alignment.getMetadata();\r
+ System.out.println("Output has been prepared with " + md.getProgram());\r
}\r
}\r
\r
if (CmdHelper.listParameters(cmd)) {\r
- System.out.println(MetadataHelper.getParametersList(thews));\r
+ List<Option<T>> opts = MetadataHelper.getParametersList(thews, hostname);\r
+ for (Option<T> o : opts) {\r
+ System.out.println("##############################################################################\n" + o.toString());\r
+ }\r
}\r
if (CmdHelper.listPresets(cmd)) {\r
- System.out.println(MetadataHelper.getPresetList(thews));\r
+ PresetManager<T> psm = MetadataHelper.getPresetList(thews);\r
+ if (null != psm) {\r
+ System.out.print(psm);\r
+ } else {\r
+ System.out.println("No presets are defined for the Web service");\r
+ }\r
}\r
if (CmdHelper.listLimits(cmd)) {\r
- System.out.println(MetadataHelper.getLimits(thews));\r
+ List<Limit<T>> lims = MetadataHelper.getLimits(thews);\r
+ for (Limit<T> l : lims) {\r
+ System.out.println("##############################################################################\n" + l.toString());\r
+ }\r
}\r
log.fine("Disconnecting...");\r
((Closeable) thews).close();\r
\r
private static void listAllServices(String hostname) throws WebServiceException, IOException {\r
RegistryWS registry = connectToRegistry(hostname);\r
- Set<Services> func_services = Collections.EMPTY_SET;\r
- Set<Services> nonfunc_services = Collections.EMPTY_SET;\r
+ Set<Services> func_services = Collections.emptySet();\r
+ //Set<Services> nonfunc_services = Collections.emptySet();\r
if (registry != null) {\r
func_services = registry.getSupportedServices();\r
- nonfunc_services = registry.getNonoperatedServices();\r
+ //nonfunc_services = registry.getNonoperatedServices();\r
FileUtil.closeSilently(((Closeable) registry));\r
} else {\r
System.out.println("Failed to connect to the registry! ");\r
String mess = "\n\rThe list:\n";\r
System.out.println(mess + Services.toString(func_services));\r
}\r
+ /*\r
if (!nonfunc_services.isEmpty()) {\r
System.out.println("There are " + nonfunc_services.size() + " non-available services at " + hostname + ":");\r
String mess = "The list (internal tests failed): ";\r
System.out.println(mess + Services.toString(nonfunc_services));\r
}\r
+ */\r
}\r
\r
/**\r
jobId = wsproxy.analize(fastalist);\r
}\r
System.out.println("\n\rcalling predictor.........");\r
- Thread.sleep(100);\r
+ Thread.sleep(1000);\r
+ /*\r
+ JobStatus status = wsproxy.getJobStatus(jobId);\r
+ System.out.println("\njob " + jobId + " status: " + status);\r
+ */\r
scores = wsproxy.getAnnotation(jobId);\r
} catch (JobSubmissionException e) {\r
System.err.println("Exception while submitting job to a web server. Exception details are below:");\r
jobId = msaws.align(fastalist);\r
}\r
System.out.println("\ncalling program.........");\r
- Thread.sleep(100);\r
+ /*\r
+ long startTime = System.nanoTime();\r
+ while (JobStatus.RUNNING == msaws.getJobStatus(jobId)) {\r
+ Thread.sleep(1000);\r
+ long endTime = System.nanoTime();\r
+ System.out.println("job " + jobId + " time executing: "+ (endTime - startTime) / 1000000 +" msec, status: " + msaws.getJobStatus(jobId));\r
+ }\r
+ */\r
+ Thread.sleep(1000);\r
alignment = msaws.getResult(jobId);\r
} catch (IOException e) {\r
System.err.println("Exception while reading the input file. Check that the input file is a FASTA file! "\r
* \r
*/\r
public static void main(String[] args) {\r
-\r
if (args == null) {\r
System.out.println(Constraints.help_text);\r
System.exit(1);\r
System.out.println(Constraints.help_text);\r
System.exit(1);\r
}\r
-\r
try {\r
new Jws2Client(args);\r
} catch (IOException e) {\r