本文整理汇总了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;
}
};
}
示例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));
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例11: GatewayResource
import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public GatewayResource(RouteLocator routeLocator, DiscoveryClient discoveryClient) {
this.routeLocator = routeLocator;
this.discoveryClient = discoveryClient;
}
示例12: AccessControlFilter
import org.springframework.cloud.netflix.zuul.filters.RouteLocator; //导入依赖的package包/类
public AccessControlFilter(RouteLocator routeLocator, JHipsterProperties jHipsterProperties) {
this.routeLocator = routeLocator;
this.jHipsterProperties = jHipsterProperties;
}
示例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);
}
示例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;
}