Class CompositeResolver
java.lang.Object
com.djrapitops.plan.delivery.web.resolver.CompositeResolver
- All Implemented Interfaces:
AsyncResolver, Resolver
Utility Resolver for organizing resolution in a tree-like structure.
CompositeResolver removes first part of the target with URIPath.omitFirst()
before calling the child Resolvers.
Example: resolverService.registerResolver("/test/", compositeResolver);
The Resolvers added to CompositeResolver will be given Request with URIPath "/".
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CompositeResolver.Builderbuilder()Create a new builder for a .booleanImplement access control if authorization is enabled.booleanrequiresAuth(Request request) Used to check if the resolver requires authentication to be used.resolveAsync(Request request) Implement asynchronous request resolution.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncResolver
resolveMethods inherited from interface Resolver
newResponseBuilder, usedWebPermissions
-
Method Details
-
builder
-
canAccess
Description copied from interface:ResolverImplement access control if authorization is enabled.Is not called when access control is not active.
-
resolveAsync
Description copied from interface:AsyncResolverImplement asynchronous request resolution.- Specified by:
resolveAsyncin interfaceAsyncResolver- Parameters:
request- HTTP request, contains all information necessary to resolve the request.- Returns:
- Future of Optional Response or empty if the response should be 404 (not found).
- See Also:
-
requiresAuth
Description copied from interface:ResolverUsed to check if the resolver requires authentication to be used.- Specified by:
requiresAuthin interfaceResolver- Parameters:
request- Incoming request that you can use to figure out if authentication is required.- Returns:
- true if you want 401 to be given when user has not logged in.
-