org.alfresco.repo.security.permissions
Class PermissionCheckedCollection.PermissionCheckedCollectionMixin

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

public static class PermissionCheckedCollection.PermissionCheckedCollectionMixin
extends org.springframework.aop.support.DelegatingIntroductionInterceptor
implements PermissionCheckedCollection

Helper 'introduction' to allow simple addition of the PermissionCheckedCollection 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.PermissionCheckedCollection
PermissionCheckedCollection.PermissionCheckedCollectionMixin
 
Field Summary
 
Fields inherited from class org.springframework.aop.support.IntroductionInfoSupport
publishedInterfaces
 
Method Summary
static java.util.Collection create(java.util.Collection collection, boolean isCutOff, int sizeUnchecked, int sizeOriginal)
          Helper method to create a PermissionCheckedCollection from an existing Collection
static java.util.Collection create(java.util.Collection collection, java.util.Collection checkedSource)
          Helper method to create a PermissionCheckedCollection from an existing Collection by applying the same values as present on a potentially permission-checked source.
 boolean isCutOff()
          Check if the results have been truncated by permission check limits.
 int sizeOriginal()
          Get the number of objects in the original (unfiltered) collection.
 int sizeUnchecked()
          Get the number of objects in the original (unfiltered) collection that did not have any permission checks.
 
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

isCutOff

public boolean isCutOff()
Description copied from interface: PermissionCheckedCollection
Check if the results have been truncated by permission check limits. This can only be called when #isFiltered() is true.

Specified by:
isCutOff in interface PermissionCheckedCollection
Returns:
true - if the results (usually a collection) have been cut off by permission check limits

sizeUnchecked

public int sizeUnchecked()
Description copied from interface: PermissionCheckedCollection
Get the number of objects in the original (unfiltered) collection that did not have any permission checks.

Specified by:
sizeUnchecked in interface PermissionCheckedCollection
Returns:
number of entries from the original collection that were not checked

sizeOriginal

public int sizeOriginal()
Description copied from interface: PermissionCheckedCollection
Get the number of objects in the original (unfiltered) collection.

Specified by:
sizeOriginal in interface PermissionCheckedCollection
Returns:
number of entries in the original, pre-checked collection

create

public static final java.util.Collection create(java.util.Collection collection,
                                                java.util.Collection checkedSource)
Helper method to create a PermissionCheckedCollection from an existing Collection by applying the same values as present on a potentially permission-checked source. If the existing checked source is NOT permission-checked, then the collection will not be decorated.

Parameters:
collection - the Collection to proxy
checkedSource - a collection that might implement PermissionCheckedCollection
Returns:
a Collection of the same type but including the PermissionCheckedCollection interface

create

public static final java.util.Collection create(java.util.Collection collection,
                                                boolean isCutOff,
                                                int sizeUnchecked,
                                                int sizeOriginal)
Helper method to create a PermissionCheckedCollection from an existing Collection

Parameters:
collection - the Collection to proxy
isCutOff - true if permission checking was cut off before completion
sizeUnchecked - number of entries from the original collection that were not checked
sizeOriginal - number of entries in the original, pre-checked collection
Returns:
a Collection of the same type but including the PermissionCheckedCollection interface


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