Class ImportLibrary

    • Method Detail

      • addObserver

        public boolean addObserver​(IObserver object)
        Description copied from interface: IObservable
        Add observer for notification
        Specified by:
        addObserver in interface IObservable
        Parameters:
        object - - observer object
        Returns:
        true if added
      • deleteObserver

        public boolean deleteObserver​(IObserver object)
        Description copied from interface: IObservable
        Delete observer
        Specified by:
        deleteObserver in interface IObservable
        Parameters:
        object - - observer to delete
        Returns:
        true if deleted
      • notifyObservers

        public void notifyObservers​(ImportEvent event)
        Description copied from interface: IObservable
        Notify observers of event
        Specified by:
        notifyObservers in interface IObservable
        Parameters:
        event - - event that happened
      • importCandidates

        public boolean importCandidates​(ImportConfig config,
                                        ImportCandidates candidates)
        Primary user method for importing a number of import candidates.
        Parameters:
        config - The configuration information.
        candidates - Hosts information about the files to import.
        Returns:
        if the import did not exit because of an error
      • deleteFilesFromRepository

        public java.util.List<java.lang.String> deleteFilesFromRepository​(ImportContainer container)
                                                                   throws ServerError
        Delete files from the managed repository.
        Parameters:
        container - The current import container containing usedFiles to be deleted.
        Returns:
        List of files that could not be deleted.
        Throws:
        ServerError - if file deletion failed
      • createImport

        public ImportProcessPrx createImport​(ImportContainer container)
                                      throws ServerError,
                                             java.io.IOException
        Provide initial configuration to the server in order to create the ImportProcessPrx which will manage state server-side.
        Parameters:
        container - the import container
        Returns:
        the new import process from the server
        Throws:
        ServerError - if the import process could not be created
        java.io.IOException - if the used files' absolute path could not be found
      • uploadFilesToRepository

        public java.util.List<java.lang.String> uploadFilesToRepository​(java.lang.String[] srcFiles,
                                                                        ImportProcessPrx proc)
        Upload files to the managed repository. This is done by first passing in the possibly absolute local file paths. A common selection of those are chosen and passed back to the client. As each file is written to the server, a message digest is kept updated of the bytes that are being written. These are then returned to the caller so they can be checked against the values found on the server.
        Parameters:
        srcFiles - the files to upload
        proc - the server import process to use for the upload
        Returns:
        A list of the client-side (i.e. local) hashes for each file.
      • uploadFile

        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
        Throws:
        ServerError
        java.io.IOException
      • importImage

        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
        Perform an image import uploading files if necessary.
        Parameters:
        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.
        Returns:
        List of Pixels that have been imported.
        Throws:
        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.
        Since:
        OMERO Beta 4.2.1.
      • getMetadataStore

        public OMEROMetadataStoreClient getMetadataStore()
        Retrieves the currently active metadata store.
        Returns:
        See above.
      • lookupManagedRepository

        public ManagedRepositoryPrx lookupManagedRepository()
        Retrieves the first managed repository from the list of current active repositories.
        Returns:
        Active proxy for the legacy repository.
      • clear

        public void clear()