public class ImportLibrary extends 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,
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. |
List<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.
|
List<omero.model.Pixels> |
importImage(ImportContainer container,
int index,
int numDone,
int total)
Perform an image import uploading files if necessary.
|
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
|
String |
uploadFile(omero.grid.ImportProcessPrx proc,
String[] srcFiles,
int index,
ChecksumProviderFactory cpf,
TimeEstimator estimator,
byte[] buf) |
String |
uploadFile(omero.grid.ImportProcessPrx proc,
String[] srcFiles,
int index,
TimeEstimator estimator) |
List<String> |
uploadFilesToRepository(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, 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 List<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, IOException
ImportProcessPrx
which will manage state server-side.container
- the import containeromero.ServerError
- if the import process could not be createdIOException
- if the used files' absolute path could not be foundpublic List<String> uploadFilesToRepository(String[] srcFiles, omero.grid.ImportProcessPrx proc)
srcFiles
- the files to uploadproc
- the server import process to use for the uploadpublic String uploadFile(omero.grid.ImportProcessPrx proc, String[] srcFiles, int index, TimeEstimator estimator) throws omero.ServerError, IOException
omero.ServerError
IOException
public String uploadFile(omero.grid.ImportProcessPrx proc, String[] srcFiles, int index, ChecksumProviderFactory cpf, TimeEstimator estimator, byte[] buf) throws omero.ServerError, IOException
omero.ServerError
IOException
public List<omero.model.Pixels> importImage(ImportContainer container, int index, int numDone, int total) throws FormatException, IOException, Throwable
container
- The import container which houses all the configuration
values and target for the import.index
- Index of the import in a set. 0
is safe if
this is a singular import.numDone
- Number of imports completed in a set. 0
is
safe if this is a singular import.total
- Total number of imports in a set. 1
is safe
if this is a singular import.FormatException
- If there is a Bio-Formats image file format
error during import.IOException
- If there is an I/O error.omero.ServerError
- If there is an error communicating with the OMERO
server we're importing into.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.3.5-ice35-b73
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.