org.astrogrid.samp.web
Class OriginAuthorizers

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

public class OriginAuthorizers
extends Object

Utility class containing OriginAuthorizer implementations.

Since:
2 Feb 2011
Author:
Mark Taylor

Field Summary
static OriginAuthorizer FALSE
          OriginAuthorizer which always denies access.
static OriginAuthorizer SWING
          OriginAuthorizer which queries the user via a popup dialogue.
static OriginAuthorizer TRUE
          OriginAuthorizer which always permits access.
 
Method Summary
static OriginAuthorizer createFixedOriginAuthorizer(boolean individualPolicy, boolean generalPolicy)
          Returns an OriginAuthorizer with fixed responses, regardless of input.
static OriginAuthorizer createLoggingOriginAuthorizer(OriginAuthorizer auth, Level acceptLevel, Level refuseLevel)
          Returns an OriginAuthorizer based on an existing one which logs responses.
static OriginAuthorizer createMemoryOriginAuthorizer(OriginAuthorizer auth)
          Returns an OriginAuthorizer based on an existing one which caches responses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FALSE

public static final OriginAuthorizer FALSE
OriginAuthorizer which always denies access.


TRUE

public static final OriginAuthorizer TRUE
OriginAuthorizer which always permits access.


SWING

public static final OriginAuthorizer SWING
OriginAuthorizer which queries the user via a popup dialogue.

Method Detail

createFixedOriginAuthorizer

public static OriginAuthorizer createFixedOriginAuthorizer(boolean individualPolicy,
                                                           boolean generalPolicy)
Returns an OriginAuthorizer with fixed responses, regardless of input.

Parameters:
individualPolicy - invariable response of authorize method
generalPolicy - invariable response of authorizeAll method

createLoggingOriginAuthorizer

public static OriginAuthorizer createLoggingOriginAuthorizer(OriginAuthorizer auth,
                                                             Level acceptLevel,
                                                             Level refuseLevel)
Returns an OriginAuthorizer based on an existing one which logs responses.

Parameters:
auth - base authorizer
acceptLevel - level at which acceptances will be logged
refuseLevel - level at which refusals will be logged

createMemoryOriginAuthorizer

public static OriginAuthorizer createMemoryOriginAuthorizer(OriginAuthorizer auth)
Returns an OriginAuthorizer based on an existing one which caches responses.

Parameters:
auth - base authorizer


Copyright © 2008-2011 AstroGrid. All Rights Reserved.