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 long |
m_timeToLive |
protected Map<String,CachedDataBinder> |
m_userCache |
| 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
|
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 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 IAccessResolver m_securityGroupsResolver
protected List<IAccessResolver> m_accessResolvers
protected Map<String,CachedDataBinder> m_userCache
protected IdcClient m_idcClient
protected long m_timeToLive
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 testingUserSecurityGroupsCachepublic 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 oldpublic 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 testing
public 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 IServiceCallUtils getServiceCallUtils()
public void setServiceCallUtils(IServiceCallUtils serviceCallUtils)
public void addAccessResolver(IAccessResolver accessResolver)
addAccessResolver in interface IUserSecurityCacheaccessResolver -public void clearCache()
clearCache in interface IUserSecurityCache@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 void setIdcClient(IdcClient idcClient)
idcClient - Information for the connection to refresh cachepublic IdcClient getIdcClient()
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 - CacheIdpublic IUserSecurityFlags getUserSecurityFlags(CacheId id, ITrace trace) throws IdcClientException
getUserSecurityFlags in interface IUserSecurityCacheid - CacheId for the usertrace - (can be null to disable tracing)IdcClientException