public interface RepositoryDao
Modifier and Type | Method and Description |
---|---|
boolean |
canUpdate(omero.model.IObject obj,
Ice.Current current)
Delegates to IAdmin#canUpdate
|
void |
createOrFixUserDir(String uuid,
List<CheckedPath> path,
org.hibernate.Session s,
ServiceFactory sf,
SqlAction sql)
Checks that the given
CheckedPath objects exist (via
findRepoFile(String, CheckedPath, String, Ice.Current) )
and are in the "user" group. |
List<Integer> |
deleteRepoDeleteLogs(List<SqlAction.DeleteLog> templates,
Ice.Current current)
Call
SqlAction.deleteRepoDeleteLogs(DeleteLog) with the current
context for a number of templates. |
int |
deleteRepoDeleteLogs(SqlAction.DeleteLog template,
Ice.Current current)
Call
SqlAction.deleteRepoDeleteLogs(DeleteLog) with the current
context. |
List<Long> |
filterFilesByRepository(String repo,
List<Long> ids,
Ice.Current current)
Find the original file IDs among those given that are in the given repository.
|
List<List<SqlAction.DeleteLog>> |
findRepoDeleteLogs(List<SqlAction.DeleteLog> templates,
Ice.Current current)
As
findRepoDeleteLogs(DeleteLog, Current) but for a collection
of templates. |
List<SqlAction.DeleteLog> |
findRepoDeleteLogs(SqlAction.DeleteLog template,
Ice.Current current)
Call
SqlAction.findRepoDeleteLogs(DeleteLog) with the current
context. |
OriginalFile |
findRepoFile(ServiceFactory sf,
SqlAction sql,
String uuid,
CheckedPath checked,
String mimetype)
As
findRepoFile(String, CheckedPath, String, Current) but
can be called from within a transaction. |
omero.model.OriginalFile |
findRepoFile(String uuid,
CheckedPath checked,
String mimetype,
Ice.Current current)
Delegate to
SqlAction.findRepoFile(String, String, String, String)
for looking up the id of the file, and then load it normally via
IQuery. |
ChecksumAlgorithm |
getChecksumAlgorithm(String name,
Ice.Current current)
Retrieve the checksum algorithm of the given name.
|
omero.sys.EventContext |
getEventContext(Ice.Current current)
Look up information for the current session as specified in the ctx
field of the current.
|
FsFile |
getFile(long id,
Ice.Current current,
String repoUuid)
Get an
FsFile object based on its ID. |
omero.model.OriginalFile |
getOriginalFile(long fileId,
Ice.Current current)
Gets the original file instance for a given file ID.
|
List<omero.model.OriginalFile> |
getOriginalFiles(String repoUuid,
CheckedPath checked,
Ice.Current current)
Return a non-null, possibly empty list of
OriginalFile elements
which are accessible to the given user at the given path. |
OriginalFile |
getOriginalFileWithHasher(long id,
Ice.Current current)
Retrieve the original file of the given ID.
|
RawFileStore |
getRawFileStore(long fileId,
CheckedPath checked,
String mode,
Ice.Current current)
Create a
RawFileBean (i.e. an implementation of
RawFileStore which can be passed to
RepoRawFileStoreI for performing internal functions. |
String |
getUserInstitution(long userId,
Ice.Current current)
Get the current user's institution.
|
String |
getUserInstitution(long userId,
ServiceFactory sf)
Get the current user's institution.
|
List<omero.model.Fileset> |
loadFilesets(List<Long> ids,
Ice.Current current)
Load filesets by id.
|
void |
makeDirs(PublicRepositoryI repo,
List<CheckedPath> dirs,
boolean parents,
Ice.Current c)
Create a number of directories in a single transaction, using the
PublicRepositoryI instance as a callback for implementation
specific logic. |
omero.model.OriginalFile |
register(String repoUuid,
CheckedPath checked,
String mimetype,
Ice.Current current)
Register an OriginalFile object
|
OriginalFile |
register(String repoUuid,
CheckedPath checked,
String mimetype,
ServiceFactory sf,
SqlAction sql)
Like
register(String, CheckedPath, String, Ice.Current) but
does not create a new transaction. |
omero.model.Fileset |
saveFileset(String repoUuid,
omero.model.Fileset fs,
omero.model.ChecksumAlgorithm checksumAlgorithm,
List<CheckedPath> paths,
Ice.Current current)
Fill the various fields of the
Fileset and then save the
entire instance into the database. |
<T extends omero.model.Job> |
saveJob(T job,
Ice.Current current)
Create a job from an instance provided by either the client or the
server.
|
void |
saveObject(IObject object,
Ice.Current current)
Save the given model object.
|
omero.RMap |
treeList(String repoUuid,
CheckedPath checked,
Ice.Current __current) |
void |
updateJob(omero.model.Job job,
String message,
String status,
Ice.Current current)
Set both the message and the status of the given job.
|
RawFileStore getRawFileStore(long fileId, CheckedPath checked, String mode, Ice.Current current) throws omero.SecurityViolation
RawFileBean
(i.e. an implementation of
RawFileStore
which can be passed to
RepoRawFileStoreI
for performing internal functions. The primary
difference to an instance created via the ServiceFactory is that
the RawFileBean.setFileIdWithBuffer(long, FileBuffer)
method is
called pointing to a non-romio file path, e.g. /OMERO/Files/x.fileId
- ID of an OriginalFile
checked
- Not null. Normalized path from the repository.mode
- FileChannel mode, "r", "rw", etc.RawFileBean.setFileIdWithBuffer(long, FileBuffer)
called.omero.SecurityViolation
omero.model.OriginalFile findRepoFile(String uuid, CheckedPath checked, String mimetype, Ice.Current current) throws omero.ServerError
SqlAction.findRepoFile(String, String, String, String)
for looking up the id of the file, and then load it normally via
IQuery. This will enforce any read security checks.uuid
- checked
- mimetype
- current
- omero.ServerError
OriginalFile findRepoFile(ServiceFactory sf, SqlAction sql, String uuid, CheckedPath checked, String mimetype)
findRepoFile(String, CheckedPath, String, Current)
but
can be called from within a transaction.omero.RMap treeList(String repoUuid, CheckedPath checked, Ice.Current __current) throws omero.ServerError
omero.ServerError
void createOrFixUserDir(String uuid, List<CheckedPath> path, org.hibernate.Session s, ServiceFactory sf, SqlAction sql) throws omero.ServerError
CheckedPath
objects exist (via
findRepoFile(String, CheckedPath, String, Ice.Current)
)
and are in the "user" group. If they don't exist, they are created; and
if they aren't in the "user" group, they are moved.omero.ServerError
boolean canUpdate(omero.model.IObject obj, Ice.Current current)
obj
- current
- an
- SecurityViolation
if the currentUser is not
allowed to access the given file.List<Long> filterFilesByRepository(String repo, List<Long> ids, Ice.Current current)
repo
- a repository UUIDids
- IDs of original filescurrent
- Ice method invocation contextomero.model.OriginalFile getOriginalFile(long fileId, Ice.Current current) throws omero.SecurityViolation
fileId
- a file IDcurrent
- applicable ICE contextomero.SecurityViolation
- if the query threw a security violationList<omero.model.OriginalFile> getOriginalFiles(String repoUuid, CheckedPath checked, Ice.Current current) throws omero.SecurityViolation
OriginalFile
elements
which are accessible to the given user at the given path. If the
directory which they are associated with is not also readable by the
current user, then a SecurityViolation
will be thrown.repoUuid
- for the repository in question.checked
- normalized path which can be found as the value of
OriginalFile.getPath()
in the database.current
- omero.SecurityViolation
omero.model.Fileset saveFileset(String repoUuid, omero.model.Fileset fs, omero.model.ChecksumAlgorithm checksumAlgorithm, List<CheckedPath> paths, Ice.Current current) throws omero.ServerError
Fileset
and then save the
entire instance into the database.repoUuid
- for the repository in question.fs
- a user provided Fileset
that must minimally have the
FilesetEntry
objects present with their clientPath set. The rest
of the fields will be filled here.checksumAlgorithm
- The algorithm to use.paths
- a List of the same size as the number of entries in fs
one per FilesetEntry
.current
- Current contextomero.ServerError
List<omero.model.Fileset> loadFilesets(List<Long> ids, Ice.Current current) throws omero.ServerError
ids
- current
- omero.ServerError
omero.model.OriginalFile register(String repoUuid, CheckedPath checked, String mimetype, Ice.Current current) throws omero.ServerError
repoUuid
- uuid of the repository that the given file argument should be
registered with. Cannot be null.checked
- Normalized path provided by the repository. Not null.mimetype
- Mimetype for use with the OriginalFile. May be null in which
case a default will be chosen.current
- Not null.omero.ServerError
OriginalFile register(String repoUuid, CheckedPath checked, String mimetype, ServiceFactory sf, SqlAction sql) throws omero.ServerError
register(String, CheckedPath, String, Ice.Current)
but
does not create a new transaction. Instead, the ServiceFactory
and SqlAction
must be passed in. The returned OriginalFile
instance is still connected to Hibernate.repoUuid
- checked
- mimetype
- sf
- sql
- omero.ServerError
FsFile getFile(long id, Ice.Current current, String repoUuid)
FsFile
object based on its ID. Returns null if
the file does not exist or does not belong to this repository.id
- database ID of the sought original filecurrent
- current applicable ICE contextrepoUuid
- the UUID of the repository containing the original file<T extends omero.model.Job> T saveJob(T job, Ice.Current current) throws omero.ServerError
job
- Not null.current
- Not null.omero.ServerError
void updateJob(omero.model.Job job, String message, String status, Ice.Current current) throws omero.ServerError
job
- Not null.message
- If null, no modification will be made for the messagestatus
- If null, no modification will be made for the status.current
- Not null.omero.ServerError
omero.sys.EventContext getEventContext(Ice.Current current)
String getUserInstitution(long userId, Ice.Current current)
userId
- the ID of the user whose institution is to be fetchedcurrent
- the current ICE method invocation contextnull
String getUserInstitution(long userId, ServiceFactory sf)
userId
- the ID of the user whose institution is to be fetchedsf
- the service factory to use for the querynull
List<SqlAction.DeleteLog> findRepoDeleteLogs(SqlAction.DeleteLog template, Ice.Current current)
SqlAction.findRepoDeleteLogs(DeleteLog)
with the current
context.template
- not null.current
- not null.List<List<SqlAction.DeleteLog>> findRepoDeleteLogs(List<SqlAction.DeleteLog> templates, Ice.Current current)
findRepoDeleteLogs(DeleteLog, Current)
but for a collection
of templates.templates
- not null.current
- not null.int deleteRepoDeleteLogs(SqlAction.DeleteLog template, Ice.Current current)
SqlAction.deleteRepoDeleteLogs(DeleteLog)
with the current
context.template
- not null.current
- not null.List<Integer> deleteRepoDeleteLogs(List<SqlAction.DeleteLog> templates, Ice.Current current)
SqlAction.deleteRepoDeleteLogs(DeleteLog)
with the current
context for a number of templates.templates
- not null.current
- not null.void makeDirs(PublicRepositoryI repo, List<CheckedPath> dirs, boolean parents, Ice.Current c) throws omero.ServerError
PublicRepositoryI
instance as a callback for implementation
specific logic. Applies the real user's event context when within a
PublicRepositoryI.sudo(Current, String)
.omero.ServerError
ChecksumAlgorithm getChecksumAlgorithm(String name, Ice.Current current)
name
- a checksum algorithm name, must existcurrent
- Ice method invocation contextOriginalFile getOriginalFileWithHasher(long id, Ice.Current current)
id
- the ID of an original file, must existcurrent
- Ice method invocation contextvoid saveObject(IObject object, Ice.Current current)
object
- a model objectcurrent
- Ice method invocation context
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.