org.apache.geronimo.jetty6.handler
Class JettySecurityHandler

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.handler.AbstractHandler
          extended by org.mortbay.jetty.handler.AbstractHandlerContainer
              extended by org.mortbay.jetty.handler.HandlerWrapper
                  extended by org.mortbay.jetty.security.SecurityHandler
                      extended by org.apache.geronimo.jetty6.handler.JettySecurityHandler
All Implemented Interfaces:
org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler, org.mortbay.jetty.HandlerContainer

public class JettySecurityHandler
extends org.mortbay.jetty.security.SecurityHandler


Nested Class Summary
 
Nested classes/interfaces inherited from class org.mortbay.jetty.security.SecurityHandler
org.mortbay.jetty.security.SecurityHandler.NotChecked
 
Field Summary
 
Fields inherited from class org.mortbay.jetty.security.SecurityHandler
__NO_USER, __NOBODY
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
JettySecurityHandler(org.mortbay.jetty.security.Authenticator authenticator, JAASJettyRealm userRealm, String policyContextID, Subject defaultSubject)
           
 
Method Summary
 boolean checkSecurityConstraints(String pathInContext, org.mortbay.jetty.Request request, org.mortbay.jetty.Response response)
          Check the security constraints using JACC.
 void doStop(JettyContainer jettyContainer)
           
protected  JAASJettyPrincipal generateDefaultPrincipal(Subject defaultSubject)
          Generate the default principal from the security config.
 void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)
           
 boolean hasConstraints()
           
 
Methods inherited from class org.mortbay.jetty.security.SecurityHandler
doStart, getAuthenticator, getAuthMethod, getConstraintMappings, getUserRealm, isCheckWelcomeFiles, setAuthenticator, setAuthMethod, setCheckWelcomeFiles, setConstraintMappings, setUserRealm
 
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
addHandler, doStop, expandChildren, getHandler, setHandler, setServer
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
destroy, getServer, toString
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
 

Constructor Detail

JettySecurityHandler

public JettySecurityHandler(org.mortbay.jetty.security.Authenticator authenticator,
                            JAASJettyRealm userRealm,
                            String policyContextID,
                            Subject defaultSubject)
Method Detail

hasConstraints

public boolean hasConstraints()
Overrides:
hasConstraints in class org.mortbay.jetty.security.SecurityHandler

doStop

public void doStop(JettyContainer jettyContainer)
            throws Exception
Throws:
Exception

handle

public void handle(String target,
                   HttpServletRequest request,
                   HttpServletResponse response,
                   int dispatch)
            throws IOException,
                   ServletException
Specified by:
handle in interface org.mortbay.jetty.Handler
Overrides:
handle in class org.mortbay.jetty.security.SecurityHandler
Throws:
IOException
ServletException

checkSecurityConstraints

public boolean checkSecurityConstraints(String pathInContext,
                                        org.mortbay.jetty.Request request,
                                        org.mortbay.jetty.Response response)
                                 throws IOException
Check the security constraints using JACC.

Overrides:
checkSecurityConstraints in class org.mortbay.jetty.security.SecurityHandler
Parameters:
pathInContext - path in context
request - HTTP request
response - HTTP response
Returns:
true if the path in context passes the security check, false if it fails or a redirection has occured during authentication.
Throws:
IOException

generateDefaultPrincipal

protected JAASJettyPrincipal generateDefaultPrincipal(Subject defaultSubject)
                                               throws GeronimoSecurityException
Generate the default principal from the security config.

Parameters:
defaultSubject - The default subject.
Returns:
the default principal
Throws:
GeronimoSecurityException - if the default principal cannot be constructed


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.