pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.request
Interface ServiceRequest

All Known Implementing Classes:
ServiceRequestImpl

public interface ServiceRequest

The request sent to the service.

The ServiceRequest 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 ServiceRequest takes care of authenticating the User.

Version:
$Revision: 1873 $
Author:
Thomas Weber

Nested Class Summary
static class ServiceRequest.SessionMode
           
 
Method Summary
 void addCookie(Cookie cookie)
          adds the given Cookie to the response of the pulse service.
 AcceptLanguages getAcceptLanguages()
          returns the parsed accept-languages header.
 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.
 EventManager getEventManager()
          returns the event manager of the service request.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          get access to the underlying HttpServletRequest.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          get access to the underlying HttpServletResponse.
 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.
 ServiceRequest init(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          initialises the service request from a HTTP servlet request.
 void refreshUser()
          refreshes the User information from the session.
 

Method Detail

getBaseURI

java.lang.String getBaseURI()
get the base URI to the servlet.

Returns:
the base URI

getCommand

Command getCommand()
get the Command sent to the pulse service.

Returns:
the Command

getSession

ServiceSession getSession()
get the ServiceSession associated to the request.

Returns:
the ServiceSession

getUploadedFiles

java.util.List<IUploadedFile> getUploadedFiles()
get all files that where uploaded during the request.

Returns:
a List of the uploaded files

getLocale

java.util.Locale getLocale()
returns the currently set Locale for the request.

Returns:
the current Locale

getUser

User getUser()
returns the User associated with the request.

Returns:
the current User

getCookies

java.util.Collection<Cookie> getCookies()
get all Cookies sent by the browser.

Returns:
an array of Cookies

addCookie

void addCookie(Cookie cookie)
adds the given Cookie to the response of the pulse service.

Parameters:
cookie - the Cookie to be added
See Also:
Cookie

getHttpServletRequest

javax.servlet.http.HttpServletRequest getHttpServletRequest()
get access to the underlying HttpServletRequest.

Returns:
the underlying HttpServletRequest

getHttpServletResponse

javax.servlet.http.HttpServletResponse getHttpServletResponse()
get access to the underlying HttpServletResponse.

Returns:
the underlying HttpServletResponse

init

ServiceRequest init(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
initialises the service request from a HTTP servlet request.

Parameters:
req - the request to be used
res - the response to be used
Returns:
the initialised service request

getEventManager

EventManager getEventManager()
returns the event manager of the service request.

Returns:
the event manager

getRequestOrigin

GeoLocation getRequestOrigin()
returns the country the request is made from or null, if the country could not be resolved by Lifecycle.getGeoLocationProvider() .

Returns:
the country the request is made from or null, if the country could not be resolved

getSessionMode

ServiceRequest.SessionMode getSessionMode()
indicates whether the session shall be used with URL based session IDs and Cookies or with Cookies only.

Returns:
true, if only cookie based sessions are to be used

refreshUser

void refreshUser()
refreshes the User information from the session.


getAcceptLanguages

AcceptLanguages getAcceptLanguages()
returns the parsed accept-languages header.

Returns:
the parsed accept-languages

getIntelliCacheMaxAge

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.

Returns:
the maximum age in milliseconds