org.apache.cocoon.auth
Interface Application

All Known Subinterfaces:
PortalApplication
All Known Implementing Classes:
StandardApplication, StandardPortalApplication

public interface Application

This class describes the current application. Inside Cocoon, you can have different applications running at the same time (a portal, a shop, a registration wizard etc.) Each of these applications might require its own login or might have different settings. The application object helps in managing these things. An application provides access to the corresponding SecurityHandler and ApplicationStore. It can also store configuration values as attributes. In addition, the application is notified about user actions (login, logout and usage).

Version:
$Id: Application.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Method Summary
 ApplicationStore getApplicationStore()
          Return the application store for loading/saving user specific data.
 Object getAttribute(String key)
          Get the value of an application attribute.
 SecurityHandler getSecurityHandler()
          Return the security handler for this application.
 void removeAttribute(String key)
          Remove an application attribute.
 void setAttribute(String key, Object value)
          Set an application attribute.
 void userDidLogin(User user, Map context)
          Notify the application about a successful login of a user.
 void userIsAccessing(User user)
          Notify the application about a user using the application in the current request.
 void userWillLogout(User user, Map context)
          Notify the application about a logout of a user.
 

Method Detail

getSecurityHandler

SecurityHandler getSecurityHandler()
Return the security handler for this application.

Returns:
The security handler

getApplicationStore

ApplicationStore getApplicationStore()
Return the application store for loading/saving user specific data.

Returns:
Return the application store or null.

userDidLogin

void userDidLogin(User user,
                  Map context)
Notify the application about a successful login of a user.

Parameters:
user - The current user.
context - The context for the login operation.

userWillLogout

void userWillLogout(User user,
                    Map context)
Notify the application about a logout of a user.

Parameters:
user - The current user.
context - The context for the logout operation.

userIsAccessing

void userIsAccessing(User user)
Notify the application about a user using the application in the current request. This method might be called more than once during one request, so the application should check this. This hook can for example be used by the application to prepare the current object model of the request.

Parameters:
user - The current user.

setAttribute

void setAttribute(String key,
                  Object value)
Set an application attribute.

Parameters:
key - The key of the attribute.
value - The value of the attribute.

removeAttribute

void removeAttribute(String key)
Remove an application attribute.

Parameters:
key - The key of the attribute.

getAttribute

Object getAttribute(String key)
Get the value of an application attribute.

Parameters:
key - The key of the attribute.
Returns:
The value of the attribute or null.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.