public interface SqlAction
SimpleJdbcTemplate
and
Session.createSQLQuery(String)
for the entire OMERO
code base.Modifier and Type | Interface and Description |
---|---|
static class |
SqlAction.DeleteLog
Record-class which matches _fs_deletelog.
|
static class |
SqlAction.IdRowMapper |
static class |
SqlAction.Impl
Base implementation which can be used
|
static class |
SqlAction.LoggingSqlAction |
static class |
SqlAction.StringRowMapper |
Modifier and Type | Method and Description |
---|---|
boolean |
activeSession(String sessionUUID)
Returns whether the given string is the UUID of a session that is
currently active.
|
void |
addMessageWithinDbPatchEnd(String version,
int patch,
String message)
Add a unique message to the DB patch table within the current patch.
|
void |
addMessageWithinDbPatchStart(String version,
int patch,
String message)
Add a unique message to the DB patch table within the current patch.
|
int |
changeGroupPermissions(Long id,
Long internal) |
int |
changeTablePermissionsForGroup(String table,
Long id,
Long internal) |
boolean |
clearPermissionsBit(String table,
long id,
int bit)
Sets the given permissions bit to
0 . |
int |
closeNode(String uuid) |
int |
closeNodeSessions(String uuid) |
int |
closeSessions(String uuid) |
String |
configValue(String name) |
long |
countFormat(String name) |
String |
createIdsTempTable(Collection<Long> ids)
Creates a temporary table filled with the given ids and returns its
name.
|
void |
createInsertTrigger(String name,
String table,
String procedure)
Creates an insert trigger of the given name, for the given table,
with the given procedure.
|
void |
createSavepoint(String savepoint) |
Set<String> |
currentUserNames() |
long |
currValue(String segmentName) |
String |
dbUuid() |
String |
dbVersion() |
void |
deferConstraints() |
int |
delConfigValue(String name) |
void |
delCurrentEventLog(String key) |
int |
deleteRepoDeleteLogs(SqlAction.DeleteLog template)
Delete all
SqlAction.DeleteLog entries which match all of the non-null
fields provided in the template. |
List<Long> |
fileIdsInDb(String uuid,
Set<String> mimetypes)
Return all IDs matching the given mimetypes, or all IDs if mimetypes is null.
|
String |
fileRepo(long fileId) |
List<Long> |
filterFileIdsByRepo(String uuid,
List<Long> fileIds)
Find the original file IDs among those given that are in the given repository.
|
List<SqlAction.DeleteLog> |
findRepoDeleteLogs(SqlAction.DeleteLog template)
Find all
SqlAction.DeleteLog entries which match all of the non-null
fields provided in the template. |
Long |
findRepoFile(String uuid,
String dirname,
String basename)
Calls
findRepoFile(String, String, String, Set)
passing null. |
Long |
findRepoFile(String uuid,
String dirname,
String basename,
Set<String> mimetypes)
Lookup the id of an
OriginalFile in a given
repository or return null if none is found. |
Long |
findRepoFile(String uuid,
String dirname,
String basename,
String mimetype)
|
String |
findRepoFilePath(String uuid,
long id) |
List<Long> |
findRepoFiles(String repoUuid,
String dirname)
Return a list of original file ids that all have a path value matching
the passed dirname in the given repository.
|
Map<String,Long> |
findRepoFiles(String uuid,
String dirname,
List<String> basenames,
Set<String> mimetypes)
Like
findRepoFile(String, String, String, Set) , but queries in
bulk and returns a map for the found IDs. |
Long |
findRepoImageFromPixels(long id) |
List<Long> |
findRepoPixels(String uuid,
String dirname,
String basename) |
String |
findRepoRootPath(String uuid)
Find the path of the repository root.
|
List<Long> |
getDeletedIds(String entityType) |
List<Object[]> |
getEventLogPartitions(Collection<String> types,
Collection<String> actions,
long offset,
long limit)
Loads up to "limit" event logs using partioning so that only the
last event log of a particular (type, id) pair is returned.
|
float |
getEventLogPercent(String key)
Returns the percent (e.g. 0-100%) as calculated by the number of rows
represented as completed by the configuration table row of this key
divided by the total number of rows in the event log.
|
Map<String,Long> |
getGroupIds(Collection<String> names) |
long |
getGroupPermissions(long id)
Returns the permissions for the given group id.
|
List<Long> |
getLdapExperimenters()
Gets the experimenters who have the
ldap attribute enabled. |
String |
getPasswordHash(Long experimenterID) |
List<String> |
getPixelsNamePathRepo(long id)
Retrieves the name, path and repo for the given pixels set.
|
List<Long> |
getShapeIds(long roiId) |
Map<Long,byte[]> |
getShareData(List<Long> ids)
Returns a map of Share ID to Share data blob.
|
Collection<String> |
getUserEmailsByGroup(long groupId)
Load all the non-empty email addresses for users in a given group.
|
List<String> |
getUserGroups(String userName) |
Long |
getUserId(String userName)
Get the user's ID
|
String |
getUsername(long userId)
Get the user's name
|
ExperimenterGroup |
groupInfoFor(String table,
long id)
Return a mostly unloaded
ExperimenterGroup object containing
only the id, name, and permissions. |
boolean |
hasUnicodeUnits() |
int |
insertFormat(String name)
Deprecated.
|
void |
insertLogs(List<Object[]> batchData) |
int |
insertSession(Map<String,Object> params) |
int |
isFileInRepo(String uuid,
long id,
Set<String> mimetypes) |
boolean |
isLdapExperimenter(Long id)
Checks whether the specified experimenter ID has the
ldap
flag set. |
List<long[]> |
nextPixelsDataLogForRepo(String repo,
long lastEventId,
int howmany)
Returns arrays of longs for the following SQL return values:
experimenter, eventlog, entityid as pixels, rownumber
The oldest N eventlogs with action = "PIXELDATA" and entitytype = "ome.model.core.Pixels"
is found per user and returned. |
Long |
nextSessionId() |
long |
nextValue(String segmentName,
int incrementSize)
The implementation of this method guarantees that even if the current
transaction fails that the value found will not be used by another
transaction.
|
long |
nodeId(String internal_uuid) |
Date |
now() |
void |
prepareSession(long eventId,
long userId,
long groupId)
Stores the current event context information in a temporary table
so that triggers can make use of them.
|
void |
refreshEventLogFromUpdatedAnnotations()
Convert the _reindexing_required table to REINDEX entries in the event log.
|
void |
releaseSavepoint(String savepoint) |
int |
removePassword(Long id) |
Map<String,Object> |
repoFile(long value) |
int |
repoScriptCount(String uuid,
Set<String> mimetypes) |
String |
rewriteHql(String query,
String key,
Object value)
Allows the specific database implementations a chance to modify
queries.
|
List<Map<String,Object>> |
roiByImage(long imageId) |
void |
rollbackSavepoint(String savepoint) |
String |
scriptRepo(long fileId,
Set<String> mimetypes)
Similar to
fileRepo(long) , but only returns values for files
which are also scripts. |
long |
selectCurrentEventLog(String key) |
Long |
sessionId(String uuid) |
void |
setCurrentEventLog(long id,
String key) |
void |
setFileRepo(Collection<Long> ids,
String repoId) |
boolean |
setPermissionsBit(String table,
long id,
int bit)
Sets the given permissions bit to
1 . |
void |
setPixelsNamePathRepo(long pixId,
String name,
String path,
String repoId) |
long |
setStatsInfo(Channel ch,
StatsInfo si) |
boolean |
setUserPassword(Long experimenterID,
String password) |
int |
synchronizeJobs(List<Long> ids) |
int |
updateConfiguration(String key,
String value) |
int |
updateOrInsertConfigValue(String name,
String value) |
void prepareSession(long eventId, long userId, long groupId)
eventId
- userId
- groupId
- String rewriteHql(String query, String key, Object value)
query
- String query (non-null) which is in effect.key
- Key of the argument e.g. (:ids)value
- value which has been passed in for that parameter.String createIdsTempTable(Collection<Long> ids)
void createInsertTrigger(String name, String table, String procedure)
boolean activeSession(String sessionUUID)
sessionUUID
- NOT NULL.true
if sessionUUID
is an active session,
false
otherwiselong getGroupPermissions(long id)
ExperimenterGroup groupInfoFor(String table, long id)
ExperimenterGroup
object containing
only the id, name, and permissions.String fileRepo(long fileId)
String scriptRepo(long fileId, Set<String> mimetypes)
fileRepo(long)
, but only returns values for files
which are also scripts. Null may be returnedfileId
- mimetypes
- null implies all files are checkedLong findRepoFile(String uuid, String dirname, String basename)
findRepoFile(String, String, String, Set)
passing null.Long findRepoFile(String uuid, String dirname, String basename, Set<String> mimetypes)
OriginalFile
in a given
repository or return null if none is found.uuid
- The UUID of the repository (originalfile.sha1)dirname
- the full directory path minus the file name.basename
- i.e. the filename without any directory pathmimetypes
- if null, then no mimetype query fragement will be added.OriginalFile
is found,
otherwise the id.Map<String,Long> findRepoFiles(String uuid, String dirname, List<String> basenames, Set<String> mimetypes)
findRepoFile(String, String, String, Set)
, but queries in
bulk and returns a map for the found IDs.List<Long> findRepoFiles(String repoUuid, String dirname)
repoUuid
- dirname
- List<SqlAction.DeleteLog> findRepoDeleteLogs(SqlAction.DeleteLog template)
SqlAction.DeleteLog
entries which match all of the non-null
fields provided in the template.template
- non-null.SqlAction.DeleteLog
entriesint deleteRepoDeleteLogs(SqlAction.DeleteLog template)
SqlAction.DeleteLog
entries which match all of the non-null
fields provided in the template.template
- not-nullString findRepoRootPath(String uuid)
uuid
- a repository UUIDLong findRepoImageFromPixels(long id)
int repoScriptCount(String uuid, Set<String> mimetypes)
uuid
- repository identifiermimetypes
- file mimetypes to check; if null, all files;Long nextSessionId()
List<Long> fileIdsInDb(String uuid, Set<String> mimetypes)
List<Long> filterFileIdsByRepo(String uuid, List<Long> fileIds)
uuid
- a repository UUIDfileIds
- IDs of original filesList<long[]> nextPixelsDataLogForRepo(String repo, long lastEventId, int howmany)
experimenter, eventlog, entityid as pixels, rownumber
The oldest N eventlogs with action = "PIXELDATA" and entitytype = "ome.model.core.Pixels"
is found per user and returned. Multiple eventlogs are returned
per user in order to support multi-threading. Duplicate pixel ids
are stripped.long countFormat(String name)
@Deprecated int insertFormat(String name)
int closeSessions(String uuid)
int closeNodeSessions(String uuid)
int closeNode(String uuid)
long nodeId(String internal_uuid)
int isFileInRepo(String uuid, long id, Set<String> mimetypes)
uuid
- Repository identifierid
- file identifiermimetypes
- Set of mimetypes to check; if null, all files.int removePassword(Long id)
Date now()
String dbVersion()
int delConfigValue(String name)
String dbUuid()
long selectCurrentEventLog(String key)
float getEventLogPercent(String key)
key
- PersistentEventLogLoader key for lookup in the configuration tableList<Object[]> getEventLogPartitions(Collection<String> types, Collection<String> actions, long offset, long limit)
types
- Collection of entityType strings which should be queriedactions
- Collection of ACTION strings which should be queriedoffset
- Offset to the row which should be queried firstlimit
- Maximum number of rows (after partionting) which should
be returned.void setCurrentEventLog(long id, String key)
void delCurrentEventLog(String key)
void refreshEventLogFromUpdatedAnnotations()
long nextValue(String segmentName, int incrementSize)
segmentName
- incrementSize
- long currValue(String segmentName)
Long getUserId(String userName)
userName
- the user's namenull
if they cannot be foundString getUsername(long userId)
userId
- the user's IDnull
if they cannot be foundCollection<String> getUserEmailsByGroup(long groupId)
groupId
- Collection
of non-empty user email addresses.List<Long> getLdapExperimenters()
ldap
attribute enabled.boolean isLdapExperimenter(Long id)
ldap
flag set.id
- The experimenter ID.Map<String,Long> getGroupIds(Collection<String> names)
void setFileRepo(Collection<Long> ids, String repoId)
void setPixelsNamePathRepo(long pixId, String name, String path, String repoId)
void createSavepoint(String savepoint)
void releaseSavepoint(String savepoint)
void rollbackSavepoint(String savepoint)
void deferConstraints()
Map<Long,byte[]> getShareData(List<Long> ids)
ids
- IDs of Shares for which data blobs are to be returned.List<String> getPixelsNamePathRepo(long id) throws InternalException
InternalException
int changeTablePermissionsForGroup(String table, Long id, Long internal)
boolean hasUnicodeUnits()
void addMessageWithinDbPatchStart(String version, int patch, String message)
version
- the version of the current DBpatch
- the patch of the current DBmessage
- the new message to notevoid addMessageWithinDbPatchEnd(String version, int patch, String message)
version
- the version of the current DBpatch
- the patch of the current DBmessage
- the new message to noteboolean setPermissionsBit(String table, long id, int bit)
1
. Note: Actually sets the bit to 1
in the value stored in the database,
does not adopt the inverse convention associated with permissions flags.table
- the table in which to find the rowid
- the value of the table's id
column that identifies the row to updatebit
- the bit number to set to 1
, counting from 0
as the least significant bitboolean clearPermissionsBit(String table, long id, int bit)
0
. Note: Actually sets the bit to 0
in the value stored in the database,
does not adopt the inverse convention associated with permissions flags.table
- the table in which to find the rowid
- the value of the table's id
column that identifies the row to updatebit
- the bit number to set to 0
, counting from 0
as the least significant bit
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.