Top Description Inners Fields Constructors Methods
org.mortbay.jetty.security

public Class ConstraintsSecurityHandler

extends HandlerWrapper
implements SecurityHandler
Class Inheritance
All Implemented Interfaces
org.mortbay.jetty.handler.SecurityHandler, org.mortbay.jetty.HandlerContainer, org.mortbay.component.LifeCycle, org.mortbay.jetty.Handler
Known Direct Subclasses
org.mortbay.jetty.security.HTAccessHandler
Imports
java.io.IOException, java.security.Principal, java.util.Map, javax.servlet.ServletException, javax.servlet.http.HttpServletRequest, .HttpServletResponse, org.mortbay.jetty.Authenticator, .Connector, .HttpConnection, .Request, .Response, .UserRealm, org.mortbay.jetty.handler.HandlerWrapper, .SecurityHandler, org.mortbay.jetty.servlet.PathMap, org.mortbay.log.Log, org.mortbay.util.LazyList, .Loader, .StringUtil

Handler to enforce SecurityConstraints.
Author
Greg Wilkins (gregw)

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
public static Principal
private Authenticator
private String
private boolean
private PathMap
private ConstraintMapping[]
private UserRealm

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

false if the request has failed a security constraint or the authenticator has already sent a response.
check
(Object constraints, Authenticator authenticator, UserRealm realm, String pathInContext, Request request, Response response)

Check security contraints

public boolean
checkSecurityConstraints(String pathInContext, Request request, Response response)

public void
public Authenticator

Returns:

Returns the authenticator.
getAuthenticator
()

Implements org.mortbay.jetty.handler.SecurityHandler.getAuthenticator.

public String
public ConstraintMapping[]

Returns:

Returns the contraintMappings.
getConstraintMappings
()

public UserRealm

Returns:

Returns the userRealm.
getUserRealm
()

Implements org.mortbay.jetty.handler.SecurityHandler.getUserRealm.

public void
handle(String
The target of the request - either a URI or a name.
target
,
HttpServletRequest
The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.
request
,
HttpServletResponse
The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.
response
,
int
The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR
dispatch
)

Overrides org.mortbay.jetty.handler.HandlerWrapper.handle.

Implements org.mortbay.jetty.Handler.handle.

Handle a request.
public boolean
public boolean

Returns:

True if forwards to welcome files are authenticated
isCheckWelcomeFiles
()

public void
setAuthenticator(Authenticator
The authenticator to set.
authenticator
)

public void
public void
setCheckWelcomeFiles(boolean
True if forwards to welcome files are authenticated
authenticateWelcomeFiles
)

public void
setConstraintMappings(ConstraintMapping[]
The contraintMappings to set.
constraintMappings
)

public void
setUserRealm(UserRealm
The userRealm to set.
userRealm
)

Inherited from org.mortbay.jetty.handler.HandlerWrapper:
addHandlerdoStopexpandChildrengetHandlerremoveHandlersetHandlersetServer

Field Detail

__NO_USERback to summary
public static Principal __NO_USER
_authenticatorback to summary
private Authenticator _authenticator
_authMethodback to summary
private String _authMethod
_checkWelcomeFilesback to summary
private boolean _checkWelcomeFiles
_constraintMapback to summary
private PathMap _constraintMap
_constraintMappingsback to summary
private ConstraintMapping[] _constraintMappings
_userRealmback to summary
private UserRealm _userRealm

Constructor Detail

ConstraintsSecurityHandlerback to summary
public ConstraintsSecurityHandler()

Method Detail

checkback to summary
private boolean check(Object constraints, Authenticator authenticator, UserRealm realm, String pathInContext, Request request, Response response) throws IOException

Check security contraints

Returns:boolean

false if the request has failed a security constraint or the authenticator has already sent a response.

checkSecurityConstraintsback to summary
public boolean checkSecurityConstraints(String pathInContext, Request request, Response response) throws IOException
doStartback to summary
public void doStart() throws Exception

Overrides org.mortbay.jetty.handler.HandlerWrapper.doStart.

getAuthenticatorback to summary
public Authenticator getAuthenticator()

Implements org.mortbay.jetty.handler.SecurityHandler.getAuthenticator.

Returns:Authenticator

Returns the authenticator.

getAuthMethodback to summary
public String getAuthMethod()
getConstraintMappingsback to summary
public ConstraintMapping[] getConstraintMappings()
Returns:ConstraintMapping[]

Returns the contraintMappings.

getUserRealmback to summary
public UserRealm getUserRealm()

Implements org.mortbay.jetty.handler.SecurityHandler.getUserRealm.

Returns:UserRealm

Returns the userRealm.

handleback to summary
public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException

Overrides org.mortbay.jetty.handler.HandlerWrapper.handle.

Implements org.mortbay.jetty.Handler.handle.

Doc from org.mortbay.jetty.Handler.handle.

Handle a request.

Parameters
target:String

The target of the request - either a URI or a name.

request:HttpServletRequest

The request either as the Request object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Request object if required.

response:HttpServletResponse

The response as the Response object or a wrapper of that request. The HttpConnection#getCurrentConnection() method can be used access the Response object if required.

dispatch:int

The dispatch mode: REQUEST, FORWARD, INCLUDE, ERROR

hasConstraintsback to summary
public boolean hasConstraints()
isCheckWelcomeFilesback to summary
public boolean isCheckWelcomeFiles()
Returns:boolean

True if forwards to welcome files are authenticated

setAuthenticatorback to summary
public void setAuthenticator(Authenticator authenticator)
Parameters
authenticator:Authenticator

The authenticator to set.

setAuthMethodback to summary
public void setAuthMethod(String method)
setCheckWelcomeFilesback to summary
public void setCheckWelcomeFiles(boolean authenticateWelcomeFiles)
Parameters
authenticateWelcomeFiles:boolean

True if forwards to welcome files are authenticated

setConstraintMappingsback to summary
public void setConstraintMappings(ConstraintMapping[] constraintMappings)
Parameters
constraintMappings:ConstraintMapping[]

The contraintMappings to set.

setUserRealmback to summary
public void setUserRealm(UserRealm userRealm)
Parameters
userRealm:UserRealm

The userRealm to set.

org.mortbay.jetty.security back to summary

public Class ConstraintsSecurityHandler.NotChecked

extends Object
implements Principal
Class Inheritance
  • java.lang.Object
  • org.mortbay.jetty.security.ConstraintsSecurityHandler.NotChecked
All Implemented Interfaces
java.security.Principal

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Implements java.security.Principal.getName.

Returns the name of this Principal.
public ConstraintsSecurityHandler
public String
toString()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Returns a string representation of this Principal.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Constructor Detail

NotCheckedback to summary
public NotChecked()

Method Detail

getNameback to summary
public String getName()

Implements java.security.Principal.getName.

Doc from java.security.Principal.getName.

Returns the name of this Principal.

Returns:String

the name of this Principal.

getSecurityHandlerback to summary
public ConstraintsSecurityHandler getSecurityHandler()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements java.security.Principal.toString.

Doc from java.security.Principal.toString.

Returns a string representation of this Principal.

Returns:String

a string representation of this Principal.