public class SimpleRouteLocator extends Object implements RouteLocator, org.springframework.core.Ordered
RouteLocator based on configuration data held in ZuulProperties.| Constructor and Description |
|---|
SimpleRouteLocator(String servletPath,
ZuulProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doRefresh()
Calculate all the routes and set up a cache for the values.
|
Collection<String> |
getIgnoredPaths()
Ignored route paths (or patterns), if any.
|
Route |
getMatchingRoute(String path)
Maps a path to an actual route with full metadata.
|
int |
getOrder() |
protected Route |
getRoute(ZuulProperties.ZuulRoute route,
String path) |
List<Route> |
getRoutes()
A map of route path (pattern) to location (e.g.
|
protected Map<String,ZuulProperties.ZuulRoute> |
getRoutesMap() |
protected Route |
getSimpleMatchingRoute(String path) |
protected ZuulProperties.ZuulRoute |
getZuulRoute(String adjustedPath) |
protected Map<String,ZuulProperties.ZuulRoute> |
locateRoutes()
Compute a map of path pattern to route.
|
protected boolean |
matchesIgnoredPatterns(String path) |
void |
setOrder(int order) |
public SimpleRouteLocator(String servletPath, ZuulProperties properties)
public List<Route> getRoutes()
RouteLocatorgetRoutes in interface RouteLocatorList of routespublic Collection<String> getIgnoredPaths()
RouteLocatorgetIgnoredPaths in interface RouteLocatorCollection of ignored pathspublic Route getMatchingRoute(String path)
RouteLocatorgetMatchingRoute in interface RouteLocatorpath - used to match the RouteRoute based on the provided pathprotected Map<String,ZuulProperties.ZuulRoute> getRoutesMap()
protected ZuulProperties.ZuulRoute getZuulRoute(String adjustedPath)
protected Route getRoute(ZuulProperties.ZuulRoute route, String path)
protected void doRefresh()
RefreshableRouteLocator.protected Map<String,ZuulProperties.ZuulRoute> locateRoutes()
ZuulProperties, but subclasses can add dynamic calculations.protected boolean matchesIgnoredPatterns(String path)
public int getOrder()
getOrder in interface org.springframework.core.Orderedpublic void setOrder(int order)
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.