org.baswell.routes
Class BasicMetaAuthenticator

java.lang.Object
  extended by org.baswell.routes.BasicMetaAuthenticator
All Implemented Interfaces:
MetaAuthenticator
Direct Known Subclasses:
SimpleMetaAuthenticator

public abstract class BasicMetaAuthenticator
extends java.lang.Object
implements MetaAuthenticator

A MetaAuthenticator that uses HTTP basic authentication. Once a user has successfully logged in (validCredentials(String, String) returns true) a session attribute is set and this user is allowed through for the lifetime of the session.


Constructor Summary
BasicMetaAuthenticator()
           
 
Method Summary
 boolean metaRequestAuthenticated(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Called when the current HTTP request matches RoutesConfiguration.routesMetaPath.
protected abstract  boolean validCredentials(java.lang.String userName, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicMetaAuthenticator

public BasicMetaAuthenticator()
Method Detail

validCredentials

protected abstract boolean validCredentials(java.lang.String userName,
                                            java.lang.String password)

metaRequestAuthenticated

public boolean metaRequestAuthenticated(javax.servlet.http.HttpServletRequest servletRequest,
                                        javax.servlet.http.HttpServletResponse servletResponse)
                                 throws java.io.IOException
Description copied from interface: MetaAuthenticator
Called when the current HTTP request matches RoutesConfiguration.routesMetaPath. If true is returned the Routes meta page will be displayed.

Specified by:
metaRequestAuthenticated in interface MetaAuthenticator
Parameters:
servletRequest - The HTTP request.
servletResponse - The HTTP response
Returns:
True if the Routes meta page is allowed to be shown, false otherwise.
Throws:
java.io.IOException - If an input or output error occurs while the servlet is handling the HTTP request.