com.atlassian.crowd.util
Class RemoteAddressCacheUtil

java.lang.Object
  extended by com.atlassian.crowd.util.RemoteAddressCacheUtil

public class RemoteAddressCacheUtil
extends java.lang.Object

Utility class to store in a cache whether the RemoteAddress is permitted or forbidden to make a request to the Crowd server.


Field Summary
static java.lang.String REMOTE_ADDRESS_CACHE_NAME
           
 
Constructor Summary
RemoteAddressCacheUtil(CacheManager cacheManager)
           
 
Method Summary
 void clearCache()
          Clears the entire cache storing the remote addresses permissions.
 boolean getPermitted(Application application, RemoteAddress remoteAddress)
          Gets from cache whether the application with remoteAddress is permitted to make a request to the Crowd server.
 void setPermitted(Application application, RemoteAddress remoteAddress, boolean permitted)
          Sets in the cache that remoteAddress is permitted/forbidden from making a request to the Crowd server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REMOTE_ADDRESS_CACHE_NAME

public static final java.lang.String REMOTE_ADDRESS_CACHE_NAME
Constructor Detail

RemoteAddressCacheUtil

public RemoteAddressCacheUtil(CacheManager cacheManager)
Method Detail

setPermitted

public void setPermitted(Application application,
                         RemoteAddress remoteAddress,
                         boolean permitted)
Sets in the cache that remoteAddress is permitted/forbidden from making a request to the Crowd server.

Parameters:
application - application that is requesting the connection.
remoteAddress - RemoteAddress to set
permitted - whether remoteAddress is permitted or forbidden to make a request.

getPermitted

public boolean getPermitted(Application application,
                            RemoteAddress remoteAddress)
                     throws NotInCacheException
Gets from cache whether the application with remoteAddress is permitted to make a request to the Crowd server.

Parameters:
application - Application making the request.
remoteAddress - address of the client making the request.
Returns:
true if application with remoteAddress is permitted to make a request
Throws:
NotInCacheException - if the address is not in the cache

clearCache

public void clearCache()
Clears the entire cache storing the remote addresses permissions.



Copyright © 2010 Atlassian. All Rights Reserved.