Class ExternalSubject

java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.externalSubjects.ExternalSubject
All Implemented Interfaces:
HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperHasContext, GrouperUtil.FieldValuable, Serializable, org.hibernate.classic.Lifecycle

public class ExternalSubject extends GrouperAPI implements GrouperHasContext, Hib3GrouperVersioned
database object for external subject
See Also:
  • Field Details

  • Constructor Details

    • ExternalSubject

      public ExternalSubject()
  • Method Details

    • getVettedEmailAddresses

      public String getVettedEmailAddresses()
      comma separated vetted email addresses
      Returns:
      comma separated vetted email addresses
    • setVettedEmailAddresses

      public void setVettedEmailAddresses(String vettedEmailAddresses1)
      comma separated vetted email addresses
      Parameters:
      vettedEmailAddresses1 -
    • notifyWatcherAboutRegistration

      public static void notifyWatcherAboutRegistration(String identifier, String emailAddressToNotify, String emailAddressOfInvitee)
      notify watcher about a registration. If there is a problem, just log the exception
      Parameters:
      identifier -
      emailAddressToNotify -
      emailAddressOfInvitee -
    • addVettedEmailAddress

      public void addVettedEmailAddress(String vettedEmailAddress)
      add a vetted email address and store this object if necessary
      Parameters:
      vettedEmailAddress -
    • getDisabledTimeDb

      public Long getDisabledTimeDb()
      when this was disabled, or when it will be disabled
      Returns:
      the millis from 1970
    • setDisabledTimeDb

      public void setDisabledTimeDb(Long disabledTime1)
      when this was disabled, or when it will be disabled
      Parameters:
      disabledTime1 -
    • getDisabledTime

      public Date getDisabledTime()
      when this was disabled, or when it will be disabled, millis from 1970
      Returns:
      disabled time
    • setDisabledTime

      public void setDisabledTime(Date theDisabledTime1)
      when this was disabled, or when it will be disabled, millis from 1970
      Parameters:
      theDisabledTime1 -
    • isEnabled

      public boolean isEnabled()
      if this is enabled
      Returns:
      true if enabled
    • getEnabledDb

      public String getEnabledDb()
      if this is enabled
      Returns:
      T or F
    • setEnabled

      public void setEnabled(boolean enabled1)
      if this is enabled
      Parameters:
      enabled1 -
    • setEnabledDb

      public void setEnabledDb(String enabled1)
      if this is enabled, T or F
      Parameters:
      enabled1 -
    • getContextId

      public String getContextId()
      contextId links to audit tables
      Returns:
      context id
    • getSearchStringLower

      public String getSearchStringLower()
      search string to find a subject, in all lower case
      Returns:
      search string lower
    • setSearchStringLower

      public void setSearchStringLower(String searchStringLower1)
      search string to find a subject, in all lower case
      Parameters:
      searchStringLower1 -
    • getUuid

      public String getUuid()
      uuid for row
      Returns:
      uuid
    • setUuid

      public void setUuid(String uuid1)
      uuid for row
      Parameters:
      uuid1 -
    • getIdentifier

      public String getIdentifier()
      the thing that the subject uses to login
      Returns:
      identifier
    • setIdentifier

      public void setIdentifier(String identifier1)
      the thing that the subject uses to login
      Parameters:
      identifier1 -
    • getName

      public String getName()
      name of subject
      Returns:
      name
    • setName

      public void setName(String name1)
      name of subject
      Parameters:
      name1 -
    • getDescription

      public String getDescription()
      description, which is generated from other attributes
      Returns:
      description
    • setDescription

      public void setDescription(String description1)
      description, which is generated from other attributes
      Parameters:
      description1 -
    • getEmail

      public String getEmail()
      email address
      Returns:
      email
    • setEmail

      public void setEmail(String email1)
      email address
      Parameters:
      email1 -
    • getInstitution

      public String getInstitution()
      institution where the user is from
      Returns:
      institution
    • setInstitution

      public void setInstitution(String institution1)
      institution where the user is from
      Parameters:
      institution1 -
    • clone

      public ExternalSubject clone()
      deep clone the fields in this object
      Specified by:
      clone in interface GrouperCloneable
      Specified by:
      clone in class GrouperAPI
      Returns:
      the clone of the object
      See Also:
    • setContextId

      public void setContextId(String contextId1)
      contextId links to audit tables
      Specified by:
      setContextId in interface GrouperHasContext
      Parameters:
      contextId1 -
    • getCreateTime

      public Date getCreateTime()
      Get creation time for this subject.
      Returns:
      Date that this subject was created.
    • getCreateTimeDb

      public long getCreateTimeDb()
      Returns:
      create time
    • getCreatorMemberId

      public String getCreatorMemberId()
      Returns:
      creator
    • getModifierMemberId

      public String getModifierMemberId()
      Returns:
      the modifier member id
    • setCreateTimeDb

      public void setCreateTimeDb(long createTime1)
      create time
      Parameters:
      createTime1 -
    • setCreatorMemberId

      public void setCreatorMemberId(String creatorMemberId1)
      member id of creator
      Parameters:
      creatorMemberId1 -
    • setModifierMemberId

      public void setModifierMemberId(String modifierMemberId1)
      member id of modifier
      Parameters:
      modifierMemberId1 -
    • setModifyTimeDb

      public void setModifyTimeDb(long modifyTime1)
      last time modified
      Parameters:
      modifyTime1 -
    • getModifyTime

      public Date getModifyTime()
      Get modify time for this subject.
      Returns:
      Date that this subject was created.
    • getModifyTimeDb

      public long getModifyTimeDb()
      Returns:
      modify time
    • subjectCanEditExternalUser

      public static boolean subjectCanEditExternalUser(Subject subject)
      see if someone is allowed to edit, cache for 1 minute, note, this method has no security
      Parameters:
      subject -
      Returns:
      true if allowed to edit
    • onPreSave

      public void onPreSave(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before a save (insert) occurs
      Specified by:
      onPreSave in interface HibGrouperLifecycle
      Overrides:
      onPreSave in class GrouperAPI
      See Also:
    • onPreUpdate

      public void onPreUpdate(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before an update occurs
      Specified by:
      onPreUpdate in interface HibGrouperLifecycle
      Overrides:
      onPreUpdate in class GrouperAPI
      See Also:
    • store

      public void store()
      store this object to the DB.
    • retrieveFieldValue

      public String retrieveFieldValue(String fieldOrAttributeName)
      get the value by field name or attribute
      Parameters:
      fieldOrAttributeName -
      Returns:
      the value
    • store

      public void store(Set<ExternalSubjectAttribute> externalSubjectAttributes, String externalSubjectInviteName, boolean validateAttributes, boolean autoaddGroups, boolean fromRecalcDaemon)
      store this object to the DB.
      Parameters:
      externalSubjectAttributes - null to not worry, not null to affect the external subject attributes too
      externalSubjectInviteName - is a variable you could put in the URL to pass to the hook so you can add the users to custom groups or whatnot
      validateAttributes - if required attributes should be validated
      autoaddGroups - if groups should be auto-added (e.g. not from daemon)
      fromRecalcDaemon - if the recalc daemon is doing the storing
    • validateIdentifier

      public void validateIdentifier()
      validate that the identifier is ok, based on grouper.properties
    • sourceName

      public static String sourceName()
      source name for external subjects
      Returns:
      name
    • sourceId

      public static String sourceId()
      source id for external subjects
      Returns:
      id
    • delete

      public void delete()
      delete this object from the DB.
    • internal_fixDisabled

      public static int internal_fixDisabled()
      fix enabled and disabled memberships, and return the count of how many were fixed
      Returns:
      the number of records affected
    • internal_daemonCalcFields

      public static int internal_daemonCalcFields()
      fix enabled and disabled memberships, and return the count of how many were fixed
      Returns:
      the number of records affected
    • assignAttribute

      public boolean assignAttribute(String attributeName, String attributeValue)
      assign an attribute to this subject, change value if already exists, add if not
      Parameters:
      attributeName -
      attributeValue -
      Returns:
      true if changed anything, false if not
    • retrieveAttributes

      public Set<ExternalSubjectAttribute> retrieveAttributes()
      get all attributes for this subject
      Returns:
      the attributes
    • retrieveAttribute

      public ExternalSubjectAttribute retrieveAttribute(String attributeName, boolean exceptionIfNotFound)
      get an attributes for this subject
      Parameters:
      attributeName -
      exceptionIfNotFound -
      Returns:
      the attributes
    • toString

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

      public boolean removeAttribute(String attributeName)
      remove an attribute
      Parameters:
      attributeName -
      Returns:
      true if did anything