com.atlassian.crowd.authentication
Class TrustedProxyManagerImpl

java.lang.Object
  extended by com.atlassian.crowd.authentication.TrustedProxyManagerImpl
All Implemented Interfaces:
TrustedProxyManager

public class TrustedProxyManagerImpl
extends java.lang.Object
implements TrustedProxyManager

Handles the list of proxy servers whose X-Forwarded-For headers we trust. Deals with persisting and querying the list.


Constructor Summary
TrustedProxyManagerImpl()
           
 
Method Summary
 boolean add(java.lang.String remoteAddress)
          Adds to the list of servers we trust.
 java.util.List<java.lang.String> getList()
          Returns the list of trusted proxy servers, or an empty List if there are none.
protected  java.util.List<java.lang.String> getListFromCache()
          Loads the list from the cache.
protected  java.lang.String getProperty()
          Loads the server property that contains the list of trusted proxies.
 boolean isTrusted(java.lang.String remoteAddress)
          Returns true if the proxy server is trusted, false otherwise.
 void remove(java.lang.String remoteAddress)
          Removes from the list of trusted servers.
protected  boolean saveList(java.util.List<java.lang.String> trustedProxies)
          Saves the updated list and reloads it.
 void setCacheManager(CacheManager cacheManager)
           
protected  boolean setProperty(java.lang.String value)
           
 void setPropertyManager(PropertyManager propertyManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustedProxyManagerImpl

public TrustedProxyManagerImpl()
Method Detail

isTrusted

public boolean isTrusted(java.lang.String remoteAddress)
Returns true if the proxy server is trusted, false otherwise.

Specified by:
isTrusted in interface TrustedProxyManager
Parameters:
remoteAddress -
Returns:

getList

public java.util.List<java.lang.String> getList()
Returns the list of trusted proxy servers, or an empty List if there are none.

Specified by:
getList in interface TrustedProxyManager
Returns:

add

public boolean add(java.lang.String remoteAddress)
Adds to the list of servers we trust. Pass an IP address in decimal dot format (eg. 192.168.3.2)

Specified by:
add in interface TrustedProxyManager
Parameters:
remoteAddress -
Returns:
true if the addition was successful, false otherwise

remove

public void remove(java.lang.String remoteAddress)
Removes from the list of trusted servers.

Specified by:
remove in interface TrustedProxyManager
Parameters:
remoteAddress -

getProperty

protected java.lang.String getProperty()
Loads the server property that contains the list of trusted proxies. If there are none, returns null.

Returns:

setProperty

protected boolean setProperty(java.lang.String value)

getListFromCache

protected java.util.List<java.lang.String> getListFromCache()
Loads the list from the cache. If not in the cache, goes to the PropertyManager and loads from there.

Returns:

saveList

protected boolean saveList(java.util.List<java.lang.String> trustedProxies)
Saves the updated list and reloads it.

Parameters:
trustedProxies -

setPropertyManager

public void setPropertyManager(PropertyManager propertyManager)

setCacheManager

public void setCacheManager(CacheManager cacheManager)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.