@Exported public class UserSecurityGroupsCache extends Object implements IUserSecurityCache
IUserSecurityCache.AdminType| Modifier and Type | Field and Description |
|---|---|
protected List<IAccessResolver> |
m_accessResolvers |
protected CSEnvCache |
m_csEnvCache |
protected IdcClient |
m_idcClient |
protected ILog |
m_log |
protected IAccessResolver |
m_securityGroupsResolver |
protected IServiceCallUtils |
m_serviceCallUtils |
protected ExpiringCache<String,CachedDataBinder> |
m_userPermissionsCache |
| Constructor and Description |
|---|
UserSecurityGroupsCache(IdcClient idcClient,
int cacheMaxSize,
long timeToLive)
Deprecated.
|
UserSecurityGroupsCache(IdcClient idcClient,
int cacheMaxSize,
long timeToLive,
IServiceCallUtils serviceCallUtils)
Deprecated.
|
UserSecurityGroupsCache(IdcClient idcClient,
int cacheMaxSize,
long userTimeToLive,
long serverTimeToLive,
IdcContext superuser)
Create a security implementation that checks Security Groups
|
UserSecurityGroupsCache(IdcClient idcClient,
int cacheMaxSize,
long userTimeToLive,
long serverTimeToLive,
IdcContext superuser,
IServiceCallUtils serviceCallUtils)
Create a security implementation that checks Security Groups
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAccessResolver(IAccessResolver accessResolver)
Adds an access handler to the chain
|
void |
clearCache()
Clear the cache completely
|
void |
clearCache(ITrace trace)
Clear the cache completely
|
int |
getAccessLevelForDocument(CacheId id,
DataObject docInfo)
Deprecated.
this method swallows IdcClientExceptions
|
int |
getAccessLevelForDocument(CacheId id,
DataObject docInfo,
ITrace trace)
Get the user's access level for a document.
|
CacheId |
getCacheIdForUser(IdcContext userContext)
Deprecated.
this method swallows IdcClientExceptions
|
CacheId |
getCacheIdForUser(IdcContext userContext,
ITrace trace)
Get the CacheId.
|
IdcClient |
getIdcClient()
Get the IdcClient used for this cache
|
int |
getInUseCount()
Get number of active entries in cache
|
DataBinder |
getPermissions(CacheId id,
ITrace trace)
Get the permissions for a user
|
IServiceCallUtils |
getServiceCallUtils() |
IUserSecurityFlags |
getUserSecurityFlags(CacheId id,
ITrace trace)
Returns the UserSecurityFlags object.
|
void |
initializeCache(int maxSize,
long timeToLive)
Initialize the user permissions cache with maximum size and length to live
|
boolean |
isAdmin(CacheId id,
DataObject docInfo,
IUserSecurityCache.AdminType adminType)
Deprecated.
this method swallows IdcClientExceptions
|
boolean |
isAdmin(CacheId id,
DataObject docInfo,
IUserSecurityCache.AdminType adminType,
ITrace trace)
Returns the Admin flag for the specific admin type.
|
boolean |
isAuthorDelete(CacheId id,
DataObject docInfo,
int access,
ITrace trace) |
protected void |
putPermissions(CacheId id,
CachedDataBinder permissions)
Remember user's permissions
|
DataBinder |
removeCacheId(CacheId id)
Drop the permissions for this user from the cache
|
protected CachedDataBinder |
removePermissions(CacheId id)
Remove user's permissions
|
void |
removeStaleEntries()
Remove entries from cache that are too old
|
void |
setIdcClient(IdcClient idcClient)
For this Cache, set the communication information
|
void |
setServiceCallUtils(IServiceCallUtils serviceCallUtils) |
protected ILog m_log
protected IdcClient m_idcClient
protected IServiceCallUtils m_serviceCallUtils
protected IAccessResolver m_securityGroupsResolver
protected List<IAccessResolver> m_accessResolvers
protected ExpiringCache<String,CachedDataBinder> m_userPermissionsCache
protected CSEnvCache m_csEnvCache
public UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser)
idcClient - RIDC connection informationcacheMaxSize - Number of entries (userids) to keep in LRU cacheuserTimeToLive - Number of milliseconds before an entry is too oldserverTimeToLive - Number of milliseconds to keep server's Environment informationsuperuser - Admin-level user to fetch environment informationUserSecurityGroupsCachepublic UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser, IServiceCallUtils serviceCallUtils)
idcClient - RIDC connection informationcacheMaxSize - Number of entries (userids) to keep in LRU cacheuserTimeToLive - Number of milliseconds before an entry is too oldserverTimeToLive - Number of milliseconds to keep server's Environment informationsuperuser - Admin-level user to fetch environment informationserviceCallUtils - util class perhaps a mock object for testingUserSecurityGroupsCache@Deprecated public UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long timeToLive)
idcClient - RIDC connection informationcacheMaxSize - Number of entries (userids) to keep in LRU cachetimeToLive - Number of milliseconds before an entry is too old@Deprecated public UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long timeToLive, IServiceCallUtils serviceCallUtils)
idcClient - RIDC connection informationcacheMaxSize - Number of entries (userids) to keep in LRU cachetimeToLive - Number of milliseconds before an entry is too oldserviceCallUtils - util class perhaps a mock object for testingpublic void initializeCache(int maxSize,
long timeToLive)
initializeCache in interface IUserSecurityCachemaxSize - Assuming an LRU cache, the maximum number of entriestimeToLive - positive number of milliseconds for each entry to be validpublic void clearCache()
clearCache in interface IUserSecurityCachepublic void clearCache(ITrace trace)
clearCache in interface IUserSecurityCachepublic void addAccessResolver(IAccessResolver accessResolver)
addAccessResolver in interface IUserSecurityCacheaccessResolver - @Deprecated public CacheId getCacheIdForUser(IdcContext userContext)
getCacheIdForUser in interface IUserSecurityCacheuserContext - the IdcContentpublic CacheId getCacheIdForUser(IdcContext userContext, ITrace trace) throws IdcClientException
getCacheIdForUser in interface IUserSecurityCacheuserContext - the IdcContenttrace - IdcClientExceptionpublic DataBinder removeCacheId(CacheId id)
removeCacheId in interface IUserSecurityCacheid - CacheID@Deprecated public int getAccessLevelForDocument(CacheId id, DataObject docInfo)
getAccessLevelForDocument in interface IUserSecurityCacheid - CacheIddocInfo - document info either from LocalData or from DOC_INFO resultsetpublic int getAccessLevelForDocument(CacheId id, DataObject docInfo, ITrace trace) throws IdcClientException
getAccessLevelForDocument in interface IUserSecurityCacheid - CacheIddocInfo - document info either from LocalData or from DOC_INFO resultsetIdcClientExceptionpublic boolean isAuthorDelete(CacheId id, DataObject docInfo, int access, ITrace trace) throws IdcClientException
IdcClientException@Deprecated public boolean isAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType)
isAdmin in interface IUserSecurityCacheid - CacheIddocInfo - document info either from LocalData or from DOC_INFO resultsetadminType - public boolean isAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType, ITrace trace) throws IdcClientException
isAdmin in interface IUserSecurityCacheid - CacheIddocInfo - document info either from LocalData or from DOC_INFO resultsetadminType - trace - IdcClientExceptionpublic IUserSecurityFlags getUserSecurityFlags(CacheId id, ITrace trace) throws IdcClientException
getUserSecurityFlags in interface IUserSecurityCacheid - CacheId for the usertrace - (can be null to disable tracing)IdcClientExceptionpublic void setIdcClient(IdcClient idcClient)
idcClient - Information for the connection to refresh cachepublic IdcClient getIdcClient()
public IServiceCallUtils getServiceCallUtils()
public void setServiceCallUtils(IServiceCallUtils serviceCallUtils)
public int getInUseCount()
public void removeStaleEntries()
public DataBinder getPermissions(CacheId id, ITrace trace) throws IdcClientException
id - CacheIdtrace - IdcClientExceptionprotected void putPermissions(CacheId id, CachedDataBinder permissions)
id - CacheIdpermissions - Databinder from the GET_USER_PERMISSIONS callprotected CachedDataBinder removePermissions(CacheId id)
id - CacheId