|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.cams.agent.http.AbstractCamsHttpAgentRequest
Abstract implementation of CamsHttpAgentRequest.
| Field Summary | |
protected boolean |
debug
A flag used to indicate whether DEBUG-level messages should be logged. |
protected Logger |
logger
Logs data. |
protected javax.servlet.http.HttpServletRequest |
request
The HttpServletRequest cast from the more general Request. |
| Constructor Summary | |
AbstractCamsHttpAgentRequest()
|
|
AbstractCamsHttpAgentRequest(javax.servlet.http.HttpServletRequest request)
Create a new AbstractCamsHttpAgentRequest. |
|
| Method Summary | |
abstract void |
addHeader(String name,
String value)
Adds the specified header and value to this CamsHttpAgentRequest. |
void |
addSessionId(SessionId sessionId)
Add a SessionId to the request. |
boolean |
containsCamsHeaders()
Determine if the CamsHttpAgentRequest contains CAMS HTTP Headers. |
void |
destroy()
Destroy the CamsHttpAgentRequest. |
javax.servlet.http.Cookie |
getCookie(String name)
Get a Cookie with the given name. |
javax.servlet.http.Cookie[] |
getCookies(com.cafesoft.core.http.HttpCookieFilter filter)
Returns an array containing all of the Cookie objects the client sent with this request. |
String |
getHeader(String name)
Returns the value of the specified request header as a String. |
Enumeration |
getHeaderNames()
Returns an enumeration of all the header names this request contains. |
Enumeration |
getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects. |
String |
getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. |
String |
getParameter(String name)
Returns the value mapped to the specified parameter. |
Enumeration |
getParameterNames()
Returns all of the Http parameters. |
String |
getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. |
String |
getQueryString()
Returns the query string that is contained in the request URL after the path. |
String |
getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request. |
String |
getRemoteHost()
Returns the fully qualified name of the client that sent the request. |
String |
getRequestURI()
Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request. |
String |
getRequestURL()
Reconstructs the URL the client used to make the request. |
String |
getScheme()
Returns the name of the scheme used to make this request. |
String |
getSecurityDomain()
Get the name of the SecurityDomain handling this request. |
String |
getServerAddr()
Returns the IP address of the server where the CamsHttpAgent is running. |
String |
getServerName()
Returns the host name of the server that received the request. |
int |
getServerPort()
Returns the port number on which this request was received. |
SessionId |
getSessionId(String securityDomain)
Get a SecurityDomain specific SessionId. |
SessionId[] |
getSessionIds()
Get all of the request's SessionIds. |
void |
initialize(Config config)
Initializes this request. |
boolean |
isLogin()
Determines if this Http request is for logging in. |
boolean |
isLogout()
Determines if this Http request is for logging out. |
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
void |
log()
Logs the data contained in this CamsHttpAgentRequest. |
void |
recycle()
Recycle the CamsHttpAgentRequest so it can be reused. |
void |
removeSessionId(SessionId sessionId)
Remove a Sessionid from the request. |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Sets the Request object. |
void |
setSecurityDomain(String securityDomain)
Get the name of the SecurityDomain handling this request. |
void |
validateHeaders()
Validate the request headers. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected javax.servlet.http.HttpServletRequest request
protected Logger logger
protected boolean debug
| Constructor Detail |
public AbstractCamsHttpAgentRequest()
public AbstractCamsHttpAgentRequest(javax.servlet.http.HttpServletRequest request)
request - the Http request
NullPointerException - thrown if the request is null| Method Detail |
public abstract void addHeader(String name,
String value)
addHeader in interface CamsHttpAgentRequestname - the name of the headervalue - the value of the header
public void validateHeaders()
throws CamsHttpAgentException
validateHeaders in interface CamsHttpAgentRequestCamsHttpAgentException - if any header name starts with the
prefix CAMS. The message of the exception is the name of the
request header that was invalid.public boolean containsCamsHeaders()
containsCamsHeaders in interface CamsHttpAgentRequestpublic void setRequest(javax.servlet.http.HttpServletRequest request)
request - contains the Http request datapublic void initialize(Config config)
config - contains configuration datapublic String getParameter(String name)
getParameter in interface CamsHttpAgentRequestname - the name of the parameter
public Enumeration getParameterNames()
getParameterNames in interface CamsHttpAgentRequestpublic String getRemoteAddr()
getRemoteAddr in interface CamsHttpAgentRequestpublic String getRemoteHost()
getRemoteHost in interface CamsHttpAgentRequestpublic String getProtocol()
getProtocol in interface CamsHttpAgentRequestpublic String getScheme()
getScheme in interface CamsHttpAgentRequestpublic String getServerName()
getServerName in interface CamsHttpAgentRequestpublic String getServerAddr()
getServerAddr in interface CamsHttpAgentRequestpublic int getServerPort()
getServerPort in interface CamsHttpAgentRequestpublic boolean isSecure()
isSecure in interface CamsHttpAgentRequestpublic String getMethod()
getMethod in interface CamsHttpAgentRequestpublic String getQueryString()
getQueryString in interface CamsHttpAgentRequestpublic String getRequestURI()
getRequestURI in interface CamsHttpAgentRequestpublic String getRequestURL()
getRequestURL in interface CamsHttpAgentRequestpublic javax.servlet.http.Cookie getCookie(String name)
getCookie in interface CamsHttpAgentRequestname - the name of the Cookie to get.
public javax.servlet.http.Cookie[] getCookies(com.cafesoft.core.http.HttpCookieFilter filter)
getCookies in interface CamsHttpAgentRequestpublic String getHeader(String name)
getHeader in interface CamsHttpAgentRequestname - a String specifying the header name
public Enumeration getHeaders(String name)
Some headers, such as Accept-Language can be sent by clients as several headers each with a different value rather than sending the header as a comma separated list.
If the request did not include any headers of the specified name, this method returns an empty Enumeration. The header name is case insensitive. You can use this method with any request header.
getHeaders in interface CamsHttpAgentRequestname - a String specifying the header name
public Enumeration getHeaderNames()
getHeaderNames in interface CamsHttpAgentRequestpublic String getSecurityDomain()
getSecurityDomain in interface CamsHttpAgentRequestpublic void setSecurityDomain(String securityDomain)
setSecurityDomain in interface CamsHttpAgentRequestsecurityDomain - the name of the SecurityDomain handling this
request.
public void addSessionId(SessionId sessionId)
addSessionId in interface CamsHttpAgentRequestsessionId - the SessionId to add to the request.public void removeSessionId(SessionId sessionId)
removeSessionId in interface CamsHttpAgentRequestsessionId - the SessionId to remove from the request.public SessionId[] getSessionIds()
getSessionIds in interface CamsHttpAgentRequestpublic SessionId getSessionId(String securityDomain)
getSessionId in interface CamsHttpAgentRequestsecurityDomain - the name of the SecurityDomain from which the
SessionId is being requested from.public boolean isLogin()
isLogin in interface CamsHttpAgentRequestpublic boolean isLogout()
isLogout in interface CamsHttpAgentRequestpublic void recycle()
recycle in interface CamsHttpAgentRequestpublic void destroy()
This method will destroy the CamsHttpAgentRequest object. This method should be used when the CamsHttpAgentRequest will no longer be used. This method should destroy everything including underlying collections.
destroy in interface CamsHttpAgentRequestpublic void log()
log in interface CamsHttpAgentRequest
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||