Class AttributeAssignSave

java.lang.Object
edu.internet2.middleware.grouper.attr.assign.AttributeAssignSave

public class AttributeAssignSave extends Object
Use this class to insert or update an attribute assign e.g. attributeAssign = new AttributeAssignSave(grouperSession).assignOwnerStemName("test:testFolder").assignNameOfAttributeName("a:b"c).save();
  • Constructor Details

    • AttributeAssignSave

      public AttributeAssignSave(GrouperSession theGrouperSession)
      create a new attribute assign save
      Parameters:
      theGrouperSession -
  • Method Details

    • assignPrintChangesToSystemOut

      public AttributeAssignSave assignPrintChangesToSystemOut(boolean thePrintChangesToSystemOut)
      if changes should be printed as system out
      Parameters:
      thePrintChangesToSystemOut -
      Returns:
      this for chaining
    • printChangesToSystemOutThreadlocal

      public static boolean printChangesToSystemOutThreadlocal()
      if should print changes to standard out
      Returns:
      if should print
    • inSaveThreadlocal

      public static boolean inSaveThreadlocal()
      if we are in the middle of saving (then maybe ignore some rules)
      Returns:
      if in the middle of saving
    • assignSaveMode

      public AttributeAssignSave assignSaveMode(SaveMode theSaveMode)
      assign save mode
      Parameters:
      theSaveMode -
      Returns:
      this for chaining
    • assignAttributeAssignDelegatable

      public AttributeAssignSave assignAttributeAssignDelegatable(AttributeAssignDelegatable theAttributeAssignDelegatable)
      if the subjects assigned to the attribute can delegate to someone else, or delegate as delegatable
      Parameters:
      theAttributeAssignDelegatable -
      Returns:
      this for chaining
    • assignAttributeAssignType

      public AttributeAssignSave assignAttributeAssignType(AttributeAssignType theAttributeAssignType)
      type of assignment
      Parameters:
      theAttributeAssignType -
      Returns:
      this for chaining
    • assignAttributeDefNameId

      public AttributeAssignSave assignAttributeDefNameId(String theAttributeDefNameId)
      attribute name in this assignment as opposed to nameOfAttributeDefName
      Parameters:
      theAttributeDefNameId -
      Returns:
      this for chaining
    • assignAttributeDefName

      public AttributeAssignSave assignAttributeDefName(AttributeDefName theAttributeDefName)
      attribute name in this assignment as opposed to nameOfAttributeDefName
      Parameters:
      theAttributeDefName -
      Returns:
      this for chaining
    • assignNameOfAttributeDefName

      public AttributeAssignSave assignNameOfAttributeDefName(String theNameOfAttributeDefName)
      attribute name in this assignment as opposed to attributeDefNameId
      Parameters:
      theNameOfAttributeDefName -
      Returns:
      this for chaining
    • assignDisabledTime

      public AttributeAssignSave assignDisabledTime(Long theDisabledTime)
      if there is a date here, and it is in the past, this assignment is disabled
      Parameters:
      theDisabledTime -
      Returns:
      this for chaining
    • assignDisabledTime

      public AttributeAssignSave assignDisabledTime(Timestamp theDisabledTimestamp)
      if there is a date here, and it is in the past, this assignment is disabled
      Parameters:
      theDisabledTimestamp -
      Returns:
      this for chaining
    • assignDisallowed

      public AttributeAssignSave assignDisallowed(boolean theDisallowed)
      if this is a permission, then if this permission assignment is allowed or not
      Parameters:
      theDisallowed -
      Returns:
      this for chaining
    • assignEnabledTime

      public AttributeAssignSave assignEnabledTime(Long theEnabledTimeDb)
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Parameters:
      theEnabledTimeDb -
      Returns:
      this for chaining
    • assignEnabledTimestamp

      public AttributeAssignSave assignEnabledTimestamp(Timestamp theEnabledTimestamp)
      if there is a date here, and it is in the future, this assignment is disabled until that time
      Parameters:
      theEnabledTimestamp -
      Returns:
      this for chaining
    • assignId

      public AttributeAssignSave assignId(String theId)
      id of this attribute assign
      Parameters:
      theId -
      Returns:
      this for chaining
    • assignNotes

      public AttributeAssignSave assignNotes(String theNotes)
      notes about this assignment, free-form text
      Parameters:
      theNotes -
      Returns:
      this for chaining
    • assignOwnerAttributeAssignId

      public AttributeAssignSave assignOwnerAttributeAssignId(String theOwnerAttributeAssignId)
      if this is an attribute assign attribute, this is the foreign key
      Parameters:
      theOwnerAttributeAssignId -
      Returns:
      this for chaining
    • assignOwnerAttributeAssign

      public AttributeAssignSave assignOwnerAttributeAssign(AttributeAssign theOwnerAttributeAssign)
      if this is an attribute assign attribute, this is the foreign key
      Parameters:
      theOwnerAttributeAssign -
      Returns:
      this for chaining
    • assignOwnerAttributeDefId

      public AttributeAssignSave assignOwnerAttributeDefId(String theOwnerAttributeDefId)
      if this is an attribute def attribute, this is the foreign key, mutually exclusive with ownerNameOfAttributeDef
      Parameters:
      theOwnerAttributeDefId -
      Returns:
      this for chaining
    • assignOwnerAttributeDef

      public AttributeAssignSave assignOwnerAttributeDef(AttributeDef theOwnerAttributeDef)
      if this is an attribute def attribute, this is the foreign key
      Parameters:
      theOwnerAttributeDef -
      Returns:
      this for chaining
    • assignOwnerNameOfAttributeDef

      public AttributeAssignSave assignOwnerNameOfAttributeDef(String theOwnerNameOfAttributeDef)
      if this is an attribute def attribute, this is the foreign key mutually exclusive with ownerAttributeDefId
      Parameters:
      theOwnerNameOfAttributeDef -
      Returns:
      this for chaining
    • assignOwnerGroupId

      public AttributeAssignSave assignOwnerGroupId(String theOwnerGroupId)
      if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupName
      Parameters:
      theOwnerGroupId -
      Returns:
      this for chaining
    • assignOwnerGroupName

      public AttributeAssignSave assignOwnerGroupName(String theOwnerGroupName)
      if this is a group attribute, this is the foreign key mutually exclusive with ownerGroupId
      Parameters:
      theOwnerGroupName -
      Returns:
      this for chaining
    • assignOwnerGroup

      public AttributeAssignSave assignOwnerGroup(Group theOwnerGroup)
      if this is a group attribute, this is the foreign key
      Parameters:
      theOwnerGroup -
      Returns:
      this for chaining
    • assignOwnerMemberId

      public AttributeAssignSave assignOwnerMemberId(String theOwnerMemberId)
      if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberSubjectId(entifier) and ownerMemberSourceId
      Parameters:
      theOwnerMemberId -
      Returns:
      this for chaining
    • assignOwnerMember

      public AttributeAssignSave assignOwnerMember(Member theOwnerMember)
      if this is a member attribute, this is the foreign key
      Parameters:
      theOwnerMember -
      Returns:
      this for chaining
    • assignOwnerMemberSubjectId

      public AttributeAssignSave assignOwnerMemberSubjectId(String theOwnerMemberSubjectId)
      if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceId
      Parameters:
      theOwnerMemberSubjectId -
      Returns:
      this for chaining
    • assignOwnerMemberSubjectIdentifier

      public AttributeAssignSave assignOwnerMemberSubjectIdentifier(String theOwnerMemberSubjectIdentifier)
      if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSourceId
      Parameters:
      theOwnerMemberSubjectIdentifier -
      Returns:
      this for chaining
    • assignOwnerMemberSourceId

      public AttributeAssignSave assignOwnerMemberSourceId(String theOwnerMemberSourceId)
      if this is a member attribute, this is the foreign key, mutually exclusive with ownerMemberId, also need to pass in ownerMemberSubjectId or ownerMemberSubjectIdentifier
      Parameters:
      theOwnerMemberSourceId -
      Returns:
      this for chaining
    • assignOwnerMembershipId

      public AttributeAssignSave assignOwnerMembershipId(String theOwnerMembershipId)
      if this is a membership attribute, this is the foreign key. mutually exclusive with group and member foreign keys
      Parameters:
      theOwnerMembershipId -
      Returns:
      this for chaining
    • assignOwnerMembership

      public AttributeAssignSave assignOwnerMembership(Membership theOwnerMembership)
      if this is a membership attribute, this is the foreign key. mutually exclusive with group and member foreign keys
      Parameters:
      theOwnerMembership -
      Returns:
      this for chaining
    • assignOwnerStemId

      public AttributeAssignSave assignOwnerStemId(String theOwnerStemId)
      if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemName
      Parameters:
      theOwnerStemId -
      Returns:
      this for chaining
    • assignOwnerStem

      public AttributeAssignSave assignOwnerStem(Stem theOwnerStem)
      if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemName
      Parameters:
      theOwnerStem -
      Returns:
      this for chaining
    • assignOwnerStemName

      public AttributeAssignSave assignOwnerStemName(String theOwnerStemName)
      if this is a stem attribute, this is the foreign key, mutually exclusive with ownerStemId
      Parameters:
      theOwnerStemName -
      Returns:
      this for chaining
    • getSaveResultType

      public SaveResultType getSaveResultType()
      get the save type
      Returns:
      save type
    • assignAttributeAssignActionId

      public AttributeAssignSave assignAttributeAssignActionId(String theAttributeAssignActionId)
      assign the action id for the action on this assignment
      Parameters:
      theAttributeAssignActionId -
      Returns:
      the id of the action on this assignment
    • assignAction

      public AttributeAssignSave assignAction(String theAction)
      assign the action
      Parameters:
      theAction -
      Returns:
      this for chaining
    • assignPutAttributeAssignIdsToNotUseSet

      public AttributeAssignSave assignPutAttributeAssignIdsToNotUseSet(boolean thePutAttributeAssignIdsToNotUseSet)
      if the attribute assign ids should be added to the set to not use
      Parameters:
      thePutAttributeAssignIdsToNotUseSet -
      Returns:
      this for chaining
    • assignAttributeAssignIdsToNotUse

      public AttributeAssignSave assignAttributeAssignIdsToNotUse(Set<String> theAttributeAssignIdsToNotUse)
      if doing an import, these are id's which should not be used. The current assignment will be added to this list
      Parameters:
      theAttributeAssignIdsToNotUse -
      Returns:
      this for chaining
    • addAttributeAssignValue

      public AttributeAssignSave addAttributeAssignValue(AttributeAssignValue attributeAssignValue)
      add a value to assign to this assignment. add null if remove all
      Parameters:
      attributeAssignValue -
      Returns:
      this for chaining
    • addValue

      public AttributeAssignSave addValue(Object theValue)
      add a value to an attribute assignment
      Parameters:
      theValue -
      Returns:
      this for chaining
    • addAttributeAssignOnThisAssignment

      public AttributeAssignSave addAttributeAssignOnThisAssignment(AttributeAssignSave theAttributeAssignSave)
      if including assignments on this assignment, put them here, put in null to remove assignments
      Parameters:
      theAttributeAssignSave -
      Returns:
      this for chaining
    • save

       create or update an attribute assignment
       
       Steps:
       
       1. Find an existing attribute assignment
       2. Internally set all the fields of the assignment
       3. Store the assignment (insert or update) if needed
       4. Manage assignments on assignments and values
       5. Return the assignment object
       
       This runs in a tx so that if part of it fails the whole thing fails, and potentially the outer
       transaction too
       
       
      Returns:
      the assignment
      Throws:
      StemNotFoundException
      InsufficientPrivilegeException
      GroupNotFoundException
      AttributeDefNameNotFoundException
    • getChangesCount

      public int getChangesCount()
      count how many things were changed (attributes values etc)
      Returns:
      change count
    • getAttributeAssignValues

      public Set<AttributeAssignValue> getAttributeAssignValues()
      migrate values to attribute assign values if needed
      Returns:
      the attribute assign values
    • findExistingAttributeAssignment

      public void findExistingAttributeAssignment()
      find an existing assignment that is similar this request