class SidecarTokenHandler extends TokenHandler{
    private static final Logger logger = LoggerFactory.getLogger(SidecarTokenHandler.class);

    public static SidecarConfig sidecarConfig;

    public SidecarTokenHandler() {
        super();
        sidecarConfig = SidecarConfig.load();
        if(logger.isDebugEnabled()) logger.debug("SidecarTokenHandler is constructed");
    }
    @Override
    public void handleRequest(HttpServerExchange exchange) throws Exception {<FILL_FUNCTION_BODY>}

}

        if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest starts with indicator {}.", sidecarConfig.getEgressIngressIndicator());
        if (Constants.HEADER.equalsIgnoreCase(sidecarConfig.getEgressIngressIndicator())) {
            HeaderValues serviceIdHeader = exchange.getRequestHeaders().get(HttpStringConstants.SERVICE_ID);
            String serviceId = serviceIdHeader != null ? serviceIdHeader.peekFirst() : null;
            String serviceUrl = exchange.getRequestHeaders().getFirst(HttpStringConstants.SERVICE_URL);
            if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest serviceId {} and serviceUrl {}.", serviceId, serviceUrl);
            if (serviceId != null || serviceUrl!=null) {
                if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest ends with calling TokenHandler");
                super.handleRequest(exchange);
            } else {
                if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest ends with skipping TokenHandler");
                Handler.next(exchange, next);
            }
        } else if (Constants.PROTOCOL.equalsIgnoreCase(sidecarConfig.getEgressIngressIndicator()) && HttpURL.PROTOCOL_HTTP.equalsIgnoreCase(exchange.getRequestScheme())){
            if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest ends with calling TokenHandler");
            super.handleRequest(exchange);
        } else {
            if(logger.isTraceEnabled()) logger.trace("SidecarTokenHandler.handleRequest ends with skipping TokenHandler");
            Handler.next(exchange, next);
        }
    
<methods>public void <init>() ,public static Result<Jwt> getJwtToken(java.lang.String) ,public HttpHandler getNext() ,public void handleRequest(HttpServerExchange) throws java.lang.Exception,public boolean isEnabled() ,public void register() ,public void reload() ,public com.networknt.handler.MiddlewareHandler setNext(HttpHandler) <variables>private static final java.lang.String HANDLER_DEPENDENCY_ERROR,public static final Map<java.lang.String,Jwt> cache,private static com.networknt.router.middleware.TokenConfig config,static Logger logger,protected volatile HttpHandler next