com.cafesoft.cams.agent.http
Interface CamsHttpAgentRequest

All Known Implementing Classes:
AbstractCamsHttpAgentRequest

public interface CamsHttpAgentRequest

Defines an interface that normalizes a container-specific HTTP request into an HTTP container-independent form that can be used by a Cafesoft HttpAccessControlAgent.

Since:
1/22/02

Method Summary
 void addHeader(String name, String value)
          Adds the specified header and value to this HttpRequest.
 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.
 X509Certificate[] getClientX509CertificateChain()
          Get the client X509 certificate chain.
 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.
 String getValueByPropertySpec(PropertySpec propertySpec)
          Get an HTTP request value by PropertySpec.
 boolean isAESO()
          Determines if this Http request is for automatic enterprise sign-on (AESO).
 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.
 boolean isSSO()
          Determines if this Http request is for cross DNS domain single sign-on.
 void log()
          Logs the data contained in this CamsHttpAgentRequest.
 void recycle()
          Recycle the CamsHttpAgentRequest for reuse.
 void removeSessionId(SessionId sessionId)
          Remove a Sessionid from the request.
 void setSecurityDomain(String securityDomain)
          Set the name of the SecurityDomain handling this request.
 void validateHeaders()
          Validate the request headers.
 

Method Detail

getParameter

String getParameter(String name)
Returns the value mapped to the specified parameter.

Parameters:
name - the name of the parameter
Returns:
the value mapped to the specified parameter

getParameterNames

Enumeration getParameterNames()
Returns all of the Http parameters.

Returns:
all of the Http parameter names

addHeader

void addHeader(String name,
               String value)
Adds the specified header and value to this HttpRequest.

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

validateHeaders

void validateHeaders()
                     throws CamsHttpAgentException
Validate the request headers.

Throws:
CamsHttpAgentException - if any header name starts with the prefix CAMS. The message of the exception is the name of the request header that was invalid.

containsCamsHeaders

boolean containsCamsHeaders()
Determine if the CamsHttpAgentRequest contains CAMS HTTP Headers. This method has been added to support proxied Cams headers.

Returns:
true if the CamsHttpAgentRequest contains CAMS HTTP Headers, false otherwise.

getRemoteAddr

String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client that sent the request.

Returns:
a String containing the IP address of the client that sent the request

getRemoteHost

String getRemoteHost()
Returns the fully qualified name of the client that sent the request. If the hostname cannot be resolved, this method returns the dotted-string form of the IP address.

Returns:
a String containing the fully qualified name of the client

getProtocol

String getProtocol()
Returns the name and version of the protocol the request uses in the form protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets, the value returned is the same as the value of the CGI variable SERVER_PROTOCOL.

Returns:
a String containing the protocol name and version number

getScheme

String getScheme()
Returns the name of the scheme used to make this request.

Returns:
the scheme. For example, http or https.

getServerName

String getServerName()
Returns the host name of the server that received the request.


getServerAddr

String getServerAddr()
Returns the IP address of the server where the CamsHttpAgent is running.

Returns:
the server's IP address as a String

getServerPort

int getServerPort()
Returns the port number on which this request was received.


isSecure

boolean isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS.


getMethod

String getMethod()
Returns the name of the HTTP method with which this request was made, for example, GET, POST, or PUT. Same as the value of the CGI variable REQUEST_METHOD.

Returns:
a String specifying the name of the method with which this request was made

getQueryString

String getQueryString()
Returns the query string that is contained in the request URL after the path. This method returns if the URL does not have a query string. Same as the value of the CGI variable QUERY_STRING.

Returns:
a String containing the query string or null if the URL contains no query string. The value is not decoded by the container.

getRequestURI

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. The web container does not decode this String. For example: First line of HTTP request Returned Value POST /some/path.html HTTP/1.1 returns: /some/path.html GET http://foo.bar/a.html HTTP/1.0 returns: /a.html HEAD /xyz?a=b HTTP/1.1 returns: /xyz

Returns:
a String containing the part of the URL from the protocol name up to the query string

getRequestURL

String getRequestURL()
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, port number, and server path, but it does not include query string parameters.

Returns:
a String containing the reconstructed URL

