public class ServiceRequest extends java.lang.Object
Constructor and Description |
---|
ServiceRequest() |
Modifier and Type | Method and Description |
---|---|
static ServiceRequest |
createRequest(UserIdentity authenticatedUser,
javax.servlet.http.HttpServletRequest httpServletRequest) |
UserIdentity |
getAuthenticatedUser() |
java.io.InputStream |
getBody()
Note: you can only read the body once.
|
java.lang.String |
getHeaderValue(java.lang.String headerName) |
java.lang.String |
getHttpMethod() |
java.lang.String |
getMethodName() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getRawParameters() |
javax.servlet.http.HttpServletRequest |
getRequest() |
java.lang.String |
getServiceName() |
javax.servlet.http.HttpSession |
getSession() |
boolean |
isBodyRequested() |
static boolean |
isValid(ServiceRequest request) |
void |
setAuthenticatedUser(UserIdentity authenticatedUser) |
void |
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set/override the previously set headers.
|
void |
setHttpMethod(java.lang.String method) |
void |
setMethodName(java.lang.String methodName) |
void |
setServiceName(java.lang.String serviceName) |
public ServiceRequest()
public static boolean isValid(ServiceRequest request)
request
- public static ServiceRequest createRequest(UserIdentity authenticatedUser, javax.servlet.http.HttpServletRequest httpServletRequest)
authenticatedUser
- httpServletRequest
- public java.io.InputStream getBody()
public java.lang.String getServiceName()
public javax.servlet.http.HttpSession getSession()
public void setServiceName(java.lang.String serviceName)
serviceName
- the serviceName to setpublic java.lang.String getMethodName()
public void setMethodName(java.lang.String methodName)
methodName
- the methodName to setpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRawParameters()
public UserIdentity getAuthenticatedUser()
public void setAuthenticatedUser(UserIdentity authenticatedUser)
authenticatedUser
- the authenticatedUser to setpublic boolean isBodyRequested()
public java.lang.String getHttpMethod()
public void setHttpMethod(java.lang.String method)
method
- the method to set, e.g. GET, POSTpublic void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers
- the map of header names/values, note that the passed list will NOT be used, and an internal copy of the map will be made.public java.lang.String getHeaderValue(java.lang.String headerName)
headerName
- public javax.servlet.http.HttpServletRequest getRequest()
Copyright © 2015 Tampere University of Technology, Pori Department.