Class PluginUtils


  • public class PluginUtils
    extends Object
    Author:
    Andrea Di Cesare
    • Constructor Detail

      • PluginUtils

        public PluginUtils()
    • Method Detail

      • requiresContent

        public static boolean requiresContent​(Interceptor interceptor)
      • name

        public static String name​(Plugin plugin)
        Parameters:
        plugin -
        Returns:
        the plugin name
      • defaultURI

        public static String defaultURI​(Service service)
        Parameters:
        service -
        Returns:
        the service default URI. If not explicitly set via defaulUri attribute, it is /[service-name]
      • defaultURI

        public static <P extends ServiceString defaultURI​(Class<P> serviceClass)
        Type Parameters:
        P -
        Parameters:
        serviceClass -
        Returns:
        the service default URI. If not explicitly set via defaulUri attribute, it is /[service-name]
      • actualUri

        public static <P extends ServiceString actualUri​(Map<String,​Object> conf,
                                                           Class<P> serviceClass)
        Type Parameters:
        P -
        Parameters:
        conf - the plugin configuration got from @InjectConfiguration
        serviceClass - the class of the service
        Returns:
        the actual service uri set in cofiguration or the defaultURI
      • dontIntercept

        public static InterceptPoint[] dontIntercept​(Service service)
        Parameters:
        service -
        Returns:
        the intercept points of interceptors that must not be executed on requests handled by service
      • handlingService

        public static Service handlingService​(PluginsRegistry registry,
                                              io.undertow.server.HttpServerExchange exchange)
        Parameters:
        registry -
        exchange -
        Returns:
        the service handling the exchange or null if the request is not handled by a service
      • dontIntercept

        public static InterceptPoint[] dontIntercept​(PluginsRegistry registry,
                                                     io.undertow.server.HttpServerExchange exchange)
        Parameters:
        registry -
        exchange -
        Returns:
        the intercept points of interceptors that must not be executed on the exchange
      • pipelineInfo

        public static PipelineInfo pipelineInfo​(io.undertow.server.HttpServerExchange exchange)
      • cachedRequestType

        public static Type cachedRequestType​(ExchangeTypeResolver plugin)
        Plugin.requestType() is heavy. This helper methods speeds up invocation using a cache
        Parameters:
        plugin -
        Returns:
      • cachedResponseType

        public static Type cachedResponseType​(ExchangeTypeResolver plugin)
        Plugin.responseType() is heavy. This helper methods speeds up invocation using a cache
        Parameters:
        plugin -
        Returns: