com.groupdocs.viewer.caching

Class CacheKeys



  • public class CacheKeys
    extends Object

    Provides methods to retrieve unique identifier for the cache entry.

    • Constructor Detail

      • CacheKeys

        public CacheKeys()
    • Method Detail

      • getAttachmentKey

        public static String getAttachmentKey(String attachmentId)

        Returns unique identifier for the cache entry that represents attachment file.

        Parameters:
        attachmentId - Unique (in context of single file) identifier of the attachment.
        Returns:
        Unique identifier for the cache entry that represents attachment file.
        Throws:
        IllegalArgumentException - Thrown when attachmentId is null or empty.
      • getAttachmentsKey

        public static String getAttachmentsKey()

        Returns unique identifier for the cache entry that represents collection of Attachment objects.

        Returns:
        Unique identifier for the cache entry that represents collection of Attachment objects.
      • getFileInfoKey

        public static String getFileInfoKey()
        Returns unique identifier for the cache entry that represents ViewInfo object.
        Returns:
        Unique identifier for the cache entry that represents ViewInfo object.
      • getFileKey

        public static String getFileKey(String extension)

        Returns unique identifier for the cache entry that represents file.

        Parameters:
        extension - The filename suffix (including the period ".") e.g. ".doc".
        Returns:
        Unique identifier for the cache entry that represents file.
        Throws:
        IllegalArgumentException - Thrown when extension is null or empty.
      • getPageKey

        public static String getPageKey(int pageNumber,
                                        String extension)

        Returns unique identifier for the cache entry that represents page file.

        Parameters:
        pageNumber - The number of the page.
        extension - The filename suffix (including the period ".") e.g. ".doc".
        Returns:
        Unique identifier for the cache entry that represents page file.
        Throws:
        IllegalArgumentException - Thrown when pageNumber is less or equal to zero.
        IllegalArgumentException - Thrown when extension is null or empty.
      • getResourceFilter

        public static String getResourceFilter(int pageNumber)

        Returns filter string to search for cache entries that represents Resource objects.

        Parameters:
        pageNumber - The number of page.
        Returns:
        Filter string to search for cache entries that represents Resource objects.
        Throws:
        IllegalArgumentException - Thrown when pageNumber is less or equal to zero.
      • getResourceKey

        public static String getResourceKey(int pageNumber,
                                            Resource resource)

        Returns unique identifier for the cache entry that represents Resource object.

        Parameters:
        pageNumber - The number of the page.
        resource - The HTML resource.
        Returns:
        Unique identifier for the cache entry that represents Resource object.
        Throws:
        IllegalArgumentException - Thrown when pageNumber is less or equal to zero.
        IllegalArgumentException - Thrown when resource is null.
      • getViewInfoKey

        public static String getViewInfoKey()

        Returns unique identifier for the cache entry that represents ViewInfo object.

        Returns:
        Unique identifier for the cache entry that represents ViewInfo object.