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


Java Route.getFullPath方法代码示例

本文整理汇总了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;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:21,代码来源:AccessControlFilter.java

示例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;
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:23,代码来源:AccessControlFilter.java

示例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;
}
 
开发者ID:xm-online,项目名称:xm-gate,代码行数:21,代码来源:AccessControlFilter.java

示例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;
}
 
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:23,代码来源:AccessControlFilter.java

示例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();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:12,代码来源:RoutesEndpoint.java

示例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;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-netflix,代码行数:10,代码来源:DiscoveryClientRouteLocatorTests.java


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