public abstract static class SqlAction.Impl extends Object implements SqlAction
SqlAction.DeleteLog, SqlAction.IdRowMapper, SqlAction.Impl, SqlAction.LoggingSqlAction, SqlAction.StringRowMapper| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
protected static int |
MAX_IN_SIZE |
| Constructor and Description |
|---|
Impl() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract SimpleJdbcOperations |
_jdbc() |
protected abstract String |
_lookup(String key) |
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.
|
protected String |
addMimetypes(Collection<String> mimetypes,
Map<String,Object> params)
Returns the "and_mimetype" clause which must be appended to a given
query.
|
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) |
String |
configValue(String key) |
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.
|
int |
delConfigValue(String key) |
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
SqlAction.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 uuid,
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
SqlAction.findRepoFile(String, String, String, Set), but queries in
bulk and returns a map for the found IDs. |
String |
findRepoRootPath(String uuid)
Find the path of the repository root.
|
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 groupId)
Returns the permissions for the given group id.
|
List<Long> |
getLdapExperimenters()
Gets the experimenters who have the
ldap attribute enabled. |
String |
getPasswordHash(Long experimenterID) |
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 |
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 rows)
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. |
protected String |
printThrowable(Throwable t) |
void |
refreshEventLogFromUpdatedAnnotations()
Convert the _reindexing_required table to REINDEX entries in the event log.
|
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.
|
String |
scriptRepo(long fileId,
Set<String> mimetypes)
Similar to
SqlAction.fileRepo(long), but only returns values for files
which are also scripts. |
long |
selectCurrentEventLog(String key) |
void |
setCurrentEventLog(long id,
String key) |
boolean |
setPermissionsBit(String table,
long id,
int bit)
Sets the given permissions bit to
1. |
long |
setStatsInfo(Channel ch,
StatsInfo si) |
boolean |
setUserPassword(Long experimenterID,
String password) |
int |
updateOrInsertConfigValue(String name,
String value) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactiveSession, closeSessions, countFormat, createSavepoint, currentUserNames, currValue, dbUuid, dbVersion, deferConstraints, findRepoImageFromPixels, findRepoPixels, getDeletedIds, getPixelsNamePathRepo, getShapeIds, insertFormat, insertLogs, insertSession, nextSessionId, nextValue, nodeId, now, prepareSession, releaseSavepoint, removePassword, repoFile, roiByImage, rollbackSavepoint, sessionId, setFileRepo, setPixelsNamePathRepo, synchronizeJobs, updateConfigurationprotected static final int MAX_IN_SIZE
protected final org.slf4j.Logger log
protected abstract SimpleJdbcOperations _jdbc()
public void createInsertTrigger(String name, String table, String procedure)
SqlActioncreateInsertTrigger in interface SqlActionpublic String rewriteHql(String query, String key, Object value)
SqlActionrewriteHql in interface SqlActionquery - 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.public String createIdsTempTable(Collection<Long> ids)
SqlActioncreateIdsTempTable in interface SqlActionpublic int closeNodeSessions(String uuid)
closeNodeSessions in interface SqlActionpublic boolean setUserPassword(Long experimenterID, String password)
setUserPassword in interface SqlActionpublic int changeGroupPermissions(Long id, Long internal)
changeGroupPermissions in interface SqlActionpublic int changeTablePermissionsForGroup(String table, Long id, Long internal)
changeTablePermissionsForGroup in interface SqlActionpublic boolean setPermissionsBit(String table, long id, int bit)
SqlAction1. Note: Actually sets the bit to 1 in the value stored in the database,
does not adopt the inverse convention associated with permissions flags.setPermissionsBit in interface SqlActiontable - 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 bitpublic boolean clearPermissionsBit(String table, long id, int bit)
SqlAction0. Note: Actually sets the bit to 0 in the value stored in the database,
does not adopt the inverse convention associated with permissions flags.clearPermissionsBit in interface SqlActiontable - 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 bitprotected String addMimetypes(Collection<String> mimetypes, Map<String,Object> params)
mimetypes - If null, then "" will be returned.params - sql parameter source to be passed to JDBC methods.public Long findRepoFile(String uuid, String dirname, String basename)
SqlActionSqlAction.findRepoFile(String, String, String, Set)
passing null.findRepoFile in interface SqlActionpublic Long findRepoFile(String uuid, String dirname, String basename, String mimetype)
SqlActionfindRepoFile in interface SqlActionpublic Long findRepoFile(String uuid, String dirname, String basename, Set<String> mimetypes)
SqlActionOriginalFile in a given
repository or return null if none is found.findRepoFile in interface SqlActionuuid - 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.public Map<String,Long> findRepoFiles(String uuid, String dirname, List<String> basenames, Set<String> mimetypes)
SqlActionSqlAction.findRepoFile(String, String, String, Set), but queries in
bulk and returns a map for the found IDs.findRepoFiles in interface SqlActionpublic int repoScriptCount(String uuid, Set<String> mimetypes)
repoScriptCount in interface SqlActionuuid - repository identifiermimetypes - file mimetypes to check; if null, all files;public int isFileInRepo(String uuid, long id, Set<String> mimetypes)
isFileInRepo in interface SqlActionuuid - Repository identifierid - file identifiermimetypes - Set of mimetypes to check; if null, all files.public List<Long> fileIdsInDb(String uuid, Set<String> mimetypes)
SqlActionfileIdsInDb in interface SqlActionpublic List<Long> filterFileIdsByRepo(String uuid, List<Long> fileIds)
SqlActionfilterFileIdsByRepo in interface SqlActionuuid - a repository UUIDfileIds - IDs of original filespublic List<Long> findRepoFiles(String uuid, String dirname)
SqlActionfindRepoFiles in interface SqlActionpublic List<SqlAction.DeleteLog> findRepoDeleteLogs(SqlAction.DeleteLog template)
SqlActionSqlAction.DeleteLog entries which match all of the non-null
fields provided in the template.findRepoDeleteLogs in interface SqlActiontemplate - non-null.SqlAction.DeleteLog entriespublic int deleteRepoDeleteLogs(SqlAction.DeleteLog template)
SqlActionSqlAction.DeleteLog entries which match all of the non-null
fields provided in the template.deleteRepoDeleteLogs in interface SqlActiontemplate - not-nullpublic String findRepoRootPath(String uuid)
SqlActionfindRepoRootPath in interface SqlActionuuid - a repository UUIDpublic String findRepoFilePath(String uuid, long id)
findRepoFilePath in interface SqlActionpublic List<long[]> nextPixelsDataLogForRepo(String repo, long lastEventId, int rows)
SqlActionexperimenter, 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.nextPixelsDataLogForRepo in interface SqlActionpublic long getGroupPermissions(long groupId)
SqlActiongetGroupPermissions in interface SqlActionpublic Map<String,Long> getGroupIds(Collection<String> names)
getGroupIds in interface SqlActionpublic String getPasswordHash(Long experimenterID)
getPasswordHash in interface SqlActionpublic Long getUserId(String userName)
SqlActionpublic Collection<String> getUserEmailsByGroup(long groupId)
SqlActiongetUserEmailsByGroup in interface SqlActionCollection of non-empty user email addresses.public String getUsername(long userId)
SqlActiongetUsername in interface SqlActionuserId - the user's IDnull if they cannot be foundpublic List<Long> getLdapExperimenters()
SqlActionldap attribute enabled.getLdapExperimenters in interface SqlActionpublic boolean isLdapExperimenter(Long id)
SqlActionldap
flag set.isLdapExperimenter in interface SqlActionid - The experimenter ID.public List<String> getUserGroups(String userName)
getUserGroups in interface SqlActionpublic ExperimenterGroup groupInfoFor(String table, long id)
SqlActionExperimenterGroup object containing
only the id, name, and permissions.groupInfoFor in interface SqlActionpublic String scriptRepo(long fileId, Set<String> mimetypes)
SqlActionSqlAction.fileRepo(long), but only returns values for files
which are also scripts. Null may be returnedscriptRepo in interface SqlActionmimetypes - null implies all files are checkedpublic long setStatsInfo(Channel ch, StatsInfo si)
setStatsInfo in interface SqlActionpublic String configValue(String key)
configValue in interface SqlActionpublic int delConfigValue(String key)
delConfigValue in interface SqlActionpublic int updateOrInsertConfigValue(String name, String value)
updateOrInsertConfigValue in interface SqlActionpublic long selectCurrentEventLog(String key)
selectCurrentEventLog in interface SqlActionpublic float getEventLogPercent(String key)
SqlActiongetEventLogPercent in interface SqlActionkey - PersistentEventLogLoader key for lookup in the configuration tablepublic List<Object[]> getEventLogPartitions(Collection<String> types, Collection<String> actions, long offset, long limit)
SqlActiongetEventLogPartitions in interface SqlActiontypes - 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.public void setCurrentEventLog(long id,
String key)
setCurrentEventLog in interface SqlActionpublic void delCurrentEventLog(String key)
delCurrentEventLog in interface SqlActionpublic void refreshEventLogFromUpdatedAnnotations()
SqlActionrefreshEventLogFromUpdatedAnnotations in interface SqlActionpublic boolean hasUnicodeUnits()
hasUnicodeUnits in interface SqlActionpublic void addMessageWithinDbPatchStart(String version, int patch, String message)
SqlActionaddMessageWithinDbPatchStart in interface SqlActionversion - the version of the current DBpatch - the patch of the current DBmessage - the new message to notepublic void addMessageWithinDbPatchEnd(String version, int patch, String message)
SqlActionaddMessageWithinDbPatchEnd in interface SqlActionversion - the version of the current DBpatch - the patch of the current DBmessage - the new message to notepublic Map<Long,byte[]> getShareData(List<Long> ids)
SqlActiongetShareData in interface SqlActionids - IDs of Shares for which data blobs are to be returned.
Version: 5.3.3-ice35-b63
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.