public class ImportLibrary extends java.lang.Object implements IObservable
OMEROMetadataStoreClient
and
FormatReader
instances. This library was factored out of
ImportHandler to support ImportFixtureFormatReader
,
OMEROMetadataStoreClient
,
ImportFixture
,
IObservable
,
IObserver
Modifier and Type | Class and Description |
---|---|
class |
ImportLibrary.ImportCallback |
Constructor and Description |
---|
ImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader)
The default implementation of
FileTransfer performs a
no-op and therefore need not have
FileTransfer.afterTransfer(int, List) as with the
ImportLibrary(OMEROMetadataStoreClient, OMEROWrapper, FileTransfer)
constructor. |
ImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader,
FileTransfer transfer)
The library will not close the client instance.
|
ImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader,
FileTransfer transfer,
int minutesToWait) |
ImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader,
FileTransfer transfer,
java.util.List<FileExclusion> exclusions,
int minutesToWait) |
Modifier and Type | Method and Description |
---|---|
boolean |
addObserver(IObserver object)
Add observer for notification
|
void |
clear() |
ImportLibrary.ImportCallback |
createCallback(ImportProcessPrx proc,
HandlePrx handle,
ImportContainer container) |
ImportProcessPrx |
createImport(ImportContainer container)
Provide initial configuration to the server in order to create the
ImportProcessPrx which will manage state server-side. |
java.util.List<java.lang.String> |
deleteFilesFromRepository(ImportContainer container)
Delete files from the managed repository.
|
boolean |
deleteObserver(IObserver object)
Delete observer
|
boolean |
importCandidates(ImportConfig config,
ImportCandidates candidates)
Primary user method for importing a number of import candidates.
|
java.util.List<Pixels> |
importImage(ImportContainer container,
java.util.concurrent.ExecutorService threadPool,
int index)
Perform an image import uploading files if necessary.
|
java.util.List<Pixels> |
importImage(ImportContainer container,
int index,
int numDone,
int total)
Deprecated.
now used by tests only
|
OriginalFile |
loadOriginalFile(RawFileStorePrx uploader)
Use
RawFileStorePrx.getFileId() in order to load the
OriginalFile that the service argument is acting on. |
ManagedRepositoryPrx |
lookupManagedRepository()
Retrieves the first managed repository from the list of current active
repositories.
|
void |
notifyObservers(ImportEvent event)
Notify observers of event
|
java.lang.String |
uploadFile(ImportProcessPrx proc,
java.lang.String[] srcFiles,
int index,
ome.util.checksum.ChecksumProviderFactory cpf,
TimeEstimator estimator,
byte[] buf) |
java.lang.String |
uploadFile(ImportProcessPrx proc,
java.lang.String[] srcFiles,
int index,
TimeEstimator estimator) |
java.util.List<java.lang.String> |
uploadFilesToRepository(java.lang.String[] srcFiles,
ImportProcessPrx proc)
Upload files to the managed repository.
|
public ImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader)
FileTransfer
performs a
no-op and therefore need not have
FileTransfer.afterTransfer(int, List)
as with the
ImportLibrary(OMEROMetadataStoreClient, OMEROWrapper, FileTransfer)
constructor.client
- client-side MetadataStore
, not nullreader
- a Bio-Formats reader (ignored), not nullpublic ImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader, FileTransfer transfer)
FileTransfer.afterTransfer(int, List)
falls to invokers of this
method.client
- client-side MetadataStore
, not nullreader
- a Bio-Formats reader (ignored), not nulltransfer
- how files are to be transferred to the serverpublic ImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader, FileTransfer transfer, int minutesToWait)
public ImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader, FileTransfer transfer, java.util.List<FileExclusion> exclusions, int minutesToWait)
public boolean addObserver(IObserver object)
IObservable
addObserver
in interface IObservable
object
- - observer objectpublic boolean deleteObserver(IObserver object)
IObservable
deleteObserver
in interface IObservable
object
- - observer to deletepublic void notifyObservers(ImportEvent event)
IObservable
notifyObservers
in interface IObservable
event
- - event that happenedpublic boolean importCandidates(ImportConfig config, ImportCandidates candidates)
config
- The configuration information.candidates
- Hosts information about the files to import.public java.util.List<java.lang.String> deleteFilesFromRepository(ImportContainer container) throws ServerError
container
- The current import container containing usedFiles to be
deleted.ServerError
- if file deletion failedpublic ImportProcessPrx createImport(ImportContainer container) throws ServerError, java.io.IOException
ImportProcessPrx
which will manage state server-side.container
- the import containerServerError
- if the import process could not be createdjava.io.IOException
- if the used files' absolute path could not be foundpublic java.util.List<java.lang.String> uploadFilesToRepository(java.lang.String[] srcFiles, ImportProcessPrx proc)
srcFiles
- the files to uploadproc
- the server import process to use for the uploadpublic java.lang.String uploadFile(ImportProcessPrx proc, java.lang.String[] srcFiles, int index, TimeEstimator estimator) throws ServerError, java.io.IOException
ServerError
java.io.IOException
public java.lang.String uploadFile(ImportProcessPrx proc, java.lang.String[] srcFiles, int index, ome.util.checksum.ChecksumProviderFactory cpf, TimeEstimator estimator, byte[] buf) throws ServerError, java.io.IOException
ServerError
java.io.IOException
@Deprecated public java.util.List<Pixels> importImage(ImportContainer container, int index, int numDone, int total) throws java.lang.Throwable
java.lang.Throwable
importImage(ImportContainer, ExecutorService, int)
public java.util.List<Pixels> importImage(ImportContainer container, java.util.concurrent.ExecutorService threadPool, int index) throws loci.formats.FormatException, java.io.IOException, java.lang.Throwable
container
- The import container which houses all the configuration
values and target for the import.threadPool
- The pool of threads to use in file upload.index
- Index of the import in a set. 0
is safe if
this is a singular import.loci.formats.FormatException
- If there is a Bio-Formats image file format
error during import.java.io.IOException
- If there is an I/O error.ServerError
- If there is an error communicating with the OMERO
server we're importing into.java.lang.Throwable
- If there is some other kind of error during import.public ImportLibrary.ImportCallback createCallback(ImportProcessPrx proc, HandlePrx handle, ImportContainer container) throws ServerError
ServerError
public ManagedRepositoryPrx lookupManagedRepository()
public void clear()
public OriginalFile loadOriginalFile(RawFileStorePrx uploader) throws ServerError
RawFileStorePrx.getFileId()
in order to load the
OriginalFile
that the service argument is acting on.uploader
- not nullServerError
- if the file could not be identified and loaded