FileDocCategorySizeDatePackage
LogAuthenticationListener.javaAPI DocGlassfish v2 API4257Fri May 04 22:36:16 BST 2007com.sun.enterprise.webservice.monitoring

LogAuthenticationListener

public class LogAuthenticationListener extends Object implements AuthenticationListener
Log all authentication successes and failures.
author
Jerome Dochez

Fields Summary
private static Logger
ejbLogger
private static Logger
webLogger
Constructors Summary
public LogAuthenticationListener()
Creates a new instance of LogAuthenticationListener

    
    
           
      
    
Methods Summary
public voidauthFailure(com.sun.enterprise.deployment.BundleDescriptor bundleDesc, Endpoint endpoint, java.security.Principal principal)
notification that a user authentication attempt has failed.

param
endpointSelector the endpoint selector
param
principal Optional principal that failed

        if (ModuleType.EJB.equals(bundleDesc.getModuleType())) {
            if (ejbLogger.isLoggable(Level.FINE)) {
                ejbLogger.fine("authentication failure for " 
                        +  endpoint.getEndpointSelector());                
            }
        } else {
            if (webLogger.isLoggable(Level.FINE)) {
                webLogger.fine("authentication failure for endpoint in " +
                        bundleDesc.getModuleID() + " web app");
            }
        }
    
public voidauthSucess(com.sun.enterprise.deployment.BundleDescriptor bundleDesc, Endpoint endpoint, java.security.Principal principal)
notification that a user properly authenticated while making a web service invocation.

        if (ModuleType.EJB.equals(bundleDesc.getModuleType())) {
            if (ejbLogger.isLoggable(Level.FINER)) {
                ejbLogger.finer("LOG LISTENER : authentication succeeded for " 
                        +  endpoint.getEndpointSelector());                
            }
        } else {
            if (webLogger.isLoggable(Level.FINER)) {
                webLogger.finer("authentication succeeded for endpoint in " +
                        bundleDesc.getModuleID() + " web app");
            }
        }