edu.internet2.middleware.grouper.permissions.limits.impl
Class PermissionLimitElLogic

java.lang.Object
  extended by edu.internet2.middleware.grouper.permissions.limits.PermissionLimitBase
      extended by edu.internet2.middleware.grouper.permissions.limits.impl.PermissionLimitElLogic
All Implemented Interfaces:
PermissionLimitInterface

public class PermissionLimitElLogic
extends PermissionLimitBase

logic for the built in EL limit

Author:
mchyzer

Field Summary
static Integer testingCacheMinutesInt
          if you are testing this, set it, otherwise, it will default
static int testingTimesCalledLogic
          count how many times called logic for testing the cache
 
Constructor Summary
PermissionLimitElLogic()
           
 
Method Summary
 boolean allowPermission(PermissionEntry permissionEntry, AttributeAssign limitAssignment, Set<AttributeAssignValue> limitAssignmentValues, Map<String,Object> limitEnvVars, Set<PermissionLimitBean> permissionLimitBeans)
          if the limit allowed the permission to be allowed
 int cacheLimitValueResultMinutes()
          if we can cache the result for a some minutes.
 PermissionLimitDocumentation documentation()
          return a UI key to documentation about the limit.
 PermissionLimitDocumentation validateLimitAssignValue(AttributeAssign limitAssign, Set<AttributeAssignValue> limitAssignmentValues)
          validate a user entered value(s) on the limit assignment
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

testingCacheMinutesInt

public static Integer testingCacheMinutesInt
if you are testing this, set it, otherwise, it will default


testingTimesCalledLogic

public static int testingTimesCalledLogic
count how many times called logic for testing the cache

Constructor Detail

PermissionLimitElLogic

public PermissionLimitElLogic()
Method Detail

cacheLimitValueResultMinutes

public int cacheLimitValueResultMinutes()
Description copied from interface: PermissionLimitInterface
if we can cache the result for a some minutes. i.e. for the same attribute assignment and value and input map, is the result the same... e.g. ip address math can be cached, amount limits, etc. If there are conditions about the permission names, then dont cache

Specified by:
cacheLimitValueResultMinutes in interface PermissionLimitInterface
Overrides:
cacheLimitValueResultMinutes in class PermissionLimitBase
Returns:
the number of minutes to cache
See Also:
PermissionLimitInterface.cacheLimitValueResultMinutes()

allowPermission

public boolean allowPermission(PermissionEntry permissionEntry,
                               AttributeAssign limitAssignment,
                               Set<AttributeAssignValue> limitAssignmentValues,
                               Map<String,Object> limitEnvVars,
                               Set<PermissionLimitBean> permissionLimitBeans)
Description copied from interface: PermissionLimitInterface
if the limit allowed the permission to be allowed

Parameters:
permissionEntry - to check
limitAssignment - the assignment of the limit (e.g. to the permission assignment a parent assignment, or the role, etc)
limitEnvVars - value could be String, Long, or Double
permissionLimitBeans - all limits for this permission (in case the limit logic needs it... note, dont use built in caching if this is the case)
Returns:
true if allowed, false if not
See Also:
PermissionLimitInterface.allowPermission(PermissionEntry, AttributeAssign, Set, Map, Set)

documentation

public PermissionLimitDocumentation documentation()
Description copied from interface: PermissionLimitInterface
return a UI key to documentation about the limit. for Grouper, put in nav.properties

Returns:
a UI key
See Also:
PermissionLimitInterface.documentation()

validateLimitAssignValue

public PermissionLimitDocumentation validateLimitAssignValue(AttributeAssign limitAssign,
                                                             Set<AttributeAssignValue> limitAssignmentValues)
Description copied from interface: PermissionLimitInterface
validate a user entered value(s) on the limit assignment

Returns:
the UI key and args for the error code (arbitrary, in Grouper should put in nav.properties) or null for ok
See Also:
PermissionLimitInterface.validateLimitAssignValue(AttributeAssign, Set)