Interface EditorConfigDAO
- All Superinterfaces:
org.exoplatform.commons.api.persistence.GenericDAO<EditorConfigEntity, Long>
- All Known Implementing Classes:
EditorConfigDAOImpl
public interface EditorConfigDAO
extends org.exoplatform.commons.api.persistence.GenericDAO<EditorConfigEntity, Long>
-
Method Summary
Modifier and TypeMethodDescriptionintcloseUnopenedConversionConfigs(long closedTime) Closes, at the given time, the active configs built for a conversion that no editor ever opened: not open, no closed time (a closing config has one), and an empty explorer URL, which only a conversion config and its copies have.getActiveConfigByDocId(String docId) getClosedConfigBefore(long expirationTime, int limit) getConfigByDocId(String docId) getConfigByKey(String key) intlockConfigUnlessClosedWith(long id, String closedError) Takes a config row's write lock until the transaction ends, by an update that changes nothing, unless its stored error is the given one: a save that writes the row back after it does not interleave with another write of the row, whatever the database's locking of reads.intreopenConfig(long id, long openedTime, String closedError) Opens a config at the given time, unless its stored error is the given one: a single conditional update, so a close written meanwhile by another transaction is never overwritten.Methods inherited from interface org.exoplatform.commons.api.persistence.GenericDAO
count, create, createAll, delete, deleteAll, deleteAll, find, findAll, update, updateAll
-
Method Details
-
getConfigByKey
-
getConfigByDocId
-
getActiveConfigByDocId
-
getClosedConfigBefore
-
closeUnopenedConversionConfigs
int closeUnopenedConversionConfigs(long closedTime) Closes, at the given time, the active configs built for a conversion that no editor ever opened: not open, no closed time (a closing config has one), and an empty explorer URL, which only a conversion config and its copies have.- Parameters:
closedTime- the closed time to set- Returns:
- the number of closed configs
-
reopenConfig
Opens a config at the given time, unless its stored error is the given one: a single conditional update, so a close written meanwhile by another transaction is never overwritten.- Parameters:
id- the config's database idopenedTime- the opened time to setclosedError- the error that keeps the config closed- Returns:
- the number of opened configs, 0 or 1
-
lockConfigUnlessClosedWith
Takes a config row's write lock until the transaction ends, by an update that changes nothing, unless its stored error is the given one: a save that writes the row back after it does not interleave with another write of the row, whatever the database's locking of reads.- Parameters:
id- the config's database idclosedError- the error that keeps the config closed- Returns:
- the number of locked configs, 0 if none is stored without that error
-