org.apache.cocoon.auth.impl
Class PipelineSecurityHandler

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

public class PipelineSecurityHandler
extends AbstractSecurityHandler
implements Serviceable, Disposable

Verify if a user can be authenticated.

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

Nested Class Summary
static class PipelineSecurityHandler.PipelineSHUser
          The internal user class.
 
Field Summary
protected  Configuration config
          Configuration.
protected  Context context
          Context.
protected  ServiceManager manager
          The service manager.
protected  SourceResolver resolver
          The source resolver.
 
Fields inherited from class org.apache.cocoon.auth.AbstractSecurityHandler
id
 
Constructor Summary
PipelineSecurityHandler()
           
 
Method Summary
 void configure(Configuration conf)
           
 void contextualize(Context aContext)
           
 void dispose()
           
protected  String isValidAuthenticationDocument(Document doc)
          Check if this is a valid document.
 User login(Map loginContext)
          Try to authenticate the user.
 void logout(Map logoutContext, User user)
          This notifies the security-handler that a user logs out.
 void service(ServiceManager aManager)
           
 
Methods inherited from class org.apache.cocoon.auth.AbstractSecurityHandler
getId
 
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

manager

protected ServiceManager manager
The service manager.


resolver

protected SourceResolver resolver
The source resolver.


config

protected Configuration config
Configuration.


context

protected Context context
Context.

Constructor Detail

PipelineSecurityHandler

public PipelineSecurityHandler()
Method Detail

contextualize

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

configure

public void configure(Configuration conf)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Overrides:
configure in class AbstractSecurityHandler
Throws:
ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

isValidAuthenticationDocument

protected String isValidAuthenticationDocument(Document doc)
Check if this is a valid document. A valid document has "authentication" as the root node and at least one child element "ID".

Parameters:
doc - The document read by the pipeline.
Returns:
The value of the ID element or null if the document is not valid

login

public User login(Map loginContext)
           throws Exception
Description copied from interface: SecurityHandler
Try to authenticate the user.

Specified by:
login in interface SecurityHandler
Parameters:
loginContext - The context for the login operation.
Returns:
The user if the authentication is successful, null otherwise.
Throws:
Exception - If something goes wrong.
See Also:
SecurityHandler.login(java.util.Map)

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()

logout

public void logout(Map logoutContext,
                   User user)
Description copied from interface: SecurityHandler
This notifies the security-handler that a user logs out.

Specified by:
logout in interface SecurityHandler
Parameters:
logoutContext - The context for the login operation.
user - The user object.
See Also:
SecurityHandler.logout(java.util.Map, org.apache.cocoon.auth.User)


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