Record Class SessionConfig
java.lang.Object
java.lang.Record
dev.tachyonmcp.core.server.config.SessionConfig
- Record Components:
enabled- whenfalse(the default) the server is stateless: no session is created and no TTL tracking occurs; settrueto enable sessionssessionTtl- duration after which idle sessions are evicted (default 30s)sessionEventStore- optional custom event store;nulluses in-memory defaultsessionStore- optional custom session store;nulluses in-memory defaultsessionIdGenerator- session id generator; defaults toSessionIdGenerator.DEFAULTjanitorInterval- interval between janitor sweeps (default 5s);nulluses 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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Durationstatic final Durationstatic final SessionConfig -
Constructor Summary
ConstructorsConstructorDescriptionSessionConfig(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 aSessionConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SessionConfig.Builderbuilder()booleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@Nullable DurationReturns the value of thejanitorIntervalrecord component.@Nullable SessionEventStoreReturns the value of thesessionEventStorerecord component.@Nullable SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> Returns the value of thesessionIdGeneratorrecord component.@Nullable SessionStoreReturns the value of thesessionStorerecord component.@Nullable DurationReturns the value of thesessionTtlrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_SESSION_TTL
-
DEFAULT_JANITOR_INTERVAL
-
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 aSessionConfigrecord class.- Parameters:
enabled- the value for theenabledrecord componentsessionTtl- the value for thesessionTtlrecord componentsessionEventStore- the value for thesessionEventStorerecord componentsessionStore- the value for thesessionStorerecord componentsessionIdGenerator- the value for thesessionIdGeneratorrecord componentjanitorInterval- the value for thejanitorIntervalrecord component
-
-
Method Details
-
builder
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
sessionTtl
Returns the value of thesessionTtlrecord component.- Returns:
- the value of the
sessionTtlrecord component
-
sessionEventStore
Returns the value of thesessionEventStorerecord component.- Returns:
- the value of the
sessionEventStorerecord component
-
sessionStore
Returns the value of thesessionStorerecord component.- Returns:
- the value of the
sessionStorerecord component
-
sessionIdGenerator
public @Nullable SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> sessionIdGenerator()Returns the value of thesessionIdGeneratorrecord component.- Returns:
- the value of the
sessionIdGeneratorrecord component
-
janitorInterval
Returns the value of thejanitorIntervalrecord component.- Returns:
- the value of the
janitorIntervalrecord component
-