com.cafesoft.cams.agent.http
Interface CamsHttpAgentResponse

All Known Implementing Classes:
AbstractCamsHttpAgentResponse

public interface CamsHttpAgentResponse

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

Since:
1/22/02

Method Summary
 void addCookie(javax.servlet.http.Cookie cookie)
          Adds the specified cookie to the response.
 void destroy()
          Destroy the CamsHttpAgentResponse.
 RemoteSession getSession()
          Returns the Cams session.
 CamsHttpAgentStatusCode getStatus()
          Gets the current status code for this response.
 void recycle()
          Recycle the CamsHttpAgentResponse for reuse.
 void redirectToDeniedPage(String message, String reason, ResourceRequest resourceRequest)
          Redirect the user to the Cams access denied page.
 void redirectToErrorPage(String message)
          Redirects the user to the Cams error page.
 void redirectToLoginPage(String camsLoginUrl, String securityDomain)
          Redirects the user to the Cams login page.
 void sendErrorPage(String message)
          Displays the Cams default error page.
 void sendRedirect(String location)
          Sends a temporary redirect response to the client using the specified redirect location URL.
 void setContentType(String contentType)
          Sets the content type of this response.
 void setSession(RemoteSession session)
          Sets the Cams session.
 void setStatus(CamsHttpAgentStatusCode status)
          Sets the status code for this response.
 

Method Detail

addCookie

public void addCookie(javax.servlet.http.Cookie cookie)
Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.

Parameters:
cookie - the Cookie to return to the client

sendRedirect

public void sendRedirect(String location)
Sends a temporary redirect response to the client using the specified redirect location URL. This method can accept relative URLs; the HTTP container must convert the relative URL to an absolute URL before sending the response to the client. If the location is relative without a leading '/' the container interprets it as * relative to the current request URI. If the location is relative with a leading '/' the container interprets it as relative to the HTTP container root. If the response has already been committed, this method throws an IllegalStateException. After using this method, the response should be considered to be committed and should not be written to.

Parameters:
location - the redirect location URL

setStatus

public void setStatus(CamsHttpAgentStatusCode status)
Sets the status code for this response.

Parameters:
status - the new status code

getStatus

public CamsHttpAgentStatusCode getStatus()
Gets the current status code for this response. This method is used to set the return status code when there is no error (for example, for the status codes SC_SUCCESS or SC_FAILED). If there is an error, the sendError method should be used instead.

Returns:
the current status code

setSession

public void setSession(RemoteSession session)
Sets the Cams session.

Parameters:
session - Contains information about a user that has logged into Cams

getSession

public RemoteSession getSession()
Returns the Cams session.

Returns:
the session associated with the authenticated user

setContentType

public void setContentType(String contentType)
Sets the content type of this response.

Parameters:
contentType - the content type of this response

redirectToLoginPage

public void redirectToLoginPage(String camsLoginUrl,
                                String securityDomain)
Redirects the user to the Cams login page.

Parameters:
camsLoginUrl - the Url of the Cams login page
securityDomain - the Cams security domain to login to

redirectToErrorPage

public void redirectToErrorPage(String message)
Redirects the user to the Cams error page.

Parameters:
message - the error message to send with the redirect

sendErrorPage

public void sendErrorPage(String message)
Displays the Cams default error page.

Parameters:
message - the message to display

redirectToDeniedPage

public void redirectToDeniedPage(String message,
                                 String reason,
                                 ResourceRequest resourceRequest)
Redirect the user to the Cams access denied page.

Parameters:
message - the message to send with the redirect
reason - the reason why access was denied
resourceRequest - represents a user or system's request for a generic Resource, which may be protected by the Cafesoft Access Management System

recycle

public void recycle()
Recycle the CamsHttpAgentResponse for reuse.

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


destroy

public void destroy()
Destroy the CamsHttpAgentResponse.

This method will destroy the CamsHttpAgentResponse object. This method should be used when the CamsHttpAgentResponse will no longer be used. This method should destroy everything including underlying collections.



Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.