Class JavaxCacheQueryResultCache

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Method to close the cache when no longer needed.
      boolean contains​(java.lang.String queryKey)
      Accessor for whether the specified query is in the cache
      void evict​(java.lang.Class candidate)
      Method to evict all queries that use the provided class as candidate.
      void evict​(Query query)
      Evict the query from the results cache.
      void evict​(Query query, java.util.Map params)
      Evict the query with the specified params from the results cache.
      void evictAll()
      Method to clear the cache.
      java.util.List<java.lang.Object> get​(java.lang.String queryKey)
      Accessor for the results from the cache.
      java.util.List<java.lang.Object> put​(java.lang.String queryKey, java.util.List<java.lang.Object> results)
      Method to put an object in the cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cache

        private javax.cache.Cache cache
    • Constructor Detail

      • JavaxCacheQueryResultCache

        public JavaxCacheQueryResultCache​(NucleusContext nucleusCtx)
        Constructor.
        Parameters:
        nucleusCtx - Context
    • Method Detail

      • close

        public void close()
        Description copied from interface: QueryResultsCache
        Method to close the cache when no longer needed. Provides a hook to release resources etc.
      • contains

        public boolean contains​(java.lang.String queryKey)
        Description copied from interface: QueryResultsCache
        Accessor for whether the specified query is in the cache
        Parameters:
        queryKey - The query key
        Returns:
        Whether it is in the cache
      • evict

        public void evict​(java.lang.Class candidate)
        Description copied from interface: QueryResultsCache
        Method to evict all queries that use the provided class as candidate. This is usually called when an instance of the candidate has been changed in the datastore.
        Parameters:
        candidate - The candidate
      • evict

        public void evict​(Query query)
        Description copied from interface: QueryResultsCache
        Evict the query from the results cache.
        Parameters:
        query - The query to evict (evicts all use of this query, with any params)
      • evict

        public void evict​(Query query,
                          java.util.Map params)
        Description copied from interface: QueryResultsCache
        Evict the query with the specified params from the results cache.
        Parameters:
        query - The query to evict
        params - The parameters
      • evictAll

        public void evictAll()
        Description copied from interface: QueryResultsCache
        Method to clear the cache.
      • get

        public java.util.List<java.lang.Object> get​(java.lang.String queryKey)
        Description copied from interface: QueryResultsCache
        Accessor for the results from the cache.
        Parameters:
        queryKey - The query key
        Returns:
        The cached query result ids
      • put

        public java.util.List<java.lang.Object> put​(java.lang.String queryKey,
                                                    java.util.List<java.lang.Object> results)
        Description copied from interface: QueryResultsCache
        Method to put an object in the cache.
        Parameters:
        queryKey - The query key
        results - The results for this query
        Returns:
        The result ids previously associated with this query (if any)