public class RequestContext extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
JSON_CONTENT_TYPE |
| Constructor and Description |
|---|
RequestContext(HttpMethod method,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
com.google.protobuf.ByteString |
asByteString(String parameterName,
String value) |
Integer |
asInteger(String parameterName,
String value) |
Long |
asLong(String parameterName,
String value) |
void |
error(String format,
Object... args) |
void |
error(Throwable t) |
HttpMethod |
getMethod() |
com.google.protobuf.ByteString |
getParameterAsByteString(String name,
ParameterLocation location,
boolean required) |
Integer |
getParameterAsInteger(String name,
ParameterLocation location,
boolean required) |
Long |
getParameterAsLong(String name,
ParameterLocation location,
boolean required) |
String |
getParameterAsString(String name,
ParameterLocation location,
boolean required) |
javax.servlet.http.HttpServletRequest |
getRequest() |
javax.servlet.http.HttpServletResponse |
getResponse() |
<E extends IEntity> |
parsePayload(IEntityFactory<E,?,?> factory) |
<M,T> M |
parsePayload(TypeDefBuilder<M,T> builder) |
boolean |
preConditionsAreMet() |
void |
sendErrorResponse(int statusCode) |
void |
sendOKResponse() |
void |
sendOKResponse(IBaseEntity response) |
public static final String JSON_CONTENT_TYPE
public RequestContext(HttpMethod method, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public HttpMethod getMethod()
public javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
@Nullable public Long getParameterAsLong(String name, ParameterLocation location, boolean required)
public Integer getParameterAsInteger(String name, ParameterLocation location, boolean required)
public com.google.protobuf.ByteString getParameterAsByteString(String name, ParameterLocation location, boolean required)
@Nullable public com.google.protobuf.ByteString asByteString(String parameterName, String value)
public String getParameterAsString(String name, ParameterLocation location, boolean required)
public boolean preConditionsAreMet()
public void sendOKResponse()
public void sendOKResponse(IBaseEntity response) throws IOException
IOExceptionpublic void sendErrorResponse(int statusCode)
public void error(Throwable t)
public <E extends IEntity> E parsePayload(IEntityFactory<E,?,?> factory)
public <M,T> M parsePayload(TypeDefBuilder<M,T> builder)
Copyright © 2018 Symphony Software Foundation. All rights reserved.