Package se.curity.identityserver.sdk.web
Interface ResponseModel
- All Known Implementing Classes:
ResponseModel.MapResponseModel,ResponseModel.TemplateResponseModel
public interface ResponseModel
A Response model contains information the server can use to provide a full HTTP response for a request
handled by a
RequestHandler.- Since:
- 2.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classA simpleResponseModelconsisting of only view data information.static final classAResponseModelwhich, besides view data information, contains a template. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionmapResponseModel(Map<String, Object> viewData) Create a Map-based response model.static ResponseModelproblemResponseModel(String type) Create a problem response model, with information about an existing problem.static ResponseModelproblemResponseModel(String type, String title) Create a problem response model, with information about an existing problem.static ResponseModelproblemResponseModel(String template, String type, String title) Create a problem response model, with information about an existing problem.templateResponseModel(Map<String, Object> viewData, String template) Create a template response model.
-
Field Details
-
KEY_PROBLEM_TYPE
Entry key for the problem type. Reserved for internal use.- See Also:
-
KEY_PROBLEM_TITLE
Entry key for the problem title. Reserved for internal use.- See Also:
-
-
Method Details
-
getViewData
- Returns:
- the view data associated with a HTTP response
-
mapResponseModel
Create a Map-based response model.- Parameters:
viewData- the model data associated with the view- Returns:
- the
MapResponseModelfor the given view data
-
templateResponseModel
static ResponseModel.TemplateResponseModel templateResponseModel(Map<String, Object> viewData, String template) Create a template response model.- Parameters:
viewData- the model data associated with the viewtemplate- the HTML template to use to render a response, if needed- Returns:
- the
TemplateResponseModelfor the given view data and template
-
problemResponseModel
Create a problem response model, with information about an existing problem.See RFC 7807 for the field semantics.
Note that setting this information doesn't necessarily imply that the response will use the
application/problem+jsonmedia type.- Parameters:
type- The problem type- Returns:
- a new
ResponseModelwith the defined information. - Since:
- 5.4.0
-
problemResponseModel
Create a problem response model, with information about an existing problem.See RFC 7807 for the field semantics.
Note that setting this information doesn't necessarily imply that the response will use the
application/problem+jsonmedia type.- Parameters:
type- The problem typetitle- The problem title- Returns:
- a new
ResponseModelwith the defined information. - Since:
- 5.4.0
-
problemResponseModel
Create a problem response model, with information about an existing problem.See RFC 7807 for the field semantics.
Note that setting this information doesn't necessarily imply that the response will use the
application/problem+jsonmedia type.- Parameters:
template- The HTML template or HAAPI representation function to use to render a response, if neededtype- The problem typetitle- The problem title- Returns:
- a new
ResponseModelwith the defined information. - Since:
- 5.4.0
-