Interface SessionManager<C,B extends org.wildfly.clustering.cache.batch.Batch>

Type Parameters:
C - the session context type
B - the batch type
All Superinterfaces:
Manager<String,B>, ManagerConfiguration<String>, Restartable

public interface SessionManager<C,B extends org.wildfly.clustering.cache.batch.Batch> extends Manager<String,B>
Author:
Paul Ferraro
  • Method Details

    • createSession

      default Session<C> createSession(String id)
      Creates a session using the specified identifier. Sessions returned by this method must be closed via Registration.close(). This method is intended to be invoked within the context of a batch.
      Parameters:
      id - a session identifier
      Returns:
      a new web session, or null if a session with the specified identifier already exists.
    • createSessionAsync

      CompletionStage<Session<C>> createSessionAsync(String id)
      Creates a session using the specified identifier. Sessions returned by this method must be closed via Registration.close(). This method is intended to be invoked within the context of a batch.
      Parameters:
      id - a session identifier
      Returns:
      a new web session, or null if a session with the specified identifier already exists.
    • findSession

      default Session<C> findSession(String id)
      Returns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed via Registration.close(). This method is intended to be invoked within the context of a batch.
      Parameters:
      id - a session identifier
      Returns:
      an existing web session, or null if none exists
    • findSessionAsync

      CompletionStage<Session<C>> findSessionAsync(String id)
      Returns the session with the specified identifier, or null if none exists. Sessions returned by this method must be closed via Registration.close(). This method is intended to be invoked within the context of a batch.
      Parameters:
      id - a session identifier
      Returns:
      an existing web session, or null if none exists
    • findImmutableSession

      default ImmutableSession findImmutableSession(String id)
      Returns a read-only view of the session with the specified identifier. This method is intended to be invoked within the context of a batch
      Parameters:
      id - a unique session identifier
      Returns:
      a read-only session or null if none exists
    • findImmutableSessionAsync

      CompletionStage<ImmutableSession> findImmutableSessionAsync(String id)
      Returns a read-only view of the session with the specified identifier. This method is intended to be invoked within the context of a batch
      Parameters:
      id - a unique session identifier
      Returns:
      a read-only session or null if none exists
    • getDetachedSession

      Session<C> getDetachedSession(String id)
      Returns a detached session with the specified identifier. A detached session is only valid if a session exists for the given identifier.
      Parameters:
      id - the session identifier of the detached session
      Returns:
      a detached session
    • getStatistics

      SessionStatistics getStatistics()
      Returns statistics for this session manager.
      Returns:
      an object from which statistics can be obtained.