Package net.officefloor.web.response
Class HttpResponder
java.lang.Object
net.officefloor.web.response.HttpResponder
- All Implemented Interfaces:
HttpEscalationHandler
Responder for an
Object or Escalation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceObtains the defaultHttpObjectResponderFactory. -
Constructor Summary
ConstructorsConstructorDescriptionHttpResponder(List<HttpObjectResponderFactory> objectResponderFactories, HttpResponder.DefaultHttpObjectResponder defaultHttpObjectResponder) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild()Builds thisHttpResponder.booleanhandle(HttpEscalationContext context) Handles theEscalation.voidsendObject(Object object, HttpStatus httpStatus, ServerHttpConnection connection, ManagedFunctionType<?, ?> managedFunctionType, ManagedFunctionObjectType<?> managedFunctionObjectType) Sends theObject.
-
Constructor Details
-
HttpResponder
public HttpResponder(List<HttpObjectResponderFactory> objectResponderFactories, HttpResponder.DefaultHttpObjectResponder defaultHttpObjectResponder) Instantiate.- Parameters:
objectResponderFactories-ListofHttpObjectResponderFactoryinstances.defaultHttpObjectResponder-HttpResponder.DefaultHttpObjectResponder.
-
-
Method Details
-
build
Builds this
HttpResponder.This may be called multiple times if re-used.
- Throws:
Exception- If fails to build.
-
sendObject
public void sendObject(Object object, HttpStatus httpStatus, ServerHttpConnection connection, ManagedFunctionType<?, ?> managedFunctionType, ManagedFunctionObjectType<?> managedFunctionObjectType) Sends theObject.- Parameters:
object-Objectto send.httpStatus-HttpStatus.connection-ServerHttpConnection.managedFunctionType-ManagedFunctionTypeofManagedFunctionsending theObject.managedFunctionObjectType-ManagedFunctionObjectTypeof theObjectResponseon theManagedFunction.
-
handle
Description copied from interface:HttpEscalationHandlerHandles theEscalation.- Specified by:
handlein interfaceHttpEscalationHandler- Parameters:
context-HttpEscalationContext.- Returns:
trueif handledEscalationinto theHttpResponse.falseif not able to handle the particularEscalation.- Throws:
IOException- If fails to write theEscalation.
-