class ServiceStrategyContextHolder extends AbstractStrategyContextHolder {
    // 如果外界也传了相同的Header，例如，从Postman传递过来的Header，当下面的变量为true，以服务设置为优先，否则以外界传值为优先
    @Value("${" + ServiceStrategyConstant.SPRING_APPLICATION_STRATEGY_SERVICE_HEADER_PRIORITY + ":true}")
    protected Boolean serviceHeaderPriority;

    public ServletRequestAttributes getRestAttributes() {
        RequestAttributes requestAttributes = RestStrategyContext.getCurrentContext().getRequestAttributes();
        if (requestAttributes == null) {
            requestAttributes = RequestContextHolder.getRequestAttributes();
        }

        return (ServletRequestAttributes) requestAttributes;
    }

    public Map<String, Object> getRpcAttributes() {
        return RpcStrategyContext.getCurrentContext().getAttributes();
    }

    public HttpServletRequest getHttpServletRequest() {
        ServletRequestAttributes attributes = getRestAttributes();
        if (attributes == null) {
            // LOG.warn("The ServletRequestAttributes object is lost for thread switched probably");

            return null;
        }

        HttpServletRequest request = attributes.getRequest();
        if (request == null) {
            // LOG.warn("The HttpServletRequest object is lost for thread switched probably");

            return null;
        }

        return request;
    }

    @Override
    public Enumeration<String> getHeaderNames() {
        HttpServletRequest request = getHttpServletRequest();
        if (request == null) {
            return null;
        }

        Enumeration<String> headerNames = request.getHeaderNames();

        Map<String, String> headerMap = strategyWrapper.getHeaderMap();
        if (MapUtils.isNotEmpty(headerMap)) {
            List<String> headerNameList = Collections.list(headerNames);

            for (Map.Entry<String, String> entry : headerMap.entrySet()) {
                String headerName = entry.getKey();
                if (!headerNameList.contains(headerName)) {
                    headerNameList.add(headerName);
                }
            }

            return Collections.enumeration(headerNameList);
        }

        return headerNames;
    }

    @Override
    public String getHeader(String name) {
        if (serviceHeaderPriority) {
            String header = strategyWrapper.getHeader(name);
            if (StringUtils.isEmpty(header)) {
                HttpServletRequest request = getHttpServletRequest();
                if (request != null) {
                    header = request.getHeader(name);
                }
            }

            return header;
        } else {
            String header = null;
            HttpServletRequest request = getHttpServletRequest();
            if (request != null) {
                header = request.getHeader(name);
            }

            if (StringUtils.isEmpty(header)) {
                header = strategyWrapper.getHeader(name);
            }

            return header;
        }
    }

    @Override
    public String getParameter(String name) {
        HttpServletRequest request = getHttpServletRequest();
        if (request == null) {
            return null;
        }

        return request.getParameter(name);
    }

    public Cookie getHttpCookie(String name) {<FILL_FUNCTION_BODY>}

    @Override
    public String getCookie(String name) {
        Cookie cookie = getHttpCookie(name);
        if (cookie != null) {
            return cookie.getValue();
        }

        return null;
    }

    public String getRequestURL() {
        HttpServletRequest request = getHttpServletRequest();
        if (request == null) {
            return null;
        }

        return request.getRequestURL().toString();
    }

    public String getRequestURI() {
        HttpServletRequest request = getHttpServletRequest();
        if (request == null) {
            return null;
        }

        return request.getRequestURI();
    }
}

        HttpServletRequest request = getHttpServletRequest();
        if (request == null) {
            return null;
        }

        Cookie[] cookies = request.getCookies();
        if (cookies == null) {
            return null;
        }

        for (int i = 0; i < cookies.length; i++) {
            Cookie cookie = cookies[i];
            String cookieName = cookie.getName();
            if (StringUtils.equals(cookieName, name)) {
                return cookie;
            }
        }

        return null;
    
<methods>public non-sealed void <init>() ,public java.lang.String getContext(java.lang.String) ,public java.lang.String getContextRouteAddress() ,public java.lang.String getContextRouteAddressBlacklist() ,public java.lang.String getContextRouteAddressFailover() ,public java.lang.String getContextRouteEnvironment() ,public java.lang.String getContextRouteEnvironmentFailover() ,public java.lang.String getContextRouteIdBlacklist() ,public java.lang.String getContextRouteRegion() ,public java.lang.String getContextRouteRegionFailover() ,public java.lang.String getContextRouteRegionTransfer() ,public java.lang.String getContextRouteRegionWeight() ,public java.lang.String getContextRouteVersion() ,public java.lang.String getContextRouteVersionFailover() ,public java.lang.String getContextRouteVersionPrefer() ,public java.lang.String getContextRouteVersionWeight() ,public java.lang.String getContextRouteZoneFailover() ,public com.nepxion.discovery.plugin.framework.adapter.PluginAdapter getPluginAdapter() ,public java.lang.String getRouteAddress() ,public java.lang.String getRouteAddressBlacklist() ,public java.lang.String getRouteAddressFailover() ,public java.lang.String getRouteEnvironment() ,public java.lang.String getRouteEnvironmentFailover() ,public java.lang.String getRouteIdBlacklist() ,public java.lang.String getRouteRegion() ,public java.lang.String getRouteRegionFailover() ,public java.lang.String getRouteRegionTransfer() ,public java.lang.String getRouteRegionWeight() ,public java.lang.String getRouteVersion() ,public java.lang.String getRouteVersionFailover() ,public java.lang.String getRouteVersionPrefer() ,public java.lang.String getRouteVersionWeight() ,public java.lang.String getRouteZoneFailover() ,public java.lang.String getSpanId() ,public com.nepxion.discovery.plugin.strategy.wrapper.StrategyWrapper getStrategyWrapper() ,public java.lang.String getTraceId() <variables>protected com.nepxion.discovery.plugin.framework.adapter.PluginAdapter pluginAdapter,protected com.nepxion.discovery.plugin.strategy.monitor.StrategyMonitorContext strategyMonitorContext,protected com.nepxion.discovery.plugin.strategy.wrapper.StrategyWrapper strategyWrapper