Class UserSecurityGroupsCache
java.lang.Object
oracle.stellent.ridc.convenience.usersecurity.impl.UserSecurityGroupsCache
- All Implemented Interfaces:
- IUserSecurityCache
- Direct Known Subclasses:
- UserSGAccountsCache
Implementation of Content Security will check Security Groups
- 
Nested Class SummaryNested classes/interfaces inherited from interface oracle.stellent.ridc.convenience.usersecurity.IUserSecurityCacheIUserSecurityCache.AdminType
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected List<IAccessResolver>protected CSEnvCacheprotected IdcClientprotected ILogprotected IAccessResolverprotected IServiceCallUtilsprotected ExpiringCache<String,CachedDataBinder> 
- 
Constructor SummaryConstructorsConstructorDescriptionUserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long timeToLive) Deprecated.UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser) Create a security implementation that checks Security GroupsUserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser, IServiceCallUtils serviceCallUtils) Create a security implementation that checks Security GroupsUserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long timeToLive, IServiceCallUtils serviceCallUtils) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddAccessResolver(IAccessResolver accessResolver) Adds an access handler to the chainvoidClear the cache completelyvoidclearCache(ITrace trace) Clear the cache completelyintgetAccessLevelForDocument(CacheId id, DataObject docInfo) Deprecated.this method swallows IdcClientExceptionsintgetAccessLevelForDocument(CacheId id, DataObject docInfo, ITrace trace) Get the user's access level for a document.getCacheIdForUser(IdcContext userContext) Deprecated.this method swallows IdcClientExceptionsgetCacheIdForUser(IdcContext userContext, ITrace trace) Get the CacheId.Get the IdcClient used for this cacheintGet number of active entries in cachegetPermissions(CacheId id, ITrace trace) Get the permissions for a usergetUserSecurityFlags(CacheId id, ITrace trace) Returns the UserSecurityFlags object.voidinitializeCache(int maxSize, long timeToLive) Initialize the user permissions cache with maximum size and length to livebooleanisAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType) Deprecated.this method swallows IdcClientExceptionsbooleanisAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType, ITrace trace) Returns the Admin flag for the specific admin type.booleanisAuthorDelete(CacheId id, DataObject docInfo, int access, ITrace trace) protected voidputPermissions(CacheId id, CachedDataBinder permissions) Remember user's permissionsremoveCacheId(CacheId id) Drop the permissions for this user from the cacheprotected CachedDataBinderRemove user's permissionsvoidRemove entries from cache that are too oldvoidsetIdcClient(IdcClient idcClient) For this Cache, set the communication informationvoidsetServiceCallUtils(IServiceCallUtils serviceCallUtils) 
- 
Field Details- 
m_log
- 
m_idcClient
- 
m_serviceCallUtils
- 
m_securityGroupsResolver
- 
m_accessResolvers
- 
m_userPermissionsCache
- 
m_csEnvCache
 
- 
- 
Constructor Details- 
UserSecurityGroupsCachepublic UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser) Create a security implementation that checks Security Groups- Parameters:
- idcClient- RIDC connection information
- cacheMaxSize- Number of entries (userids) to keep in LRU cache
- userTimeToLive- Number of milliseconds before an entry is too old
- serverTimeToLive- Number of milliseconds to keep server's Environment information
- superuser- Admin-level user to fetch environment information
- See Also:
 
- 
UserSecurityGroupsCachepublic UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser, IServiceCallUtils serviceCallUtils) Create a security implementation that checks Security Groups- Parameters:
- idcClient- RIDC connection information
- cacheMaxSize- Number of entries (userids) to keep in LRU cache
- userTimeToLive- Number of milliseconds before an entry is too old
- serverTimeToLive- Number of milliseconds to keep server's Environment information
- superuser- Admin-level user to fetch environment information
- serviceCallUtils- util class perhaps a mock object for testing
- See Also:
 
- 
UserSecurityGroupsCacheDeprecated.Create a security implementation that checks Security Groups This constructor will use the anonymous user to fetch environment information. You should consider using another constructor and the superuser as some environment information is restricted. Since this is a potentially dangerous configuration (you will silently not get all the information you think you should be getting) it is marked as deprecated.- Parameters:
- idcClient- RIDC connection information
- cacheMaxSize- Number of entries (userids) to keep in LRU cache
- timeToLive- Number of milliseconds before an entry is too old
 
- 
UserSecurityGroupsCache@Deprecated public UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long timeToLive, IServiceCallUtils serviceCallUtils) Deprecated.Create a security implementation that checks Security Groups overriding the default ServiceCallUtils This constructor will use the anonymous user to fetch environment information. You should consider using another constructor and the superuser as some environment information is restricted. Since this is a potentially dangerous configuration (you will silently not get all the information you think you should be getting) it is marked as deprecated.- Parameters:
- idcClient- RIDC connection information
- cacheMaxSize- Number of entries (userids) to keep in LRU cache
- timeToLive- Number of milliseconds before an entry is too old
- serviceCallUtils- util class perhaps a mock object for testing
 
 
- 
- 
Method Details- 
initializeCachepublic void initializeCache(int maxSize, long timeToLive) Initialize the user permissions cache with maximum size and length to live- Specified by:
- initializeCachein interface- IUserSecurityCache
- Parameters:
- maxSize- Assuming an LRU cache, the maximum number of entries
- timeToLive- positive number of milliseconds for each entry to be valid
 
