Class AttributeAssignBaseDelegate

java.lang.Object
edu.internet2.middleware.grouper.attr.assign.AttributeAssignBaseDelegate
Direct Known Subclasses:
AttributeAssignAttrAssignDelegate, AttributeAssignAttributeDefDelegate, AttributeAssignEffMshipDelegate, AttributeAssignGroupDelegate, AttributeAssignMemberDelegate, AttributeAssignMembershipDelegate, AttributeAssignStemDelegate

public abstract class AttributeAssignBaseDelegate extends Object
delegate privilege calls from attribute defs
  • Field Details

    • allAttributeAssignsCacheHitsForTest

      public static long allAttributeAssignsCacheHitsForTest
      cache hits for testing
    • allAttributeAssignsCacheMissesForTest

      public static long allAttributeAssignsCacheMissesForTest
      cache misses for testing
  • Method Details

    • assertCanReadAttributeDefName

      public void assertCanReadAttributeDefName(AttributeDefName attributeDefName)
      make sure the user can read the attribute (including looking at object if necessary)
      Parameters:
      attributeDefName -
    • assertCanReadAttributeDef

      public abstract void assertCanReadAttributeDef(AttributeDef attributeDef)
      make sure the user can read the attribute (including looking at object if necessary)
      Parameters:
      attributeDef -
    • assertCanUpdateAttributeDefName

      public abstract void assertCanUpdateAttributeDefName(AttributeDefName attributeDefName)
      make sure the user can update the attribute (including looking at object if necessary)
      Parameters:
      attributeDefName -
    • assertCanDelegateAttributeDefName

      public void assertCanDelegateAttributeDefName(String action, AttributeDefName attributeDefName)
      make sure the user can delegate the attribute
      Parameters:
      action -
      attributeDefName -
    • assertCanGrantAttributeDefName

      public void assertCanGrantAttributeDefName(String action, AttributeDefName attributeDefName)
      make sure the user can grant delegation to the attribute
      Parameters:
      action -
      attributeDefName -
    • assignAttribute

      public AttributeAssignResult assignAttribute(AttributeDefName attributeDefName)
      Parameters:
      attributeDefName -
      Returns:
      the result including if added or already there
    • assignAttributeByName

      public AttributeAssignResult assignAttributeByName(String attributeDefNameName)
      Parameters:
      attributeDefNameName -
      Returns:
      the result including if added or already there
    • assignAttributeById

      public AttributeAssignResult assignAttributeById(String attributeDefNameId)
      Parameters:
      attributeDefNameId -
      Returns:
      the result including if added or already there
    • hasAttributeById

      public boolean hasAttributeById(String attributeDefNameId)
      Parameters:
      attributeDefNameId -
      Returns:
      true if has attribute, false if not
    • hasAttribute

      public boolean hasAttribute(AttributeDefName attributeDefName)
      Parameters:
      attributeDefName -
      Returns:
      true if has attribute, false if not
    • retrieveAssignment

      public AttributeAssign retrieveAssignment(String action, AttributeDefName attributeDefName, boolean checkSecurity, boolean exceptionIfNull)
      retrieve an assignment (should be single assign)
      Parameters:
      action -
      attributeDefName -
      checkSecurity -
      exceptionIfNull -
      Returns:
      the assignment
    • hasAttributeByName

      public boolean hasAttributeByName(String attributeDefNameName)
      see if the group
      Parameters:
      attributeDefNameName -
      Returns:
      true if has attribute, false if not
    • retrieveAssignmentsByAttributeDefId

      public Set<AttributeAssign> retrieveAssignmentsByAttributeDefId(String attributeDefId)
      Parameters:
      attributeDefId -
      Returns:
      the assignments for a def name
    • retrieveAttributesByAttributeDefId

      public Set<AttributeDefName> retrieveAttributesByAttributeDefId(String attributeDefId)
      Parameters:
      attributeDefId -
      Returns:
      the assignments for a def
    • retrieveAttributesByAttributeDef

      public Set<AttributeDefName> retrieveAttributesByAttributeDef(String nameOfAttributeDef)
      Parameters:
      nameOfAttributeDef -
      Returns:
      the attributes for a def
    • retrieveAssignmentsByAttributeDef

      public Set<AttributeAssign> retrieveAssignmentsByAttributeDef(String name)
      Parameters:
      name - is the name of the attribute def
      Returns:
      the assignments for a def
    • retrieveAssignments

      public Set<AttributeAssign> retrieveAssignments(AttributeDef attributeDef)
      find the assignments of any name associated with a def
      Parameters:
      attributeDef -
      Returns:
      the set of assignments or the empty set
    • retrieveAssignments

      public Set<AttributeAssign> retrieveAssignments(AttributeDefName attributeDefName)
      Parameters:
      attributeDefName -
      Returns:
      the assignments for a def name
    • retrieveAttributes

      public Set<AttributeDefName> retrieveAttributes(AttributeDef attributeDef)
      Parameters:
      attributeDef -
      Returns:
      the attributes for a def
    • removeAttribute

      public AttributeAssignResult removeAttribute(AttributeDefName attributeDefName)
      Parameters:
      attributeDefName -
      Returns:
      if removed or already not assigned
    • getAllAttributeAssignsForCache

      protected Set<AttributeAssign> getAllAttributeAssignsForCache()
      return the cache of all attribute assigns, might be null if not caching
      Returns:
      the allAttributeAssignsCache
    • setAllAttributeAssignsForCache

      protected void setAllAttributeAssignsForCache(Set<AttributeAssign> allAttributeAssignsForCache)
      Parameters:
      allAttributeAssignsForCache - the Set of attributes to put in cache
    • removeAttributeById

      public AttributeAssignResult removeAttributeById(String attributeDefNameId)
      Parameters:
      attributeDefNameId -
      Returns:
      if added or already there
    • removeAttributeByName

      public AttributeAssignResult removeAttributeByName(String attributeDefNameName)
      Parameters:
      attributeDefNameName -
      Returns:
      if added or already there
    • assignAttribute

      public AttributeAssignResult assignAttribute(String action, AttributeDefName attributeDefName)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      Returns:
      the result including if added or already there
    • assignAttribute

      public AttributeAssignResult assignAttribute(String action, AttributeDefName attributeDefName, PermissionAllowed permissionAllowed)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      permissionAllowed - if permission then if allowed or disallowed
      Returns:
      the result including if added or already there
    • internal_assignAttributeHelper

      public AttributeAssignResult internal_assignAttributeHelper(String action, AttributeDefName attributeDefName, boolean checkSecurity, String uuid, PermissionAllowed permissionAllowed)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      checkSecurity -
      uuid - uuid of the assignment
      permissionAllowed - if permission this is the allowed flag
      Returns:
      the result including if added or already there
    • assignAttributeById

      public AttributeAssignResult assignAttributeById(String action, String attributeDefNameId)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameId -
      Returns:
      the result including if added or already there
    • assignAttributeByName

      public AttributeAssignResult assignAttributeByName(String action, String attributeDefNameName)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameName -
      Returns:
      the result including if added or already there
    • hasAttribute

      public boolean hasAttribute(String action, AttributeDefName attributeDefName)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      Returns:
      true if has attribute, false if not
    • hasAttributeById

      public boolean hasAttributeById(String action, String attributeDefNameId)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameId -
      Returns:
      true if has attribute, false if not
    • hasAttributeByName

      public boolean hasAttributeByName(String action, String attributeDefNameName)
      see if the group
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameName -
      Returns:
      true if has attribute, false if not
    • removeAttribute

      public AttributeAssignResult removeAttribute(String action, AttributeDefName attributeDefName)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      Returns:
      if removed or already not assigned
    • removeAttributeById

      public AttributeAssignResult removeAttributeById(String action, String attributeDefNameId)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameId -
      Returns:
      if added or already there
    • removeAttributeByAssignId

      public AttributeAssignResult removeAttributeByAssignId(String assignId)
      remove an attribute assign by id
      Parameters:
      assignId -
      Returns:
      if removed or already gone
    • removeAttributeByAssignId

      public AttributeAssignResult removeAttributeByAssignId(String assignId, boolean checkSecurity)
      Parameters:
      checkSecurity -
      assignId -
      Returns:
      if removed or already gone
    • removeAttributeByName

      public AttributeAssignResult removeAttributeByName(String action, String attributeDefNameName)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameName -
      Returns:
      if added or already there
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
      See Also:
    • delegateAttribute

      public AttributeAssignResult delegateAttribute(AttributeDefName attributeDefName, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      attributeDefName -
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      Returns:
      the result including if added or already there
    • delegateAttribute

      public AttributeAssignResult delegateAttribute(String action, AttributeDefName attributeDefName, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      Returns:
      the result including if added or already there
    • delegateAttributeById

      public AttributeAssignResult delegateAttributeById(String attributeDefNameId, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      attributeDefNameId -
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      Returns:
      the result including if added or already there
    • delegateAttributeById

      public AttributeAssignResult delegateAttributeById(String action, String attributeDefNameId, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameId -
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      Returns:
      the result including if added or already there
    • delegateAttributeByName

      public AttributeAssignResult delegateAttributeByName(String attributeDefNameName, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      attributeDefNameName -
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      Returns:
      the result including if added or already there
    • delegateAttributeByName

      public AttributeAssignResult delegateAttributeByName(String action, String attributeDefNameName, boolean assign, AttributeAssignDelegateOptions attributeAssignDelegateOptions)
      Parameters:
      action - is the action on the assignment (null means default action)
      assign - true to assign, false to unassign
      attributeAssignDelegateOptions - if there are more options, null if not
      attributeDefNameName -
      Returns:
      the result including if added or already there
    • addAttribute

      public AttributeAssignResult addAttribute(AttributeDefName attributeDefName)
      add a multi assignable attribute
      Parameters:
      attributeDefName -
      Returns:
      the result including if added or already there
    • addAttribute

      public AttributeAssignResult addAttribute(String action, AttributeDefName attributeDefName)
      add a multi assignable attribute
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      Returns:
      the result including if added or already there
    • addAttributeById

      public AttributeAssignResult addAttributeById(String attributeDefNameId)
      add a multi assignable attribute
      Parameters:
      attributeDefNameId -
      Returns:
      the result including if added or already there
    • addAttributeById

      public AttributeAssignResult addAttributeById(String action, String attributeDefNameId)
      add a multi assignable attribute
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameId -
      Returns:
      the result including if added or already there
    • addAttributeByName

      public AttributeAssignResult addAttributeByName(String attributeDefNameName)
      add a multi assignable attribute
      Parameters:
      attributeDefNameName -
      Returns:
      the result including if added or already there
    • addAttributeByName

      public AttributeAssignResult addAttributeByName(String action, String attributeDefNameName)
      add a multi assignable attribute
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefNameName -
      Returns:
      the result including if added or already there
    • assertScopeOk

      public void assertScopeOk(AttributeDef attributeDef)
      Parameters:
      attributeDef -
    • getAttributeAssignable

      public abstract AttributeAssignable getAttributeAssignable()
      get the assignable object
      Returns:
      the assignable object
    • internal_addAttributeHelper

      public AttributeAssignResult internal_addAttributeHelper(String action, AttributeDefName attributeDefName, boolean checkSecurity, String uuid)
      add a multi assignable attribute
      Parameters:
      action - is the action on the assignment (null means default action)
      attributeDefName -
      checkSecurity -
      uuid - uuid of the assignment
      Returns:
      the result including if added or already there
    • retrieveAttributes

      public Set<AttributeDefName> retrieveAttributes()
      Returns:
      the attributes for an owner
    • getAttributeAssigns

      public Set<AttributeAssign> getAttributeAssigns()
      find the assignments of any name associated with an owner this is the javabean equivalent to retrieveAssignments
      Returns:
      the set of assignments or the empty set
    • retrieveAssignments

      public Set<AttributeAssign> retrieveAssignments()
      find the assignments of any name associated with an owner
      Returns:
      the set of assignments or the empty set
    • clearObjectHasAttributeCache

      public static void clearObjectHasAttributeCache()
      clear the cache if we are assigning attributes
    • hasAttributeOrAncestorHasAttribute

      public boolean hasAttributeOrAncestorHasAttribute(String attributeFlagName, boolean checkSecurity)
      see if a group or parent or ancestor folder has an attribute. this can run securely.
      Parameters:
      attributeFlagName -
      checkSecurity -
      Returns:
      true if group or stem has attribute
    • getAttributeOrAncestorAttribute

      public AttributeAssignable getAttributeOrAncestorAttribute(String attributeFlagName, boolean checkSecurity)
      see if a group or parent or ancestor folder has an attribute. this can run securely.
      Parameters:
      attributeFlagName -
      checkSecurity -
      Returns:
      true if group or stem has attribute
    • getAttributeOrAncestorAttribute

      public AttributeAssignable getAttributeOrAncestorAttribute(String attributeFlagName, boolean checkSecurity, String uuidOfMetadataAttributeDefName0, String metadataValue0)
      see if a group or parent or ancestor folder has an attribute. this can run securely.
      Parameters:
      attributeFlagName -
      checkSecurity -
      Returns:
      true if group or stem has attribute
    • getAttributeOrAncestorAttribute

      public AttributeAssignable getAttributeOrAncestorAttribute(String attributeFlagName, boolean checkSecurity, String uuidOfMetadataAttributeDefName0, String metadataValue0, String uuidOfMetadataAttributeDefName1, String metadataValue1)
      see if a group or parent or ancestor folder has an attribute. this can run securely.
      Parameters:
      attributeFlagName -
      checkSecurity -
      uuidOfMetadataAttributeDefName0 - uuid of an attributeDefName metadata attribute (null means dont check)
      metadataValue0 - string value of the metadata attribute
      uuidOfMetadataAttributeDefName1 - uuid of a second attributeDefName metadata attribute (null means dont check)
      metadataValue1 - string value of a second metadata attribuet
      Returns:
      true if group or stem has attribute