Class PermissionCheckCollection.PermissionCheckCollectionMixin<T>
java.lang.Object
org.springframework.aop.support.IntroductionInfoSupport
org.springframework.aop.support.DelegatingIntroductionInterceptor
org.alfresco.repo.security.permissions.PermissionCheckCollection.PermissionCheckCollectionMixin<T>
- Type Parameters:
T- the type of theCollectionin use
- All Implemented Interfaces:
Serializable,PermissionCheckCollection<T>,org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor,org.springframework.aop.DynamicIntroductionAdvice,org.springframework.aop.IntroductionInfo,org.springframework.aop.IntroductionInterceptor
- Enclosing interface:
- PermissionCheckCollection<T>
public static class PermissionCheckCollection.PermissionCheckCollectionMixin<T>
extends org.springframework.aop.support.DelegatingIntroductionInterceptor
implements PermissionCheckCollection<T>
Helper 'introduction' to allow simple addition of the
PermissionCheckCollection interface to
existing collections.- Since:
- 4.0
- Author:
- Derek Hulley
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.security.permissions.PermissionCheckCollection
PermissionCheckCollection.PermissionCheckCollectionMixin<T> -
Field Summary
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport
publishedInterfaces -
Method Summary
Modifier and TypeMethodDescriptionstatic final <TT> Collection<TT>create(Collection<TT> collection, int targetResultCount, long cutOffAfterTimeMs, int cutOffAfterCount) Helper method to create aPermissionCheckCollectionfrom an existingCollectionintGet the maximum number of permission checks to perform before cutting the results offlongGet the maximum time for permission checks to execute before cutting the results off.intGet the desired number of results.Methods inherited from class org.springframework.aop.support.DelegatingIntroductionInterceptor
doProceed, invokeMethods inherited from class org.springframework.aop.support.IntroductionInfoSupport
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterfaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.aop.DynamicIntroductionAdvice
implementsInterface
-
Method Details
-
getTargetResultCount
public int getTargetResultCount()Description copied from interface:PermissionCheckCollectionGet the desired number of results. Permission checks can stop once the number of return objects reaches this number.- Specified by:
getTargetResultCountin interfacePermissionCheckCollection<T>- Returns:
- the number of results desired
-
getCutOffAfterTimeMs
public long getCutOffAfterTimeMs()Description copied from interface:PermissionCheckCollectionGet the maximum time for permission checks to execute before cutting the results off.
Zero: Ignore this value.- Specified by:
getCutOffAfterTimeMsin interfacePermissionCheckCollection<T>- Returns:
- the time allowed for permission checks before cutoff
-
getCutOffAfterCount
public int getCutOffAfterCount()Description copied from interface:PermissionCheckCollectionGet the maximum number of permission checks to perform before cutting the results off- Specified by:
getCutOffAfterCountin interfacePermissionCheckCollection<T>- Returns:
- the maximum number of permission checks before cutoff
-
create
public static final <TT> Collection<TT> create(Collection<TT> collection, int targetResultCount, long cutOffAfterTimeMs, int cutOffAfterCount) Helper method to create aPermissionCheckCollectionfrom an existingCollection- Type Parameters:
TT- the type of theCollection- Parameters:
collection- theCollectionto proxytargetResultCount- the desired number of results or default to the collection sizecutOffAfterTimeMs- the number of milliseconds to wait before cut-off or zero to use the system default time-based cut-off.cutOffAfterCount- the number of permission checks to process before cut-off or zero to use the system default count-based cut-off.- Returns:
- a
Collectionof the same type but including thePermissionCheckCollectioninterface
-