Class Base1PluginExecuter

    • Field Detail

      • permissions

        private static final Set<Permissions> permissions
        The plug-in permissions.
      • dtdFile

        private static final URL dtdFile
      • fileParameter

        private static final PluginParameter<File> fileParameter
        Parameter definition that asks for the configuration file that should be imported.
      • execPathParameter

        private static PluginParameter<String> execPathParameter
        The path to where the plug-in executer can find the executables. In Base1 this was default to /usr/local/base/plugins.
      • serialFormatParameter

        private PluginParameter<Boolean> serialFormatParameter
        This parameter describes if the data should be exported in serial format or in matrix.
      • versionNumberParameter

        private PluginParameter<String> versionNumberParameter
        The version number of the plug-in.
      • geneAveragesParameter

        private PluginParameter<Boolean> geneAveragesParameter
        If the data should be exported averaged per gene.
      • maxChannelsParameter

        private PluginParameter<Integer> maxChannelsParameter
        The maximum number of channels, 0 means unlimited.
      • leaveStdinParameter

        private PluginParameter<Boolean> leaveStdinParameter
        If the plug-in should leave the stdin.txt after execution.
      • leaveStdoutParameter

        private PluginParameter<Boolean> leaveStdoutParameter
        If the plug-in should leave the stdout.txt after execution.
      • usedColumnsParameter

        private PluginParameter<String> usedColumnsParameter
        The reporter fields that should be exported as a tab separated string of column headers.
      • usedFieldsParameter

        private PluginParameter<String> usedFieldsParameter
        The spot fields that should be exported as a tab separated string of column headers.
      • jobParametersParameter

        private PluginParameter<String> jobParametersParameter
        This parameter describes the job parameters that the base1 plugin needs.
      • pluginDirectoryParameter

        private PluginParameter<String> pluginDirectoryParameter
        The directory where the plug-in will store it's output.
      • COMMAND_MANUAL_CONFIG

        private static final String COMMAND_MANUAL_CONFIG
        This command is used if the user decides to configure the plugin by hand.
        See Also:
        Constant Field Values
      • configureJob

        private RequestInformation configureJob
        Holds info about a job configuration request.
      • configurePlugin

        private RequestInformation configurePlugin
        Holds information about a plugin configuration request.
      • configureManual

        private RequestInformation configureManual
        Holds information about a manual plugin configuration request.
      • jobParameters

        private List<PluginParameter<?>> jobParameters
        This list holds the job parameters derived from the configuration file.
      • execDirectory

        private File execDirectory
        This is the directory where the plugin will generate its output.
    • Constructor Detail

      • Base1PluginExecuter

        public Base1PluginExecuter()
    • Method Detail

      • copy

        private void copy​(File f,
                          File d)
                   throws IOException
        Copies the content from a File to a directory on the file system.
        Parameters:
        f - The file to be copied.
        d - The directory where the file will be written.
        Throws:
        IOException - If there is any error with target.
      • deleteDir

        private boolean deleteDir​(File dir)
        Deletes all files and sub directories under dir.
        Returns:
        true if all deletions were successful
      • run

        public void run​(Request request,
                        Response response,
                        ProgressReporter progress)
        Description copied from interface: Plugin
        Run the plugin. If a progress reporter object is passed it is recommended that the plugin makes use of it.
        Specified by:
        run in interface Plugin
        Parameters:
        request - Request object with the command and parameters
        response - Response object in for the plugin to response through
        progress - A ProgressReporter where the plugin can report its progess, can be null
      • getSignalHandler

        public SignalHandler getSignalHandler()
        Description copied from interface: SignalTarget
        Get the signal handler that is handling signals on behalf of this object. Multiple invokations of this method may receive the same or different objects. Null may be returned if, for some reason, the current object instance doesn't want to receive signals. Returning null is the same as not implementing this interface.
        Specified by:
        getSignalHandler in interface SignalTarget
        Returns:
        A SignalHandler object, or null if the current instance doesn't support signals
      • exportData

        private File exportData​(DbControl dc,
                                Directory workingDirectory,
                                ProgressReporter progress)
        Export the bioassay set to a file called 'stdin.txt' in the plugin directory.
        Parameters:
        dc - DbControl used to access the database
        workingDirectory - Where in base' file system the exported BASEFile should be stored.
        Returns:
        The file where the data is exported to.
      • getAnnotationTypes

        private List<AnnotationType> getAnnotationTypes()
        Get the experimental factors connected to a experiment.
        Returns:
        A list of AnnotationType:s
      • getParametersFromBaseFile

        private Map<String,​String> getParametersFromBaseFile​(File f)
                                                            throws IOException
        Get the data from the configuration file.
        Parameters:
        f - The file.
        Returns:
        A map of name->value pairs.
        Throws:
        IOException - If there i any problem reading from file.
      • getBoolean

        private Boolean getBoolean​(String s)
        Creates a boolean from a string.
        Parameters:
        s - The string.
        Returns:
        false if s.equals("0") else true.
      • getManualConfigureParameters

        private RequestInformation getManualConfigureParameters()
        Creates the information needed for manual configuration and initiates the parameters. The parameters added are: versionNumber, usedColumns, usedFields, execName, geneAverages, SerialFormat, leaveStdin, leaveStdout, minChannel and maxCannel.
        Returns:
        The RequestInformation.
      • getConfigureJobParameters

        private RequestInformation getConfigureJobParameters()
        Creates the information needed for job configuration and initiates the parameters. The parameters added are: bioAssaySet and the parameters found in the configuration file.
        Returns:
        The RequestInformation
      • getConfigurePluginParameters

        private RequestInformation getConfigurePluginParameters()
        Creates the information needed for plugin configuration and initiates the parameters. The parameters added are: file and execPath.
        Returns:
        The RequestInformation.
      • getExecDirectory

        private File getExecDirectory()
                               throws IOException
        Get the exec directory as a java.io.File. The exec directory is a sub directory in "java.io.tmpdir".
        Returns:
        the directory.
        Throws:
        IOException
      • getExecLine

        private String getExecLine()
      • getInitializedFlatFileParser

        private FlatFileParser getInitializedFlatFileParser​(InputStream stream,
                                                            String charset)
        Creates a FlatFileParser for a plugin configuration file.
        Parameters:
        stream - The stream that the parser should read from.
        Returns:
        The initialised parser