Package org.apache.juneau.rest
Class RestOpSession
java.lang.Object
org.apache.juneau.ContextSession
org.apache.juneau.rest.RestOpSession
- Direct Known Subclasses:
RrpcRestOpSession
A session for a single HTTP request.
This session object gets created by RestSession once the Java method to be invoked has been determined.
Notes:
- This class is not thread safe.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRestOpSession(RestOpSession.Builder builder) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic RestOpSession.Buildercreate(RestOpContext ctx, RestSession session) Static creator.finish()Called at the end of a call to finish any remaining tasks such as flushing buffers and logging the response.Returns the bean store for this session.Returns the context that created this session.Returns the REST request object for this session.Returns the REST response object for this session.Returns the context of the parent class of this Java method.Returns the session of the parent class of this Java method.Returns the properties on this bean as a map for debugging.voidrun()Runs this session.status(StatusLine value) Sets the status of the response.Methods inherited from class org.apache.juneau.ContextSession
addWarning, checkForWarnings, getSessionProperties, getWarnings, isDebug, toString
-
Constructor Details
-
RestOpSession
Constructor.- Parameters:
builder- The builder for this object.
-
-
Method Details
-
create
Static creator.- Parameters:
ctx- The context object of the Java method being invoked.
Cannot benull .session- The REST session object creating this object.
Cannot benull .- Returns:
- A new builder.
-
finish
Called at the end of a call to finish any remaining tasks such as flushing buffers and logging the response.- Returns:
- This object.
-
getBeanStore
Returns the bean store for this session.- Returns:
- The bean store for this session.
-
getContext
Description copied from class:ContextSessionReturns the context that created this session.- Overrides:
getContextin classContextSession- Returns:
- The context that created this session.
-
getRequest
Returns the REST request object for this session.- Returns:
- The REST request object for this session.
-
getResponse
Returns the REST response object for this session.- Returns:
- The REST response object for this session.
-
getRestContext
Returns the context of the parent class of this Java method.- Returns:
- The context of the parent class of this Java method.
-
getRestSession
Returns the session of the parent class of this Java method.- Returns:
- The session of the parent class of this Java method.
-
run
Runs this session.Does the following:
- Runs the guards on the method.
- Finds the parameter values to pass to the Java method.
- Invokes the Java method.
- Sets the output and status on the response.
- Calls the converters on the Java method.
- Throws:
Throwable- Any throwable can be thrown.
-
status
Sets the status of the response.- Parameters:
value- The new status.
Can benull (ignored).- Returns:
- This object.
-
properties
Description copied from class:ContextSessionReturns the properties on this bean as a map for debugging.- Overrides:
propertiesin classContextSession- Returns:
- The properties on this bean as a map for debugging.
-