Class AttributeDefSave

java.lang.Object
edu.internet2.middleware.grouper.attr.AttributeDefSave

public class AttributeDefSave extends Object

Use this class to insert or update an attribute definition

Sample call

 AttributeDefSave attributeDefSave = new AttributeDefSave(grouperSession)
    .assignName("top:b").assignDescription("whatever").assignValueType(AttributeDefValueType.string).assignMultiValued(true);
 AttributeDef attributeDef = attributeDefSave.save();
 System.out.println(attributeDefSave.getSaveResultType()); // INSERT, NO_CHANGE, or UPDATE
 

Sample call to update only one attribute

 new AttributeDefSave(grouperSession)
      .assignName("top:b").assignMultiValued(true).assignReplaceAllSettings(false).save();
 

  • Constructor Details

    • AttributeDefSave

      public AttributeDefSave(GrouperSession theGrouperSession)
      create a new attribute def save
      Parameters:
      theGrouperSession -
    • AttributeDefSave

      public AttributeDefSave()
      create a new attribute def save
      Parameters:
      theGrouperSession -
  • Method Details

    • getAttributeDefNameToEdit

      public String getAttributeDefNameToEdit()
    • getName

      public String getName()
    • assignIdIndex

      public AttributeDefSave assignIdIndex(Long theIdIndex)
      assign id_index
      Parameters:
      theIdIndex -
      Returns:
      this for chaining
    • assignAttributeDefNameToEdit

      public AttributeDefSave assignAttributeDefNameToEdit(String theAttributeDefNameToEdit)
      attributeDef name to edit
      Parameters:
      theAttributeDefNameToEdit -
      Returns:
      the attributeDef name to edit
    • assignId

      public AttributeDefSave assignId(String theId)
      uuid
      Parameters:
      theUuid -
      Returns:
      uuid
    • assignName

      public AttributeDefSave assignName(String name1)
      name
      Parameters:
      name1 -
      Returns:
      name
    • assignDescription

      public AttributeDefSave assignDescription(String theDescription)
      assign description
      Parameters:
      theDescription -
      Returns:
      this for chaining
    • assignSaveMode

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

      public AttributeDefSave assignCreateParentStemsIfNotExist(boolean theCreateParentStemsIfNotExist)
      assign create parents if not exist
      Parameters:
      theCreateParentStemsIfNotExist -
      Returns:
      this for chaining
    • assignToAttributeDef

      public AttributeDefSave assignToAttributeDef(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToAttributeDefAssn

      public AttributeDefSave assignToAttributeDefAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToEffMembership

      public AttributeDefSave assignToEffMembership(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToEffMembershipAssn

      public AttributeDefSave assignToEffMembershipAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToGroup

      public AttributeDefSave assignToGroup(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToGroupAssn

      public AttributeDefSave assignToGroupAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToImmMembership

      public AttributeDefSave assignToImmMembership(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToImmMembershipAssn

      public AttributeDefSave assignToImmMembershipAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToMember

      public AttributeDefSave assignToMember(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToMemberAssn

      public AttributeDefSave assignToMemberAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToStem

      public AttributeDefSave assignToStem(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignToStemAssn

      public AttributeDefSave assignToStemAssn(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignAttributeDefPublic

      public AttributeDefSave assignAttributeDefPublic(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignAttributeDefType

      public AttributeDefSave assignAttributeDefType(AttributeDefType theAttributeDefType)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignMultiAssignable

      public AttributeDefSave assignMultiAssignable(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • assignMultiValued

      public AttributeDefSave assignMultiValued(boolean theBoolean)
      if assign
      Parameters:
      theBoolean -
      Returns:
      self for chaining
    • assignReplaceAllSettings

      public AttributeDefSave assignReplaceAllSettings(boolean theReplaceAllSettings)
      replace all existing settings. defaults to true.
      Returns:
      this for chaining
    • assignValueType

      public AttributeDefSave assignValueType(AttributeDefValueType attributeDefValueType)
      if assign
      Parameters:
      theBoolean -
      Returns:
      this for chaining
    • getSaveResultType

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

       create or update an attribute def.  Note this will not rename an attribute def at this time (might in future)
       
       Steps:
       
       1. Find the attributeDef by attributeDefNameToEdit
       2. Internally set all the fields of the attributeDef (no need to reset if already the same)
       3. Store the attributeDef (insert or update) if needed
       4. Return the attributeDef 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 attributeDef
      Throws:
      StemNotFoundException
      InsufficientPrivilegeException
      StemAddException
    • assignPrivAllAdmin

      public AttributeDefSave assignPrivAllAdmin(boolean thePrivAllAdmin)
      assign priv admin to be different than the defaults for grouperAll
      Parameters:
      thePrivAllAdmin -
      Returns:
      this for chaining
    • assignPrivAllAttrRead

      public AttributeDefSave assignPrivAllAttrRead(boolean thePrivAllAttrRead)
      assign priv attr read to be different than the defaults for grouperAll
      Parameters:
      thePrivAllAttrRead -
      Returns:
      this for chaining
    • assignPrivAllAttrUpdate

      public AttributeDefSave assignPrivAllAttrUpdate(boolean thePrivAllAttrUpdate)
      assign priv attr update to be different than the defaults for grouperAll
      Parameters:
      thePrivAllAttrUpdate -
      Returns:
      this for chaining
    • assignPrivAllOptin

      public AttributeDefSave assignPrivAllOptin(boolean thePrivAllOptin)
      assign priv optin to be different than the defaults for grouperAll
      Parameters:
      thePrivAllOptin -
      Returns:
      this for chaining
    • assignPrivAllOptout

      public AttributeDefSave assignPrivAllOptout(boolean thePrivAllOptout)
      assign priv optout to be different than the defaults for grouperAll
      Parameters:
      thePrivAllOptout -
      Returns:
      this for chaining
    • assignPrivAllRead

      public AttributeDefSave assignPrivAllRead(boolean thePrivAllRead)
      assign priv read to be different than the defaults for grouperAll
      Parameters:
      thePrivAllRead -
      Returns:
      this for chaining
    • assignPrivAllUpdate

      public AttributeDefSave assignPrivAllUpdate(boolean thePrivAllUpdate)
      assign priv update to be different than the defaults for grouperAll
      Parameters:
      thePrivAllUpdate -
      Returns:
      this for chaining
    • assignPrivAllView

      public AttributeDefSave assignPrivAllView(boolean thePrivAllView)
      assign priv view to be different than the defaults for grouperAll
      Parameters:
      thePrivAllView -
      Returns:
      this for chaining