com.cafesoft.cams.agent.http
Interface CamsHttpAgent


public interface CamsHttpAgent

Provides methods for authentication, logout, accessing a session, and access control.

Since:
11/21/02

Method Summary
 void destroy()
          Destroy the CamsHttpAgent
 void invoke(CamsHttpAgentRequest request, CamsHttpAgentResponse response)
          Invokes the CamsHttpAgent.
 boolean isStarted()
          Check if the CamsHttpAgent is started.
 void start()
          Start the CamsHttpAgent.
 void stop()
          Stop the CamsHttpAgent.
 

Method Detail

start

public void start()
           throws CamsHttpAgentException
Start the CamsHttpAgent. This method should be invoked when the enclosing web server is started.

Throws:
CamsHttpAgentException - if CamsHttpAgent fails to start or is already started.

stop

public void stop()
          throws CamsHttpAgentException
Stop the CamsHttpAgent. This method should be invoked when the enclosing web server is shutdown.

Throws:
CamsHttpAgentException - if CamsHttpAgent fails to stop or is already stopped.

isStarted

public boolean isStarted()
Check if the CamsHttpAgent is started.

Returns:
true if the CamsHttpAgent has been successfully started, false if the agent has not been started, or if the agent is null.

invoke

public void invoke(CamsHttpAgentRequest request,
                   CamsHttpAgentResponse response)
Invokes the CamsHttpAgent.

The underlying CamsHttpAgent implementation will inspect the canonical HttpRequest and take one of the following actions:

  1. If access to the HTTP resource is granted, the status code: CamsHttpAgentStatusCode.SC_GRANTED is returned indicating the HTTP client should be given access to the requested resource. The enclosing web server component should take whatever action is necessary to dispatch or continue to the requested resource.
  2. If access to the HTTP resource is denied because authentication is required, a redirect to the configured login page is returned to the HTTP client. The status code: CamsHttpAgentStatusCode.SC_REDIRECT is returned to indicate that the agent has sent the redirect response the HTTP client.
  3. If access to the HTTP resource is otherwise denied, the agent redirects the HTTP client to the configured Cams "access denied" URL, once again returning: CamsHttpAgentStatusCode.SC_REDIRECT.
  4. If the request is for authentication (default POST to URI=/cams/login) the CamsHttpAgent handles the HTTP request, delegates authentication to the configured CamsPolicyServer(s), and either redirects to the originally requested URL on successful login, or to the configured error page if authentication fails. Status code: CamsHttpAgentStatusCode.SC_REDIRECT is returned.
  5. If a serious error occurs and the CamsHttpAgent is unable to redirect to the configured Cams error URL, then a HTML error message is returned to the client and response status: CamsHttpAgentStatusCode.SC_DONE is returned.

Parameters:
request - the CamsHttpRequest, which provides normalized access to the container-specific HTTP request context.
response - the CamsHttpResponse, which enables the CamsHttpAgent to redirect or send a complete HTTP response if necessary. It provides normalized access to the container-specific HTTP response context.
Throws:
NullPointerException - if request or response objects are null.

destroy

public void destroy()
Destroy the CamsHttpAgent



Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.