org.opencms.db
Class CmsCacheKey

java.lang.Object
  extended by org.opencms.db.CmsCacheKey
All Implemented Interfaces:
I_CmsCacheKey

public class CmsCacheKey
extends java.lang.Object
implements I_CmsCacheKey

Generates the cache keys for the user and permission caches.

Since:
6.0.0
Version:
$Revision: 1.21 $
Author:
Carsten Weinholz

Field Summary
static java.lang.String CACHE_KEY_SUBALL
          Cache key for a list of sub-resources (files and folders) of a folder.
static java.lang.String CACHE_KEY_SUBFILES
          Cache key for a list of sub-files of a folder.
static java.lang.String CACHE_KEY_SUBFOLDERS
          Cache key for a list of sub-folders of a folder.
 
Constructor Summary
CmsCacheKey()
          Constructor to create a new instance of CmsCacheKey.
 
Method Summary
 java.lang.String getCacheKeyForGroupUsers(java.lang.String prefix, CmsDbContext context, CmsGroup group)
          Returns the cache key for the group users cache.
 java.lang.String getCacheKeyForUserGroups(java.lang.String prefix, CmsDbContext context, CmsUser user)
          Returns the cache key for the user groups cache.
 java.lang.String getCacheKeyForUserPermissions(java.lang.String prefix, CmsDbContext context, CmsResource resource, CmsPermissionSet requiredPermissions)
          Returns the cache key for the permission cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_KEY_SUBALL

public static final java.lang.String CACHE_KEY_SUBALL
Cache key for a list of sub-resources (files and folders) of a folder.

See Also:
Constant Field Values

CACHE_KEY_SUBFILES

public static final java.lang.String CACHE_KEY_SUBFILES
Cache key for a list of sub-files of a folder.

See Also:
Constant Field Values

CACHE_KEY_SUBFOLDERS

public static final java.lang.String CACHE_KEY_SUBFOLDERS
Cache key for a list of sub-folders of a folder.

See Also:
Constant Field Values
Constructor Detail

CmsCacheKey

public CmsCacheKey()
Constructor to create a new instance of CmsCacheKey.

Method Detail

getCacheKeyForGroupUsers

public java.lang.String getCacheKeyForGroupUsers(java.lang.String prefix,
                                                 CmsDbContext context,
                                                 CmsGroup group)
Description copied from interface: I_CmsCacheKey
Returns the cache key for the group users cache.

Specified by:
getCacheKeyForGroupUsers in interface I_CmsCacheKey
Parameters:
prefix - to distinguish keys additionally
context - the context
group - the group
Returns:
a cache key that is unique for the set of parameters
See Also:
I_CmsCacheKey.getCacheKeyForGroupUsers(java.lang.String, org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)

getCacheKeyForUserGroups

public java.lang.String getCacheKeyForUserGroups(java.lang.String prefix,
                                                 CmsDbContext context,
                                                 CmsUser user)
Description copied from interface: I_CmsCacheKey
Returns the cache key for the user groups cache.

Specified by:
getCacheKeyForUserGroups in interface I_CmsCacheKey
Parameters:
prefix - to distinguish keys additionally
context - the context
user - the user
Returns:
a cache key that is unique for the set of parameters
See Also:
I_CmsCacheKey.getCacheKeyForUserGroups(java.lang.String, org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)

getCacheKeyForUserPermissions

public java.lang.String getCacheKeyForUserPermissions(java.lang.String prefix,
                                                      CmsDbContext context,
                                                      CmsResource resource,
                                                      CmsPermissionSet requiredPermissions)
Description copied from interface: I_CmsCacheKey
Returns the cache key for the permission cache.

Specified by:
getCacheKeyForUserPermissions in interface I_CmsCacheKey
Parameters:
prefix - to distinguish keys additionally
context - the context
resource - the resource
requiredPermissions - the permissions to check
Returns:
a cache key that is unique for the set of parameters
See Also:
I_CmsCacheKey.getCacheKeyForUserPermissions(java.lang.String, org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, org.opencms.security.CmsPermissionSet)