Class EnqueueingSessionManager

java.lang.Object
io.jmix.search.index.queue.impl.EnqueueingSessionManager

@Component("search_EnqueueingSessionManager") public class EnqueueingSessionManager extends Object
  • Field Details

  • Constructor Details

    • EnqueueingSessionManager

      public EnqueueingSessionManager()
  • Method Details

    • initSession

      public boolean initSession(String entityName)
      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

      public List<String> loadEntityNamesOfSessions()
      Gets entity names of all existing enqueueing sessions.
      Returns:
      list of entity names
    • suspendSession

      public boolean suspendSession(String entityName)
      Prevents session from being executed.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • resumeSession

      public boolean resumeSession(String entityName)
      Resumes previously suspended session.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • removeSession

      public boolean removeSession(EnqueueingSession session)
      Removes provided session.
      Parameters:
      session - session
      Returns:
      true if operation was successfully performed, false otherwise
    • removeSession

      public boolean removeSession(String entityName)
      Removes session by provided entity name.
      Parameters:
      entityName - entity name
      Returns:
      true if operation was successfully performed, false otherwise
    • getSession

      @Nullable public EnqueueingSession getSession(String entityName)
      Gets session for provided entity.
      Parameters:
      entityName - entity name
      Returns:
      existing session or null if it doesn't exist
    • getNextActiveSession

      @Nullable public EnqueueingSession getNextActiveSession()
      Gets next active session.
      Returns:
      some active session or null if there are no sessions at all
    • updateOrderingValue

      public void updateOrderingValue(EnqueueingSession session, @Nullable Object lastOrderingValue)
      Updates provided session with provided ordering value.
      Parameters:
      session - session
      lastOrderingValue - value
    • reloadSession

      protected Optional<EnqueueingSession> reloadSession(EnqueueingSession session)
    • loadEnqueueingSessionEntityByEntityName

      protected Optional<EnqueueingSession> loadEnqueueingSessionEntityByEntityName(String entityName)
    • resolveOrderingProperty

      protected MetaProperty resolveOrderingProperty(MetaClass entityClass)
    • executeManagementAction

      protected boolean executeManagementAction(String entityName, int lockTimeoutMs, EnqueueingSessionManager.SessionManagementAction action)
    • convertOrderingValueToString

      protected String convertOrderingValueToString(Object orderingValue)