/** * @param nettyRequest The {@link io.netty.handler.codec.http.HttpRequest} * @param ctx The {@link ChannelHandlerContext} * @param environment The Environment * @param serverConfiguration The {@link HttpServerConfiguration} */ @SuppressWarnings("MagicNumber") public NettyHttpRequest(io.netty.handler.codec.http.HttpRequest nettyRequest, ChannelHandlerContext ctx, ConversionService environment, HttpServerConfiguration serverConfiguration) { super(nettyRequest, environment); Objects.requireNonNull(nettyRequest, "Netty request cannot be null"); Objects.requireNonNull(ctx, "ChannelHandlerContext cannot be null"); Objects.requireNonNull(environment, "Environment cannot be null"); Channel channel = ctx.channel(); if (channel != null) { channel.attr(KEY).set(this); } this.serverConfiguration = serverConfiguration; this.attributes = new MutableConvertibleValuesMap<>(new ConcurrentHashMap<>(4), conversionService); this.channelHandlerContext = ctx; this.headers = new NettyHttpHeaders(nettyRequest.headers(), conversionService); this.body = SupplierUtil.memoizedNonEmpty(() -> Optional.ofNullable((T) buildBody())); }
/** * @param environment The {@link Environment} */ public ConfigurationInfoSource(Environment environment) { this.environment = environment; this.supplier = SupplierUtil.memoized(this::retrieveConfigurationInfo); }
/** * @param environment The {@link Environment} */ public ConfigurationInfoSource(Environment environment) { this.environment = environment; this.supplier = SupplierUtil.memoized(this::retrieveConfigurationInfo); }
/** * @param resourceResolver A {@link ResourceResolver} * @param gitPropertiesPath The path for the git properties file */ public GitInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.git.location:git.properties}") String gitPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveGitInfo); this.gitPropertiesPath = gitPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param buildPropertiesPath The build properties path */ public BuildInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.build.location:META-INF/build-info.properties}") String buildPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveBuildInfo); this.buildPropertiesPath = buildPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param buildPropertiesPath The build properties path */ public BuildInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.build.location:META-INF/build-info.properties}") String buildPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveBuildInfo); this.buildPropertiesPath = buildPropertiesPath; }
/** * @param resourceResolver A {@link ResourceResolver} * @param gitPropertiesPath The path for the git properties file */ public GitInfoSource( ResourceResolver resourceResolver, @Value("${endpoints.info.git.location:git.properties}") String gitPropertiesPath) { this.resourceResolver = resourceResolver; this.supplier = SupplierUtil.memoized(this::retrieveGitInfo); this.gitPropertiesPath = gitPropertiesPath; }