Class ExternalSubjectSave

java.lang.Object
edu.internet2.middleware.grouper.externalSubjects.ExternalSubjectSave

public class ExternalSubjectSave extends Object
Use this class to insert or update a external subject
  • Constructor Details

    • ExternalSubjectSave

      public ExternalSubjectSave(GrouperSession theGrouperSession)
      create a new external subject save
      Parameters:
      theGrouperSession -
  • Method Details

    • assignAttributes

      public ExternalSubjectSave assignAttributes(Map<String,String> theAttributes)
      assign attributes
      Parameters:
      theAttributes -
      Returns:
      this for chaining
    • addAttribute

      public ExternalSubjectSave addAttribute(String name, String value)
      add an attribute assignment
      Parameters:
      name -
      value -
      Returns:
      this for chaining
    • assignIdentifierToEdit

      public ExternalSubjectSave assignIdentifierToEdit(String theIdentifierToEdit)
      identifier to edit
      Parameters:
      theIdentifierToEdit -
      Returns:
      the identifier to edit
    • assignUuid

      public ExternalSubjectSave assignUuid(String theUuid)
      uuid
      Parameters:
      theUuid -
      Returns:
      uuid
    • assignIdentifier

      public ExternalSubjectSave assignIdentifier(String theIdentifier)
      Parameters:
      theIdentifier -
      Returns:
      this for chaining
    • assignInstitution

      public ExternalSubjectSave assignInstitution(String theInstitution)
      Parameters:
      theInstitution -
      Returns:
      this for chaining
    • assignEnabled

      public ExternalSubjectSave assignEnabled(boolean theEnabled)
      Parameters:
      theEnabled -
      Returns:
      this for chaining
    • assignEmail

      public ExternalSubjectSave assignEmail(String theEmail)
      Parameters:
      theEmail -
      Returns:
      this for chaining
    • assignName

      public ExternalSubjectSave assignName(String name1)
      name
      Parameters:
      name1 -
      Returns:
      name
    • assignSaveMode

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

      public ExternalSubjectSave assignVettedEmailAddresses(String theVettedEmailAddresses)
      Parameters:
      theVettedEmailAddresses -
      Returns:
      this for chaining
    • getSaveResultType

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

      public ExternalSubject save()
       create or update a external subject.
       
       Steps:
       
       1. Find the external subject by identifierToEdit
       2. Internally set all the fields of the stem (no need to reset if already the same)
       3. Store the external subject (insert or update) if needed
       4. Return the external subject 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 external subject
      Throws:
      InsufficientPrivilegeException