org.apache.cocoon.auth.impl
Class StandardApplicationManager

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.auth.impl.StandardApplicationManager
All Implemented Interfaces:
Disposable, Contextualizable, LogEnabled, Serviceable, ThreadSafe, ApplicationManager

public class StandardApplicationManager
extends AbstractLogEnabled
implements ApplicationManager, Contextualizable, Serviceable, ThreadSafe, Disposable

This is the default implementation of the ApplicationManager.

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

Field Summary
protected static String APPLICATION_KEY_PREFIX
          The prefix used to store the application data object in the session.
protected  Context context
          The component context.
protected static String LOGIN_INFO_KEY
          The key used to store the login information in the session.
protected  ServiceManager manager
          The service manager.
 
Fields inherited from interface org.apache.cocoon.auth.ApplicationManager
APPLICATION, APPLICATION_DATA, LOGIN_CONTEXT_PARAMETERS_KEY, LOGOUT_CONTEXT_MODE_KEY, LOGOUT_CONTEXT_PARAMETERS_KEY, LOGOUT_MODE_KEEP_SESSION, LOGOUT_MODE_TERMINATE_SESSION_IF_UNUSED, USER
 
Constructor Summary
StandardApplicationManager()
           
 
Method Summary
 void contextualize(Context aContext)
           
 void dispose()
           
protected  Application getApplication(String appName)
          Get the application with the given name.
 boolean isLoggedIn(String appName)
          Test, if the current user is already logged into the application.
 User login(String appName, Map loginContext)
          Log the user in to the application.
 void logout(String appName, Map logoutContext)
          Logout the user from an application.
 void service(ServiceManager aManager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_INFO_KEY

protected static final String LOGIN_INFO_KEY
The key used to store the login information in the session.


APPLICATION_KEY_PREFIX

protected static final String APPLICATION_KEY_PREFIX
The prefix used to store the application data object in the session.


context

protected Context context
The component context.


manager

protected ServiceManager manager
The service manager.

Constructor Detail

StandardApplicationManager

public StandardApplicationManager()
Method Detail

contextualize

public void contextualize(Context aContext)
                   throws ContextException
Specified by:
contextualize in interface Contextualizable
Throws:
ContextException
See Also:
Contextualizable.contextualize(org.apache.avalon.framework.context.Context)

service

public void service(ServiceManager aManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

dispose

public void dispose()
Specified by:
dispose in interface Disposable
See Also:
Disposable.dispose()

getApplication

protected Application getApplication(String appName)
                              throws Exception
Get the application with the given name. This method tries to lookup the applicating using the current sitemap service manager.

Parameters:
appName - The name of the application.
Returns:
The application object.
Throws:
Exception - If the application can't be found.

isLoggedIn

public boolean isLoggedIn(String appName)
Description copied from interface: ApplicationManager
Test, if the current user is already logged into the application.

Specified by:
isLoggedIn in interface ApplicationManager
Parameters:
appName - The name of the application.
Returns:
Returns true if the user is already logged in, false otherwise.
See Also:
ApplicationManager.isLoggedIn(java.lang.String)

login

public User login(String appName,
                  Map loginContext)
           throws Exception
Description copied from interface: ApplicationManager
Log the user in to the application. If the user is already logged in then the corresponding user object is returned. If the login process is started, the login context is passed to SecurityHandler.login(Map) and on successful login to Application.userDidLogin(User, Map).

Specified by:
login in interface ApplicationManager
Parameters:
appName - The name of the application.
loginContext - The context for the login operation.
Returns:
The user object on a successful login, null otherwise.
Throws:
Exception - If anything goes wrong.
See Also:
ApplicationManager.login(java.lang.String, java.util.Map)

logout

public void logout(String appName,
                   Map logoutContext)
Description copied from interface: ApplicationManager
Logout the user from an application. During the logout process, the logout context is passed to Application.userWillLogout(User, Map), and eventually to SecurityHandler.logout(Map, User).

Specified by:
logout in interface ApplicationManager
Parameters:
appName - The name of the application.
logoutContext - The context for the logout operation.
See Also:
ApplicationManager.logout(java.lang.String, java.util.Map)


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