Package org.fcrepo.kernel.api.cache
Interface UserTypesCache
public interface UserTypesCache
Cache of user RDF types. This cache has two levels. Types are cached at the session level as well as globally.
This is necessary to support long-running transactions that can span multiple requests.
- Author:
- pwinckles
-
Method Summary
Modifier and TypeMethodDescriptionvoidcacheUserTypes(FedoraId resourceId, List<URI> userTypes, String sessionId) Caches the user RDF types in the session level cache.voidcacheUserTypes(FedoraId resourceId, RdfStream rdf, String sessionId) Extracts the user RDF types from the RDF and caches them in the session level cache.voiddropSessionCache(String sessionId) Drops a session level cache without merging it into the global cache.getUserTypes(FedoraId resourceId, String sessionId, Supplier<RdfStream> rdfProvider) Gets the user RDF types for the specified resource from the cache.voidmergeSessionCache(String sessionId) Merges the session level cache into the global cache.
-
Method Details
-
getUserTypes
Gets the user RDF types for the specified resource from the cache. First, the session's cache is checked. If the types were not found, then the global cache is checked. If not in either cache, then the rdfProvider is called to load the resource's RDF from which the types are parsed, cached, and returned. This method should NOT be called on binary resources.- Parameters:
resourceId- the id of the resourcesessionId- the id of the current sessionrdfProvider- the provider that is called, if needed, to load the resource's rdf- Returns:
- the resource's user RDF types
-
cacheUserTypes
Extracts the user RDF types from the RDF and caches them in the session level cache.- Parameters:
resourceId- the id of the resourcerdf- the resource's RDFsessionId- the session to cache the types in
-
cacheUserTypes
Caches the user RDF types in the session level cache.- Parameters:
resourceId- the id of the resourceuserTypes- the resource's typessessionId- the session to cache the types in
-
mergeSessionCache
Merges the session level cache into the global cache.- Parameters:
sessionId- the id of the session to merge
-
dropSessionCache
Drops a session level cache without merging it into the global cache.- Parameters:
sessionId- the id of the session cache to drop
-