info.sswap.ontologies.exec.api
Interface Exec

All Known Implementing Classes:
ExecImpl, ExecServlet

public interface Exec

Execution of legacy programs. The Exec package allows one to wrap a non-semantic legacy program and run it as a semantic web service. The package requires no source code for implementation: simply define the appropriate RDGPath (and optional hotboxPath) in web.xml (see ExecServlet). Then place RDF/XML RDGs in the RDGPath or place their JSON equivalents in the hotboxPath. RDG data types should use the data ontology (http://sswapmeet.sswap.info/data) either explicitly, or usually implicitly, for example as is achieved by using the mime ontology at http://sswapmeet.sswap.info/mime. Invocation of legacy services is then handled automatically by the Exec package.

WARNING: Security Risk

Running programs that may not have been originally designed for web invocation has inherent security risks. Many of these risks are not specific to SSWAP, but are generally applicable; for example, such risks also exist for traditional CGI (Common Gateway Interface) wrapping.

Risks include:

The Exec package security model

Author:
Damian Gessler
See Also:
ExecServlet

Method Summary
 java.lang.String[] getCommandLine(java.lang.String commandLineStr)
          Basic parsing and sanity checking of the command line.
 void setEnvironment(java.util.Map<java.lang.String,java.lang.String> env)
          Set the process' execution environment.
 

Method Detail

getCommandLine

java.lang.String[] getCommandLine(java.lang.String commandLineStr)
                                  throws TooManyArgumentsException,
                                         ArgumentTooLongException
Basic parsing and sanity checking of the command line. Parsing implies deconstructing a single string into a string array analogous to the array argument passed to Java main(). Override this method to validate, sanitize, and otherwise change the command and the user arguments.

Parameters:
commandLineStr - a concatenation of the RDG's exec:command and the RIG's exec:args.
Returns:
Java main() equivalent of command line arguments. The command itself must be the first element.
Throws:
ArgumentTooLongException - if an argument exceeds a preset maximum
TooManyArgumentsException - if the number of arguments exceeds a preset maximum

setEnvironment

void setEnvironment(java.util.Map<java.lang.String,java.lang.String> env)
Set the process' execution environment. Override this method to set the execution environment. Default implementation is to clear the environment.

Parameters:
env - the default environment ProcessBuilder environment
See Also:
ProcessBuilder.environment()


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.