Package org.fcrepo.kernel.api.cache
Interface UserTypesCache
-
- All Known Implementing Classes:
UserTypesCacheImpl
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cacheUserTypes(FedoraId resourceId, List<URI> userTypes, String sessionId)
Caches the user RDF types in the session level cache.void
cacheUserTypes(FedoraId resourceId, RdfStream rdf, String sessionId)
Extracts the user RDF types from the RDF and caches them in the session level cache.void
dropSessionCache(String sessionId)
Drops a session level cache without merging it into the global cache.List<URI>
getUserTypes(FedoraId resourceId, String sessionId, Supplier<RdfStream> rdfProvider)
Gets the user RDF types for the specified resource from the cache.void
mergeSessionCache(String sessionId)
Merges the session level cache into the global cache.
-
-
-
Method Detail
-
getUserTypes
List<URI> getUserTypes(FedoraId resourceId, String sessionId, Supplier<RdfStream> rdfProvider)
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
void cacheUserTypes(FedoraId resourceId, RdfStream rdf, String sessionId)
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
void cacheUserTypes(FedoraId resourceId, List<URI> userTypes, String sessionId)
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
void mergeSessionCache(String sessionId)
Merges the session level cache into the global cache.- Parameters:
sessionId
- the id of the session to merge
-
dropSessionCache
void dropSessionCache(String sessionId)
Drops a session level cache without merging it into the global cache.- Parameters:
sessionId
- the id of the session cache to drop
-
-