Interface IServerCachePersist

  • All Known Implementing Classes:
    FileCachePersist

    public interface IServerCachePersist
    This interface describes the methods for the server side cacing store. Please implement this interface in order to provide custom store implementation.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clean​(java.lang.String prefix)
      Method clean
      remove all cache items from the store depends on prefix
      void dropItem​(java.lang.String prefix, java.lang.String key)
      Method dropItem
      drop a single item, this method is necessary for clean job in case of occurred exception
      java.io.InputStream getInputStream​(java.lang.String prefix, java.lang.String key)
      Method getInputStream
      long getLastModified​(java.lang.String prefix, java.lang.String key)
      Method getLastModified
      java.io.OutputStream getOutputStream​(java.lang.String prefix, java.lang.String key)
      Method getOutputStream
      boolean isCached​(java.lang.String prefix, java.lang.String key)
      Method isCached
    • Method Detail

      • clean

        void clean​(java.lang.String prefix)
            throws java.lang.Exception
        Method clean
        remove all cache items from the store depends on prefix
        Parameters:
        prefix -
        Throws:
        java.lang.Exception
      • getOutputStream

        java.io.OutputStream getOutputStream​(java.lang.String prefix,
                                             java.lang.String key)
                                      throws java.lang.Exception
        Method getOutputStream
        Parameters:
        prefix -
        key -
        Returns:
        output stream for creating a new item depends on prefix and key. The OutputStream will be closed by caller
        Throws:
        java.lang.Exception
      • getInputStream

        java.io.InputStream getInputStream​(java.lang.String prefix,
                                           java.lang.String key)
                                    throws java.lang.Exception
        Method getInputStream
        Parameters:
        prefix -
        key -
        Returns:
        input stream for reading item depends on prefix and key. The InputStream will be closed by caller
        Throws:
        java.lang.Exception
      • dropItem

        void dropItem​(java.lang.String prefix,
                      java.lang.String key)
               throws java.lang.Exception
        Method dropItem
        drop a single item, this method is necessary for clean job in case of occurred exception
        Parameters:
        prefix -
        key -
        Throws:
        java.lang.Exception
      • isCached

        boolean isCached​(java.lang.String prefix,
                         java.lang.String key)
                  throws java.lang.Exception
        Method isCached
        Parameters:
        prefix -
        key -
        Returns:
        true if the item depends on prefix and key available in the store
        Throws:
        java.lang.Exception
      • getLastModified

        long getLastModified​(java.lang.String prefix,
                             java.lang.String key)
                      throws java.lang.Exception
        Method getLastModified
        Parameters:
        prefix -
        key -
        Returns:
        the long value represents the last modified timestamp in milliseconds
        Throws:
        java.lang.Exception