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 Detail

      • getUserTypes

        List<URIgetUserTypes​(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 resource
        sessionId - the id of the current session
        rdfProvider - 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 resource
        rdf - the resource's RDF
        sessionId - 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 resource
        userTypes - the resource's types
        sessionId - 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