Record Class NettyServerConfig
java.lang.Object
java.lang.Record
dev.tachyonmcp.core.transport.netty.NettyServerConfig
- Record Components:
host- the host address to bind toport- the port to bind toendpointPath- the HTTP endpoint path for MCP messagesreaderIdleTimeout- idle timeout for readingwriterIdleTimeout- idle timeout for writingmaxContentLength- maximum HTTP content length in bytescorsConfig- CORS configuration, ornullfor defaultsioEngine- the Netty I/O engine to usepipelineCustomizer- optional customizer for the Netty channel pipeline
public record NettyServerConfig(String host, int port, String endpointPath, Duration readerIdleTimeout, Duration writerIdleTimeout, int maxContentLength, @Nullable io.netty.handler.codec.http.cors.CorsConfig corsConfig, NettyIoEngine ioEngine, @Nullable Consumer<io.netty.channel.ChannelPipeline> pipelineCustomizer)
extends Record
Configuration for the Netty transport.
-
Constructor Summary
ConstructorsConstructorDescriptionNettyServerConfig(String host, int port, String endpointPath, Duration readerIdleTimeout, Duration writerIdleTimeout, int maxContentLength, @Nullable io.netty.handler.codec.http.cors.CorsConfig corsConfig, NettyIoEngine ioEngine, @Nullable Consumer<io.netty.channel.ChannelPipeline> pipelineCustomizer) Creates an instance of aNettyServerConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.handler.codec.http.cors.CorsConfigbuildCorsConfig(@Nullable List<String> allowedOrigins, boolean allowNullOrigin, boolean allowPrivateNetworks, @Nullable List<String> allowedHeaders) Builds a CORS configuration from the given parameters.@Nullable io.netty.handler.codec.http.cors.CorsConfigReturns the value of thecorsConfigrecord component.Returns the value of theendpointPathrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.host()Returns the value of thehostrecord component.ioEngine()Returns the value of theioEnginerecord component.intReturns the value of themaxContentLengthrecord component.@Nullable Consumer<io.netty.channel.ChannelPipeline> Returns the value of thepipelineCustomizerrecord component.intport()Returns the value of theportrecord component.Returns the value of thereaderIdleTimeoutrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewriterIdleTimeoutrecord component.
-
Constructor Details
-
NettyServerConfig
public NettyServerConfig(String host, int port, String endpointPath, Duration readerIdleTimeout, Duration writerIdleTimeout, int maxContentLength, @Nullable io.netty.handler.codec.http.cors.CorsConfig corsConfig, NettyIoEngine ioEngine, @Nullable Consumer<io.netty.channel.ChannelPipeline> pipelineCustomizer) Creates an instance of aNettyServerConfigrecord class.- Parameters:
host- the value for thehostrecord componentport- the value for theportrecord componentendpointPath- the value for theendpointPathrecord componentreaderIdleTimeout- the value for thereaderIdleTimeoutrecord componentwriterIdleTimeout- the value for thewriterIdleTimeoutrecord componentmaxContentLength- the value for themaxContentLengthrecord componentcorsConfig- the value for thecorsConfigrecord componentioEngine- the value for theioEnginerecord componentpipelineCustomizer- the value for thepipelineCustomizerrecord component
-
-
Method Details
-
buildCorsConfig
public static io.netty.handler.codec.http.cors.CorsConfig buildCorsConfig(@Nullable List<String> allowedOrigins, boolean allowNullOrigin, boolean allowPrivateNetworks, @Nullable List<String> allowedHeaders) Builds a CORS configuration from the given parameters. -
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 '=='. -
host
Returns the value of thehostrecord component.- Returns:
- the value of the
hostrecord component
-
port
public int port()Returns the value of theportrecord component.- Returns:
- the value of the
portrecord component
-
endpointPath
Returns the value of theendpointPathrecord component.- Returns:
- the value of the
endpointPathrecord component
-
readerIdleTimeout
Returns the value of thereaderIdleTimeoutrecord component.- Returns:
- the value of the
readerIdleTimeoutrecord component
-
writerIdleTimeout
Returns the value of thewriterIdleTimeoutrecord component.- Returns:
- the value of the
writerIdleTimeoutrecord component
-
maxContentLength
public int maxContentLength()Returns the value of themaxContentLengthrecord component.- Returns:
- the value of the
maxContentLengthrecord component
-
corsConfig
public @Nullable io.netty.handler.codec.http.cors.CorsConfig corsConfig()Returns the value of thecorsConfigrecord component.- Returns:
- the value of the
corsConfigrecord component
-
ioEngine
Returns the value of theioEnginerecord component.- Returns:
- the value of the
ioEnginerecord component
-
pipelineCustomizer
Returns the value of thepipelineCustomizerrecord component.- Returns:
- the value of the
pipelineCustomizerrecord component
-