Package org.apache.juneau.rest.server
Class RestOperations
java.lang.Object
org.apache.juneau.rest.server.RestOperations
- Direct Known Subclasses:
RestOperations.Void
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class.final classRepresents a null value for the RestOperations class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedMethods(RestSession session) Returns the value of theAllow header for a405 Method Not Allowed response to the specified call.static RestOperations.BuilderStatic creator.findOperation(RestSession session) Finds the method that should handle the specified call.Returns the list of method contexts in this object.
-
Constructor Details
-
RestOperations
Constructor.- Parameters:
builder- The builder containing the settings for this object. Must not benull .
-
-
Method Details
-
create
Static creator.- Parameters:
beanStore- The bean store to use for creating beans.- Returns:
- A new builder for this object.
-
findOperation
public RestOpContext findOperation(RestSession session) throws MethodNotAllowed, PreconditionFailed, NotFound Finds the method that should handle the specified call.- Parameters:
session- The HTTP call. Must not benull .- Returns:
- The method that should handle the specified call.
- Throws:
MethodNotAllowed- If no methods implement the requested HTTP method.PreconditionFailed- At least one method was found but it didn't match one or more matchers.NotFound- HTTP method match was found but matching path was not.
-
allowedMethods
Returns the value of theAllow header for a405 Method Not Allowed response to the specified call.The methods this resource answers on the call's path: every key of the operation table, other than
"*" , with at least one operation whose path pattern matches, plus the request-line method when a"*" operation's path matches (the un-overridden request is always accepted there). The keys are what dispatch looks up, so a remote-proxy operation contributesGET andPOST , neverRRPC .Only path patterns are tested. Matchers are not run and the session's cached path match is not touched, so the call can be made for any request without disturbing the operation that handles it.
- Parameters:
session- The HTTP call. Must not benull .- Returns:
- The sorted, comma-separated method names. Empty when nothing answers on the path. Never
null . - Since:
- 10.0.0
-
getOpContexts
Returns the list of method contexts in this object.- Returns:
- An unmodifiable list of method contexts in this object.
-