jrun.servlet.security
Class WebAppSecurityService

jrun.servlet.security.WebAppSecurityService
All Implemented Interfaces:
ConfigurableServicePartitionMBean, java.io.Serializable, Service, ServiceMBean, ServicePartitionMBean, WebAppSecurity, WebAppSecurityServiceMBean

public class WebAppSecurityService
implements WebAppSecurity

Processes and stores security data for a web application. It parses the web.xml and creates WebAppAuthenticationFactorys and SecurityFilters. It also finds the JRunSecurityManager.

Author:
Brian Deitte
See Also:
Serialized Form

Fields inherited from interface jrunx.kernel.Service
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
WebAppSecurityService()
           
 
Method Summary
protected  WebResourceCollection addResource(java.lang.String resourceName, java.util.Collection roles, java.util.Collection methods, java.lang.String transport)
           
 AuthenticatedPrincipal authenticate(java.lang.String username, java.lang.String password, javax.servlet.http.HttpSession session)
           
protected  void createSecurityFilters()
          Create the securityk filters from data in WebAppMetaData
 java.lang.String getErrorPage()
           
 java.lang.String getLoginPage()
           
 WebResourceCollection getResource(java.lang.String resourceName)
           
 java.util.Iterator getSecurityFilters()
           
 java.util.Map getServletRoleRefs()
           
 SSL getSSL()
           
 WebAppMetaData getWebAppMetaData()
           
 WebAppSecurity getWebAppSecurity()
           
 boolean isAuthorized(java.security.Principal user, java.util.Collection roleNames)
           
 boolean isPrincipalInRole(java.security.Principal user, java.lang.String role)
           
 void logoff(javax.servlet.http.HttpSession session, java.lang.Object contextId)
           
protected  void processSecurityData()
           
 void requestBegin(javax.servlet.http.HttpServletRequest request)
          This method needs to be called once at the beginning of every request.
 void requestEnd()
          This method needs to be called once at the end every request.
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
           
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
           
 void setRuntimeContext(AuthenticatedPrincipal user)
           
 void start()
           
 
Methods inherited from interface jrunx.kernel.ConfigurableServicePartitionMBean
setChildElements
 
Methods inherited from interface jrunx.kernel.ServicePartitionMBean
addService, addService, iterator, removeService, removeService
 
Methods inherited from interface jrunx.kernel.ServiceMBean
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getLogger, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind
 
Methods inherited from interface jrunx.kernel.Service
destroy, getStatus, init, stop, updateStatus
 

Constructor Detail

WebAppSecurityService

public WebAppSecurityService()
Method Detail

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Service

getWebAppMetaData

public WebAppMetaData getWebAppMetaData()
Specified by:
getWebAppMetaData in interface WebAppSecurityServiceMBean

getWebAppSecurity

public WebAppSecurity getWebAppSecurity()
Specified by:
getWebAppSecurity in interface WebAppSecurityServiceMBean

requestBegin

public void requestBegin(javax.servlet.http.HttpServletRequest request)
This method needs to be called once at the beginning of every request.
Specified by:
requestBegin in interface WebAppSecurity

requestEnd

public void requestEnd()
This method needs to be called once at the end every request.
Specified by:
requestEnd in interface WebAppSecurity

isPrincipalInRole

public boolean isPrincipalInRole(java.security.Principal user,
                                 java.lang.String role)
Specified by:
isPrincipalInRole in interface WebAppSecurityServiceMBean

logoff

public void logoff(javax.servlet.http.HttpSession session,
                   java.lang.Object contextId)
Specified by:
logoff in interface WebAppSecurityServiceMBean

authenticate

public AuthenticatedPrincipal authenticate(java.lang.String username,
                                           java.lang.String password,
                                           javax.servlet.http.HttpSession session)
                                    throws java.lang.Exception
Specified by:
authenticate in interface WebAppSecurityServiceMBean

isAuthorized

public boolean isAuthorized(java.security.Principal user,
                            java.util.Collection roleNames)
Specified by:
isAuthorized in interface WebAppSecurityServiceMBean

setRuntimeContext

public void setRuntimeContext(AuthenticatedPrincipal user)

getSecurityFilters

public java.util.Iterator getSecurityFilters()
Specified by:
getSecurityFilters in interface WebAppSecurity

addResource

protected WebResourceCollection addResource(java.lang.String resourceName,
                                            java.util.Collection roles,
                                            java.util.Collection methods,
                                            java.lang.String transport)

getResource

public WebResourceCollection getResource(java.lang.String resourceName)
Specified by:
getResource in interface WebAppSecurity

getLoginPage

public java.lang.String getLoginPage()
Specified by:
getLoginPage in interface WebAppSecurityServiceMBean

getErrorPage

public java.lang.String getErrorPage()
Specified by:
getErrorPage in interface WebAppSecurityServiceMBean

getServletRoleRefs

public java.util.Map getServletRoleRefs()
Specified by:
getServletRoleRefs in interface WebAppSecurityServiceMBean

processSecurityData

protected void processSecurityData()

getSSL

public SSL getSSL()
Specified by:
getSSL in interface WebAppSecurity

createSecurityFilters

protected void createSecurityFilters()
                              throws SecurityInitException
Create the securityk filters from data in WebAppMetaData

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent event)

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)


Copyright � 2002 Macromedia Corporation. All Rights Reserved.