Record Class SessionConfig

java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.config.SessionConfig
Record Components:
enabled - when false (the default) the server is stateless: no session is created and no TTL tracking occurs; set true to enable sessions
sessionTtl - duration after which idle sessions are evicted (default 30s)
sessionEventStore - optional custom event store; null uses in-memory default
sessionStore - optional custom session store; null uses in-memory default
sessionIdGenerator - session id generator; defaults to SessionIdGenerator.DEFAULT
janitorInterval - interval between janitor sweeps (default 5s); null uses the default

public record SessionConfig(boolean enabled, @Nullable Duration sessionTtl, @Nullable SessionEventStore sessionEventStore, @Nullable SessionStore sessionStore, @Nullable SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> sessionIdGenerator, @Nullable Duration janitorInterval) extends Record
Session lifecycle and persistence configuration.
  • Field Details

    • DEFAULT_SESSION_TTL

      public static final Duration DEFAULT_SESSION_TTL
    • DEFAULT_JANITOR_INTERVAL

      public static final Duration DEFAULT_JANITOR_INTERVAL
    • STATELESS

      public static final SessionConfig STATELESS
  • Constructor Details

    • SessionConfig

      public SessionConfig(boolean enabled, @Nullable Duration sessionTtl, @Nullable SessionEventStore sessionEventStore, @Nullable SessionStore sessionStore, @Nullable SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> sessionIdGenerator, @Nullable Duration janitorInterval)
      Creates an instance of a SessionConfig record class.
      Parameters:
      enabled - the value for the enabled record component
      sessionTtl - the value for the sessionTtl record component
      sessionEventStore - the value for the sessionEventStore record component
      sessionStore - the value for the sessionStore record component
      sessionIdGenerator - the value for the sessionIdGenerator record component
      janitorInterval - the value for the janitorInterval record component
  • Method Details

    • builder

      public static SessionConfig.Builder builder()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • sessionTtl

      public @Nullable Duration sessionTtl()
      Returns the value of the sessionTtl record component.
      Returns:
      the value of the sessionTtl record component
    • sessionEventStore

      public @Nullable SessionEventStore sessionEventStore()
      Returns the value of the sessionEventStore record component.
      Returns:
      the value of the sessionEventStore record component
    • sessionStore

      public @Nullable SessionStore sessionStore()
      Returns the value of the sessionStore record component.
      Returns:
      the value of the sessionStore record component
    • sessionIdGenerator

      public @Nullable SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> sessionIdGenerator()
      Returns the value of the sessionIdGenerator record component.
      Returns:
      the value of the sessionIdGenerator record component
    • janitorInterval

      public @Nullable Duration janitorInterval()
      Returns the value of the janitorInterval record component.
      Returns:
      the value of the janitorInterval record component