本文整理汇总了Java中org.springframework.cloud.netflix.zuul.filters.Route.getFullPath方法的典型用法代码示例。如果您正苦于以下问题:Java Route.getFullPath方法的具体用法?Java Route.getFullPath怎么用?Java Route.getFullPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.cloud.netflix.zuul.filters.Route
的用法示例。
在下文中一共展示了Route.getFullPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldFilter
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
/**
* Filter requests on endpoints that are not in the list of authorized microservices endpoints.
*/
@Override
public boolean shouldFilter() {
String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI();
// If the request Uri does not start with the path of the authorized endpoints, we block the request
for (Route route : routeLocator.getRoutes()) {
String serviceUrl = route.getFullPath();
String serviceName = route.getId();
// If this route correspond to the current request URI
// We do a substring to remove the "**" at the end of the route URL
if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) {
return !isAuthorizedRequest(serviceUrl, serviceName, requestUri);
}
}
return true;
}
示例2: shouldFilter
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
/**
* Filter requests on endpoints that are not in the list of authorized microservices endpoints.
*/
@Override
public boolean shouldFilter() {
String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI();
log.debug(requestUri);
// If the request Uri does not start with the path of the authorized endpoints, we block the request
for (Route route : routeLocator.getRoutes()) {
String serviceUrl = route.getFullPath();
String serviceName = route.getId();
// If this route correspond to the current request URI
// We do a substring to remove the "**" at the end of the route URL
if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) {
return !isAuthorizedRequest(serviceUrl, serviceName, requestUri);
}
}
return true;
}
示例3: shouldFilter
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
/**
* Filter requests on endpoints that are not in the list of authorized microservices endpoints.
*/
@Override
public boolean shouldFilter() {
String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI();
// If the request Uri does not start with the path of the authorized endpoints, we block the request
for (Route route : routeLocator.getRoutes()) {
String serviceUrl = route.getFullPath();
String serviceName = route.getId();
// If this route correspond to the current request URI
// We do a substring to remove the "**" at the end of the route URL
if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) {
return !isAuthorizedRequest(serviceUrl, serviceName, requestUri);
}
}
return true;
}
示例4: shouldFilter
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
/**
* Filter requests on endpoints that are not in the list of authorized microservices endpoints.
*/
@Override
public boolean shouldFilter() {
String requestUri = RequestContext.getCurrentContext().getRequest().getRequestURI();
// If the request Uri does not start with the path of the authorized endpoints, we block the request
for (Route route : routeLocator.getRoutes()) {
String serviceUrl = route.getFullPath();
String serviceName = route.getId();
// If this route correspond to the current request URI
// We do a substring to remove the "**" at the end of the route URL
if (requestUri.startsWith(serviceUrl.substring(0, serviceUrl.length() - 2))) {
if (isAuthorizedRequest(serviceUrl, serviceName, requestUri)) {
return false;
}
}
}
return true;
}
示例5: RouteDetails
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
RouteDetails(final Route route) {
this.id = route.getId();
this.fullPath = route.getFullPath();
this.path = route.getPath();
this.location = route.getLocation();
this.prefix = route.getPrefix();
this.retryable = route.getRetryable();
this.sensitiveHeaders = route.getSensitiveHeaders();
this.customSensitiveHeaders = route.isCustomSensitiveHeaders();
this.prefixStripped = route.isPrefixStripped();
}
示例6: getRoute
import org.springframework.cloud.netflix.zuul.filters.Route; //导入方法依赖的package包/类
private Route getRoute(List<Route> routes, String path) {
for (Route route : routes) {
String pattern = route.getFullPath();
if (path.equals(pattern)) {
return route;
}
}
return null;
}