getCookie

javax.servlet.http.Cookie getCookie(String name)
Get a Cookie with the given name. If no cookie with that name exists then return null.

Parameters:
name - the name of the Cookie to get.
Returns:
the Cookie with the given name, or null if Cookie does not exist.
Since:
1.11

getCookies

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. This method returns null if no cookies were sent.

Returns:
an array of all the Cookies included with this request, or null if the request has no cookies.

getHeader

String getHeader(String name)
Returns the value of the specified request header as a String. If the request did not include a header of the specified name, this method returns null. The header name is case insensitive. You can use this method with any request header.

Parameters:
name - a String specifying the header name.
Returns:
a String containing the value of the requested header, or null if the request does not have a header of that name

getHeaders

Enumeration getHeaders(String name)
Returns all the values of the specified request header as an Enumeration of String objects.

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.

Parameters:
name - a String specifying the header name
Returns:
an Enumeration containing the values of the requested header. If the request does not have any headers of that name return an empty enumeration. If the container does not allow access to header information, return null

getHeaderNames

Enumeration getHeaderNames()
Returns an enumeration of all the header names this request contains. If the request has no headers, this method returns an empty enumeration. Some HTTP containers do not allow do not allow access to headers using this method, in which case this method returns null

Returns:
an enumeration of all the header names sent with this request; if the request has no headers, an empty enumeration; if the HTTP container does not allow access to headers in this way, return null.

getClientX509CertificateChain

X509Certificate[] getClientX509CertificateChain()
Get the client X509 certificate chain.

Returns:
an array of X509Certificate objects or an empty array if no client certificate chain is available.

getSecurityDomain

String getSecurityDomain()
Get the name of the SecurityDomain handling this request.

Returns:
the name of the SecurityDomain handling this request, or null if the SecurityDomain name has not yet been determined.
Since:
1.12

setSecurityDomain

void setSecurityDomain(String securityDomain)
Set the name of the SecurityDomain handling this request.

Parameters:
securityDomain - the name of the SecurityDomain handling this request.
Since:
1.12

addSessionId

void addSessionId(SessionId sessionId)
Add a SessionId to the request.

Parameters:
sessionId - the SessionId to add to the request.
Since:
1.12

removeSessionId

void removeSessionId(SessionId sessionId)
Remove a Sessionid from the request.

Parameters:
sessionId - the SessionId to remove from the request.
Since:
1.12

getSessionIds

SessionId[] getSessionIds()
Get all of the request's SessionIds.

Returns:
a non-null array of SessionIds.
Since:
1.12

getSessionId

SessionId getSessionId(String securityDomain)
Get a SecurityDomain specific SessionId.

Parameters:
securityDomain - the name of the SecurityDomain from which the SessionId is being requested from.
Since:
1.12

getValueByPropertySpec

String getValueByPropertySpec(PropertySpec propertySpec)
                              throws CamsHttpAgentException
Get an HTTP request value by PropertySpec.

Parameters:
propSpec - the PropertySpec.
Returns:
the PropertySpec value or null if the PropertySpec specifies an unknown value.
Throws:
CamsHttpAgentException - if an error occurs resolving the PropertySpec to a value.

isLogin

boolean isLogin()
Determines if this Http request is for logging in.

Returns:
true if this Http request is for logging in, false otherwise

isLogout

boolean isLogout()
Determines if this Http request is for logging out.

Returns:
true if this Http request is for logging out, false otherwise

isSSO

boolean isSSO()
Determines if this Http request is for cross DNS domain single sign-on.

Returns:
true if this Http request is for cross DNS domain single sign-on, false otherwise

isAESO

boolean isAESO()
Determines if this Http request is for automatic enterprise sign-on (AESO).

Returns:
true if this HTTP request is for automatic enterprise sign-on, false otherwise

log

void log()
Logs the data contained in this CamsHttpAgentRequest.


recycle

void recycle()
Recycle the CamsHttpAgentRequest for reuse.

This method will return the CamsHttpAgentRequest object back to it's original creation state. That means any underlying collections should be cleared and not destroyed.


destroy

void destroy()
Destroy the CamsHttpAgentRequest.

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.



Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.