public interface AssociationCache
nextId()
).
Implementations should employ some sort of strategy to remove associations for which
Association.hasExpired()
returns true.
Implementations must be thread-safe.
Implementations must ensure that ids generated will be unique even across different instances of the cache.
This is because openid4java relies on private and shared associations not only being stored in separate caches, but
(if the checkPrivateSharedAssociations option is turned on) unfortunately also on each association ever created
having a unique handle because it (currently) never manually removes associations from its public associations store.
(Note that the requirement imposed by this interface is actually a bit stricter than openid4java's requirements,
which would only require that all instances eventually used by ServerManager generate completely unique ids.)
If this imposes limitations on clients' use of an implementation, implementation must clearly document it.Modifier and Type | Method and Description |
---|---|
org.openid4java.association.Association |
get(String key) |
String |
nextId() |
void |
put(String key,
org.openid4java.association.Association association) |
void |
remove(String key) |
String nextId()
void put(String key, org.openid4java.association.Association association)
key
- key to store the association underassociation
- association to store@Nullable org.openid4java.association.Association get(String key)
key
- the key of the association to fetchvoid remove(String key)
key
- the key that the association to delete is stored underCopyright © 2018 Atlassian. All rights reserved.