当前位置: 首页>>代码示例>>Java>>正文


Java RouteLocator类代码示例

本文整理汇总了Java中org.springframework.cloud.netflix.zuul.filters.RouteLocator的典型用法代码示例。如果您正苦于以下问题:Java RouteLocator类的具体用法?Java RouteLocator怎么用?Java RouteLocator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RouteLocator类属于org.springframework.cloud.netflix.zuul.filters包,在下文中一共展示了RouteLocator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Before
public void setUp() {
	this.locator = new RouteLocator() {
		@Override
		public Collection<String> getIgnoredPaths() {
			return null;
		}

		@Override
		public List<Route> getRoutes() {
			List<Route> routes = new ArrayList<>();
			routes.add(new Route("foo", "foopath", "foolocation", null, true, Collections.EMPTY_SET));
			routes.add(new Route("bar", "barpath", "barlocation", "/bar-prefix", true, Collections.EMPTY_SET));
			return routes;
		}

		@Override
		public Route getMatchingRoute(String path) {
			return null;
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:23,代码来源:RoutesEndpointTests.java

示例2: setUp

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Before
public void setUp() {
	this.locator = new RouteLocator() {
		@Override
		public Collection<String> getIgnoredPaths() {
			return null;
		}

		@Override
		public List<Route> getRoutes() {
			List<Route> routes = new ArrayList<>();
			routes.add(new Route("foo", "foopath", "foolocation", null, true, Collections.EMPTY_SET));
			routes.add(new Route("bar", "barpath", "barlocation", "bar-prefix", true, Collections.EMPTY_SET));
			return routes;
		}

		@Override
		public Route getMatchingRoute(String path) {
			return null;
		}
	};
	endpoint = spy(new RoutesEndpoint(locator));
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:24,代码来源:RoutesEndpointDetailsTests.java

示例3: setFilterUpWith

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
private LocationRewriteFilter setFilterUpWith(RequestContext context,
		ZuulProperties zuulProperties, Route route, String toZuulRequestUri,
		String redirectedUri) {
	MockHttpServletRequest httpServletRequest = new MockHttpServletRequest();
	httpServletRequest.setRequestURI(toZuulRequestUri);
	httpServletRequest.setServerName(ZUUL_HOST);
	httpServletRequest.setScheme(ZUUL_SCHEME);
	httpServletRequest.setServerPort(ZUUL_PORT);
	context.setRequest(httpServletRequest);

	MockHttpServletResponse httpServletResponse = new MockHttpServletResponse();
	context.getZuulResponseHeaders().add(new Pair<>("Location",
			String.format("%s%s", SERVER_BASE_URL, redirectedUri)));
	context.setResponse(httpServletResponse);

	RouteLocator routeLocator = mock(RouteLocator.class);
	when(routeLocator.getMatchingRoute(toZuulRequestUri)).thenReturn(route);
	LocationRewriteFilter filter = new LocationRewriteFilter(zuulProperties,
			routeLocator);

	return filter;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:23,代码来源:LocationRewriteFilterTests.java

示例4: discoveryRouteLocator

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Bean
@Override
@ConditionalOnMissingBean(RouteLocator.class)
public DiscoveryClientRouteLocator discoveryRouteLocator() {
  return new StoreProxyRouteLocator(server.getServletPath(), discovery, zuulProperties,
      zuulRouteStore);
}
 
开发者ID:venus-boot,项目名称:saluki,代码行数:8,代码来源:ZuulProxyStoreConfiguration.java

示例5: rateLimiterPreFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Bean
public ZuulFilter rateLimiterPreFilter(final RateLimiter rateLimiter,
                                       final RateLimitProperties rateLimitProperties,
                                       final RouteLocator routeLocator,
                                       final RateLimitKeyGenerator rateLimitKeyGenerator) {
    return new RateLimitPreFilter(rateLimitProperties, routeLocator, urlPathHelper, rateLimiter,
            rateLimitKeyGenerator);
}
 
开发者ID:marcosbarbero,项目名称:spring-cloud-zuul-ratelimit,代码行数:9,代码来源:RateLimitAutoConfiguration.java

示例6: rateLimiterPostFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Bean
public ZuulFilter rateLimiterPostFilter(final RateLimiter rateLimiter,
                                        final RateLimitProperties rateLimitProperties,
                                        final RouteLocator routeLocator,
                                        final RateLimitKeyGenerator rateLimitKeyGenerator) {
    return new RateLimitPostFilter(rateLimitProperties, routeLocator, urlPathHelper, rateLimiter,
            rateLimitKeyGenerator);
}
 
开发者ID:marcosbarbero,项目名称:spring-cloud-zuul-ratelimit,代码行数:9,代码来源:RateLimitAutoConfiguration.java

示例7: RateLimitPreFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public RateLimitPreFilter(final RateLimitProperties properties, final RouteLocator routeLocator,
    final UrlPathHelper urlPathHelper, final RateLimiter rateLimiter,
    final RateLimitKeyGenerator rateLimitKeyGenerator) {
    super(properties, routeLocator, urlPathHelper);
    this.rateLimiter = rateLimiter;
    this.rateLimitKeyGenerator = rateLimitKeyGenerator;
}
 
开发者ID:marcosbarbero,项目名称:spring-cloud-zuul-ratelimit,代码行数:8,代码来源:RateLimitPreFilter.java

示例8: RateLimitPostFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public RateLimitPostFilter(final RateLimitProperties properties, final RouteLocator routeLocator,
                           final UrlPathHelper urlPathHelper, final RateLimiter rateLimiter,
                           final RateLimitKeyGenerator rateLimitKeyGenerator) {
    super(properties, routeLocator, urlPathHelper);
    this.rateLimiter = rateLimiter;
    this.rateLimitKeyGenerator = rateLimitKeyGenerator;
}
 
开发者ID:marcosbarbero,项目名称:spring-cloud-zuul-ratelimit,代码行数:8,代码来源:RateLimitPostFilter.java

示例9: PreDecorationFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public PreDecorationFilter(RouteLocator routeLocator, String dispatcherServletPath, ZuulProperties properties,
		ProxyRequestHelper proxyRequestHelper) {
	this.routeLocator = routeLocator;
	this.properties = properties;
	this.urlPathHelper.setRemoveSemicolonContent(properties.isRemoveSemicolonContent());
	this.dispatcherServletPath = dispatcherServletPath;
	this.proxyRequestHelper = proxyRequestHelper;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:9,代码来源:PreDecorationFilter.java

示例10: mappingWithIgnoredPathsAndRoutes

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
private ZuulHandlerMapping mappingWithIgnoredPathsAndRoutes(List<String> ignoredPaths, Route route) {
	RouteLocator routeLocator = Mockito.mock(RouteLocator.class);
	Mockito.when(routeLocator.getIgnoredPaths())
			.thenReturn(ignoredPaths);
	Mockito.when(routeLocator.getRoutes()).thenReturn(Collections.singletonList(route));
	ZuulHandlerMapping zuulHandlerMapping = new ZuulHandlerMapping(routeLocator, new ZuulController());
	return zuulHandlerMapping;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:9,代码来源:ZuulHandlerMappingTests.java

示例11: GatewayResource

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public GatewayResource(RouteLocator routeLocator, DiscoveryClient discoveryClient) {
    this.routeLocator = routeLocator;
    this.discoveryClient = discoveryClient;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:5,代码来源:GatewayResource.java

示例12: AccessControlFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public AccessControlFilter(RouteLocator routeLocator, JHipsterProperties jHipsterProperties) {
    this.routeLocator = routeLocator;
    this.jHipsterProperties = jHipsterProperties;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:5,代码来源:AccessControlFilter.java

示例13: GatewaySwaggerResourcesProvider

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public GatewaySwaggerResourcesProvider(RouteLocator routeLocator, DiscoveryClient discoveryClient) {
    this.routeLocator = routeLocator;
    this.discoveryClient = discoveryClient;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:5,代码来源:GatewaySwaggerResourcesProvider.java

示例14: accessControlFilter

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
@Bean
public AccessControlFilter accessControlFilter(RouteLocator routeLocator, JHipsterProperties jHipsterProperties){
    return new AccessControlFilter(routeLocator, jHipsterProperties);
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:5,代码来源:GatewayConfiguration.java

示例15: RoutesResource

import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public RoutesResource(RouteLocator routeLocator, DiscoveryClient discoveryClient, ZuulProperties zuulProperties) {
    this.routeLocator = routeLocator;
    this.discoveryClient = discoveryClient;
    this.zuulProperties = zuulProperties;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:6,代码来源:RoutesResource.java


注:本文中的org.springframework.cloud.netflix.zuul.filters.RouteLocator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。