org.alfresco.repo.security.permissions
Class PermissionCheckCollection.PermissionCheckCollectionMixin

java.lang.Object
  extended by org.springframework.aop.support.IntroductionInfoSupport
      extended by org.springframework.aop.support.DelegatingIntroductionInterceptor
          extended by org.alfresco.repo.security.permissions.PermissionCheckCollection.PermissionCheckCollectionMixin
All Implemented Interfaces:
java.io.Serializable, PermissionCheckCollection, 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

public static class PermissionCheckCollection.PermissionCheckCollectionMixin
extends org.springframework.aop.support.DelegatingIntroductionInterceptor
implements PermissionCheckCollection

Helper 'introduction' to allow simple addition of the PermissionCheckCollection interface to existing collections.

Since:
4.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.security.permissions.PermissionCheckCollection
PermissionCheckCollection.PermissionCheckCollectionMixin
 
Field Summary
 
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport
publishedInterfaces
 
Method Summary
static java.util.Collection create(java.util.Collection collection, int targetResultCount, long cutOffAfterTimeMs, int cutOffAfterCount)
          Helper method to create a PermissionCheckCollection from an existing Collection
 int getCutOffAfterCount()
          Get the maximum number of permission checks to perform before cutting the results off
 long getCutOffAfterTimeMs()
          Get the maximum time for permission checks to execute before cutting the results off.
 int getTargetResultCount()
          Get the desired number of results.
 
Methods inherited from class org.springframework.aop.support.DelegatingIntroductionInterceptor
doProceed, invoke
 
Methods inherited from class org.springframework.aop.support.IntroductionInfoSupport
getInterfaces, implementInterfacesOnObject, implementsInterface, isMethodOnIntroducedInterface, suppressInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.aop.DynamicIntroductionAdvice
implementsInterface
 

Method Detail

getTargetResultCount

public int getTargetResultCount()
Description copied from interface: PermissionCheckCollection
Get the desired number of results. Permission checks can stop once the number of return objects reaches this number.

Specified by:
getTargetResultCount in interface PermissionCheckCollection
Returns:
the number of results desired

getCutOffAfterTimeMs

public long getCutOffAfterTimeMs()
Description copied from interface: PermissionCheckCollection
Get the maximum time for permission checks to execute before cutting the results off.
Zero: Ignore this value.

Specified by:
getCutOffAfterTimeMs in interface PermissionCheckCollection
Returns:
the time allowed for permission checks before cutoff

getCutOffAfterCount

public int getCutOffAfterCount()
Description copied from interface: PermissionCheckCollection
Get the maximum number of permission checks to perform before cutting the results off

Specified by:
getCutOffAfterCount in interface PermissionCheckCollection
Returns:
the maximum number of permission checks before cutoff

create

public static final java.util.Collection create(java.util.Collection collection,
                                                int targetResultCount,
                                                long cutOffAfterTimeMs,
                                                int cutOffAfterCount)
Helper method to create a PermissionCheckCollection from an existing Collection

Parameters:
collection - the Collection to proxy
targetResultCount - the desired number of results or default to the collection size
cutOffAfterTimeMs - 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 Collection of the same type but including the PermissionCheckCollection interface


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.