org.astrogrid.samp.web
Class ClientAuthorizers

java.lang.Object
  extended by org.astrogrid.samp.web.ClientAuthorizers

public class ClientAuthorizers
extends Object

Utility class containing ClientAuthorizer implementations.

Since:
2 Feb 2011
Author:
Mark Taylor

Field Summary
static ClientAuthorizer FALSE
          Authorizer which always denies access, with INFO logging either way.
static ClientAuthorizer TRUE
          Authorizer which always permits access, with WARNING logging either way.
 
Method Summary
static ClientAuthorizer createFixedClientAuthorizer(boolean policy)
          Returns a new authorizer instance which always produces the same authorization status.
static ClientAuthorizer createLoggingClientAuthorizer(ClientAuthorizer auth, Level acceptLevel, Level refuseLevel)
          Returns a new authorizer instance based on an existing one which logs authorization results through the logging system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FALSE

public static final ClientAuthorizer FALSE
Authorizer which always denies access, with INFO logging either way.


TRUE

public static final ClientAuthorizer TRUE
Authorizer which always permits access, with WARNING logging either way.

Method Detail

createFixedClientAuthorizer

public static ClientAuthorizer createFixedClientAuthorizer(boolean policy)
Returns a new authorizer instance which always produces the same authorization status.

Parameters:
policy - value to return from the authorize method
Returns:
new authorizer

createLoggingClientAuthorizer

public static ClientAuthorizer createLoggingClientAuthorizer(ClientAuthorizer auth,
                                                             Level acceptLevel,
                                                             Level refuseLevel)
Returns a new authorizer instance based on an existing one which logs authorization results through the logging system.

Parameters:
auth - base authorizer
acceptLevel - logging level at which auth acceptances are logged
refuseLevel - logging level at which auth refusals are logged
Returns:
new authorizer


Copyright © 2008-2011 AstroGrid. All Rights Reserved.