Class ManagedRepositoryI

    • Field Detail

      • templateRoot

        protected FsFile templateRoot
    • Constructor Detail

      • ManagedRepositoryI

        public ManagedRepositoryI​(java.lang.String template,
                                  RepositoryDao dao)
                           throws java.lang.Exception
        Creates a ProcessContainer internally that will not be managed by background threads. Used primarily during testing.
        Parameters:
        template -
        dao -
        Throws:
        java.lang.Exception
      • ManagedRepositoryI

        public ManagedRepositoryI​(java.lang.String template,
                                  RepositoryDao dao,
                                  ProcessContainer processes,
                                  ome.security.SecuritySystem securitySystem,
                                  ome.util.checksum.ChecksumProviderFactory checksumProviderFactory,
                                  java.lang.String checksumAlgorithmSupported,
                                  java.lang.String pathRules,
                                  java.lang.String rootSessionUuid,
                                  ome.system.Roles roles,
                                  java.util.Set<java.lang.String> managedRepoUuids)
                           throws ServerError
        Throws:
        ServerError
    • Method Detail

      • tie

        public Ice.Object tie()
        Description copied from class: PublicRepositoryI
        Wrap the current instance with an TieBase so that it can be turned into a proxy. This is required due to the subclassing between public repo instances.
        Overrides:
        tie in class PublicRepositoryI
      • importPaths

        public ImportProcessPrx importPaths​(java.util.List<java.lang.String> paths,
                                            Ice.Current __current)
                                     throws ServerError
        Description copied from interface: _ManagedRepositoryOperations
        For clients without access to Bio-Formats, the simplified importPaths method allows passing solely the absolute path of the files to be uploaded (no directories) and all configuration happens server-side. Much of the functionality provided via Fileset and ImportSettings is of course lost.
        Specified by:
        importPaths in interface _ManagedRepositoryOperations
        __current - The Current object for the invocation.
        Throws:
        ServerError
      • listImports

        public java.util.List<ImportProcessPrx> listImports​(Ice.Current __current)
                                                     throws ServerError
        Description copied from interface: _ManagedRepositoryOperations
        List imports that are currently running in this importer. These will be limited based on user/group membership for the Fileset object which is being created by the import. If the user has write permissions for the fileset, then the import will be included.
        Specified by:
        listImports in interface _ManagedRepositoryOperations
        Parameters:
        __current - The Current object for the invocation.
        Throws:
        ServerError
      • listChecksumAlgorithms

        public java.util.List<ChecksumAlgorithm> listChecksumAlgorithms​(Ice.Current __current)
        Description copied from interface: _ManagedRepositoryOperations
        Return the list of checksum algorithms supported by this repository for verifying the integrity of uploaded files. They are named as ""algorithm-integer"", integer being the bit width of the resulting hash code. It is possible for the same algorithm to be offered with different bit widths. They are listed in descending order of preference, as set by the server administrator, and any of them may be specified for ImportSettings.checksumAlgorithm.
        Specified by:
        listChecksumAlgorithms in interface _ManagedRepositoryOperations
        Parameters:
        __current - The Current object for the invocation.
      • verifyChecksums

        public java.util.List<java.lang.Long> verifyChecksums​(java.util.List<java.lang.Long> ids,
                                                              Ice.Current __current)
                                                       throws ServerError
        Description copied from interface: _ManagedRepositoryOperations
        Verify the checksum for the original files identified by the given IDs. The files must be in this repository. Returns the IDs of the original files whose checksums do not match the file on disk.
        Specified by:
        verifyChecksums in interface _ManagedRepositoryOperations
        __current - The Current object for the invocation.
        Throws:
        ServerError
      • setChecksumAlgorithm

        public java.util.List<java.lang.Long> setChecksumAlgorithm​(ChecksumAlgorithm toHasherWrapped,
                                                                   java.util.List<java.lang.Long> ids,
                                                                   Ice.Current __current)
                                                            throws ServerError
        Description copied from interface: _ManagedRepositoryOperations
        Set the checksum algorithm for the original files identified by the given IDs and calculate their checksum accordingly. The files must be in this repository. Existing checksums are checked before being changed. If a checksum does not match, ServerError will be thrown; in this case some other files may already have had their checksum algorithm set. Returns the IDs of the original files that did not already have a checksum set for the given algorithm.
        Specified by:
        setChecksumAlgorithm in interface _ManagedRepositoryOperations
        __current - The Current object for the invocation.
        Throws:
        ServerError
      • createImportProcess

        protected ImportProcessPrx createImportProcess​(Fileset fs,
                                                       ImportLocation location,
                                                       ImportSettings settings,
                                                       Ice.Current __current)
                                                throws ServerError
        Creating the process will register itself in an appropriate container (i.e. a SessionI or similar) for the current user and therefore this instance no longer needs to worry about the maintenance of the object.
        Throws:
        ServerError
      • createUploadProcess

        protected ImportProcessPrx createUploadProcess​(Fileset fs,
                                                       ImportLocation location,
                                                       ImportSettings settings,
                                                       Ice.Current __current,
                                                       boolean uploadOnly)
                                                throws ServerError
        Creating the process will register itself in an appropriate container (i.e. a SessionI or similar) for the current user and therefore this instance no longer needs to worry about the maintenance of the object.
        Throws:
        ServerError
      • getReaderClass

        protected java.lang.Class<? extends loci.formats.FormatReader> getReaderClass​(Fileset fs,
                                                                                      Ice.Current __current)
        Get the suggested BioFormats Reader for the given Fileset.
        Parameters:
        fs - a fileset
        __current - the current ICE context
        Returns:
        a reader class, or null if none could be found
      • commonRoot

        protected FsFile commonRoot​(java.util.List<FsFile> paths)
        From a list of paths, calculate the common root path that all share. In the worst case, that may be "/". May not include the last element, the filename.
        Parameters:
        paths - some paths
        Returns:
        the paths' common root
      • expandTemplateRootOwnedPath

        protected FsFile expandTemplateRootOwnedPath​(EventContext ctx,
                                                     ome.system.ServiceFactory sf)
                                              throws ServerError
        Expand the root-owned segment of the template path.
        Parameters:
        ctx - the event context to apply in expanding terms
        sf - the service factory
        Returns:
        the expanded template path
        Throws:
        ServerError - if the path could not be expanded
      • createTemplatePath

        protected FsFile createTemplatePath​(java.lang.Object consistentData,
                                            Ice.Current __current)
                                     throws ServerError
        Expand the template path and create its directories with the correct ownership.
        Parameters:
        consistentData - the object to hash in expanding %hash%
        __current - the method invocation context
        Returns:
        the expanded template path
        Throws:
        ServerError - if the new path could not be created
      • createTemplatePath

        public FsFile createTemplatePath​(java.lang.Object consistentData,
                                         ome.system.EventContext ctx,
                                         ome.system.ServiceFactory sf,
                                         org.hibernate.Session session,
                                         ome.util.SqlAction sql)
                                  throws ServerError
        Expand the template path and create its directories with the correct ownership. Performs the work of createTemplatePath(Object, Current) except from within an existing transaction.
        Parameters:
        consistentData - the object to hash in expanding %hash%
        ctx - the event context to apply in expanding terms
        sf - the service factory
        session - the Hibernate session
        sql - the JDBC convenience wrapper
        Returns:
        the expanded template path
        Throws:
        ServerError - if the new path could not be created
      • trimPaths

        protected ome.services.blitz.repo.ManagedRepositoryI.Paths trimPaths​(FsFile basePath,
                                                                             java.util.List<FsFile> fullPaths,
                                                                             java.lang.Class<? extends loci.formats.FormatReader> readerClass)
        Trim off the start of long client-side paths.
        Parameters:
        basePath - the common root
        fullPaths - the full paths from the common root down to the filename
        readerClass - BioFormats reader for data, may be null
        Returns:
        possibly trimmed common root and full paths
      • suggestImportPaths

        protected ImportLocation suggestImportPaths​(FsFile relPath,
                                                    FsFile basePath,
                                                    java.util.List<FsFile> paths,
                                                    java.lang.Class<? extends loci.formats.FormatReader> reader,
                                                    ChecksumAlgorithm checksumAlgorithm,
                                                    Ice.Current __current)
                                             throws ServerError
        Take a relative path that the user would like to see in his or her upload area, and provide an import location instance whose paths correspond to existing directories corresponding to the sanitized file paths.
        Parameters:
        relPath - Path parsed from the template
        basePath - Common base of all the listed paths ("/my/path")
        reader - BioFormats reader for data, may be null
        checksumAlgorithm - the checksum algorithm to use in verifying the integrity of uploaded files
        Returns:
        ImportLocation instance
        Throws:
        ServerError