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
-
Constructor Summary
ConstructorDescriptionClusterAwareInetAddressCache
(com.atlassian.cache.Cache<String, Boolean> cache, ClusterMessageService clusterMessageService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the entire cache storing the address permissions.getPermitted
(Application application, InetAddress address) Gets from cache whether theapplication
withaddress
is permitted to make a request to the Crowd server.void
void
setPermitted
(Application application, InetAddress address, boolean permitted) Sets in the cache thataddress
is 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 thataddress
is permitted/forbidden from making a request to the Crowd server.- Parameters:
application
- application that is requesting the connection.address
- InetAddress to setpermitted
- whetheraddress
is permitted or forbidden to make a request.
-
getPermitted
Gets from cache whether theapplication
withaddress
is 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
application
withaddress
is permitted to make a request, ornull
if unknown
-
clear
public void clear()Clears the entire cache storing the address permissions.
-