com.bradmcevoy.http
Class ReadOnlySecurityManager

java.lang.Object
  extended by com.bradmcevoy.http.ReadOnlySecurityManager
All Implemented Interfaces:
SecurityManager

public class ReadOnlySecurityManager
extends java.lang.Object
implements SecurityManager

Author:
brad

Constructor Summary
ReadOnlySecurityManager()
           
ReadOnlySecurityManager(java.lang.String realm)
           
 
Method Summary
 java.lang.Object authenticate(DigestResponse digestRequest)
          Authenticate a digest request See com.bradmcevoy.http.http11.auth.DigestGenerator
 java.lang.Object authenticate(java.lang.String user, java.lang.String password)
           
 boolean authorise(Request request, Request.Method method, Auth auth, Resource resource)
          Check that the authenticater user can access the given resource for the given method.
 java.lang.String getRealm(java.lang.String host)
          Will return the configured realm if it is not null.
 java.lang.Object getUserByName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlySecurityManager

public ReadOnlySecurityManager(java.lang.String realm)

ReadOnlySecurityManager

public ReadOnlySecurityManager()
Method Detail

authenticate

public java.lang.Object authenticate(java.lang.String user,
                                     java.lang.String password)
Specified by:
authenticate in interface SecurityManager
Returns:
- some object representing the user to associate with the request

authenticate

public java.lang.Object authenticate(DigestResponse digestRequest)
Description copied from interface: SecurityManager
Authenticate a digest request See com.bradmcevoy.http.http11.auth.DigestGenerator

Specified by:
authenticate in interface SecurityManager
Returns:

authorise

public boolean authorise(Request request,
                         Request.Method method,
                         Auth auth,
                         Resource resource)
Description copied from interface: SecurityManager
Check that the authenticater user can access the given resource for the given method.

Specified by:
authorise in interface SecurityManager
Parameters:
request - - the request itself
method - - the request method
auth - - authentication object representing the current user
resource - - the resource being operated on
Returns:
- true to indicate that the user is allowed access

getRealm

public java.lang.String getRealm(java.lang.String host)
Will return the configured realm if it is not null. Otherwise, will return the requested hostname as the realm if it is not blank, otherwise will return "ReadOnlyRealm"

Specified by:
getRealm in interface SecurityManager
Parameters:
host - - the requested host name
Returns:

getUserByName

public java.lang.Object getUserByName(java.lang.String name)


Copyright © 2011. All Rights Reserved.