Package org.restheart.utils
Class PluginUtils
- java.lang.Object
-
- org.restheart.utils.PluginUtils
-
public class PluginUtils extends Object
- Author:
- Andrea Di Cesare
-
-
Constructor Summary
Constructors Constructor Description PluginUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <P extends Service>
StringactualUri(Map<String,Object> conf, Class<P> serviceClass)static TypecachedRequestType(ExchangeTypeResolver plugin)Plugin.requestType() is heavy.static TypecachedResponseType(ExchangeTypeResolver plugin)Plugin.responseType() is heavy.static <P extends Service>
StringdefaultURI(Class<P> serviceClass)static StringdefaultURI(Service service)static InterceptPoint[]dontIntercept(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange)static InterceptPoint[]dontIntercept(Service service)static ServicehandlingService(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange)static InitPointinitPoint(Initializer initializer)static InterceptPointinterceptPoint(Interceptor interceptor)static Stringname(Plugin plugin)static PipelineInfopipelineInfo(io.undertow.server.HttpServerExchange exchange)static booleanrequiresContent(Interceptor interceptor)
-
-
-
Method Detail
-
interceptPoint
public static InterceptPoint interceptPoint(Interceptor interceptor)
-
initPoint
public static InitPoint initPoint(Initializer initializer)
-
requiresContent
public static boolean requiresContent(Interceptor interceptor)
-
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 Service> String 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 Service> String actualUri(Map<String,Object> conf, Class<P> serviceClass)
- Type Parameters:
P-- Parameters:
conf- the plugin configuration got from @InjectConfigurationserviceClass- 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:
-
-