Class GroupSet

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

public class GroupSet extends GrouperAPI implements GrouperHasContext, Hib3GrouperVersioned
See Also:
  • Field Details

    • COLUMN_ID

      public static final String COLUMN_ID
      db id for this row
      See Also:
    • COLUMN_CONTEXT_ID

      public static final String COLUMN_CONTEXT_ID
      Context id links together multiple operations into one high level action
      See Also:
    • COLUMN_FIELD_ID

      public static final String COLUMN_FIELD_ID
      field represented by this group set
      See Also:
    • COLUMN_MSHIP_TYPE

      public static final String COLUMN_MSHIP_TYPE
      type of membership represented by this group set, immediate or composite or effective
      See Also:
    • COLUMN_VIA_GROUP_ID

      public static final String COLUMN_VIA_GROUP_ID
      same as member_group_id if depth is greater than 0, otherwise null.
      See Also:
    • COLUMN_DEPTH

      public static final String COLUMN_DEPTH
      number of hops in directed graph
      See Also:
    • COLUMN_PARENT_ID

      public static final String COLUMN_PARENT_ID
      parent group set
      See Also:
    • COLUMN_CREATOR_ID

      public static final String COLUMN_CREATOR_ID
      member uuid of the creator of this record
      See Also:
    • COLUMN_CREATE_TIME

      public static final String COLUMN_CREATE_TIME
      number of millis since 1970 that this record was created
      See Also:
    • COLUMN_OWNER_ID

      public static final String COLUMN_OWNER_ID
      owner id
      See Also:
    • COLUMN_OWNER_GROUP_ID

      public static final String COLUMN_OWNER_GROUP_ID
      owner group if applicable
      See Also:
    • COLUMN_OWNER_GROUP_ID_NULL

      public static final String COLUMN_OWNER_GROUP_ID_NULL
      same as owner_group_id except nulls are replaced with the string ''
      See Also:
    • COLUMN_OWNER_ATTR_DEF_ID

      public static final String COLUMN_OWNER_ATTR_DEF_ID
      owner attribute def if applicable
      See Also:
    • COLUMN_OWNER_ATTR_DEF_ID_NULL

      public static final String COLUMN_OWNER_ATTR_DEF_ID_NULL
      same as owner_attr_def_id except nulls are replaced with the string ''
      See Also:
    • COLUMN_OWNER_STEM_ID

      public static final String COLUMN_OWNER_STEM_ID
      owner stem if applicable
      See Also:
    • COLUMN_OWNER_STEM_ID_NULL

      public static final String COLUMN_OWNER_STEM_ID_NULL
      same as owner_stem_id except nulls are replaced with the string ''
      See Also:
    • COLUMN_MEMBER_GROUP_ID

      public static final String COLUMN_MEMBER_GROUP_ID
      member group if applicable
      See Also:
    • COLUMN_MEMBER_ATTR_DEF_ID

      public static final String COLUMN_MEMBER_ATTR_DEF_ID
      member attr def if applicable
      See Also:
    • COLUMN_MEMBER_STEM_ID

      public static final String COLUMN_MEMBER_STEM_ID
      member stem if applicable
      See Also:
    • COLUMN_MEMBER_ID

      public static final String COLUMN_MEMBER_ID
      member id
      See Also:
    • COLUMN_MEMBER_FIELD_ID

      public static final String COLUMN_MEMBER_FIELD_ID
      field id used in joining this record with entries in grouper_memberships
      See Also:
    • FIELD_CONTEXT_ID

      public static final String FIELD_CONTEXT_ID
      constant for field name for: contextId
      See Also:
    • FIELD_CREATE_TIME

      public static final String FIELD_CREATE_TIME
      constant for field name for: createTime
      See Also:
    • FIELD_CREATOR_ID

      public static final String FIELD_CREATOR_ID
      constant for field name for: creatorId
      See Also:
    • FIELD_DEPTH

      public static final String FIELD_DEPTH
      constant for field name for: depth
      See Also:
    • FIELD_VIA_GROUP_ID

      public static final String FIELD_VIA_GROUP_ID
      constant for field name for: viaGroupId
      See Also:
    • FIELD_FIELD_ID

      public static final String FIELD_FIELD_ID
      constant for field name for: fieldId
      See Also:
    • FIELD_MSHIP_TYPE

      public static final String FIELD_MSHIP_TYPE
      constant for field name for: type
      See Also:
    • FIELD_ID

      public static final String FIELD_ID
      constant for field name for: id
      See Also:
    • FIELD_MEMBER_GROUP_ID

      public static final String FIELD_MEMBER_GROUP_ID
      constant for field name for: memberGroupId
      See Also:
    • FIELD_MEMBER_STEM_ID

      public static final String FIELD_MEMBER_STEM_ID
      constant for field name for: memberStemId
      See Also:
    • FIELD_OWNER_ID

      public static final String FIELD_OWNER_ID
      constant for field name for: ownerId
      See Also:
    • FIELD_OWNER_GROUP_ID

      public static final String FIELD_OWNER_GROUP_ID
      constant for field name for: ownerGroupId
      See Also:
    • FIELD_OWNER_GROUP_ID_NULL

      public static final String FIELD_OWNER_GROUP_ID_NULL
      constant for field name for: ownerGroupIdNull
      See Also:
    • FIELD_OWNER_STEM_ID

      public static final String FIELD_OWNER_STEM_ID
      constant for field name for: ownerStemId
      See Also:
    • FIELD_OWNER_STEM_ID_NULL

      public static final String FIELD_OWNER_STEM_ID_NULL
      constant for field name for: ownerStemIdNull
      See Also:
    • FIELD_PARENT_ID

      public static final String FIELD_PARENT_ID
      constant for field name for: parentId
      See Also:
    • FIELD_MEMBER_FIELD_ID

      public static final String FIELD_MEMBER_FIELD_ID
      constant for field name for: memberFieldId
      See Also:
    • TABLE_GROUPER_GROUP_SET

      public static final String TABLE_GROUPER_GROUP_SET
      name of the group set table in the database.
      See Also:
    • nullColumnValue

      public static final String nullColumnValue
      the value we're storing in the db for nulls that need a value so that we can add a unique constraint.
      See Also:
  • Constructor Details

    • GroupSet

      public GroupSet()
  • Method Details

    • toString

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

      public boolean equals(Object other)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • clone

      public GrouperAPI clone()
      Description copied from class: GrouperAPI
      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:
    • 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:
    • onPostSave

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

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

      public boolean internal_isCircular(GroupSet newGroupSet, GroupSet startGroupSet)
      Check if the new group set being added will cause a circular group set.
      Parameters:
      newGroupSet - group set being added
      startGroupSet - group set that's a parent of newGroupSet which will be used as a starting point to check if we're forming a circular group set
      Returns:
      true if the new group set will cause a circular group set.
    • getParentGroupSet

      public GroupSet getParentGroupSet()
      Returns:
      the parent group set
    • getId

      public String getId()
      Returns:
      id
    • setId

      public void setId(String id)
      set id
      Parameters:
      id -
    • getContextId

      public String getContextId()
      Returns:
      context id
    • setContextId

      public void setContextId(String contextId)
      set context id
      Specified by:
      setContextId in interface GrouperHasContext
      Parameters:
      contextId -
    • getFieldId

      public String getFieldId()
      Returns:
      field id
    • setFieldId

      public void setFieldId(String fieldId)
      Parameters:
      fieldId -
    • getMemberFieldId

      public String getMemberFieldId()
      Returns:
      field id used in joining with grouper_memberships table
    • setMemberFieldId

      public void setMemberFieldId(String memberFieldId)
      Internal use only.
      Parameters:
      memberFieldId -
    • getDepth

      public int getDepth()
      This is 0 for self memberships (where the owner and member are the same). Otherwise, it's the number of hops in a directed graph from the member to the group.
      Returns:
      depth
    • setDepth

      public void setDepth(int depth)
      set depth
      Parameters:
      depth -
    • getViaGroupId

      public String getViaGroupId()
      Returns:
      via group id
    • setViaGroupId

      public void setViaGroupId(String viaGroupId)
      Set via group id. This is for internal use only.
      Parameters:
      viaGroupId -
    • getParentId

      public String getParentId()
      Returns:
      parent id
    • setParentId

      public void setParentId(String parentId)
      set parent id
      Parameters:
      parentId -
    • getCreatorId

      public String getCreatorId()
      Returns:
      creator
    • setCreatorId

      public void setCreatorId(String creatorId)
      set creator
      Parameters:
      creatorId -
    • getCreateTime

      public Long getCreateTime()
      Returns:
      create time
    • setCreateTime

      public void setCreateTime(Long createTime)
      set create time
      Parameters:
      createTime -
    • getOwnerId

      public String getOwnerId()
      Returns:
      owner id
    • setOwnerId

      public void setOwnerId(String ownerId)
      Set owner id. This is for internal use only.
      Parameters:
      ownerId -
    • getOwnerGroupId

      public String getOwnerGroupId()
      Returns:
      group id for the owner if this is a group membership
    • setOwnerGroupId

      public void setOwnerGroupId(String ownerGroupId)
      Set group id for the owner if this is a group membership
      Parameters:
      ownerGroupId -
    • getOwnerGroupIdNull

      public String getOwnerGroupIdNull()
      This is for internal use only. This is the same as getOwnerGroupId() except nulls are replaced with a constant string.
      Returns:
      group id for the owner if this is a group membership
    • setOwnerGroupIdNull

      public void setOwnerGroupIdNull(String ownerGroupIdNull)
      Set group id for the owner if this is a group membership. This is for internal use only.
      Parameters:
      ownerGroupIdNull -
    • getOwnerStemId

      public String getOwnerStemId()
      Returns:
      stem id for the owner if this is a stem membership
    • setOwnerStemId

      public void setOwnerStemId(String ownerStemId)
      Set stem id for the owner if this is a stem membership
      Parameters:
      ownerStemId -
    • getOwnerStemIdNull

      public String getOwnerStemIdNull()
      This is for internal use only. This is the same as getOwnerStemId() except nulls are replaced with a constant string.
      Returns:
      stem id for the owner if this is a stem membership
    • setOwnerStemIdNull

      public void setOwnerStemIdNull(String ownerStemIdNull)
      Set stem id for the owner if this is a stem membership. This is for internal use only.
      Parameters:
      ownerStemIdNull -
    • getMemberGroupId

      public String getMemberGroupId()
      Returns:
      group id for the member if the member is a group
    • setMemberGroupId

      public void setMemberGroupId(String memberGroupId)
      Set group id for the member if the member is a group
      Parameters:
      memberGroupId -
    • getMemberStemId

      public String getMemberStemId()
      Returns:
      stem id for the member if the member is a stem
    • setMemberStemId

      public void setMemberStemId(String memberStemId)
      Set stem id for the member if the member is a stem
      Parameters:
      memberStemId -
    • getType

      public String getType()
      This is 'immediate' for self memberships (owner and member are the same) except if the group is a composite in which case this will be 'composite'. For non-self memberships, this is 'effective'.
      Returns:
      membership type (immediate, effective, or composite)
    • setType

      public void setType(String type)
      set membership type
      Parameters:
      type -
    • getMemberAttrDefId

      public String getMemberAttrDefId()
      Returns:
      group id for the member if the member is a group
    • getOwnerAttrDefId

      public String getOwnerAttrDefId()
      Returns:
      attrdef id for the owner if this is a attrdef membership
    • getOwnerAttrDefIdNull

      public String getOwnerAttrDefIdNull()
      This is for internal use only. This is the same as getOwnerAttrDefId() except nulls are replaced with a constant string.
      Returns:
      attr def id for the owner if this is a attrdef membership
    • setMemberAttrDefId

      public void setMemberAttrDefId(String memberAttrDefId1)
      Set attr def id for the member if the member is a attrdef
      Parameters:
      memberAttrDefId1 -
    • setOwnerAttrDefId

      public void setOwnerAttrDefId(String ownerAttrDefId1)
      Set attrdef id for the owner if this is a attrdef membership
      Parameters:
      ownerAttrDefId1 -
    • setOwnerAttrDefIdNull

      public void setOwnerAttrDefIdNull(String ownerAttrDefIdNull1)
      Set attrdef id for the owner if this is a attrdef membership. This is for internal use only.
      Parameters:
      ownerAttrDefIdNull1 -
    • getMemberId

      public String getMemberId()
      get the member id
      Returns:
      the member id
    • setMemberId

      public void setMemberId(String member)
      This is for internal use only.
      Parameters:
      member -
    • 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:
    • delete

      public void delete(boolean forceDisablePITEntry)
      Parameters:
      forceDisablePITEntry - should only be used if we're removing a corrupt group set