public class PublicRepositoryI extends Object implements omero.grid._RepositoryOperations, ApplicationContextAware
Modifier and Type | Class and Description |
---|---|
static class |
PublicRepositoryI.AMD_submit |
Modifier and Type | Field and Description |
---|---|
protected com.google.common.collect.ImmutableList<omero.model.ChecksumAlgorithm> |
checksumAlgorithms |
protected ChecksumProviderFactory |
checksumProviderFactory |
protected OmeroContext |
context |
static String |
DIRECTORY_MIMETYPE
Mimetype used to connote a directory
OriginalFile object. |
protected FilePathRestrictions |
filePathRestrictions |
static String |
IMPORT_LOG_MIMETYPE
media type for import logs
|
protected RepositoryDao |
repositoryDao |
protected ServerFilePathTransformer |
serverPaths |
Constructor and Description |
---|
PublicRepositoryI(RepositoryDao repositoryDao,
ChecksumProviderFactory checksumProviderFactory,
String checksumAlgorithmSupported,
String pathRules) |
Modifier and Type | Method and Description |
---|---|
protected CheckedPath |
checkPath(String path,
omero.model.ChecksumAlgorithm checksumAlgorithm,
Ice.Current curr)
Create a new
CheckedPath object based on the given user input. |
protected omero.api.RawFileStorePrx |
createRepoRFS(CheckedPath checked,
String mode,
Ice.Current __current)
Create, initialize, and register an
RepoRawFileStoreI
with the proper setting (read or write). |
omero.cmd.HandlePrx |
deletePaths(String[] files,
boolean recursive,
boolean force,
Ice.Current __current)
Delete paths recursively as described in Repositories.ice.
|
omero.api.RawFileStorePrx |
file(String path,
String mode,
Ice.Current __current) |
omero.api.RawFileStorePrx |
fileById(long fileId,
Ice.Current __current) |
boolean |
fileExists(String path,
Ice.Current __current) |
protected omero.model.OriginalFile |
findInDb(CheckedPath checked,
String mode,
Ice.Current current)
Find the given path in the DB or create.
|
protected omero.model.OriginalFile |
findOrCreateInDb(CheckedPath checked,
String mode,
Ice.Current curr) |
protected omero.model.OriginalFile |
findOrCreateInDb(CheckedPath checked,
String mode,
String mimetype,
Ice.Current curr) |
protected Ice.ObjectFactory |
getFactory(String id,
Ice.Current current) |
String |
getRepoUuid() |
void |
initialize(FileMaker fileMaker,
Long id,
String repoUuid)
Called by the internal repository once initialization has taken place.
|
List<String> |
list(String path,
Ice.Current __current) |
List<omero.model.OriginalFile> |
listFiles(String path,
Ice.Current __current) |
protected Ice.Current |
makeAdjustedCurrent(Ice.Current __current) |
protected void |
makeCheckedDirs(LinkedList<CheckedPath> paths,
boolean parents,
org.hibernate.Session s,
ServiceFactory sf,
SqlAction sql,
EventContext effectiveEventContext)
Internal method to be used by subclasses to perform any extra checks on
the listed of
CheckedPath instances before allowing the creation
of directories. |
void |
makeDir(CheckedPath checked,
boolean parents,
org.hibernate.Session s,
ServiceFactory sf,
SqlAction sql,
EventContext effectiveEventContext) |
void |
makeDir(String path,
boolean parents,
Ice.Current current)
Create a nested path in the repository.
|
String |
mimetype(String path,
Ice.Current __current)
Get the mimetype for a file.
|
protected OriginalFile |
persistLogFile(OriginalFile originalFile,
Ice.Current current)
Deprecated.
|
omero.api.RawPixelsStorePrx |
pixels(String path,
Ice.Current __current) |
protected void |
publishMessage(InternalMessage msg) |
omero.model.OriginalFile |
register(String path,
omero.RString mimetype,
Ice.Current __current)
Register an OriginalFile using its path
|
omero.model.OriginalFile |
root(Ice.Current __current) |
void |
setApplicationContext(ApplicationContext applicationContext) |
protected String |
stackTraceAsString(Throwable t) |
protected PublicRepositoryI.AMD_submit |
submitRequest(ServiceFactoryI sf,
omero.cmd.Request req,
Ice.Current current) |
protected Ice.Current |
sudo(Ice.Current current,
String sessionUuid)
Provide a
Current like the given one, except with the request context session UUID replaced. |
Ice.Object |
tie()
Wrap the current instance with an
TieBase so that it
can be turned into a proxy. |
omero.RMap |
treeList(String path,
Ice.Current __current) |
public static final String DIRECTORY_MIMETYPE
OriginalFile
object.public static final String IMPORT_LOG_MIMETYPE
protected ServerFilePathTransformer serverPaths
protected final RepositoryDao repositoryDao
protected final ChecksumProviderFactory checksumProviderFactory
protected final com.google.common.collect.ImmutableList<omero.model.ChecksumAlgorithm> checksumAlgorithms
protected FilePathRestrictions filePathRestrictions
protected OmeroContext context
public PublicRepositoryI(RepositoryDao repositoryDao, ChecksumProviderFactory checksumProviderFactory, String checksumAlgorithmSupported, String pathRules) throws omero.ServerError
omero.ServerError
public void initialize(FileMaker fileMaker, Long id, String repoUuid) throws omero.ValidationException
fileMaker
- id
- omero.ValidationException
public Ice.Object tie()
TieBase
so that it
can be turned into a proxy. This is required due to the subclassing
between public repo instances.public String getRepoUuid()
public omero.model.OriginalFile root(Ice.Current __current) throws omero.ServerError
root
in interface omero.grid._RepositoryOperations
omero.ServerError
public boolean fileExists(String path, Ice.Current __current) throws omero.ServerError
fileExists
in interface omero.grid._RepositoryOperations
omero.ServerError
public List<String> list(String path, Ice.Current __current) throws omero.ServerError
list
in interface omero.grid._RepositoryOperations
omero.ServerError
public List<omero.model.OriginalFile> listFiles(String path, Ice.Current __current) throws omero.ServerError
listFiles
in interface omero.grid._RepositoryOperations
omero.ServerError
public omero.RMap treeList(String path, Ice.Current __current) throws omero.ServerError
treeList
in interface omero.grid._RepositoryOperations
omero.ServerError
public omero.model.OriginalFile register(String path, omero.RString mimetype, Ice.Current __current) throws omero.ServerError
register
in interface omero.grid._RepositoryOperations
path
- Absolute path of the file to be registered.mimetype
- Mimetype as an RString__current
- ice context.omero.ServerError
public omero.cmd.HandlePrx deletePaths(String[] files, boolean recursive, boolean force, Ice.Current __current) throws omero.ServerError
treeList(String, Ice.Current)
to build the recursive
list of files.deletePaths
in interface omero.grid._RepositoryOperations
files
- non-null, preferably non-empty list of files to check.recursive
- See Repositories.ice for an explanationforce
- See Repositories.ice for an explanation__current
- Non-null ice context.omero.ServerError
public String mimetype(String path, Ice.Current __current) throws omero.ServerError
mimetype
in interface omero.grid._RepositoryOperations
path
- A path on a repository.__current
- ice context.omero.ServerError
public omero.api.RawPixelsStorePrx pixels(String path, Ice.Current __current) throws omero.ServerError
pixels
in interface omero.grid._RepositoryOperations
omero.ServerError
public omero.api.RawFileStorePrx file(String path, String mode, Ice.Current __current) throws omero.ServerError
file
in interface omero.grid._RepositoryOperations
omero.ServerError
public omero.api.RawFileStorePrx fileById(long fileId, Ice.Current __current) throws omero.ServerError
fileById
in interface omero.grid._RepositoryOperations
omero.ServerError
protected omero.model.OriginalFile findInDb(CheckedPath checked, String mode, Ice.Current current) throws omero.ServerError
omero.ServerError
@Deprecated protected OriginalFile persistLogFile(OriginalFile originalFile, Ice.Current current) throws omero.ServerError
originalFile
- the ID of the log filecurrent
- the Ice method invocation contextomero.ServerError
protected omero.model.OriginalFile findOrCreateInDb(CheckedPath checked, String mode, Ice.Current curr) throws omero.ServerError
omero.ServerError
protected omero.model.OriginalFile findOrCreateInDb(CheckedPath checked, String mode, String mimetype, Ice.Current curr) throws omero.ServerError
omero.ServerError
protected Ice.Current makeAdjustedCurrent(Ice.Current __current)
protected Ice.Current sudo(Ice.Current current, String sessionUuid)
Current
like the given one, except with the request context session UUID replaced.current
- an Current
instancesessionUuid
- a new session UUID for the instanceCurrent
instance like the given one but with the new session UUIDprotected omero.api.RawFileStorePrx createRepoRFS(CheckedPath checked, String mode, Ice.Current __current) throws omero.ServerError, omero.InternalException
RepoRawFileStoreI
with the proper setting (read or write).checked
- The file that will be read. Can't be null,
and must have ID set.mode
- The mode for writing. If null, read-only.__current
- The current user's session information.omero.ServerError
omero.InternalException
protected void publishMessage(InternalMessage msg) throws omero.ServerError, omero.InternalException
omero.ServerError
omero.InternalException
protected PublicRepositoryI.AMD_submit submitRequest(ServiceFactoryI sf, omero.cmd.Request req, Ice.Current current) throws omero.ServerError, omero.InternalException
omero.ServerError
omero.InternalException
protected Ice.ObjectFactory getFactory(String id, Ice.Current current)
public void makeDir(String path, boolean parents, Ice.Current current) throws omero.ServerError
makeDir
in interface omero.grid._RepositoryOperations
path
- A path on a repository.parents
- Boolean switch like the "mkdir -p" flag in unix.current
- ice context.omero.ServerError
public void makeDir(CheckedPath checked, boolean parents, org.hibernate.Session s, ServiceFactory sf, SqlAction sql, EventContext effectiveEventContext) throws omero.ServerError
omero.ServerError
protected void makeCheckedDirs(LinkedList<CheckedPath> paths, boolean parents, org.hibernate.Session s, ServiceFactory sf, SqlAction sql, EventContext effectiveEventContext) throws omero.ServerError
CheckedPath
instances before allowing the creation
of directories.paths
- Not null, not empty. (Will be emptied by this method.)parents
- "mkdir -p" like flag.s
- The sessionsf
- sql
- effectiveEventContext
- omero.ServerError
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
protected CheckedPath checkPath(String path, omero.model.ChecksumAlgorithm checksumAlgorithm, Ice.Current curr) throws omero.ValidationException
CheckedPath
object based on the given user input.
This method is included to allow subclasses a chance to introduce their
own CheckedPath
implementations.path
- A path on a repository.omero.ValidationException
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.