public class CacheKeys extends Object
Provides methods to retrieve unique identifier for the cache entry.
Constructor and Description |
---|
CacheKeys() |
Modifier and Type | Method and Description |
---|---|
static String |
getAttachmentKey(String attachmentId)
Returns unique identifier for the cache entry that represents attachment file.
|
static String |
getAttachmentsKey()
Returns unique identifier for the cache entry that represents collection of
Attachment objects. |
static String |
getFileInfoKey()
Returns unique identifier for the cache entry that represents
ViewInfo object. |
static String |
getFileKey(String extension)
Returns unique identifier for the cache entry that represents file.
|
static String |
getPageKey(int pageNumber,
String extension)
Returns unique identifier for the cache entry that represents page file.
|
static String |
getResourceFilter(int pageNumber)
Returns filter string to search for cache entries that represents
Resource objects. |
static String |
getResourceKey(int pageNumber,
Resource resource)
Returns unique identifier for the cache entry that represents
Resource object. |
static String |
getViewInfoKey()
Returns unique identifier for the cache entry that represents
ViewInfo object. |
public static String getAttachmentKey(String attachmentId)
Returns unique identifier for the cache entry that represents attachment file.
attachmentId
- Unique (in context of single file) identifier of the attachment.IllegalArgumentException
- Thrown when attachmentId
is null or empty.public static String getAttachmentsKey()
Returns unique identifier for the cache entry that represents collection of Attachment
objects.
Attachment
objects.public static String getFileInfoKey()
ViewInfo
object.ViewInfo
object.public static String getFileKey(String extension)
Returns unique identifier for the cache entry that represents file.
extension
- The filename suffix (including the period ".") e.g. ".doc".IllegalArgumentException
- Thrown when extension
is null or empty.public static String getPageKey(int pageNumber, String extension)
Returns unique identifier for the cache entry that represents page file.
pageNumber
- The number of the page.extension
- The filename suffix (including the period ".") e.g. ".doc".IllegalArgumentException
- Thrown when pageNumber
is less or equal to zero.IllegalArgumentException
- Thrown when extension
is null or empty.public static String getResourceFilter(int pageNumber)
Returns filter string to search for cache entries that represents Resource
objects.
pageNumber
- The number of page.Resource
objects.IllegalArgumentException
- Thrown when pageNumber
is less or equal to zero.public static String getResourceKey(int pageNumber, Resource resource)
Returns unique identifier for the cache entry that represents Resource
object.
pageNumber
- The number of the page.resource
- The HTML resource.Resource
object.IllegalArgumentException
- Thrown when pageNumber
is less or equal to zero.IllegalArgumentException
- Thrown when resource
is null.