Package ome.util
Class SqlAction.Impl
- java.lang.Object
-
- ome.util.SqlAction.Impl
-
- All Implemented Interfaces:
SqlAction
- Direct Known Subclasses:
PostgresSqlAction
- Enclosing interface:
- SqlAction
public abstract static class SqlAction.Impl extends java.lang.Object implements SqlAction
Base implementation which can be used
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ome.util.SqlAction
SqlAction.DeleteLog, SqlAction.IdRowMapper, SqlAction.Impl, SqlAction.LoggingSqlAction, SqlAction.StringRowMapper
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
protected static int
MAX_IN_SIZE
-
Constructor Summary
Constructors Constructor Description Impl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.springframework.jdbc.core.JdbcTemplate
_jdbc()
protected abstract java.lang.String
_lookup(java.lang.String key)
protected abstract org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
_namedJdbc()
void
addMessageWithinDbPatchEnd(java.lang.String version, int patch, java.lang.String message)
Add a unique message to the DB patch table within the current patch.void
addMessageWithinDbPatchStart(java.lang.String version, int patch, java.lang.String message)
Add a unique message to the DB patch table within the current patch.protected java.lang.String
addMimetypes(java.util.Collection<java.lang.String> mimetypes, org.springframework.jdbc.core.namedparam.MapSqlParameterSource params)
Returns the "and_mimetype" clause which must be appended to a given query.int
changeGroupPermissions(java.lang.Long id, java.lang.Long internal)
int
changeTablePermissionsForGroup(java.lang.String table, java.lang.Long id, java.lang.Long internal)
boolean
clearPermissionsBit(java.lang.String table, long id, int bit)
Sets the given permissions bit to0
.int
closeNode(java.lang.String uuid)
int
closeNodeSessions(java.lang.String uuid)
java.lang.String
configValue(java.lang.String key)
java.lang.String
createIdsTempTable(java.util.Collection<java.lang.Long> ids)
Creates a temporary table filled with the given ids and returns its name.void
createInsertTrigger(java.lang.String name, java.lang.String table, java.lang.String procedure)
Creates an insert trigger of the given name, for the given table, with the given procedure.int
delConfigValue(java.lang.String key)
void
delCurrentEventLog(java.lang.String key)
void
deleteCurrentAdminPrivileges()
Delete the current light administrator privileges for the current transaction.void
deleteOldAdminPrivileges(java.util.Collection<java.lang.Long> transactionIds)
Delete the current light administrator privileges for the given transactions.int
deleteRepoDeleteLogs(SqlAction.DeleteLog template)
Delete allSqlAction.DeleteLog
entries which match all of the non-null fields provided in the template.java.util.List<java.lang.Long>
fileIdsInDb(java.lang.String uuid, java.util.Set<java.lang.String> mimetypes)
Return all IDs matching the given mimetypes, or all IDs if mimetypes is null.java.lang.String
fileRepo(long fileId)
java.util.List<java.lang.Long>
filterFileIdsByRepo(java.lang.String uuid, java.util.List<java.lang.Long> fileIds)
Find the original file IDs among those given that are in the given repository.java.util.Collection<java.lang.Long>
findOldAdminPrivileges()
Find the completed transactions among the current light administrator privileges.java.util.List<SqlAction.DeleteLog>
findRepoDeleteLogs(SqlAction.DeleteLog template)
Find allSqlAction.DeleteLog
entries which match all of the non-null fields provided in the template.java.lang.Long
findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename)
CallsSqlAction.findRepoFile(String, String, String, Set)
passing null.java.lang.Long
findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename, java.lang.String mimetype)
java.lang.Long
findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename, java.util.Set<java.lang.String> mimetypes)
Lookup the id of anOriginalFile
in a given repository or return null if none is found.java.lang.String
findRepoFilePath(java.lang.String uuid, long id)
java.util.List<java.lang.Long>
findRepoFiles(java.lang.String uuid, java.lang.String dirname)
Return a list of original file ids that all have a path value matching the passed dirname in the given repository.java.util.Map<java.lang.String,java.lang.Long>
findRepoFiles(java.lang.String uuid, java.lang.String dirname, java.util.List<java.lang.String> basenames, java.util.Set<java.lang.String> mimetypes)
LikeSqlAction.findRepoFile(String, String, String, Set)
, but queries in bulk and returns a map for the found IDs.java.lang.String
findRepoRootPath(java.lang.String uuid)
Find the path of the repository root.java.util.List<java.lang.Object[]>
getEventLogPartitions(java.util.Collection<java.lang.String> types, java.util.Collection<java.lang.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(java.lang.String key)
Returns the percent (e.g.java.util.Map<java.lang.String,java.lang.Long>
getGroupIds(java.util.Collection<java.lang.String> names)
long
getGroupPermissions(long groupId)
Returns the permissions for the given group id.java.util.List<java.lang.Long>
getLdapExperimenters()
Gets the experimenters who have theldap
attribute enabled.java.lang.String
getPasswordHash(java.lang.Long experimenterID)
java.util.Map<java.lang.Long,byte[]>
getShareData(java.util.List<java.lang.Long> ids)
Returns a map of Share ID to Share data blob.java.lang.String
getUserEmailByOmeName(java.lang.String userName)
Load the email address for the given user.java.util.Collection<java.lang.String>
getUserEmailsByGroup(long groupId)
Load all the non-empty email addresses for users in a given group.java.util.List<java.lang.String>
getUserGroups(java.lang.String userName)
java.lang.Long
getUserId(java.lang.String userName)
Get the user's IDjava.lang.String
getUsername(long userId)
Get the user's namejava.lang.String
getUserPrettyNameByOmeName(java.lang.String userName)
Load the pretty name for the given user.ExperimenterGroup
groupInfoFor(java.lang.String table, long id)
Return a mostly unloadedExperimenterGroup
object containing only the id, name, and permissions.boolean
hasUnicodeUnits()
void
insertCurrentAdminPrivileges(java.lang.Iterable<AdminPrivilege> privileges)
Insert the current light administrator privileges for the current transaction.int
isFileInRepo(java.lang.String uuid, long id, java.util.Set<java.lang.String> mimetypes)
boolean
isLdapExperimenter(java.lang.Long id)
Checks whether the specified experimenter ID has theldap
flag set.java.util.List<long[]>
nextPixelsDataLogForRepo(java.lang.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 java.lang.String
printThrowable(java.lang.Throwable t)
void
refreshEventLogFromUpdatedAnnotations()
Convert the _reindexing_required table to REINDEX entries in the event log.int
repoScriptCount(java.lang.String uuid, java.util.Set<java.lang.String> mimetypes)
java.lang.String
rewriteHql(java.lang.String query, java.lang.String key, java.lang.Object value)
Allows the specific database implementations a chance to modify queries.java.lang.String
scriptRepo(long fileId, java.util.Set<java.lang.String> mimetypes)
Similar toSqlAction.fileRepo(long)
, but only returns values for files which are also scripts.long
selectCurrentEventLog(java.lang.String key)
void
setCurrentEventLog(long id, java.lang.String key)
boolean
setPermissionsBit(java.lang.String table, long id, int bit)
Sets the given permissions bit to1
.void
setRoles(long rootUserId, long guestUserId, long systemGroupId, long userGroupId, long guestGroupId)
Note the roles in the database.long
setStatsInfo(Channel ch, StatsInfo si)
boolean
setUserPassword(java.lang.Long experimenterID, java.lang.String password)
int
updateOrInsertConfigValue(java.lang.String name, java.lang.String value)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ome.util.SqlAction
activeSession, 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, updateConfiguration, updateSessionUserIP
-
-
-
-
Field Detail
-
MAX_IN_SIZE
protected static final int MAX_IN_SIZE
- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
-
-
Method Detail
-
_jdbc
protected abstract org.springframework.jdbc.core.JdbcTemplate _jdbc()
-
_namedJdbc
protected abstract org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate _namedJdbc()
-
_lookup
protected abstract java.lang.String _lookup(java.lang.String key)
-
printThrowable
protected java.lang.String printThrowable(java.lang.Throwable t)
-
createInsertTrigger
public void createInsertTrigger(java.lang.String name, java.lang.String table, java.lang.String procedure)
Description copied from interface:SqlAction
Creates an insert trigger of the given name, for the given table, with the given procedure. No error handling is performed.- Specified by:
createInsertTrigger
in interfaceSqlAction
-
rewriteHql
public java.lang.String rewriteHql(java.lang.String query, java.lang.String key, java.lang.Object value)
Description copied from interface:SqlAction
Allows the specific database implementations a chance to modify queries.- Specified by:
rewriteHql
in interfaceSqlAction
- Parameters:
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.- Returns:
- Returns a query replacement.
- See Also:
- ticket 3697
-
createIdsTempTable
public java.lang.String createIdsTempTable(java.util.Collection<java.lang.Long> ids)
Description copied from interface:SqlAction
Creates a temporary table filled with the given ids and returns its name. The table is only available for the period if the transaction.- Specified by:
createIdsTempTable
in interfaceSqlAction
-
closeNodeSessions
public int closeNodeSessions(java.lang.String uuid)
- Specified by:
closeNodeSessions
in interfaceSqlAction
-
closeNode
public int closeNode(java.lang.String uuid)
-
setUserPassword
public boolean setUserPassword(java.lang.Long experimenterID, java.lang.String password)
- Specified by:
setUserPassword
in interfaceSqlAction
-
changeGroupPermissions
public int changeGroupPermissions(java.lang.Long id, java.lang.Long internal)
- Specified by:
changeGroupPermissions
in interfaceSqlAction
-
changeTablePermissionsForGroup
public int changeTablePermissionsForGroup(java.lang.String table, java.lang.Long id, java.lang.Long internal)
- Specified by:
changeTablePermissionsForGroup
in interfaceSqlAction
-
setPermissionsBit
public boolean setPermissionsBit(java.lang.String table, long id, int bit)
Description copied from interface:SqlAction
Sets the given permissions bit to1
. Note: Actually sets the bit to1
in the value stored in the database, does not adopt the inverse convention associated with permissions flags.- Specified by:
setPermissionsBit
in interfaceSqlAction
- Parameters:
table
- the table in which to find the rowid
- the value of the table'sid
column that identifies the row to updatebit
- the bit number to set to1
, counting from0
as the least significant bit- Returns:
- if the row was found in the table, regardless of the given bit's previous value
-
clearPermissionsBit
public boolean clearPermissionsBit(java.lang.String table, long id, int bit)
Description copied from interface:SqlAction
Sets the given permissions bit to0
. Note: Actually sets the bit to0
in the value stored in the database, does not adopt the inverse convention associated with permissions flags.- Specified by:
clearPermissionsBit
in interfaceSqlAction
- Parameters:
table
- the table in which to find the rowid
- the value of the table'sid
column that identifies the row to updatebit
- the bit number to set to0
, counting from0
as the least significant bit- Returns:
- if the row was found in the table, regardless of the given bit's previous value
-
setRoles
public void setRoles(long rootUserId, long guestUserId, long systemGroupId, long userGroupId, long guestGroupId)
Description copied from interface:SqlAction
Note the roles in the database.
-
findOldAdminPrivileges
public java.util.Collection<java.lang.Long> findOldAdminPrivileges()
Description copied from interface:SqlAction
Find the completed transactions among the current light administrator privileges.- Specified by:
findOldAdminPrivileges
in interfaceSqlAction
- Returns:
- the transaction IDs
-
deleteOldAdminPrivileges
public void deleteOldAdminPrivileges(java.util.Collection<java.lang.Long> transactionIds)
Description copied from interface:SqlAction
Delete the current light administrator privileges for the given transactions.- Specified by:
deleteOldAdminPrivileges
in interfaceSqlAction
- Parameters:
transactionIds
- the transaction IDs to delete
-
deleteCurrentAdminPrivileges
public void deleteCurrentAdminPrivileges()
Description copied from interface:SqlAction
Delete the current light administrator privileges for the current transaction.- Specified by:
deleteCurrentAdminPrivileges
in interfaceSqlAction
-
insertCurrentAdminPrivileges
public void insertCurrentAdminPrivileges(java.lang.Iterable<AdminPrivilege> privileges)
Description copied from interface:SqlAction
Insert the current light administrator privileges for the current transaction.- Specified by:
insertCurrentAdminPrivileges
in interfaceSqlAction
- Parameters:
privileges
- some light administrator privileges
-
addMimetypes
protected java.lang.String addMimetypes(java.util.Collection<java.lang.String> mimetypes, org.springframework.jdbc.core.namedparam.MapSqlParameterSource params)
Returns the "and_mimetype" clause which must be appended to a given query. Note: the rest of the SQL statement to which this clause is appended must use named SQL parameters otherwise "Can't infer the SQL type to use" will be raised.- Parameters:
mimetypes
- If null, then "" will be returned.params
- sql parameter source to be passed to JDBC methods.- Returns:
- Possibly empty String, but never null.
-
findRepoFile
public java.lang.Long findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename)
Description copied from interface:SqlAction
CallsSqlAction.findRepoFile(String, String, String, Set)
passing null.- Specified by:
findRepoFile
in interfaceSqlAction
-
findRepoFile
public java.lang.Long findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename, java.lang.String mimetype)
Description copied from interface:SqlAction
- Specified by:
findRepoFile
in interfaceSqlAction
-
findRepoFile
public java.lang.Long findRepoFile(java.lang.String uuid, java.lang.String dirname, java.lang.String basename, java.util.Set<java.lang.String> mimetypes)
Description copied from interface:SqlAction
Lookup the id of anOriginalFile
in a given repository or return null if none is found.- Specified by:
findRepoFile
in interfaceSqlAction
- Parameters:
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.- Returns:
- null if no
OriginalFile
is found, otherwise the id.
-
findRepoFiles
public java.util.Map<java.lang.String,java.lang.Long> findRepoFiles(java.lang.String uuid, java.lang.String dirname, java.util.List<java.lang.String> basenames, java.util.Set<java.lang.String> mimetypes)
Description copied from interface:SqlAction
LikeSqlAction.findRepoFile(String, String, String, Set)
, but queries in bulk and returns a map for the found IDs.- Specified by:
findRepoFiles
in interfaceSqlAction
-
repoScriptCount
public int repoScriptCount(java.lang.String uuid, java.util.Set<java.lang.String> mimetypes)
- Specified by:
repoScriptCount
in interfaceSqlAction
- Parameters:
uuid
- repository identifiermimetypes
- file mimetypes to check; if null, all files;
-
isFileInRepo
public int isFileInRepo(java.lang.String uuid, long id, java.util.Set<java.lang.String> mimetypes)
- Specified by:
isFileInRepo
in interfaceSqlAction
- Parameters:
uuid
- Repository identifierid
- file identifiermimetypes
- Set of mimetypes to check; if null, all files.
-
fileIdsInDb
public java.util.List<java.lang.Long> fileIdsInDb(java.lang.String uuid, java.util.Set<java.lang.String> mimetypes)
Description copied from interface:SqlAction
Return all IDs matching the given mimetypes, or all IDs if mimetypes is null.- Specified by:
fileIdsInDb
in interfaceSqlAction
-
filterFileIdsByRepo
public java.util.List<java.lang.Long> filterFileIdsByRepo(java.lang.String uuid, java.util.List<java.lang.Long> fileIds)
Description copied from interface:SqlAction
Find the original file IDs among those given that are in the given repository.- Specified by:
filterFileIdsByRepo
in interfaceSqlAction
- Parameters:
uuid
- a repository UUIDfileIds
- IDs of original files- Returns:
- those IDs among those given whose original files are in the given repository
-
findRepoFiles
public java.util.List<java.lang.Long> findRepoFiles(java.lang.String uuid, java.lang.String dirname)
Description copied from interface:SqlAction
Return a list of original file ids that all have a path value matching the passed dirname in the given repository.- Specified by:
findRepoFiles
in interfaceSqlAction
- Returns:
- possibly empty list of ids.
-
findRepoDeleteLogs
public java.util.List<SqlAction.DeleteLog> findRepoDeleteLogs(SqlAction.DeleteLog template)
Description copied from interface:SqlAction
Find allSqlAction.DeleteLog
entries which match all of the non-null fields provided in the template.- Specified by:
findRepoDeleteLogs
in interfaceSqlAction
- Parameters:
template
- non-null.- Returns:
- a list of
SqlAction.DeleteLog
entries
-
deleteRepoDeleteLogs
public int deleteRepoDeleteLogs(SqlAction.DeleteLog template)
Description copied from interface:SqlAction
Delete allSqlAction.DeleteLog
entries which match all of the non-null fields provided in the template.- Specified by:
deleteRepoDeleteLogs
in interfaceSqlAction
- Parameters:
template
- not-null- Returns:
- the number of rows deleted.
-
findRepoRootPath
public java.lang.String findRepoRootPath(java.lang.String uuid)
Description copied from interface:SqlAction
Find the path of the repository root.- Specified by:
findRepoRootPath
in interfaceSqlAction
- Parameters:
uuid
- a repository UUID- Returns:
- the repository root
-
findRepoFilePath
public java.lang.String findRepoFilePath(java.lang.String uuid, long id)
- Specified by:
findRepoFilePath
in interfaceSqlAction
-
nextPixelsDataLogForRepo
public java.util.List<long[]> nextPixelsDataLogForRepo(java.lang.String repo, long lastEventId, int rows)
Description copied from interface:SqlAction
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. Multiple eventlogs are returned per user in order to support multi-threading. Duplicate pixel ids are stripped.- Specified by:
nextPixelsDataLogForRepo
in interfaceSqlAction
-
getGroupPermissions
public long getGroupPermissions(long groupId)
Description copied from interface:SqlAction
Returns the permissions for the given group id.- Specified by:
getGroupPermissions
in interfaceSqlAction
-
getGroupIds
public java.util.Map<java.lang.String,java.lang.Long> getGroupIds(java.util.Collection<java.lang.String> names)
- Specified by:
getGroupIds
in interfaceSqlAction
-
getPasswordHash
public java.lang.String getPasswordHash(java.lang.Long experimenterID)
- Specified by:
getPasswordHash
in interfaceSqlAction
-
getUserId
public java.lang.Long getUserId(java.lang.String userName)
Description copied from interface:SqlAction
Get the user's ID
-
getUserPrettyNameByOmeName
public java.lang.String getUserPrettyNameByOmeName(java.lang.String userName)
Description copied from interface:SqlAction
Load the pretty name for the given user.- Specified by:
getUserPrettyNameByOmeName
in interfaceSqlAction
- Parameters:
userName
- a user's OME name- Returns:
- the user's name for presentation, may be
null
if their OME name does not exist
-
getUserEmailByOmeName
public java.lang.String getUserEmailByOmeName(java.lang.String userName)
Description copied from interface:SqlAction
Load the email address for the given user.- Specified by:
getUserEmailByOmeName
in interfaceSqlAction
- Parameters:
userName
- a user's OME name- Returns:
- the user's email address, may be
null
if they have none or their OME name does not exist
-
getUserEmailsByGroup
public java.util.Collection<java.lang.String> getUserEmailsByGroup(long groupId)
Description copied from interface:SqlAction
Load all the non-empty email addresses for users in a given group.- Specified by:
getUserEmailsByGroup
in interfaceSqlAction
- Returns:
- a non-null
Collection
of non-empty user email addresses.
-
getUsername
public java.lang.String getUsername(long userId)
Description copied from interface:SqlAction
Get the user's name- Specified by:
getUsername
in interfaceSqlAction
- Parameters:
userId
- the user's ID- Returns:
- their name, or
null
if they cannot be found
-
getLdapExperimenters
public java.util.List<java.lang.Long> getLdapExperimenters()
Description copied from interface:SqlAction
Gets the experimenters who have theldap
attribute enabled.- Specified by:
getLdapExperimenters
in interfaceSqlAction
- Returns:
- a list of user IDs.
-
isLdapExperimenter
public boolean isLdapExperimenter(java.lang.Long id)
Description copied from interface:SqlAction
Checks whether the specified experimenter ID has theldap
flag set.- Specified by:
isLdapExperimenter
in interfaceSqlAction
- Parameters:
id
- The experimenter ID.- Returns:
- true if the experimenter is an LDAP user; false otherwise.
-
getUserGroups
public java.util.List<java.lang.String> getUserGroups(java.lang.String userName)
- Specified by:
getUserGroups
in interfaceSqlAction
-
groupInfoFor
public ExperimenterGroup groupInfoFor(java.lang.String table, long id)
Description copied from interface:SqlAction
Return a mostly unloadedExperimenterGroup
object containing only the id, name, and permissions.- Specified by:
groupInfoFor
in interfaceSqlAction
-
fileRepo
public java.lang.String fileRepo(long fileId)
-
scriptRepo
public java.lang.String scriptRepo(long fileId, java.util.Set<java.lang.String> mimetypes)
Description copied from interface:SqlAction
Similar toSqlAction.fileRepo(long)
, but only returns values for files which are also scripts. Null may be returned- Specified by:
scriptRepo
in interfaceSqlAction
mimetypes
- null implies all files are checked
-
setStatsInfo
public long setStatsInfo(Channel ch, StatsInfo si)
- Specified by:
setStatsInfo
in interfaceSqlAction
-
configValue
public java.lang.String configValue(java.lang.String key)
- Specified by:
configValue
in interfaceSqlAction
-
delConfigValue
public int delConfigValue(java.lang.String key)
- Specified by:
delConfigValue
in interfaceSqlAction
-
updateOrInsertConfigValue
public int updateOrInsertConfigValue(java.lang.String name, java.lang.String value)
- Specified by:
updateOrInsertConfigValue
in interfaceSqlAction
-
selectCurrentEventLog
public long selectCurrentEventLog(java.lang.String key)
- Specified by:
selectCurrentEventLog
in interfaceSqlAction
-
getEventLogPercent
public float getEventLogPercent(java.lang.String key)
Description copied from interface:SqlAction
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. Since this method executes 2 counts over the event log table, it can take a significant amount of time.- Specified by:
getEventLogPercent
in interfaceSqlAction
- Parameters:
key
- PersistentEventLogLoader key for lookup in the configuration table- Returns:
- float value between 0 and 100 of the percent completed
-
getEventLogPartitions
public java.util.List<java.lang.Object[]> getEventLogPartitions(java.util.Collection<java.lang.String> types, java.util.Collection<java.lang.String> actions, long offset, long limit)
Description copied from interface:SqlAction
Loads up to "limit" event logs using partioning so that only the last event log of a particular (type, id) pair is returned. The contents of the object array are:- the id of the event log (Long)
- the entity type of the event log (String)
- the entity id of the event log (Long)
- the action of the event log (String)
- the number of skipped event logs (Integer)
- Specified by:
getEventLogPartitions
in interfaceSqlAction
- Parameters:
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.
-
setCurrentEventLog
public void setCurrentEventLog(long id, java.lang.String key)
- Specified by:
setCurrentEventLog
in interfaceSqlAction
-
delCurrentEventLog
public void delCurrentEventLog(java.lang.String key)
- Specified by:
delCurrentEventLog
in interfaceSqlAction
-
refreshEventLogFromUpdatedAnnotations
public void refreshEventLogFromUpdatedAnnotations()
Description copied from interface:SqlAction
Convert the _reindexing_required table to REINDEX entries in the event log.- Specified by:
refreshEventLogFromUpdatedAnnotations
in interfaceSqlAction
-
hasUnicodeUnits
public boolean hasUnicodeUnits()
- Specified by:
hasUnicodeUnits
in interfaceSqlAction
- Returns:
- if the database's type system contains correctly encoded units of measure
-
addMessageWithinDbPatchStart
public void addMessageWithinDbPatchStart(java.lang.String version, int patch, java.lang.String message)
Description copied from interface:SqlAction
Add a unique message to the DB patch table within the current patch. This method marks the start of the corresponding DB adjustment process.- Specified by:
addMessageWithinDbPatchStart
in interfaceSqlAction
- Parameters:
version
- the version of the current DBpatch
- the patch of the current DBmessage
- the new message to note
-
addMessageWithinDbPatchEnd
public void addMessageWithinDbPatchEnd(java.lang.String version, int patch, java.lang.String message)
Description copied from interface:SqlAction
Add a unique message to the DB patch table within the current patch. This method marks the end of the corresponding DB adjustment process.- Specified by:
addMessageWithinDbPatchEnd
in interfaceSqlAction
- Parameters:
version
- the version of the current DBpatch
- the patch of the current DBmessage
- the new message to note
-
getShareData
public java.util.Map<java.lang.Long,byte[]> getShareData(java.util.List<java.lang.Long> ids)
Description copied from interface:SqlAction
Returns a map of Share ID to Share data blob.- Specified by:
getShareData
in interfaceSqlAction
- Parameters:
ids
- IDs of Shares for which data blobs are to be returned.- Returns:
- map of ID to data blob.
-
-