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(omero.grid.ImportProcessPrx proc,
omero.cmd.HandlePrx handle,
ImportContainer container) |
omero.grid.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<omero.model.Pixels> |
importImage(ImportContainer container,
java.util.concurrent.ExecutorService threadPool,
int index)
Perform an image import uploading files if necessary.
|
java.util.List<omero.model.Pixels> |
importImage(ImportContainer container,
int index,
int numDone,
int total)
Deprecated.
now used by tests only
|
omero.model.OriginalFile |
loadOriginalFile(omero.api.RawFileStorePrx uploader)
Use
RawFileStorePrx.getFileId() in order to load the
OriginalFile that the service argument is acting on. |
omero.grid.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(omero.grid.ImportProcessPrx proc,
java.lang.String[] srcFiles,
int index,
ChecksumProviderFactory cpf,
TimeEstimator estimator,
byte[] buf) |
java.lang.String |
uploadFile(omero.grid.ImportProcessPrx proc,
java.lang.String[] srcFiles,
int index,
TimeEstimator estimator) |
java.util.List<java.lang.String> |
uploadFilesToRepository(java.lang.String[] srcFiles,
omero.grid.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 omero.ServerError
container
- The current import container containing usedFiles to be
deleted.omero.ServerError
- if file deletion failedpublic omero.grid.ImportProcessPrx createImport(ImportContainer container) throws omero.ServerError, java.io.IOException
ImportProcessPrx
which will manage state server-side.container
- the import containeromero.ServerError
- 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, omero.grid.ImportProcessPrx proc)
srcFiles
- the files to uploadproc
- the server import process to use for the uploadpublic java.lang.String uploadFile(omero.grid.ImportProcessPrx proc, java.lang.String[] srcFiles, int index, TimeEstimator estimator) throws omero.ServerError, java.io.IOException
omero.ServerError
java.io.IOException
public java.lang.String uploadFile(omero.grid.ImportProcessPrx proc, java.lang.String[] srcFiles, int index, ChecksumProviderFactory cpf, TimeEstimator estimator, byte[] buf) throws omero.ServerError, java.io.IOException
omero.ServerError
java.io.IOException
@Deprecated public java.util.List<omero.model.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<omero.model.Pixels> importImage(ImportContainer container, java.util.concurrent.ExecutorService threadPool, int index) throws 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.FormatException
- If there is a Bio-Formats image file format
error during import.java.io.IOException
- If there is an I/O error.omero.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(omero.grid.ImportProcessPrx proc, omero.cmd.HandlePrx handle, ImportContainer container) throws omero.ServerError
omero.ServerError
public omero.grid.ManagedRepositoryPrx lookupManagedRepository()
public void clear()
public omero.model.OriginalFile loadOriginalFile(omero.api.RawFileStorePrx uploader) throws omero.ServerError
RawFileStorePrx.getFileId()
in order to load the
OriginalFile
that the service argument is acting on.uploader
- not nullomero.ServerError
- if the file could not be identified and loaded
Version: 5.4.10-ice35-b105
Copyright © 2019 The University of Dundee & Open Microscopy Environment. All Rights Reserved.