Interface ResourceMethodResolver
public interface ResourceMethodResolver
Contract for matching incoming HTTP requests with appropriate Resource Methods (Java methods to invoke to handle requests).
Standard implementations can be acquired via these factory methods:
However, should a custom implementation be necessary for your application, documentation is available at https://www.soklet.com/docs/request-handling#resource-method-resolution.
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionVends the set of all Resource Methods registered in the system.resourceMethodForRequest
(Request request) Given an HTTP request, provide a matching Resource Method to invoke.static ResourceMethodResolver
static ResourceMethodResolver
withMethods
(Set<Method> methods) static ResourceMethodResolver
withResourceClasses
(Set<Class<?>> resourceClasses)
-
Method Details
-
resourceMethodForRequest
Given an HTTP request, provide a matching Resource Method to invoke.An unmatched Resource Method generally indicates an
HTTP 404
.- Parameters:
request
- the HTTP request- Returns:
- the matching Resource Method, or
Optional.empty()
if no match was found
-
getResourceMethods
Vends the set of all Resource Methods registered in the system.- Returns:
- the set of all Resource Methods in the system
-
withDefaults
-
withResourceClasses
-
withMethods
-