Package org.astrogrid.samp.web

# Class OriginAuthorizers

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

public class OriginAuthorizers extends Object
Utility class containing OriginAuthorizer implementations.

Since:
  2 Feb 2011
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final OriginAuthorizer`
`FALSE`
OriginAuthorizer which always denies access.
`static final OriginAuthorizer`
`SWING`
OriginAuthorizer which queries the user via a popup dialogue.
`static final OriginAuthorizer`
`TRUE`
OriginAuthorizer which always permits access.

## Method Summary

Modifier and Type
Method
Description
`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 Details

### 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 Details

### 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