net.sf.jguard.jee.authentication.schemes
Class AuditSchemeHandler<Req,Res>

java.lang.Object
  extended by net.sf.jguard.jee.authentication.schemes.AuditSchemeHandler<Req,Res>
All Implemented Interfaces:
AuthenticationSchemeHandler<Req,Res>
Direct Known Subclasses:
HttpServletAuditSchemeHandler

public abstract class AuditSchemeHandler<Req,Res>
extends Object
implements AuthenticationSchemeHandler<Req,Res>


Field Summary
 
Fields inherited from interface net.sf.jguard.core.authentication.schemes.AuthenticationSchemeHandler
REDIRECT
 
Constructor Summary
AuditSchemeHandler(Map<String,String> parameters, StatefulScopes authenticationBindings)
           
 
Method Summary
 boolean answerToChallenge(Request request, Response response)
          no challenge are asked to the user.
 void authenticationFailed(Request request, Response response)
          nothing to do when authentication failed.
 void authenticationSucceed(Subject subject, Request request, Response response)
          nothing to do when authentication succeed.
 void buildChallenge(Request request, Response response)
          no challenge are needed to collect required informations.
 boolean challengeNeeded(Request request, Response response)
          like AuditSchemeHandler only records activity, it doesnt need to request an authentication challenge.
 Collection<Class<? extends Callback>> getCallbackTypes()
           
 PermissionCollection getGrantedPermissions()
          no Permission needs to be granted to the user to collect informations.
protected abstract  Locale getLocale(Request<Req> request)
           
 String getName()
           
protected abstract  String getRemoteAddress(Request<Req> request)
           
protected abstract  String getRemoteHost(Request<Req> request)
           
 void handleSchemeCallbacks(Request<Req> request, Response<Res> response, Callback[] cbks)
           
static String reverseDns(String hostIp)
          return the host name related to the IP adress.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditSchemeHandler

public AuditSchemeHandler(Map<String,String> parameters,
                          StatefulScopes authenticationBindings)
Method Detail

getName

public String getName()
Specified by:
getName in interface AuthenticationSchemeHandler<Req,Res>

getCallbackTypes

public Collection<Class<? extends Callback>> getCallbackTypes()
Specified by:
getCallbackTypes in interface AuthenticationSchemeHandler<Req,Res>
Returns:
{LanguageCallback} and {InetAddressCallback}.

answerToChallenge

public boolean answerToChallenge(Request request,
                                 Response response)
no challenge are asked to the user. Only some information involved by the communication and underlying technology are grabbed by this class.

Specified by:
answerToChallenge in interface AuthenticationSchemeHandler<Req,Res>
Returns:
always true

challengeNeeded

public boolean challengeNeeded(Request request,
                               Response response)
like AuditSchemeHandler only records activity, it doesnt need to request an authentication challenge.

Specified by:
challengeNeeded in interface AuthenticationSchemeHandler<Req,Res>
Parameters:
request -
response -
Returns:

buildChallenge

public void buildChallenge(Request request,
                           Response response)
no challenge are needed to collect required informations.

Specified by:
buildChallenge in interface AuthenticationSchemeHandler<Req,Res>
Throws:
AuthenticationException

getGrantedPermissions

public PermissionCollection getGrantedPermissions()
no Permission needs to be granted to the user to collect informations.

Specified by:
getGrantedPermissions in interface AuthenticationSchemeHandler<Req,Res>
Returns:
empty PermissionCollection.

authenticationSucceed

public void authenticationSucceed(Subject subject,
                                  Request request,
                                  Response response)
nothing to do when authentication succeed.

Specified by:
authenticationSucceed in interface AuthenticationSchemeHandler<Req,Res>
Throws:
AuthenticationException

authenticationFailed

public void authenticationFailed(Request request,
                                 Response response)
nothing to do when authentication failed.

Specified by:
authenticationFailed in interface AuthenticationSchemeHandler<Req,Res>
Throws:
AuthenticationException

getRemoteAddress

protected abstract String getRemoteAddress(Request<Req> request)

getRemoteHost

protected abstract String getRemoteHost(Request<Req> request)

getLocale

protected abstract Locale getLocale(Request<Req> request)

handleSchemeCallbacks

public void handleSchemeCallbacks(Request<Req> request,
                                  Response<Res> response,
                                  Callback[] cbks)
                           throws UnsupportedCallbackException
Specified by:
handleSchemeCallbacks in interface AuthenticationSchemeHandler<Req,Res>
Throws:
UnsupportedCallbackException

reverseDns

public static String reverseDns(String hostIp)
                         throws IOException
return the host name related to the IP adress. this method comes from a blog entry about dnsjava.

Parameters:
hostIp - Internet Protocol adress
Returns:
host name related to the hostIp parameter, or hostIp parameter if no nam eserver is found.
Throws:
IOException


Copyright © 2004-2011. All Rights Reserved.