|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.service.request.ServiceRequestImpl
public final class ServiceRequestImpl
The request sent to the service.
The ServiceRequestImpl contains the Command and ServiceSession associated to the request to the pulse service. It
also provides access to Cookies and TemporaryFiles belonging
to the request.
Moreover, the ServiceRequestImpl takes care of authenticating the
User.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.torweg.pulse.service.request.ServiceRequest |
|---|
ServiceRequest.SessionMode |
| Constructor Summary | |
|---|---|
ServiceRequestImpl()
protected constructor. for internal use only. |
|
| Method Summary | |
|---|---|
void |
addCookie(Cookie cookie)
adds the given Cookie to the response. |
void |
addUploadedFile(IUploadedFile file)
adds an IUploadedFile to the list. |
AcceptLanguages |
getAcceptLanguages()
parses the accept-language header and returns the language and country components of the first locale. |
java.lang.String |
getBaseURI()
get the base URI to the servlet. |
Command |
getCommand()
get the Command sent to the pulse service. |
java.util.Collection<Cookie> |
getCookies()
get all Cookies sent by the browser. |
EventManagerImpl |
getEventManager()
returns all events produced by bundles in an EventManagerImpl. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
get access to the underlying HttpServletRequest. |
javax.servlet.http.HttpServletResponse |
getHttpServletResponse()
get access to the underlying HttpServletRequest. |
long |
getIntelliCacheMaxAge()
returns the maximum age for a dynamic page cached using IntelliCache to be considered for 304 Not Modified
responses upon a stateless ServiceSession. |
java.util.Locale |
getLocale()
returns the currently set Locale for the request. |
GeoLocation |
getRequestOrigin()
returns the country the request is made from or null, if the
country could not be resolved by
Lifecycle.getGeoLocationProvider()
. |
ServiceSession |
getSession()
get the ServiceSession associated to the request. |
ServiceRequest.SessionMode |
getSessionMode()
indicates whether the session shall be used with URL based session IDs and Cookies or with Cookies only. |
java.util.List<IUploadedFile> |
getUploadedFiles()
get all files that where uploaded during the request. |
User |
getUser()
returns the User associated with the request. |
ServiceRequestImpl |
init(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
initializes the ServiceRequestImpl from the HttpServletRequest. |
void |
refreshUser()
refreshes the internal User information from the session. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceRequestImpl()
| Method Detail |
|---|
public ServiceRequestImpl init(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
ServiceRequestImpl from the HttpServletRequest.
init in interface ServiceRequestreq - the request sent to the controller servletres - the response used by the controller servlet
public java.lang.String getBaseURI()
ServiceRequest
getBaseURI in interface ServiceRequestpublic Command getCommand()
ServiceRequestCommand sent to the pulse service.
getCommand in interface ServiceRequestServiceRequest.getCommand()public AcceptLanguages getAcceptLanguages()
getAcceptLanguages in interface ServiceRequestpublic long getIntelliCacheMaxAge()
IntelliCache to be considered for 304 Not Modified
responses upon a stateless ServiceSession.
getIntelliCacheMaxAge in interface ServiceRequestpublic ServiceSession getSession()
ServiceRequestServiceSession associated to the request.
getSession in interface ServiceRequestServiceRequest.getSession()public void addUploadedFile(IUploadedFile file)
IUploadedFile to the list.
file - the uploaded filepublic java.util.List<IUploadedFile> getUploadedFiles()
ServiceRequest
getUploadedFiles in interface ServiceRequestServiceRequest.getUploadedFiles()public GeoLocation getRequestOrigin()
null, if the
country could not be resolved by
Lifecycle.getGeoLocationProvider()
.
getRequestOrigin in interface ServiceRequestnull, if the
country could not be resolvedpublic java.util.Locale getLocale()
ServiceRequestLocale for the request.
getLocale in interface ServiceRequestServiceRequest.getLocale()public User getUser()
ServiceRequestUser associated with the request.
getUser in interface ServiceRequestServiceRequest.getUser()public EventManagerImpl getEventManager()
getEventManager in interface ServiceRequestpublic java.util.Collection<Cookie> getCookies()
ServiceRequestCookies sent by the browser.
getCookies in interface ServiceRequestServiceRequest.getCookies()public void addCookie(Cookie cookie)
Cookie to the response.
addCookie in interface ServiceRequestcookie - the cookie to addCookiepublic javax.servlet.http.HttpServletRequest getHttpServletRequest()
HttpServletRequest.
getHttpServletRequest in interface ServiceRequestpublic javax.servlet.http.HttpServletResponse getHttpServletResponse()
HttpServletRequest.
getHttpServletResponse in interface ServiceRequestpublic ServiceRequest.SessionMode getSessionMode()
getSessionMode in interface ServiceRequesttrue, if only cookie based sessions are to be usedpublic void refreshUser()
User information from the session.
refreshUser in interface ServiceRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||