Package ome.util.actions
Class PostgresSqlAction
- java.lang.Object
-
- ome.util.SqlAction.Impl
-
- ome.util.actions.PostgresSqlAction
-
- All Implemented Interfaces:
SqlAction
public class PostgresSqlAction extends SqlAction.Impl
-
-
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 static java.lang.String
insertFormatSql
Deprecated.-
Fields inherited from class ome.util.SqlAction.Impl
log, MAX_IN_SIZE
-
-
Constructor Summary
Constructors Constructor Description PostgresSqlAction(org.springframework.jdbc.core.JdbcTemplate jdbc)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.springframework.jdbc.core.JdbcTemplate
_jdbc()
protected java.lang.String
_lookup(java.lang.String key)
protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate
_namedJdbc()
boolean
activeSession(java.lang.String sessionUUID)
Returns whether the given string is the UUID of a session that is currently active.int
closeSessions(java.lang.String uuid)
long
countFormat(java.lang.String name)
void
createSavepoint(java.lang.String savepoint)
java.util.Set<java.lang.String>
currentUserNames()
long
currValue(java.lang.String segmentName)
java.lang.String
dbUuid()
java.lang.String
dbVersion()
void
deferConstraints()
void
delCurrentEventLog(java.lang.String key)
java.lang.Long
findRepoImageFromPixels(long id)
java.util.List<java.lang.Long>
findRepoPixels(java.lang.String uuid, java.lang.String dirname, java.lang.String basename)
java.util.List<java.lang.Long>
getDeletedIds(java.lang.String entityType)
java.util.List<java.lang.String>
getPixelsNamePathRepo(long id)
Retrieves the name, path and repo for the given pixels set.java.util.List<java.lang.Long>
getShapeIds(long roiId)
protected void
handlePotentialPgArrayJarError(org.springframework.jdbc.UncategorizedSQLException e)
If postgresql is installed with an older jdbc jar that is on the bootstrap classpath, then it's possible that the use of pgarrays will fail (I think).int
insertFormat(java.lang.String name)
Deprecated.void
insertLogs(java.util.List<java.lang.Object[]> batchData)
int
insertSession(java.util.Map<java.lang.String,java.lang.Object> params)
java.lang.Long
nextSessionId()
long
nextValue(java.lang.String segmentValue, 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(java.lang.String internal_uuid)
java.util.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
releaseSavepoint(java.lang.String savepoint)
int
removePassword(java.lang.Long id)
java.util.Map<java.lang.String,java.lang.Object>
repoFile(long value)
java.lang.String
rewriteHql(java.lang.String query, java.lang.String key, java.lang.Object value)
The temp_ids infrastructure was never properly put in place for the "psql" profile.java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
roiByImage(long imageId)
void
rollbackSavepoint(java.lang.String savepoint)
long
selectCurrentEventLog(java.lang.String key)
java.lang.Long
sessionId(java.lang.String uuid)
void
setCurrentEventLog(long id, java.lang.String key)
void
setFileRepo(java.util.Collection<java.lang.Long> ids, java.lang.String repoId)
void
setPixelsNamePathRepo(long pixId, java.lang.String name, java.lang.String path, java.lang.String repoId)
int
synchronizeJobs(java.util.List<java.lang.Long> ids)
int
updateConfiguration(java.lang.String key, java.lang.String value)
int
updateSessionUserIP(long sessionId, java.lang.String userIP)
-
Methods inherited from class ome.util.SqlAction.Impl
addMessageWithinDbPatchEnd, addMessageWithinDbPatchStart, addMimetypes, changeGroupPermissions, changeTablePermissionsForGroup, clearPermissionsBit, closeNode, closeNodeSessions, configValue, createIdsTempTable, createInsertTrigger, delConfigValue, deleteCurrentAdminPrivileges, deleteOldAdminPrivileges, deleteRepoDeleteLogs, fileIdsInDb, fileRepo, filterFileIdsByRepo, findOldAdminPrivileges, findRepoDeleteLogs, findRepoFile, findRepoFile, findRepoFile, findRepoFilePath, findRepoFiles, findRepoFiles, findRepoRootPath, getEventLogPartitions, getEventLogPercent, getGroupIds, getGroupPermissions, getLdapExperimenters, getPasswordHash, getShareData, getUserEmailByOmeName, getUserEmailsByGroup, getUserGroups, getUserId, getUsername, getUserPrettyNameByOmeName, groupInfoFor, hasUnicodeUnits, insertCurrentAdminPrivileges, isFileInRepo, isLdapExperimenter, nextPixelsDataLogForRepo, printThrowable, refreshEventLogFromUpdatedAnnotations, repoScriptCount, scriptRepo, setPermissionsBit, setRoles, setStatsInfo, setUserPassword, updateOrInsertConfigValue
-
-
-
-
Method Detail
-
_jdbc
protected org.springframework.jdbc.core.JdbcTemplate _jdbc()
- Specified by:
_jdbc
in classSqlAction.Impl
-
_namedJdbc
protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate _namedJdbc()
- Specified by:
_namedJdbc
in classSqlAction.Impl
-
_lookup
protected java.lang.String _lookup(java.lang.String key)
- Specified by:
_lookup
in classSqlAction.Impl
-
rewriteHql
public java.lang.String rewriteHql(java.lang.String query, java.lang.String key, java.lang.Object value)
The temp_ids infrastructure was never properly put in place for the "psql" profile. This method simply bypasses all query rewriting until that's functional.- Specified by:
rewriteHql
in interfaceSqlAction
- Overrides:
rewriteHql
in classSqlAction.Impl
- 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 3961, ticket 9077
-
prepareSession
public void prepareSession(long eventId, long userId, long groupId)
Description copied from interface:SqlAction
Stores the current event context information in a temporary table so that triggers can make use of them.
-
activeSession
public boolean activeSession(java.lang.String sessionUUID)
Description copied from interface:SqlAction
Returns whether the given string is the UUID of a session that is currently active.- Parameters:
sessionUUID
- NOT NULL.- Returns:
true
ifsessionUUID
is an active session,false
otherwise
-
synchronizeJobs
public int synchronizeJobs(java.util.List<java.lang.Long> ids)
-
findRepoPixels
public java.util.List<java.lang.Long> findRepoPixels(java.lang.String uuid, java.lang.String dirname, java.lang.String basename)
-
findRepoImageFromPixels
public java.lang.Long findRepoImageFromPixels(long id)
-
nextSessionId
public java.lang.Long nextSessionId()
-
repoFile
public java.util.Map<java.lang.String,java.lang.Object> repoFile(long value)
-
countFormat
public long countFormat(java.lang.String name)
-
insertFormat
@Deprecated public int insertFormat(java.lang.String name)
Deprecated.
-
closeSessions
public int closeSessions(java.lang.String uuid)
-
nodeId
public long nodeId(java.lang.String internal_uuid)
-
insertSession
public int insertSession(java.util.Map<java.lang.String,java.lang.Object> params)
-
updateSessionUserIP
public int updateSessionUserIP(long sessionId, java.lang.String userIP)
-
sessionId
public java.lang.Long sessionId(java.lang.String uuid)
-
removePassword
public int removePassword(java.lang.Long id)
-
now
public java.util.Date now()
-
updateConfiguration
public int updateConfiguration(java.lang.String key, java.lang.String value)
-
dbVersion
public java.lang.String dbVersion()
-
dbUuid
public java.lang.String dbUuid()
-
selectCurrentEventLog
public long selectCurrentEventLog(java.lang.String key)
- Specified by:
selectCurrentEventLog
in interfaceSqlAction
- Overrides:
selectCurrentEventLog
in classSqlAction.Impl
-
setCurrentEventLog
public void setCurrentEventLog(long id, java.lang.String key)
- Specified by:
setCurrentEventLog
in interfaceSqlAction
- Overrides:
setCurrentEventLog
in classSqlAction.Impl
-
delCurrentEventLog
public void delCurrentEventLog(java.lang.String key)
- Specified by:
delCurrentEventLog
in interfaceSqlAction
- Overrides:
delCurrentEventLog
in classSqlAction.Impl
-
nextValue
public long nextValue(java.lang.String segmentValue, int incrementSize)
Description copied from interface:SqlAction
The implementation of this method guarantees that even if the current transaction fails that the value found will not be used by another transaction. Database implementations can choose whether to do this at the procedure level or by using transaction PROPAGATION settings in Java.- See Also:
- ticket 3697, ticket 3253
-
currValue
public long currValue(java.lang.String segmentName)
-
insertLogs
public void insertLogs(java.util.List<java.lang.Object[]> batchData)
-
roiByImage
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> roiByImage(long imageId)
-
getShapeIds
public java.util.List<java.lang.Long> getShapeIds(long roiId)
-
setFileRepo
public void setFileRepo(java.util.Collection<java.lang.Long> ids, java.lang.String repoId)
-
setPixelsNamePathRepo
public void setPixelsNamePathRepo(long pixId, java.lang.String name, java.lang.String path, java.lang.String repoId)
-
getDeletedIds
public java.util.List<java.lang.Long> getDeletedIds(java.lang.String entityType)
-
createSavepoint
public void createSavepoint(java.lang.String savepoint)
-
releaseSavepoint
public void releaseSavepoint(java.lang.String savepoint)
-
rollbackSavepoint
public void rollbackSavepoint(java.lang.String savepoint)
-
deferConstraints
public void deferConstraints()
-
currentUserNames
public java.util.Set<java.lang.String> currentUserNames()
-
getPixelsNamePathRepo
public java.util.List<java.lang.String> getPixelsNamePathRepo(long id) throws InternalException
Description copied from interface:SqlAction
Retrieves the name, path and repo for the given pixels set. If the id is not found, null is returned.- Throws:
InternalException
-
handlePotentialPgArrayJarError
protected void handlePotentialPgArrayJarError(org.springframework.jdbc.UncategorizedSQLException e)
If postgresql is installed with an older jdbc jar that is on the bootstrap classpath, then it's possible that the use of pgarrays will fail (I think). See #7432
-
-