Commits

Anonymous committed 4a7ba8b

GeneralCacheAdministrator: Added convenience methods for flushing single cache entries and for flushing the entire cache instantly.

Comments (0)

Files changed (1)

src/core/java/com/opensymphony/oscache/general/GeneralCacheAdministrator.java

     // METHODS THAT DELEGATES TO THE CACHE ---------------------
 
     /**
-     *        Flush all the cache at a given date
+     * Flush the entire cache immediately.
+     */
+    public void flushAll() {
+        getCache().flushAll(new Date());
+    }
+
+    /**
+     * Flush the entire cache at the given date.
      *
-     *        @param date         The time to flush
+     * @param date The time to flush
      */
     public void flushAll(Date date) {
         getCache().flushAll(date);
     }
 
     /**
+     * Flushes a single cache entry.
+     */
+    public void flushEntry(String key) {
+        getCache().flushEntry(key);
+    }
+
+    /**
      * Flushes all items that belong to the specified group.
      *
      * @param group The name of the group to flush