FileDocCategorySizeDatePackage
HttpServletAuthParam.javaAPI DocGlassfish v2 API5730Fri May 04 22:35:42 BST 2007com.sun.enterprise.security.jauth

HttpServletAuthParam

public class HttpServletAuthParam extends Object implements AuthParam
An HTTP Servlet authentication parameter that encapsulates HTTP Servlet request and response objects.

HttpServletAuthParam may be created with null request or response objects. The following table describes when it is appropriate to pass null:

Request Response
------- --------

ClientAuthModule.secureRequest non-null null
ClientAuthModule.validateResponse null non-null

ServerAuthModule.validateRequest non-null null
ServerAuthModule.secureResponse null non-null

As noted above, in the case of ServerAuthModule.validateRequest the module receives a null response object. If the implementation of validateRequest encounters an authentication error, it may construct the appropriate response object itself and set it into the HttpServletAuthParam via the setResponse method.

version
%I%, %G%

Fields Summary
private HttpServletRequest
request
private HttpServletResponse
response
Constructors Summary
public HttpServletAuthParam(HttpServletRequest request, HttpServletResponse response)
Create an HttpServletAuthParam with HTTP request and response objects.

param
request the HTTP Servlet request object, or null.
param
response the HTTP Servlet response object, or null.

	this.request = request;
	this.response = response;
    
public HttpServletAuthParam(javax.security.auth.message.MessageInfo messageInfo)
Create an HttpServletAuthParam with MessageInfo object.

param
messageInfo

        this.request = (HttpServletRequest)messageInfo.getRequestMessage();
        this.response = (HttpServletResponse)messageInfo.getResponseMessage();
    
Methods Summary
public java.lang.StringgetOperation()
Get the operation related to the encapsulated HTTP Servlet request and response objects.

return
the operation related to the encapsulated request and response objects, or null.

	return null;
    
public javax.servlet.http.HttpServletRequestgetRequest()
Get the HTTP Servlet request object.

return
the HTTP Servlet request object, or null.

	return this.request;
    
public javax.servlet.http.HttpServletResponsegetResponse()
Get the HTTP Servlet response object.

return
the HTTP Servlet response object, or null.

	return this.response;
    
public voidsetResponse(javax.servlet.http.HttpServletResponse response)
Set a new HTTP Servlet response object.

If a response has already been set (it is non-null), this method returns. The original response is not overwritten.

param
response the HTTP Servlet response object.
exception
IllegalArgumentException if the specified response is null.

	if (response == null) {
	    throw new IllegalArgumentException("invalid null response");
	}

	if (this.response == null) {
	    this.response = response;
	}