com.jeesuite.gateway.router.CustomRouteDefinitionRepository Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2016-2022 www.jeesuite.com.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jeesuite.gateway.router;
import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.event.EnableBodyCachingEvent;
import org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter;
import org.springframework.cloud.gateway.filter.FilterDefinition;
import org.springframework.cloud.gateway.handler.predicate.PredicateDefinition;
import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
import org.springframework.cloud.gateway.support.NotFoundException;
import com.jeesuite.common.GlobalRuntimeContext;
import com.jeesuite.gateway.CurrentSystemHolder;
import com.jeesuite.gateway.GatewayConstants;
import com.jeesuite.gateway.model.BizSystemModule;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
*
*
* Class Name : CustomRouteDefinitionRepository
*
* @author vakin
* @version 1.0.0
* @date Apr 5, 2022
*/
public class CustomRouteDefinitionRepository implements RouteDefinitionRepository {
private final static Logger logger = LoggerFactory.getLogger("com.zvosframework.adapter.gateway");
private static AtomicReference