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()
RouteLocator
getRoutes
in interface RouteLocator
public Collection<String> getIgnoredPaths()
RouteLocator
getIgnoredPaths
in interface RouteLocator
public Route getMatchingRoute(String path)
RouteLocator
getMatchingRoute
in interface RouteLocator
protected 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.Ordered
public void setOrder(int order)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.