com.zeus.ZXTMServlet
Interface ZXTMHttpServletRequest

All Superinterfaces:
HttpServletRequest, ServletRequest, ZXTMServletRequest

public interface ZXTMHttpServletRequest
extends ZXTMServletRequest, HttpServletRequest

ZXTMHttpServletRequest extends the HttpServletRequest interface to allow extended ZXTM functionality. In particular, it provides methods to allow the HttpServlet to alter the supplied HTTP request. The modified request can then be forwarded by ZXTM on to a backend web server in order to generate a response. When ZXTM invokes a HttpServlet, the HttpServletRequest parameter can be safely cast into a ZXTMHttpServletRequest. This will enable your HttpServlet to use the ZXTM extensions to the base HttpServlet API. For example, a typical HTTP Servlet can do the following:

 public void doGet( HttpServletRequest req, HttpServletResponse res )
 {
     ZXTMHttpServletRequest zreq = (ZXTMHttpServletRequest)req;
     ZXTMHttpServletResponse zres = (ZXTMHttpServletResponse)res;
     
     // zreq and zres can now be used to access the extended ZXTM
     // functionality
 }
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.zeus.ZXTMServlet.ZXTMServletRequest
ZXTMServletRequest.DataType
 
Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Method Summary
 void addHeader(String header, String value)
          Add a HTTP request header with the given name and value.
 String[] getRemoteUserAndPassword()
          Return { username, password }, if HTTP Basic Auth is used.
 void removeHeader(String header)
          Remove a HTTP header from the request.
 void setDateHeader(String header, long value)
          Set a HTTP request header to the supplied date.
 void setHeader(String header, String value)
          Set a HTTP request header.
 void setIntHeader(String header, int value)
          Set a HTTP request header to the supplied integer.
 void setMethod(String method)
          Set the HTTP method
 void setProtocol(String protocol)
          Set the HTTP version
 void setQueryString(String query)
          Set or delete the HTTP query string
 void setURL(String url)
          Set the URL.
 
Methods inherited from interface com.zeus.ZXTMServlet.ZXTMServletRequest
emitEvent, geoGetCity, geoGetCity, geoGetCountry, geoGetCountry, geoGetCountryCode, geoGetDistanceKM, geoGetDistanceKM, geoGetDistanceMiles, geoGetDistanceMiles, geoGetIPDistanceKM, geoGetIPDistanceKM, geoGetIPDistanceMiles, geoGetIPDistanceMiles, geoGetLatLon, geoGetLatLon, geoGetRegion, geoGetRegion, geoGetRegionCode, geoGetRegionCode, getActiveNodes, getConnectionData, getConnectionDataType, getData, getDataType, getOutputStream, getSLMConforming, getSLMThreshold, getWriter, incrementCounter, incrementCounter, isSLMOK, setConnectionData, setConnectionData, setData, setData
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Method Detail

addHeader

void addHeader(String header,
               String value)
Add a HTTP request header with the given name and value. This method allows request headers to have multiple values.

Parameters:
header - the name of the header
value - the additional header value

getRemoteUserAndPassword

String[] getRemoteUserAndPassword()
Return { username, password }, if HTTP Basic Auth is used. Otherwise, returns null


removeHeader

void removeHeader(String header)
Remove a HTTP header from the request.

Parameters:
header - the name of the header to remove

setDateHeader

void setDateHeader(String header,
                   long value)
Set a HTTP request header to the supplied date. The date is specified as milliseconds since the epoch. If the header already exists, then the new value overwrites the old one.

Parameters:
header - the name of the header
value - the date value

setHeader

void setHeader(String header,
               String value)
Set a HTTP request header. If the header already exists, then the new value overwrites the old one.

Parameters:
header - the name of the header
value - the header value

setIntHeader

void setIntHeader(String header,
                  int value)
Set a HTTP request header to the supplied integer. If the header already exists, then the the new value overwrites the old one.

Parameters:
header - the name of the header
value - the assigned integer value

setMethod

void setMethod(String method)
Set the HTTP method

Parameters:
method - the replacement HTTP method, e.g. 'GET'

setProtocol

void setProtocol(String protocol)
Set the HTTP version

Parameters:
protocol - the replacement protocol, e.g. 'HTTP/1.0'

setQueryString

void setQueryString(String query)
Set or delete the HTTP query string

Parameters:
query - Query string. null means wipe out any query string

setURL

void setURL(String url)
Set the URL.

Parameters:
url - - URL of the request. Can be a path, e.g. '/foo', or a full URL, e.g. 'http://www.zeus.com/foo', and can also include a query string. If a query string is not supplied, then any existing query string will be preserved.