Package org.restheart.utils
Class PluginUtils
java.lang.Object
org.restheart.utils.PluginUtils
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Authorizer.TYPEauthorizerType(Authorizer authorizer) static booleanstatic TypePlugin.requestType() is heavy.static TypePlugin.responseType() is heavy.defaultURI(Class<P> serviceClass) static StringdefaultURI(Service service) static InterceptPoint[]dontIntercept(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange) static InterceptPoint[]dontIntercept(Service service) static Service<?, ?> handlingService(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange) static PluginRecord<Service<?, ?>> handlingServicePluginRecord(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange) static InitPointinitPoint(Initializer initializer) static InterceptPointinterceptPoint(Interceptor interceptor) static Stringstatic Booleanrequiredinterceptor(Interceptor interceptor) static booleanrequiresContent(Interceptor<? extends Request<?>, ? extends Response<?>> interceptor) static RegisterPlugin.MATCH_POLICYuriMatchPolicy(Service service)
-
Constructor Details
-
PluginUtils
public PluginUtils()
-
-
Method Details
-
interceptPoint
- Parameters:
interceptor-- Returns:
- the interceptPoint as defined by the @RegisterPlugin annotation if annotated or the value of the field interceptPoint if exists
-
requiredinterceptor
- Parameters:
interceptor-- Returns:
- the requiredinterceptor as defined by the @RegisterPlugin annotation
-
initPoint
-
requiresContent
public static boolean requiresContent(Interceptor<? extends Request<?>, ? extends Response<?>> interceptor) -
name
- Parameters:
plugin-- Returns:
- the plugin name
-
defaultURI
- Parameters:
service-- Returns:
- the service default URI. If not explicitly set via defaulUri attribute, it is /[service-name]
-
uriMatchPolicy
- Parameters:
service-- Returns:
- uri match policy.
-
defaultURI
- Type Parameters:
P-- Parameters:
serviceClass-- Returns:
- the service default URI. If not explicitly set via defaulUri attribute, it is /[service-name]
-
actualUri
- Type Parameters:
P-- Parameters:
conf- the plugin configuration got from @Inject("conf")serviceClass- the class of the service- Returns:
- the actual service uri set in cofiguration or the defaultURI
-
dontIntercept
- Parameters:
service-- Returns:
- the intercept points of interceptors that must not be executed on requests handled by service
-
authorizerType
- Parameters:
authorizer-- Returns:
- the Authorizer type
-
blocking
-
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
-
handlingServicePluginRecord
public static PluginRecord<Service<?,?>> handlingServicePluginRecord(PluginsRegistry registry, io.undertow.server.HttpServerExchange exchange) - Parameters:
registry-exchange-- Returns:
- the plugin record of 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
-
cachedRequestType
Plugin.requestType() is heavy. This helper methods speeds up invocation using a cache- Parameters:
plugin-- Returns:
-
cachedResponseType
Plugin.responseType() is heavy. This helper methods speeds up invocation using a cache- Parameters:
plugin-- Returns:
-