Class GatewayUtils
java.lang.Object
io.microsphere.spring.cloud.gateway.server.webflux.util.GatewayUtils
- All Implemented Interfaces:
io.microsphere.util.Utils
The utilities class for Gateway
- Since:
- 1.0.0
- Author:
- Mercy
-
Method Summary
Modifier and TypeMethodDescriptiongetGatewayProperties(org.springframework.core.env.ConfigurableEnvironment environment) Get the flatten properties ofGatewayPropertiesfrom the SpringEnvironmentgetRouteProperties(org.springframework.core.env.ConfigurableEnvironment environment, String routeId) Get the flatten properties of the specifiedRouteDefinitionin theGatewayPropertiesfrom the SpringEnvironmentstatic booleanisSuccessRouteLocatorEvent(org.springframework.cloud.gateway.event.RefreshRoutesResultEvent event) Is the specifiedRefreshRoutesResultEventsuccess and the source isRouteLocator
-
Method Details
-
getGatewayProperties
@NonNull public static Map<String,Object> getGatewayProperties(org.springframework.core.env.ConfigurableEnvironment environment) Get the flatten properties ofGatewayPropertiesfrom the SpringEnvironment- Parameters:
environment-ConfigurableEnvironment- Returns:
- non-null
-
getRouteProperties
@NonNull public static Map<String,Object> getRouteProperties(org.springframework.core.env.ConfigurableEnvironment environment, String routeId) Get the flatten properties of the specifiedRouteDefinitionin theGatewayPropertiesfrom the SpringEnvironment- Parameters:
environment-ConfigurableEnvironmentrouteId- the id ofRouteDefinition- Returns:
- non-null
-
isSuccessRouteLocatorEvent
public static boolean isSuccessRouteLocatorEvent(org.springframework.cloud.gateway.event.RefreshRoutesResultEvent event) Is the specifiedRefreshRoutesResultEventsuccess and the source isRouteLocator- Parameters:
event-RefreshRoutesResultEvent- Returns:
- if success and the source is
RouteLocator, returntrue, orfalse
-