- 
clearCachepublic void clearCache()Clear the cache completely- Specified by:
- clearCachein interface- IUserSecurityCache
 
- 
clearCacheClear the cache completely- Specified by:
- clearCachein interface- IUserSecurityCache
 
- 
addAccessResolverAdds an access handler to the chain- Specified by:
- addAccessResolverin interface- IUserSecurityCache
- Parameters:
- accessResolver-
 
- 
getCacheIdForUserDeprecated.this method swallows IdcClientExceptionsGet the CacheId. A call is made to the content server using the IdcContext.- Specified by:
- getCacheIdForUserin interface- IUserSecurityCache
- Parameters:
- userContext- the IdcContent
- Returns:
- a cacheId to be used in future fetches
 
- 
getCacheIdForUserGet the CacheId. A call is made to the content server using the IdcContext.- Specified by:
- getCacheIdForUserin interface- IUserSecurityCache
- Parameters:
- userContext- the IdcContent
- trace-
- Returns:
- a cacheId to be used in future fetches
- Throws:
- IdcClientException
 
- 
removeCacheIdDrop the permissions for this user from the cache- Specified by:
- removeCacheIdin interface- IUserSecurityCache
- Parameters:
- id- CacheID
- Returns:
- DataBinder permissions removed from cache or null
 
- 
getAccessLevelForDocumentDeprecated.this method swallows IdcClientExceptionsGet the user's access level for a document. Note that Admin rights are undefined on the document and thus never returned. You can only read, write or delete the document.- Specified by:
- getAccessLevelForDocumentin interface- IUserSecurityCache
- Parameters:
- id- CacheId
- docInfo- document info either from LocalData or from DOC_INFO resultset
- Returns:
- access level in Content Server form (1=Read, 3=Write, 7=Delete)
 
- 
getAccessLevelForDocumentpublic int getAccessLevelForDocument(CacheId id, DataObject docInfo, ITrace trace) throws IdcClientException Get the user's access level for a document. Note that Admin rights are undefined on the document and thus never returned. You can only read, write or delete the document.- Specified by:
- getAccessLevelForDocumentin interface- IUserSecurityCache
- Parameters:
- id- CacheId
- docInfo- document info either from LocalData or from DOC_INFO resultset
- Returns:
- access level in Content Server form (1=Read, 3=Write, 7=Delete)
- Throws:
- IdcClientException
 
- 
isAuthorDeletepublic boolean isAuthorDelete(CacheId id, DataObject docInfo, int access, ITrace trace) throws IdcClientException - Throws:
- IdcClientException
 
- 
isAdmin@Deprecated public boolean isAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType) Deprecated.this method swallows IdcClientExceptionsReturns the Admin flag for the specific admin type. Note that Admin rights are undefined on the document. You can only read, write or delete the document. Any admin rights returned here might or might not be used by the content server when performing the actual service call.- Specified by:
- isAdminin interface- IUserSecurityCache
- Parameters:
- id- CacheId
- docInfo- document info either from LocalData or from DOC_INFO resultset
- adminType-
- Returns:
- true or false
 
- 
isAdminpublic boolean isAdmin(CacheId id, DataObject docInfo, IUserSecurityCache.AdminType adminType, ITrace trace) throws IdcClientException Returns the Admin flag for the specific admin type. Note that Admin rights are undefined on the document. You can only read, write or delete the document. Any admin rights returned here might or might not be used by the content server when performing the actual service call.- Specified by:
- isAdminin interface- IUserSecurityCache
- Parameters:
- id- CacheId
- docInfo- document info either from LocalData or from DOC_INFO resultset
- adminType-
- trace-
- Returns:
- true or false
- Throws:
- IdcClientException
 
- 
getUserSecurityFlagsReturns the UserSecurityFlags object. This object is a snapshot copy of what is in the cache. Typically, it would be used to complete a single request and then discarded.- Specified by:
- getUserSecurityFlagsin interface- IUserSecurityCache
- Parameters:
- id- CacheId for the user
- trace- (can be null to disable tracing)
- Returns:
- User security flags object
- Throws:
- IdcClientException
 
- 
setIdcClientFor this Cache, set the communication information- Parameters:
- idcClient- Information for the connection to refresh cache
 
- 
getIdcClientGet the IdcClient used for this cache- Returns:
- IdcClient
 
- 
getServiceCallUtils
- 
setServiceCallUtils
- 
getInUseCountpublic int getInUseCount()Get number of active entries in cache- Returns:
- number of entries used in cache
 
- 
removeStaleEntriespublic void removeStaleEntries()Remove entries from cache that are too old
- 
getPermissionsGet the permissions for a user- Parameters:
- id- CacheId
- trace-
- Returns:
- DataBinder containing user information as the result of the Service GET_USER_PERMISSIONS
- Throws:
- IdcClientException
 
- 
putPermissionsRemember user's permissions- Parameters:
- id- CacheId
- permissions- Databinder from the GET_USER_PERMISSIONS call
 
- 
removePermissionsRemove user's permissions- Parameters:
- id- CacheId
- Returns:
 
 
-