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 Summary
Nested classes/interfaces inherited from interface oracle.stellent.ridc.convenience.usersecurity.IUserSecurityCache
IUserSecurityCache.AdminType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<IAccessResolver>protected CSEnvCacheprotected IdcClientprotected ILogprotected IAccessResolverprotected IServiceCallUtilsprotected ExpiringCache<String,CachedDataBinder> -
Constructor Summary
ConstructorsConstructorDescriptionUserSecurityGroupsCache(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 Summary
Modifier 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
-
UserSecurityGroupsCache
public UserSecurityGroupsCache(IdcClient idcClient, int cacheMaxSize, long userTimeToLive, long serverTimeToLive, IdcContext superuser) Create a security implementation that checks Security Groups- Parameters:
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 information- See Also:
-
UserSecurityGroupsCache
public 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 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 testing- See Also:
-
UserSecurityGroupsCache
Deprecated.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 informationcacheMaxSize- Number of entries (userids) to keep in LRU cachetimeToLive- 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 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
-
-
Method Details
-
initializeCache
public void initializeCache(int maxSize, long timeToLive) Initialize the user permissions cache with maximum size and length to live- Specified by:
initializeCachein interfaceIUserSecurityCache- Parameters:
maxSize- Assuming an LRU cache, the maximum number of entriestimeToLive- positive number of milliseconds for each entry to be valid
-
clearCache
public void clearCache()Clear the cache completely- Specified by:
clearCachein interfaceIUserSecurityCache
-
clearCache
Clear the cache completely- Specified by:
clearCachein interfaceIUserSecurityCache
-
addAccessResolver
Adds an access handler to the chain- Specified by:
addAccessResolverin interfaceIUserSecurityCache- Parameters:
accessResolver-
-
getCacheIdForUser
Deprecated.this method swallows IdcClientExceptionsGet the CacheId. A call is made to the content server using the IdcContext.- Specified by:
getCacheIdForUserin interfaceIUserSecurityCache- Parameters:
userContext- the IdcContent- Returns:
- a cacheId to be used in future fetches
-
getCacheIdForUser
Get the CacheId. A call is made to the content server using the IdcContext.- Specified by:
getCacheIdForUserin interfaceIUserSecurityCache- Parameters:
userContext- the IdcContenttrace-- Returns:
- a cacheId to be used in future fetches
- Throws:
IdcClientException
-
removeCacheId
Drop the permissions for this user from the cache- Specified by:
removeCacheIdin interfaceIUserSecurityCache- Parameters:
id- CacheID- Returns:
- DataBinder permissions removed from cache or null
-
getAccessLevelForDocument
Deprecated.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 interfaceIUserSecurityCache- Parameters:
id- CacheIddocInfo- document info either from LocalData or from DOC_INFO resultset- Returns:
- access level in Content Server form (1=Read, 3=Write, 7=Delete)
-
getAccessLevelForDocument
public 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 interfaceIUserSecurityCache- Parameters:
id- CacheIddocInfo- 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
-
isAuthorDelete
public 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 interfaceIUserSecurityCache- Parameters:
id- CacheIddocInfo- document info either from LocalData or from DOC_INFO resultsetadminType-- Returns:
- true or false
-
isAdmin
public 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 interfaceIUserSecurityCache- Parameters:
id- CacheIddocInfo- document info either from LocalData or from DOC_INFO resultsetadminType-trace-- Returns:
- true or false
- Throws:
IdcClientException
-
getUserSecurityFlags
Returns 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 interfaceIUserSecurityCache- Parameters:
id- CacheId for the usertrace- (can be null to disable tracing)- Returns:
- User security flags object
- Throws:
IdcClientException
-
setIdcClient
For this Cache, set the communication information- Parameters:
idcClient- Information for the connection to refresh cache
-
getIdcClient
Get the IdcClient used for this cache- Returns:
- IdcClient
-
getServiceCallUtils
-
setServiceCallUtils
-
getInUseCount
public int getInUseCount()Get number of active entries in cache- Returns:
- number of entries used in cache
-
removeStaleEntries
public void removeStaleEntries()Remove entries from cache that are too old -
getPermissions
Get the permissions for a user- Parameters:
id- CacheIdtrace-- Returns:
- DataBinder containing user information as the result of the Service GET_USER_PERMISSIONS
- Throws:
IdcClientException
-
putPermissions
Remember user's permissions- Parameters:
id- CacheIdpermissions- Databinder from the GET_USER_PERMISSIONS call
-
removePermissions
Remove user's permissions- Parameters:
id- CacheId- Returns:
-