Package com.atlassian.crowd.util
Class ClusterAwareInetAddressCache
java.lang.Object
com.atlassian.crowd.util.ClusterAwareInetAddressCache
Utility class to store in a cache whether the InetAddress is permitted or forbidden to make a request to the Crowd server.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClusterAwareInetAddressCache(com.atlassian.cache.Cache<String, Boolean> cache, ClusterMessageService clusterMessageService) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the entire cache storing the address permissions.getPermitted(Application application, InetAddress address) Gets from cache whether theapplicationwithaddressis permitted to make a request to the Crowd server.voidvoidsetPermitted(Application application, InetAddress address, boolean permitted) Sets in the cache thataddressis permitted/forbidden from making a request to the Crowd server.void
-
Field Details
-
CLUSTER_MESSAGE_CHANNEL
- See Also:
-
CLUSTER_MESSAGE_CLEAR
- See Also:
-
-
Constructor Details
-
ClusterAwareInetAddressCache
public ClusterAwareInetAddressCache(com.atlassian.cache.Cache<String, Boolean> cache, ClusterMessageService clusterMessageService)
-
-
Method Details
-
registerClusterListener
@PostConstruct public void registerClusterListener() -
unregisterClusterListener
@PreDestroy public void unregisterClusterListener() -
setPermitted
Sets in the cache thataddressis permitted/forbidden from making a request to the Crowd server.- Parameters:
application- application that is requesting the connection.address- InetAddress to setpermitted- whetheraddressis permitted or forbidden to make a request.
-
getPermitted
Gets from cache whether theapplicationwithaddressis permitted to make a request to the Crowd server.- Parameters:
application- Application making the request.address- address of the client making the request.- Returns:
- an indication of whether the
applicationwithaddressis permitted to make a request, ornullif unknown
-
clear
public void clear()Clears the entire cache storing the address permissions.
-