public class ManagedRepositoryI extends PublicRepositoryI implements _ManagedRepositoryOperations
PublicRepositoryI.AMD_submit
Modifier and Type | Field and Description |
---|---|
protected FsFile |
templateRoot |
checksumAlgorithms, checksumProviderFactory, context, DIRECTORY_MIMETYPE, filePathRestrictions, IMPORT_LOG_MIMETYPE, repositoryDao, serverPaths
Constructor and Description |
---|
ManagedRepositoryI(java.lang.String template,
RepositoryDao dao)
Creates a
ProcessContainer internally that will not be managed
by background threads. |
ManagedRepositoryI(java.lang.String template,
RepositoryDao dao,
ProcessContainer processes,
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) |
Modifier and Type | Method and Description |
---|---|
protected FsFile |
commonRoot(java.util.List<FsFile> paths)
From a list of paths, calculate the common root path that all share.
|
protected ImportProcessPrx |
createImportProcess(Fileset fs,
ImportLocation location,
ImportSettings settings,
Ice.Current __current)
Creating the process will register itself in an appropriate
container (i.e.
|
protected FsFile |
createTemplatePath(java.lang.Object consistentData,
Ice.Current __current)
Expand the template path and create its directories with the correct ownership.
|
protected ImportProcessPrx |
createUploadProcess(Fileset fs,
ImportLocation location,
ImportSettings settings,
Ice.Current __current,
boolean uploadOnly)
Creating the process will register itself in an appropriate
container (i.e.
|
protected FsFile |
expandTemplateRootOwnedPath(EventContext ctx,
ome.system.ServiceFactory sf)
Expand the root-owned segment of the template path.
|
protected java.lang.Class<? extends loci.formats.FormatReader> |
getReaderClass(Fileset fs,
Ice.Current __current)
Get the suggested BioFormats Reader for the given Fileset.
|
ImportProcessPrx |
importFileset(Fileset fs,
ImportSettings settings,
Ice.Current __current)
Return a template based directory path.
|
ImportProcessPrx |
importPaths(java.util.List<java.lang.String> paths,
Ice.Current __current)
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. |
void |
initialize(FileMaker fileMaker,
java.lang.Long id,
java.lang.String repoUuid)
Called by the internal repository once initialization has taken place.
|
java.util.List<ChecksumAlgorithm> |
listChecksumAlgorithms(Ice.Current __current)
Return the list of checksum algorithms supported by this repository
for verifying the integrity of uploaded files.
|
java.util.List<ImportProcessPrx> |
listImports(Ice.Current __current)
List imports that are currently running in this importer.
|
protected void |
makeCheckedDirs(java.util.LinkedList<CheckedPath> paths,
boolean parents,
org.hibernate.Session s,
ome.system.ServiceFactory sf,
ome.util.SqlAction sql,
ome.system.EventContext effectiveEventContext)
Checks for the top-level user directory restriction before calling
PublicRepositoryI.makeCheckedDirs(LinkedList, boolean, Session, ServiceFactory, SqlAction, EventContext) |
java.util.List<java.lang.Long> |
setChecksumAlgorithm(ChecksumAlgorithm toHasherWrapped,
java.util.List<java.lang.Long> ids,
Ice.Current __current)
Set the checksum algorithm for the original files identified
by the given IDs and calculate their checksum accordingly.
|
ChecksumAlgorithm |
suggestChecksumAlgorithm(java.util.List<ChecksumAlgorithm> supported,
Ice.Current __current)
Suggest a checksum algorithm to use for
ImportSettings.checksumAlgorithm according to the
preferences set by the server administrator. |
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)
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.
|
Ice.Object |
tie()
Wrap the current instance with an
TieBase so that it
can be turned into a proxy. |
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.
|
ImportProcessPrx |
uploadFileset(Fileset fs,
ImportSettings settings,
Ice.Current __current)
Return a template based directory path.
|
java.util.List<java.lang.Long> |
verifyChecksums(java.util.List<java.lang.Long> ids,
Ice.Current __current)
Verify the checksum for the original files identified by
the given IDs.
|
checkPath, createRepoRFS, deletePaths, file, fileById, fileExists, findInDb, findOrCreateInDb, findOrCreateInDb, getFactory, getRepoUuid, list, listFiles, makeAdjustedCurrent, makeDir, makeDir, mimetype, persistLogFile, publishMessage, register, root, setApplicationContext, stackTraceAsString, submitRequest, submitRequest, sudo, treeList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deletePaths, file, fileById, fileExists, list, listFiles, makeDir, mimetype, register, root, treeList
protected FsFile templateRoot
public ManagedRepositoryI(java.lang.String template, RepositoryDao dao) throws java.lang.Exception
ProcessContainer
internally that will not be managed
by background threads. Used primarily during testing.template
- dao
- java.lang.Exception
public ManagedRepositoryI(java.lang.String template, RepositoryDao dao, ProcessContainer processes, 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
ServerError
public Ice.Object tie()
PublicRepositoryI
TieBase
so that it
can be turned into a proxy. This is required due to the subclassing
between public repo instances.tie
in class PublicRepositoryI
public void initialize(FileMaker fileMaker, java.lang.Long id, java.lang.String repoUuid) throws ValidationException
PublicRepositoryI
initialize
in class PublicRepositoryI
ValidationException
public ImportProcessPrx uploadFileset(Fileset fs, ImportSettings settings, Ice.Current __current) throws ServerError
PublicRepositoryI.makeDir(String, boolean, Ice.Current)
.ServerError
public ImportProcessPrx importFileset(Fileset fs, ImportSettings settings, Ice.Current __current) throws ServerError
PublicRepositoryI.makeDir(String, boolean, Ice.Current)
.importFileset
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.ServerError
public ImportProcessPrx importPaths(java.util.List<java.lang.String> paths, Ice.Current __current) throws ServerError
_ManagedRepositoryOperations
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.importPaths
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.ServerError
public java.util.List<ImportProcessPrx> listImports(Ice.Current __current) throws ServerError
_ManagedRepositoryOperations
Fileset
object which is being created
by the import. If the user has write permissions for the
fileset, then the import will be included.listImports
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.ServerError
public java.util.List<ChecksumAlgorithm> listChecksumAlgorithms(Ice.Current __current)
_ManagedRepositoryOperations
ImportSettings.checksumAlgorithm
.listChecksumAlgorithms
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.public ChecksumAlgorithm suggestChecksumAlgorithm(java.util.List<ChecksumAlgorithm> supported, Ice.Current __current)
_ManagedRepositoryOperations
ImportSettings.checksumAlgorithm
according to the
preferences set by the server administrator. Provide a
list of the algorithms supported by the client, and the
server will report which of them is most preferred by
the server, or return null if none of them are supported.suggestChecksumAlgorithm
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.public java.util.List<java.lang.Long> verifyChecksums(java.util.List<java.lang.Long> ids, Ice.Current __current) throws ServerError
_ManagedRepositoryOperations
verifyChecksums
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.ServerError
public java.util.List<java.lang.Long> setChecksumAlgorithm(ChecksumAlgorithm toHasherWrapped, java.util.List<java.lang.Long> ids, Ice.Current __current) throws ServerError
_ManagedRepositoryOperations
setChecksumAlgorithm
in interface _ManagedRepositoryOperations
__current
- The Current object for the invocation.ServerError
protected ImportProcessPrx createImportProcess(Fileset fs, ImportLocation location, ImportSettings settings, Ice.Current __current) throws ServerError
ServerError
protected ImportProcessPrx createUploadProcess(Fileset fs, ImportLocation location, ImportSettings settings, Ice.Current __current, boolean uploadOnly) throws ServerError
ServerError
protected java.lang.Class<? extends loci.formats.FormatReader> getReaderClass(Fileset fs, Ice.Current __current)
fs
- a fileset__current
- the current ICE contextprotected FsFile commonRoot(java.util.List<FsFile> paths)
paths
- some pathsprotected FsFile expandTemplateRootOwnedPath(EventContext ctx, ome.system.ServiceFactory sf) throws ServerError
ctx
- the event context to apply in expanding termssf
- the service factory which to perform queriesServerError
- if the path could not be expandedprotected FsFile createTemplatePath(java.lang.Object consistentData, Ice.Current __current) throws ServerError
consistentData
- the object to hash in expanding %hash%
__current
- the current ICE method invocation contextServerError
- if the new path could not be createdprotected ome.services.blitz.repo.ManagedRepositoryI.Paths trimPaths(FsFile basePath, java.util.List<FsFile> fullPaths, java.lang.Class<? extends loci.formats.FormatReader> readerClass)
basePath
- the common rootfullPaths
- the full paths from the common root down to the filenamereaderClass
- BioFormats reader for data, may be nullprotected 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
relPath
- Path parsed from the templatebasePath
- Common base of all the listed paths ("/my/path")reader
- BioFormats reader for data, may be nullchecksumAlgorithm
- the checksum algorithm to use in verifying the integrity of uploaded filesImportLocation
instanceServerError
protected void makeCheckedDirs(java.util.LinkedList<CheckedPath> paths, boolean parents, org.hibernate.Session s, ome.system.ServiceFactory sf, ome.util.SqlAction sql, ome.system.EventContext effectiveEventContext) throws ServerError
PublicRepositoryI.makeCheckedDirs(LinkedList, boolean, Session, ServiceFactory, SqlAction, EventContext)
makeCheckedDirs
in class PublicRepositoryI
paths
- Not null, not empty. (Will be emptied by this method.)parents
- "mkdir -p" like flag.s
- The sessionServerError