Package io.jmix.search.index.queue.impl
Class EnqueueingSessionManager
java.lang.Object
io.jmix.search.index.queue.impl.EnqueueingSessionManager
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected DataManager
protected IndexConfigurationManager
protected IndexingLocker
protected Metadata
protected MetadataTools
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
convertOrderingValueToString
(Object orderingValue) protected boolean
executeManagementAction
(String entityName, int lockTimeoutMs, EnqueueingSessionManager.SessionManagementAction action) Gets next active session.getSession
(String entityName) Gets session for provided entity.boolean
initSession
(String entityName) Initializes session for provided entity.protected Optional<EnqueueingSession>
loadEnqueueingSessionEntityByEntityName
(String entityName) Gets entity names of all existing enqueueing sessions.protected Optional<EnqueueingSession>
reloadSession
(EnqueueingSession session) boolean
removeSession
(EnqueueingSession session) Removes provided session.boolean
removeSession
(String entityName) Removes session by provided entity name.protected MetaProperty
resolveOrderingProperty
(MetaClass entityClass) boolean
resumeSession
(String entityName) Resumes previously suspended session.boolean
suspendSession
(String entityName) Prevents session from being executed.void
updateOrderingValue
(EnqueueingSession session, Object lastOrderingValue) Updates provided session with provided ordering value.
-
Field Details
-
dataManager
-
metadata
-
metadataTools
-
indexConfigurationManager
-
locker
-
-
Constructor Details
-
EnqueueingSessionManager
public EnqueueingSessionManager()
-
-
Method Details
-
initSession
Initializes session for provided entity. Existing session will be removed and created again.- Parameters:
entityName
- entity name- Returns:
- true if operation was successfully performed, false otherwise
-
loadEntityNamesOfSessions
Gets entity names of all existing enqueueing sessions.- Returns:
- list of entity names
-
suspendSession
Prevents session from being executed.- Parameters:
entityName
- entity name- Returns:
- true if operation was successfully performed, false otherwise
-
resumeSession
Resumes previously suspended session.- Parameters:
entityName
- entity name- Returns:
- true if operation was successfully performed, false otherwise
-
removeSession
Removes provided session.- Parameters:
session
- session- Returns:
- true if operation was successfully performed, false otherwise
-
removeSession
Removes session by provided entity name.- Parameters:
entityName
- entity name- Returns:
- true if operation was successfully performed, false otherwise
-
getSession
Gets session for provided entity.- Parameters:
entityName
- entity name- Returns:
- existing session or null if it doesn't exist
-
getNextActiveSession
Gets next active session.- Returns:
- some active session or null if there are no sessions at all
-
updateOrderingValue
Updates provided session with provided ordering value.- Parameters:
session
- sessionlastOrderingValue
- value
-
reloadSession
-
loadEnqueueingSessionEntityByEntityName
-
resolveOrderingProperty
-
executeManagementAction
protected boolean executeManagementAction(String entityName, int lockTimeoutMs, EnqueueingSessionManager.SessionManagementAction action) -
convertOrderingValueToString
-