public class CommandLineImporter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ImportCandidates |
candidates
Candidates for import
|
ImportConfig |
config
Configuration used by all components
|
static int |
DEFAULT_WAIT |
java.util.List<FileExclusion> |
exclusions
FileExclusion mechanisms for skipping candidates |
protected boolean |
getUsedFiles
If true, then only a report on used files will be produced
|
ErrorHandler |
handler
ErrorHandler which is also responsible for uploading files
|
protected ImportOutput |
importOutput
Format which should be preferred for standard out messages
|
ImportLibrary |
library
Base importer library, this is what we actually use to import.
|
protected OMEROWrapper |
reader
Bio-Formats reader wrapper customized for OMERO.
|
protected OMEROMetadataStoreClient |
store
Bio-Formats
MetadataStore implementation for OMERO. |
FileTransfer |
transfer
FileTransfer mechanism to be used for uploading |
Constructor and Description |
---|
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles)
Legacy constructor which uses a
UploadFileTransfer . |
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles,
FileTransfer transfer,
int minutesToWait)
Legacy constructor without any file exclusions.
|
CommandLineImporter(ImportConfig config,
java.lang.String[] paths,
boolean getUsedFiles,
FileTransfer transfer,
java.util.List<FileExclusion> exclusions,
int minutesToWait)
Main entry class for the application.
|
Modifier and Type | Method and Description |
---|---|
static void |
advUsage()
Prints advanced usage to STDERR and exits with return code 1.
|
protected void |
checkLogin()
Checks that requisite command line options for OMERO session
creation have been provided and if not calls
usage() . |
void |
cleanup()
Cleans up after a successful or unsuccessful image import.
|
static int |
closeCompleted(ImportConfig config)
Look for all
ImportProcessPrx in the current session and close
them if they return a non-null Response (i.e. |
protected ImportLibrary |
createImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader,
FileTransfer transfer,
java.util.List<FileExclusion> exclusions,
int minutesToWait)
Creates the
ImportLibrary that this command line importer will
use to import data |
static void |
main(java.lang.String[] args)
Command line application entry point which parses CLI arguments and
passes them into the importer.
|
static void |
setArgument(java.util.Map<java.lang.String,java.lang.Boolean> map,
java.lang.String key)
Set a conflicting argument and return the usage if the key is already
set
|
ImportOutput |
setImportOutput(ImportOutput importOutput)
Set the current
ImportOutput (defaulting to null if
a null value is passed). |
int |
start() |
static void |
usage()
Prints usage to STDERR and exits with return code 1.
|
static int |
waitCompleted(ImportConfig config)
Look for all
ImportProcessPrx in the current session and close
them if they return a non-null Response (i.e. |
public static final int DEFAULT_WAIT
public final ImportConfig config
public final FileTransfer transfer
FileTransfer
mechanism to be used for uploadingpublic final java.util.List<FileExclusion> exclusions
FileExclusion
mechanisms for skipping candidatespublic final ImportLibrary library
public final ErrorHandler handler
protected final OMEROWrapper reader
protected final OMEROMetadataStoreClient store
MetadataStore
implementation for OMERO.protected final ImportCandidates candidates
protected final boolean getUsedFiles
protected ImportOutput importOutput
public CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles) throws java.lang.Exception
UploadFileTransfer
.config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filesjava.lang.Exception
- if the import could not be set uppublic CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles, FileTransfer transfer, int minutesToWait) throws java.lang.Exception
config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filestransfer
- how files are to be transferred to the serverminutesToWait
- for how many minutes to wait for an import (negative for indefinitely)java.lang.Exception
- if the import could not be set uppublic CommandLineImporter(ImportConfig config, java.lang.String[] paths, boolean getUsedFiles, FileTransfer transfer, java.util.List<FileExclusion> exclusions, int minutesToWait) throws java.lang.Exception
config
- the import configurationpaths
- files or directories to searchgetUsedFiles
- if only getting a list of used filestransfer
- how files are to be transferred to the serverexclusions
- mechanisms to be used for skipping candidatesminutesToWait
- for how many minutes to wait for an import (negative for indefinitely)java.lang.Exception
- if the import could not be set upprotected void checkLogin()
usage()
.protected ImportLibrary createImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader, FileTransfer transfer, java.util.List<FileExclusion> exclusions, int minutesToWait)
ImportLibrary
that this command line importer will
use to import dataclient
- Bio-Formats MetadataStore
implementation for OMEROreader
- Bio-Formats reader wrapper customized for OMEROtransfer
- FileTransfer
mechanism to be used for uploadingexclusions
- FileExclusion
mechanisms for skipping candidatesminutesToWait
- for how many minutes to wait for an import (negative for indefinitely)public static int closeCompleted(ImportConfig config) throws java.lang.Exception
ImportProcessPrx
in the current session and close
them if they return a non-null Response
(i.e. they are done).config
- the import configurationjava.lang.Exception
- in the event of errorpublic static int waitCompleted(ImportConfig config) throws java.lang.Exception
ImportProcessPrx
in the current session and close
them if they return a non-null Response
(i.e. they are done).config
- the import configuration0
for successjava.lang.Exception
- in the event of errorpublic ImportOutput setImportOutput(ImportOutput importOutput)
ImportOutput
(defaulting to null if
a null value is passed).importOutput
- possibly null enumeration value.public int start()
public void cleanup()
public static void usage()
public static void advUsage()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- Command line arguments.java.lang.Exception
- in the event of errorpublic static void setArgument(java.util.Map<java.lang.String,java.lang.Boolean> map, java.lang.String key)
map
- map of conflicting propertieskey
- configuration property to be set