Class GatewayUtils

  • All Implemented Interfaces:
    io.microsphere.util.Utils

    public abstract class GatewayUtils
    extends java.lang.Object
    implements io.microsphere.util.Utils
    The utilities class for Gateway
    Since:
    1.0.0
    Author:
    Mercy
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> getGatewayProperties​(org.springframework.core.env.ConfigurableEnvironment environment)
      Get the flatten properties of GatewayProperties from the Spring Environment
      static java.util.Map<java.lang.String,​java.lang.Object> getRouteProperties​(org.springframework.core.env.ConfigurableEnvironment environment, java.lang.String routeId)
      Get the flatten properties of the specified RouteDefinition in the GatewayProperties from the Spring Environment
      static boolean isSuccessRouteLocatorEvent​(org.springframework.cloud.gateway.event.RefreshRoutesResultEvent event)
      Is the specified RefreshRoutesResultEvent success and the source is RouteLocator
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getGatewayProperties

        @NonNull
        public static java.util.Map<java.lang.String,​java.lang.Object> getGatewayProperties​(org.springframework.core.env.ConfigurableEnvironment environment)
        Get the flatten properties of GatewayProperties from the Spring Environment
        Parameters:
        environment - ConfigurableEnvironment
        Returns:
        non-null
      • getRouteProperties

        @NonNull
        public static java.util.Map<java.lang.String,​java.lang.Object> getRouteProperties​(org.springframework.core.env.ConfigurableEnvironment environment,
                                                                                                java.lang.String routeId)
        Get the flatten properties of the specified RouteDefinition in the GatewayProperties from the Spring Environment
        Parameters:
        environment - ConfigurableEnvironment
        routeId - the id of RouteDefinition
        Returns:
        non-null
      • isSuccessRouteLocatorEvent

        public static boolean isSuccessRouteLocatorEvent​(org.springframework.cloud.gateway.event.RefreshRoutesResultEvent event)
        Is the specified RefreshRoutesResultEvent success and the source is RouteLocator
        Parameters:
        event - RefreshRoutesResultEvent
        Returns:
        if success and the source is RouteLocator, return true, or false