Class PersistentCacheKey
java.lang.Object
se.liu.ida.hefquin.federation.access.impl.cache.PersistentCacheKey
- All Implemented Interfaces:
Serializable
Immutable cache key for a request sent to a specific federation member.
The key is derived from a string-based representation of the request,
constructed from the
DataRetrievalRequest, the
FederationMember, and the PersistentCacheKey.ResponseMode.
This representation is hashed using SHA-256 and stored as a 32-byte digest,
and equality and hash code are based solely on this digest.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines how the response of a request is interpreted when caching. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPersistentCacheKey(DataRetrievalRequest req, FederationMember fm, PersistentCacheKey.ResponseMode responseMode) Creates a cache key for the given request, federation member, and response mode. -
Method Summary
-
Field Details
-
requestDigest
protected final byte[] requestDigest
-
-
Constructor Details
-
PersistentCacheKey
public PersistentCacheKey(DataRetrievalRequest req, FederationMember fm, PersistentCacheKey.ResponseMode responseMode) Creates a cache key for the given request, federation member, and response mode. The key is computed by constructing a URL representation of the request and hashing it together with the response mode using SHA-256.- Parameters:
req- the retrieval request (must not benull)fm- the target federation member (must not benull)responseMode- the response mode (must not benull)- Throws:
IllegalArgumentException- if the request/member combination is unsupported
-
-
Method Details
-
equals
-
hashCode
-
toString
-