Class ResolveCommand

java.lang.Object
org.phyloref.jphyloref.commands.ResolveCommand
All Implemented Interfaces:
Command

public class ResolveCommand
extends java.lang.Object
implements Command
Resolve an ontology of phyloreferences provided on the command line, and report on the resolution of each clade definition. The resulting report or an appropriate error message will be provided in JSON, and the exit code will be set to non-zero if an error occurred.

This code was extracted from WebserverCommand so its functionality can be used from the command line, which is while for now it returns its results in the JSON format. We might eventually want to switch over to YAML or another more command line friendly format.

Author:
Gaurav Vaidya
  • Constructor Summary

    Constructors
    Constructor Description
    ResolveCommand()  
  • Method Summary

    Modifier and Type Method Description
    void addCommandLineOptions​(org.apache.commons.cli.Options opts)
    Add command-line options specific to this command.
    int execute​(org.apache.commons.cli.CommandLine cmdLine)
    Set up a webserver to listen on the provided hostname and port (or their defaults).
    java.lang.String getDescription()
    A description of the Resolve command.
    java.lang.String getName()
    This command is named "resolve".

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResolveCommand

      public ResolveCommand()
  • Method Details

    • getName

      public java.lang.String getName()
      This command is named "resolve". It should be invoked as "java -jar jphyloref.jar resolve ..."
      Specified by:
      getName in interface Command
      Returns:
      The name of this command.
    • getDescription

      public java.lang.String getDescription()
      A description of the Resolve command.
      Specified by:
      getDescription in interface Command
      Returns:
      A description of this command.
    • addCommandLineOptions

      public void addCommandLineOptions​(org.apache.commons.cli.Options opts)
      Add command-line options specific to this command.
      Specified by:
      addCommandLineOptions in interface Command
      Parameters:
      opts - The command-line options to modify for this command.
    • execute

      public int execute​(org.apache.commons.cli.CommandLine cmdLine) throws java.lang.RuntimeException
      Set up a webserver to listen on the provided hostname and port (or their defaults).
      Specified by:
      execute in interface Command
      Parameters:
      cmdLine - The command line options provided to this command.
      Throws:
      java.lang.RuntimeException