Class UserTypesCacheImpl

    • Method Detail

      • getUserTypes

        public 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.
        Specified by:
        getUserTypes in interface UserTypesCache
        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

        public void cacheUserTypes​(FedoraId resourceId,
                                   RdfStream rdf,
                                   String sessionId)
        Extracts the user RDF types from the RDF and caches them in the session level cache.
        Specified by:
        cacheUserTypes in interface UserTypesCache
        Parameters:
        resourceId - the id of the resource
        rdf - the resource's RDF
        sessionId - the session to cache the types in
      • cacheUserTypes

        public void cacheUserTypes​(FedoraId resourceId,
                                   List<URI> userTypes,
                                   String sessionId)
        Caches the user RDF types in the session level cache.
        Specified by:
        cacheUserTypes in interface UserTypesCache
        Parameters:
        resourceId - the id of the resource
        userTypes - the resource's types
        sessionId - the session to cache the types in
      • dropSessionCache

        public void dropSessionCache​(String sessionId)
        Drops a session level cache without merging it into the global cache.
        Specified by:
        dropSessionCache in interface UserTypesCache
        Parameters:
        sessionId - the id of the session cache to drop