Record Class NettyServerConfig

java.lang.Object
java.lang.Record
dev.tachyonmcp.core.transport.netty.NettyServerConfig
Record Components:
host - the host address to bind to
port - the port to bind to
endpointPath - the HTTP endpoint path for MCP messages
readerIdleTimeout - idle timeout for reading
writerIdleTimeout - idle timeout for writing
maxContentLength - maximum HTTP content length in bytes
corsConfig - CORS configuration, or null for defaults
ioEngine - the Netty I/O engine to use
pipelineCustomizer - 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 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 a NettyServerConfig record class.
      Parameters:
      host - the value for the host record component
      port - the value for the port record component
      endpointPath - the value for the endpointPath record component
      readerIdleTimeout - the value for the readerIdleTimeout record component
      writerIdleTimeout - the value for the writerIdleTimeout record component
      maxContentLength - the value for the maxContentLength record component
      corsConfig - the value for the corsConfig record component
      ioEngine - the value for the ioEngine record component
      pipelineCustomizer - the value for the pipelineCustomizer record 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

      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.
    • host

      public String host()
      Returns the value of the host record component.
      Returns:
      the value of the host record component
    • port

      public int port()
      Returns the value of the port record component.
      Returns:
      the value of the port record component
    • endpointPath

      public String endpointPath()
      Returns the value of the endpointPath record component.
      Returns:
      the value of the endpointPath record component
    • readerIdleTimeout

      public Duration readerIdleTimeout()
      Returns the value of the readerIdleTimeout record component.
      Returns:
      the value of the readerIdleTimeout record component
    • writerIdleTimeout

      public Duration writerIdleTimeout()
      Returns the value of the writerIdleTimeout record component.
      Returns:
      the value of the writerIdleTimeout record component
    • maxContentLength

      public int maxContentLength()
      Returns the value of the maxContentLength record component.
      Returns:
      the value of the maxContentLength record component
    • corsConfig

      public @Nullable io.netty.handler.codec.http.cors.CorsConfig corsConfig()
      Returns the value of the corsConfig record component.
      Returns:
      the value of the corsConfig record component
    • ioEngine

      public NettyIoEngine ioEngine()
      Returns the value of the ioEngine record component.
      Returns:
      the value of the ioEngine record component
    • pipelineCustomizer

      public @Nullable Consumer<io.netty.channel.ChannelPipeline> pipelineCustomizer()
      Returns the value of the pipelineCustomizer record component.
      Returns:
      the value of the pipelineCustomizer record component