Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

net.sf.acegisecurity.adapters.jetty
Class JettyAcegiUserRealm  view JettyAcegiUserRealm download JettyAcegiUserRealm.java

java.lang.Object
  extended bynet.sf.acegisecurity.adapters.jetty.JettyAcegiUserRealm
All Implemented Interfaces:
org.mortbay.http.UserRealm

public final class JettyAcegiUserRealm
extends java.lang.Object
implements org.mortbay.http.UserRealm

Adapter to enable Jetty to authenticate via the Acegi Security System for Spring.

Returns a JettyAcegiUserToken to Jetty's authentication system, which is subsequently available via HttpServletRequest.getUserPrincipal().

Version:
$Id: JettyAcegiUserRealm.java,v 1.3 2004/03/28 12:05:12 benalex Exp $

Field Summary
private  net.sf.acegisecurity.AuthenticationManager authenticationManager
           
private  java.lang.String key
           
private static org.apache.commons.logging.Log logger
           
private  java.lang.String realm
           
 
Constructor Summary
protected JettyAcegiUserRealm()
           
  JettyAcegiUserRealm(java.lang.String realm, java.lang.String providerKey, java.lang.String appContextLocation)
          Construct a SpringUserRealm.
 
Method Summary
 org.mortbay.http.UserPrincipal authenticate(java.lang.String username, java.lang.Object password, org.mortbay.http.HttpRequest httpRequest)
          Authenticate a users credentials.
 void disassociate(org.mortbay.http.UserPrincipal userPrincipal)
           
 net.sf.acegisecurity.AuthenticationManager getAuthenticationManager()
           
 java.lang.String getName()
          Accesses the realm name.
 void logout(org.mortbay.http.UserPrincipal arg0)
           
 org.mortbay.http.UserPrincipal popRole(org.mortbay.http.UserPrincipal userPrincipal)
           
 org.mortbay.http.UserPrincipal pushRole(org.mortbay.http.UserPrincipal userPrincipal, java.lang.String role)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mortbay.http.UserRealm
disassociate, getPrincipal, isUserInRole, logout, popRole, pushRole, reauthenticate
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger

authenticationManager

private net.sf.acegisecurity.AuthenticationManager authenticationManager

key

private java.lang.String key

realm

private java.lang.String realm
Constructor Detail

JettyAcegiUserRealm

public JettyAcegiUserRealm(java.lang.String realm,
                           java.lang.String providerKey,
                           java.lang.String appContextLocation)
Construct a SpringUserRealm.


JettyAcegiUserRealm

protected JettyAcegiUserRealm()
Method Detail

getAuthenticationManager

public net.sf.acegisecurity.AuthenticationManager getAuthenticationManager()

getName

public java.lang.String getName()
Accesses the realm name.

Specified by:
getName in interface org.mortbay.http.UserRealm

authenticate

public org.mortbay.http.UserPrincipal authenticate(java.lang.String username,
                                                   java.lang.Object password,
                                                   org.mortbay.http.HttpRequest httpRequest)
Description copied from interface: org.mortbay.http.UserRealm
Authenticate a users credentials. Implementations of this method may adorn the calling context to assoicate it with the authenticated principal (eg ThreadLocals). If such context associations are made, they should be considered valid until a UserRealm.deAuthenticate(UserPrincipal) call is made for this UserPrincipal.

Specified by:
authenticate in interface org.mortbay.http.UserRealm

disassociate

public void disassociate(org.mortbay.http.UserPrincipal userPrincipal)

logout

public void logout(org.mortbay.http.UserPrincipal arg0)

popRole

public org.mortbay.http.UserPrincipal popRole(org.mortbay.http.UserPrincipal userPrincipal)

pushRole

public org.mortbay.http.UserPrincipal pushRole(org.mortbay.http.UserPrincipal userPrincipal,
                                               java.lang.String role)