com.nepxion.discovery.plugin.strategy.gateway.context.GatewayStrategyContextHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of discovery-plugin-strategy-starter-gateway Show documentation
Show all versions of discovery-plugin-strategy-starter-gateway Show documentation
Nepxion Discovery is an enhancement for Spring Cloud Discovery
package com.nepxion.discovery.plugin.strategy.gateway.context;
/**
* Title: Nepxion Discovery
* Description: Nepxion Discovery
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.server.ServerWebExchange;
import com.nepxion.discovery.plugin.strategy.context.AbstractStrategyContextHolder;
public class GatewayStrategyContextHolder extends AbstractStrategyContextHolder {
private static final Logger LOG = LoggerFactory.getLogger(GatewayStrategyContextHolder.class);
public ServerWebExchange getExchange() {
return GatewayStrategyContext.getCurrentContext().getExchange();
}
@Override
public String getHeader(String name) {
ServerWebExchange exchange = getExchange();
if (exchange == null) {
LOG.warn("The ServerWebExchange object is null");
return null;
}
return exchange.getRequest().getHeaders().getFirst(name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy