|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.manager.proxy.TrustedProxyManagerImpl
public class TrustedProxyManagerImpl
Handles the list of proxy servers whose X-Forwarded-For headers we trust. Deals with persisting and querying the list.
Field Summary | |
---|---|
protected static java.lang.String |
REQUESTED_PROXIES_CACHE_KEY
|
protected static java.lang.String |
TRUSTED_PROXIES_CACHE_KEY
|
protected static java.lang.String |
TRUSTED_PROXIES_STRING_CACHE_KEY
|
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. |
protected java.util.List<RemoteAddress> |
getRemoteAddressFromCache()
Loads the list from the cache. |
protected java.util.Map<java.lang.String,java.lang.Boolean> |
getRequestedProxiesMapFromCache()
Loads a map of requested proxies from the cache. |
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)
Sets the server property with the specified list of trusted proxies. |
void |
setPropertyManager(PropertyManager propertyManager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String TRUSTED_PROXIES_STRING_CACHE_KEY
protected static final java.lang.String TRUSTED_PROXIES_CACHE_KEY
protected static final java.lang.String REQUESTED_PROXIES_CACHE_KEY
Constructor Detail |
---|
public TrustedProxyManagerImpl()
Method Detail |
---|
public boolean isTrusted(java.lang.String remoteAddress)
isTrusted
in interface TrustedProxyManager
remoteAddress
-
public java.util.List<java.lang.String> getList()
getList
in interface TrustedProxyManager
public boolean add(java.lang.String remoteAddress)
add
in interface TrustedProxyManager
remoteAddress
-
public void remove(java.lang.String remoteAddress)
remove
in interface TrustedProxyManager
remoteAddress
- protected java.lang.String getProperty()
protected boolean setProperty(java.lang.String value)
value
- list of trusted proxies as a comma delimited string
protected java.util.Map<java.lang.String,java.lang.Boolean> getRequestedProxiesMapFromCache()
protected java.util.List<java.lang.String> getListFromCache()
protected java.util.List<RemoteAddress> getRemoteAddressFromCache()
protected boolean saveList(java.util.List<java.lang.String> trustedProxies)
trustedProxies
- public void setPropertyManager(PropertyManager propertyManager)
public void setCacheManager(CacheManager cacheManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |