Class Group

java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Group
All Implemented Interfaces:
AttributeAssignable, Entity, GrouperSetElement, HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperHasContext, GrouperId, GrouperObject, Owner, Role, GrouperUtil.FieldValuable, XmlImportable<Group>, XmlImportableBase<Group>, Serializable, Comparable, org.hibernate.classic.Lifecycle

A group within the Groups Registry.

Version:
$Id: Group.java,v 1.269 2009-12-15 06:47:06 mchyzer Exp $
See Also:
  • Field Details

    • VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY

      public static final String VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY
      See Also:
    • VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY

      public static final String VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY
      See Also:
    • VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY

      public static final String VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY
      See Also:
    • VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY

      public static final String VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY
      See Also:
    • VALIDATION_GROUP_NAME_TOO_LONG_KEY

      public static final String VALIDATION_GROUP_NAME_TOO_LONG_KEY
      See Also:
    • TABLE_GROUPER_GROUPS

      public static final String TABLE_GROUPER_GROUPS
      name of the groups table in the db
      See Also:
    • COLUMN_UUID

      public static final String COLUMN_UUID
      uuid col in db (not used anymore)
      See Also:
    • COLUMN_ID

      public static final String COLUMN_ID
      id col in db
      See Also:
    • COLUMN_PARENT_STEM

      public static final String COLUMN_PARENT_STEM
      col in db
      See Also:
    • COLUMN_CREATOR_ID

      public static final String COLUMN_CREATOR_ID
      col in db
      See Also:
    • COLUMN_CREATE_TIME

      public static final String COLUMN_CREATE_TIME
      col in db
      See Also:
    • COLUMN_MODIFIER_ID

      public static final String COLUMN_MODIFIER_ID
      col in db
      See Also:
    • COLUMN_MODIFY_TIME

      public static final String COLUMN_MODIFY_TIME
      col in db
      See Also:
    • COLUMN_NAME

      public static final String COLUMN_NAME
      col in db
      See Also:
    • COLUMN_DISPLAY_NAME

      public static final String COLUMN_DISPLAY_NAME
      col in db
      See Also:
    • COLUMN_EXTENSION

      public static final String COLUMN_EXTENSION
      col in db
      See Also:
    • COLUMN_DISPLAY_EXTENSION

      public static final String COLUMN_DISPLAY_EXTENSION
      col in db
      See Also:
    • COLUMN_DESCRIPTION

      public static final String COLUMN_DESCRIPTION
      col in db
      See Also:
    • COLUMN_OLD_ID

      public static final String COLUMN_OLD_ID
      old id col for id conversion
      See Also:
    • COLUMN_OLD_UUID

      public static final String COLUMN_OLD_UUID
      old uuid id col for id conversion
      See Also:
    • COLUMN_LAST_MEMBERSHIP_CHANGE

      public static final String COLUMN_LAST_MEMBERSHIP_CHANGE
      timestamp of the last membership change for this group
      See Also:
    • COLUMN_LAST_IMMEDIATE_MEMBERSHIP_CHANGE

      public static final String COLUMN_LAST_IMMEDIATE_MEMBERSHIP_CHANGE
      timestamp of the last immediate membership change for this group
      See Also:
    • COLUMN_ALTERNATE_NAME

      public static final String COLUMN_ALTERNATE_NAME
      an alternate name for this group
      See Also:
    • COLUMN_TYPE_OF_GROUP

      public static final String COLUMN_TYPE_OF_GROUP
      if this is a group or role
      See Also:
    • COLUMN_ID_INDEX

      public static final String COLUMN_ID_INDEX
      unique number for this group
      See Also:
    • COLUMN_INTERNAL_ID

      public static final String COLUMN_INTERNAL_ID
      inernal unique number for this group
      See Also:
    • COLUMN_DISABLED_TIMESTAMP

      public static final String COLUMN_DISABLED_TIMESTAMP
      epoch time of when to disable membership
      See Also:
    • COLUMN_ENABLED_TIMESTAMP

      public static final String COLUMN_ENABLED_TIMESTAMP
      epoch time of when to enable membership
      See Also:
    • COLUMN_ENABLED

      public static final String COLUMN_ENABLED
      whether the membership is enabled or disabled: T|F
      See Also:
    • FIELD_ALTERNATE_NAME_DB

      public static final String FIELD_ALTERNATE_NAME_DB
      constant for field name for: alternateNameDb
      See Also:
    • FIELD_CREATE_TIME

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

      public static final String FIELD_CREATOR_UUID
      constant for field name for: creatorUUID
      See Also:
    • FIELD_DB_VERSION

      public static final String FIELD_DB_VERSION
      constant for field name for: dbVersion
      See Also:
    • FIELD_DESCRIPTION

      public static final String FIELD_DESCRIPTION
      constant for field name for: description
      See Also:
    • FIELD_DISPLAY_EXTENSION

      public static final String FIELD_DISPLAY_EXTENSION
      constant for field name for: displayExtension
      See Also:
    • FIELD_DISPLAY_NAME

      public static final String FIELD_DISPLAY_NAME
      constant for field name for: displayName
      See Also:
    • FIELD_EXTENSION

      public static final String FIELD_EXTENSION
      constant for field name for: extension
      See Also:
    • FIELD_ID_INDEX

      public static final String FIELD_ID_INDEX
      constant for field name for: idIndex
      See Also:
    • FIELD_INTERNAL_ID

      public static final String FIELD_INTERNAL_ID
      constant for field name for: internalId
      See Also:
    • FIELD_LAST_MEMBERSHIP_CHANGE_DB

      public static final String FIELD_LAST_MEMBERSHIP_CHANGE_DB
      constant for field name for: lastMembershipChangeDb
      See Also:
    • FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB

      public static final String FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB
      constant for field name for: lastImmediateMembershipChangeDb
      See Also:
    • FIELD_MODIFIER_UUID

      public static final String FIELD_MODIFIER_UUID
      constant for field name for: modifierUUID
      See Also:
    • FIELD_MODIFY_TIME

      public static final String FIELD_MODIFY_TIME
      constant for field name for: modifyTime
      See Also:
    • FIELD_NAME

      public static final String FIELD_NAME
      constant for field name for: name
      See Also:
    • FIELD_PARENT_UUID

      public static final String FIELD_PARENT_UUID
      constant for field name for: parentUuid
      See Also:
    • FIELD_TYPE_OF_GROUP

      public static final String FIELD_TYPE_OF_GROUP
      constant for field name for: typeOfGroup
      See Also:
    • FIELD_UUID

      public static final String FIELD_UUID
      constant for field name for: uuid
      See Also:
    • FIELD_DISABLED_TIME_DB

      public static final String FIELD_DISABLED_TIME_DB
      constant for field name for: disabledTimeDb
      See Also:
    • FIELD_ENABLED

      public static final String FIELD_ENABLED
      constant for field name for: enabled
      See Also:
    • FIELD_ENABLED_TIME_DB

      public static final String FIELD_ENABLED_TIME_DB
      constant for field name for: enabledTimeDb
      See Also:
    • INTERNAL_FIELD_ATTRIBUTES

      public static final Set<String> INTERNAL_FIELD_ATTRIBUTES
      list of internal field attributes, access with method so it can lazy load
  • Constructor Details

    • Group

      public Group()
  • Method Details

    • getComposite

      @Deprecated public Composite getComposite() throws CompositeNotFoundException
      Deprecated.
      use the overload with boolean instead
      if this is a composite group, get the composite object for this group
      Returns:
      the composite group
      Throws:
      CompositeNotFoundException - if composite not found
    • getComposite

      public Composite getComposite(boolean throwExceptionIfNotFound)
      if this is a composite group, get the composite object for this group
      Parameters:
      throwExceptionIfNotFound -
      Returns:
      the composite group or null if none
      Throws:
      CompositeNotFoundException - if not found and throwExceptionIfNotFound is true
    • saveGroup

      public static Group saveGroup(GrouperSession GROUPER_SESSION, String groupNameToEdit, String uuid, String name, String displayExtension, String description, SaveMode saveMode, boolean createParentStemsIfNotExist) throws StemNotFoundException, InsufficientPrivilegeException, StemAddException, GroupModifyException, GroupNotFoundException, GroupAddException
       create or update a group.  Note this will not rename a group at this time (might in future)
       
       This is a static method since setters to Group objects persist to the DB
       
       Steps:
       
       1. Find the group by groupNameToEdit
       2. Internally set all the fields of the stem (no need to reset if already the same)
       3. Store the group (insert or update) if needed
       4. Return the group object
       
       This runs in a tx so that if part of it fails the whole thing fails, and potentially the outer
       transaction too
       
      Parameters:
      GROUPER_SESSION - to act as
      groupNameToEdit - is the name of the group to edit (or null if insert)
      description - new description for group
      displayExtension - display friendly name for this group only (parent stems are not specified)
      name - this is required, and is the full name of the group including the names of parent stems. e.g. stem1:stem2:stem3 the parent stem must exist unless createParentStemsIfNotExist. Can rename a stem extension, but not the parent stem name (move)
      uuid - of the group. If a group exists with this uuid, then it will be updated, if not, then it will be created if createIfNotExist is true
      saveMode - to constrain if insert only or update only, if null defaults to INSERT_OR_UPDATE
      createParentStemsIfNotExist - true if the stems should be created if they dont exist, false for StemNotFoundException if not exist. Note, the display extension on created stems will equal the extension
      Returns:
      the stem that was updated or created
      Throws:
      StemNotFoundException
      InsufficientPrivilegeException
      StemAddException
      GroupModifyException
      GroupNotFoundException
      GroupAddException
    • getContextId

      public String getContextId()
      context id of the transaction
      Specified by:
      getContextId in interface Entity
      Returns:
      context id
    • setContextId

      public void setContextId(String contextId1)
      context id of the transaction
      Specified by:
      setContextId in interface GrouperHasContext
      Parameters:
      contextId1 -
    • internal_isEnabledUsingTimestamps

      public boolean internal_isEnabledUsingTimestamps()
      Should this group be enabled based on the enabled and disabled dates?
      Returns:
      boolean
    • isEnabled

      public boolean isEnabled()
      Is this group enabled?
      Returns:
      boolean
    • setEnabled

      public void setEnabled(boolean enabled)
      Whether to enable or disable this group.
      Parameters:
      enabled -
    • getEnabledDb

      public String getEnabledDb()
      Whether or not this group is enabled.
      Returns:
      the enabled
    • setEnabledDb

      public void setEnabledDb(String enabled)
      Whether to enable or disable this group.
      Parameters:
      enabled -
    • getEnabledTimeDb

      public Long getEnabledTimeDb()
      Time when this group is enabled if the value is in the future.
      Returns:
      Long
    • getEnabledTime

      public Timestamp getEnabledTime()
      Time when this group is enabled if the value is in the future.
      Returns:
      Timestamp
    • setEnabledTimeDb

      public void setEnabledTimeDb(Long enabledTimeDb)
      Set the time when this group should be enabled.
      Parameters:
      enabledTimeDb -
    • setEnabledTime

      public void setEnabledTime(Timestamp enabledTimeDb)
      Set the time when this group should be enabled.
      Parameters:
      enabledTimeDb -
    • getDisabledTimeDb

      public Long getDisabledTimeDb()
      Time when this group is disabled if the value is in the future.
      Returns:
      Long
    • getDisabledTime

      public Timestamp getDisabledTime()
      Time when this group is disabled if the value is in the future.
      Returns:
      Timestamp
    • setDisabledTimeDb

      public void setDisabledTimeDb(Long disabledTimeDb)
      Set the time to disable this group.
      Parameters:
      disabledTimeDb -
    • setDisabledTime

      public void setDisabledTime(Timestamp disabledTimeDb)
      Set the time to disable this group.
      Parameters:
      disabledTimeDb -
    • getInternalId

      public Long getInternalId()
    • setInternalId

      public void setInternalId(Long internalId)
    • getAttributeDelegate

      public AttributeAssignGroupDelegate getAttributeDelegate()
      Description copied from interface: AttributeAssignable
      get the logic delegate
      Specified by:
      getAttributeDelegate in interface AttributeAssignable
      Specified by:
      getAttributeDelegate in interface Entity
      Returns:
      the delegate
      See Also:
    • getAttributeValueDelegate

      public AttributeValueDelegate getAttributeValueDelegate()
      this delegate works on attributes and values at the same time
      Specified by:
      getAttributeValueDelegate in interface AttributeAssignable
      Specified by:
      getAttributeValueDelegate in interface Entity
      Specified by:
      getAttributeValueDelegate in interface Role
      Returns:
      the delegate
      See Also:
    • getAttributeDelegateEffMship

      public AttributeAssignEffMshipDelegate getAttributeDelegateEffMship(Member member)
      delegate for effective memberships
      Parameters:
      member -
      Returns:
      the delegate
    • getAttributeValueDelegateEffMship

      public AttributeValueDelegate getAttributeValueDelegateEffMship(Member member)
      this delegate works on attributes and values at the same time
      Parameters:
      member -
      Returns:
      the delegate
    • getAttributeDelegateMembership

      public AttributeAssignMembershipDelegate getAttributeDelegateMembership(Member member)
      delegate for effective memberships
      Parameters:
      member -
      Returns:
      the delegate
    • getAttributeDelegateMembership

      public AttributeAssignMembershipDelegate getAttributeDelegateMembership(Member member, Field field)
      delegate for effective memberships
      Parameters:
      member -
      field -
      Returns:
      the delegate
    • getAttributeValueDelegateMembership

      public AttributeValueDelegate getAttributeValueDelegateMembership(Member member, Field field)
      this delegate works on attributes and values at the same time
      Parameters:
      member -
      field -
      Returns:
      the delegate
    • getAttributeValueDelegateMembership

      public AttributeValueDelegate getAttributeValueDelegateMembership(Member member)
      this delegate works on attributes and values at the same time
      Parameters:
      member -
      Returns:
      the delegate
    • getDefaultList

      public static Field getDefaultList() throws GrouperException
      Retrieve default members Field.
       Field members = Group.getDefaultList();
       
      Returns:
      The "members" Field
      Throws:
      GrouperException
    • assignCompositeMember

      public void assignCompositeMember(CompositeType type, Group left, Group right) throws InsufficientPrivilegeException, MemberAddException, MemberDeleteException
      Add ore replace a composite membership to this group.
       try {
         g.assignCompositeMember(CompositeType.UNION, leftGroup, rightGroup);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add composite membership
       } 
       
      Parameters:
      type - Add membership of this CompositeType.
      left - Group that is left factor of of composite membership.
      right - Group that is right factor of composite membership.
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      MemberDeleteException
      Since:
      1.0
    • addCompositeMember

      public Composite addCompositeMember(CompositeType type, Group left, Group right) throws InsufficientPrivilegeException, MemberAddException
      Add a composite membership to this group.
       try {
         g.addCompositeMember(CompositeType.UNION, leftGroup, rightGroup);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add composite membership
       } 
       
      Parameters:
      type - Add membership of this CompositeType.
      left - Group that is left factor of of composite membership.
      right - Group that is right factor of composite membership.
      Returns:
      composite
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      Since:
      1.0
    • addMember

      public void addMember(Subject subj) throws InsufficientPrivilegeException, MemberAddException
      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add subject
       } 
       
      Parameters:
      subj - Add this Subject
      Throws:
      InsufficientPrivilegeException
      MemberAddException
    • addMember

      public boolean addMember(Subject subj, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException
      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add subject
       } 
       
      Specified by:
      addMember in interface Role
      Parameters:
      subj - Add this Subject
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      InsufficientPrivilegeException
      MemberAddException
    • addMember

      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj, f);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add member
       } 
       catch (SchemaException eS) {
         // Invalid Field
       } 
       
      Parameters:
      subj - Add this Subject
      f - Add subject to this Field.
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      SchemaException
    • addMember

      public boolean addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException, SchemaException
      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj, f);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add member
       } 
       catch (SchemaException eS) {
         // Invalid Field
       } 
       
      Parameters:
      subj - Add this Subject
      f - Add subject to this Field.
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      SchemaException
    • replaceMembers

      public int replaceMembers(Collection<Subject> newSubjectList)
      replace the member list with new list. Note this is not done in a tx so it can make as much progress as possible though feel free to put a tx outside of the call if you need it
      Parameters:
      newSubjectList -
      Returns:
      the number of members changed
    • replaceMembers

      public int replaceMembers(Collection<Subject> newSubjectList, Field field)
      replace the member list with new list. Note this is not done in a tx so it can make as much progress as possible though feel free to put a tx outside of the call if you need it
      Parameters:
      newSubjectList -
      field -
      Returns:
      the number of members changed
    • addMember

      @Deprecated public boolean addMember(Subject subject, boolean defaultPrivs, boolean memberChecked, boolean adminChecked, boolean updateChecked, boolean readChecked, boolean viewChecked, boolean optinChecked, boolean optoutChecked, boolean attrReadChecked, boolean attrUpdateChecked, Date startDate, Date endDate, boolean revokeIfUnchecked)
      Deprecated.
      use addOrEditMember instead
      add a member to group, take into account if any default privs should be changed
      Parameters:
      subject - to add
      defaultPrivs - if true, forget about all the other checked params
      memberChecked -
      adminChecked -
      updateChecked -
      readChecked -
      viewChecked -
      optinChecked -
      optoutChecked -
      attrReadChecked -
      attrUpdateChecked -
      startDate - on membership
      endDate - on membership
      revokeIfUnchecked -
      Returns:
      if something was changed
    • addOrEditMember

      public boolean addOrEditMember(Subject subject, boolean defaultPrivs, boolean memberChecked, boolean adminChecked, boolean updateChecked, boolean readChecked, boolean viewChecked, boolean optinChecked, boolean optoutChecked, boolean attrReadChecked, boolean attrUpdateChecked, Date startDate, Date endDate, boolean revokeIfUnchecked)
      add a member to group, take into account if any default privs should be changed
      Parameters:
      subject - to add
      defaultPrivs - if true, forget about all the other checked params
      memberChecked -
      adminChecked -
      updateChecked -
      readChecked -
      viewChecked -
      optinChecked -
      optoutChecked -
      attrReadChecked -
      attrUpdateChecked -
      startDate - on membership
      endDate - on membership
      revokeIfUnchecked -
      Returns:
      if something was changed
    • addMember

      @Deprecated public boolean addMember(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked)
      Deprecated.
      use addOrEditMember instead
      add a member to group, take into account if any default privs should be changed
      Parameters:
      subject - to add
      defaultPrivs - if true, forget about all the other checked params
      memberChecked -
      startDate - on membership
      endDate - on membership
      revokeIfUnchecked -
      Returns:
      if something was changed
    • addOrEditMember

      public boolean addOrEditMember(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked)
      add a member to group, take into account if any default privs should be changed
      Parameters:
      subject - to add
      defaultPrivs - if true, forget about all the other checked params
      memberChecked -
      startDate - on membership
      endDate - on membership
      revokeIfUnchecked -
      Returns:
      if something was changed
    • internal_addMember

      public boolean internal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate) throws InsufficientPrivilegeException, MemberAddException, SchemaException
      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj, f);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add member
       } 
       catch (SchemaException eS) {
         // Invalid Field
       } 
       
      Parameters:
      subj - Add this Subject
      f - Add subject to this Field.
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      uuid - is uuid or null for generated
      startDate -
      endDate -
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      SchemaException
    • internal_addMember

      public boolean internal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate, boolean checkSecurity) throws InsufficientPrivilegeException, MemberAddException, SchemaException
      Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.addMember(subj, f);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add members 
       }
       catch (MemberAddException eMA) {
         // Unable to add member
       } 
       catch (SchemaException eS) {
         // Invalid Field
       } 
       
      Parameters:
      subj - Add this Subject
      f - Add subject to this Field.
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      uuid - is uuid or null for generated
      startDate -
      endDate -
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      InsufficientPrivilegeException
      MemberAddException
      SchemaException
    • addType

      Deprecated.
      Add an additional group type.
       try {
         GroupType custom = GroupTypeFinder.find("custom type");
         g.addType(custom);
       }
       catch (GroupModifyException eGM) {
         // Unable to add type 
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add type
       }
       catch (SchemaException eS) {
         // Cannot add system-maintained types
       }
       
      Parameters:
      type - The GroupType to add.
      Throws:
      GroupModifyException - if unable to add type.
      InsufficientPrivilegeException - if subject not root-like.
      SchemaException - if attempting to add a system group type.
    • addType

      public boolean addType(GroupType type, boolean exceptionIfAlreadyHasType) throws GroupModifyException, InsufficientPrivilegeException, SchemaException
      Deprecated.
      Add an additional group type.
       try {
         GroupType custom = GroupTypeFinder.find("custom type");
         g.addType(custom);
       }
       catch (GroupModifyException eGM) {
         // Unable to add type 
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add type
       }
       catch (SchemaException eS) {
         // Cannot add system-maintained types
       }
       
      Parameters:
      type - The GroupType to add.
      exceptionIfAlreadyHasType -
      Returns:
      if it was added or not
      Throws:
      GroupModifyException - if unable to add type.
      InsufficientPrivilegeException - if subject not root-like.
      SchemaException - if attempting to add a system group type.
    • internal_addType

      public boolean internal_addType(GroupType type, String groupTypeAssignmentId, boolean exceptionIfAlreadyHasType) throws GroupModifyException, InsufficientPrivilegeException, SchemaException
      Parameters:
      type -
      groupTypeAssignmentId -
      exceptionIfAlreadyHasType -
      Returns:
      if it was added or not
      Throws:
      GroupModifyException
      InsufficientPrivilegeException
      SchemaException
    • canReadField

      public boolean canReadField(Field f) throws IllegalArgumentException, SchemaException
      Check whether the Subject that loaded this Group can read the specified Field.
       try {
         boolean rv = g.canReadField(f);
       }
       catch (SchemaException eS) {
         // invalid field
       }
       
      Parameters:
      f - Check privileges on this Field.
      Returns:
      True if Subject can read Field, false otherwise.
      Throws:
      IllegalArgumentException - if null Field
      SchemaException - if invalid Field
      Since:
      1.0
    • canReadField

      public boolean canReadField(Subject subj, Field f) throws IllegalArgumentException, SchemaException
      Check whether the specified Subject can read the specified Field.
       try {
         boolean rv = g.canReadField(subj, f);
       }
       catch (SchemaException eS) {
         // invalid field
       }
       
      Parameters:
      subj - Check privileges for this Subject.
      f - Check privileges on this Field.
      Returns:
      True if Subject can read Field, false otherwise.
      Throws:
      IllegalArgumentException - if null Subject or Field
      SchemaException - if invalid Field or Subject.
      Since:
      1.2.0
    • canWriteField

      public boolean canWriteField(Field f) throws IllegalArgumentException, SchemaException
      Check whether the Subject that loaded this Group can write the specified Field.
       try {
         boolean rv = g.canWriteField(f);
       }
       catch (SchemaException eS) {
         // invalid field
       }
       
      Parameters:
      f - Check privileges on this Field.
      Returns:
      True if Subject can write Field, false otherwise.
      Throws:
      IllegalArgumentException - if null Field
      SchemaException - if invalid Field
      Since:
      1.0
    • canWriteField

      public boolean canWriteField(Subject subj, Field f) throws IllegalArgumentException, SchemaException
      Check whether the specified Subject can write the specified Field.
       try {
         boolean rv = g.canWriteField(subj, f);
       }
       catch (SchemaException eS) {
         // invalid field
       }
       
      Parameters:
      subj - Check privileges for this Subject.
      f - Check privileges on this Field.
      Returns:
      True if Subject can write Field, false otherwise.
      Throws:
      IllegalArgumentException - if null Subject or Field
      SchemaException - if invalid Field
      Since:
      1.0
    • deleteOccuring

      public static boolean deleteOccuring()
      see if we are in the middle of a delete (e.g. for hook)
      Returns:
      true if delete is occurring
    • delete

      Delete this group from the Groups Registry.
       try {
         g.delete();
       }
       catch (GroupDeleteException e0) {
         // Unable to delete group
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to delete this group
       }
       
      Specified by:
      delete in interface Entity
      Specified by:
      delete in interface Role
      Throws:
      GroupDeleteException
      InsufficientPrivilegeException
    • deleteAttribute

      Deprecated.
      Delete a group attribute.
       try {
         g.deleteAttribute(attribute);
       }
       catch (GroupModifyException e0) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to delete this attribute
       }
       
      Parameters:
      attrName - Delete this attribute.
      Throws:
      AttributeNotFoundException
      GroupModifyException
      InsufficientPrivilegeException
    • deleteAttribute

      public void deleteAttribute(String attrName, boolean failOnRequiredAttribute) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException
      Deprecated.
      Delete a group attribute.
       try {
         g.deleteAttribute(attribute);
       }
       catch (GroupModifyException e0) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to delete this attribute
       }
       
      Parameters:
      attrName - Delete this attribute.
      failOnRequiredAttribute - true if exception when attribute is required
      Throws:
      AttributeNotFoundException
      GroupModifyException
      InsufficientPrivilegeException
    • deleteCompositeMember

      public void deleteCompositeMember() throws InsufficientPrivilegeException, MemberDeleteException
      Delete a Composite membership from this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.
       try {
         g.deleteCompositeMember();
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete members
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete composite membership
       } 
       
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      Since:
      1.0
    • deleteMember

      public boolean deleteMember(Member member, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException
      Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(member);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      member - Delete this Member
      exceptionIfAlreadyDeleted - throw exception if already deleted
      Returns:
      false if it was already deleted, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
    • deleteMember

      public void deleteMember(Member member) throws InsufficientPrivilegeException, MemberDeleteException
      Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(member);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      member - Delete this Member
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
    • deleteMember

      public boolean deleteMember(Member member, Field f, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException
      Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(m, f);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      member - Delete this Member.
      f - Delete subject from this Field.
      exceptionIfAlreadyDeleted -
      Returns:
      false if it was already deleted, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      SchemaException
    • deleteMember

      public void deleteMember(Member member, Field f) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException
      Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(m, f);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      member - Delete this Member.
      f - Delete subject from this Field.
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      SchemaException
    • deleteMember

      public void deleteMember(Subject subj) throws InsufficientPrivilegeException, MemberDeleteException
      Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(subj);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      subj - Delete this Subject
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
    • deleteMember

      public boolean deleteMember(Subject subj, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException
      Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(subj);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Specified by:
      deleteMember in interface Role
      Parameters:
      subj - Delete this Subject
      exceptionIfAlreadyDeleted -
      Returns:
      false if it was already deleted, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
    • deleteMember

      Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(m, f);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      subj - Delete this Subject.
      f - Delete subject from this Field.
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      SchemaException
    • deleteMember

      public boolean deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException
      Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(m, f);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      subj - Delete this Subject.
      f - Delete subject from this Field.
      exceptionIfAlreadyDeleted - true if an exception should be thrown if the member is already deleted
      Returns:
      false if it was already deleted, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      SchemaException
    • internal_deleteMember

      public boolean internal_deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted, boolean checkSecurity)
      Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       try {
         g.deleteMember(m, f);
       } 
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to delete this subject
       }
       catch (MemberDeleteException eMD) {
         // Unable to delete subject
       }
       
      Parameters:
      subj - Delete this Subject.
      f - Delete subject from this Field.
      exceptionIfAlreadyDeleted - true if an exception should be thrown if the member is already deleted
      checkSecurity - false if should not check security
      Returns:
      false if it was already deleted, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      MemberDeleteException
      SchemaException
    • deleteType

      Deprecated.
      Delete a group type.
       try {
         GroupType custom = GroupTypeFinder.find("custom type");
         g.deleteType(custom);
       }
       catch (GroupModifyException eGM) {
         // Unable to delete type 
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to add type
       }
       catch (SchemaException eS) {
         // Cannot delete system-maintained types
       }
       
      Parameters:
      type - The GroupType to add.
      Throws:
      GroupModifyException - if unable to delete type.
      InsufficientPrivilegeException - if subject not root-like.
      SchemaException - if attempting to delete a system group type.
    • getAdmins

      public Set<Subject> getAdmins() throws GrouperException
      Get subjects with the ADMIN privilege on this group.
       Set admins = g.getAdmins();
       
      Specified by:
      getAdmins in interface Entity
      Returns:
      Set of subjects with ADMIN
      Throws:
      GrouperException
    • getAttributeOrNull

      @Deprecated public String getAttributeOrNull(String attributeName)
      Deprecated.
      use getAttributeValue()
      get the value of an attribute, if not there return null
      Parameters:
      attributeName -
      Returns:
      the attribute value
    • getAttributeOrFieldValue

      public String getAttributeOrFieldValue(String attributeOrFieldName, boolean checkSecurity, boolean exceptionIfAttributeNotFound)
      Deprecated.
      if attribute or field name is a field name, call that getter with reflection. If not, then call getAttributeValue()
      Parameters:
      attributeOrFieldName -
      checkSecurity -
      exceptionIfAttributeNotFound -
      Returns:
      the value
    • getAttributeValue

      public String getAttributeValue(String attributeName, boolean checkSecurity, boolean exceptionIfNotFound)
      Deprecated.
      get the value of an attribute, if not there return the empty string. or exception if expected to be there.
      Parameters:
      attributeName -
      exceptionIfNotFound -
      checkSecurity -
      Returns:
      the attribute value or null if not there and not expecting exception.
    • getAttribute

      @Deprecated public String getAttribute(String attr) throws AttributeNotFoundException
      Deprecated.
      Get attribute value.
       try {
         String value = g.getAttribute(attribute);
       }
       catch (AttributeNotFoundException e) {
         // Group doesn't have attribute
       }
       
      Parameters:
      attr - Get value of this attribute.
      Returns:
      Attribute value. or throw AttributeNotFoundException if not there. The value will be the emprty string if it is null
      Throws:
      AttributeNotFoundException
    • getCompositeMembers

      public Set<Member> getCompositeMembers(QueryOptions queryOptions)
      Get Composite Members of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.
       Set members = g.getCompositeMembers();
       
      Parameters:
      queryOptions -
      Returns:
      A set of Member objects.
      Since:
      1.0
    • getAttributes

      @Deprecated public Map<String,String> getAttributes()
      Deprecated.
      use getAttributesMap
      Get all attributes and values.
       Map attributes = g.getAttributes();
       
      Returns:
      A map of attributes and values.
    • getCompositeMembers

      public Set<Member> getCompositeMembers()
      Get Composite Members of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.
       Set members = g.getCompositeMembers();
       
      Returns:
      A set of Member objects.
      Since:
      1.0
    • getCompositeMemberships

      public Set<Membership> getCompositeMemberships()
      Get Composite Memberships of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members. A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set mships = g.getCompositeMembers();
       
      Returns:
      A set of Membership objects.
      Since:
      1.0
    • getCreateSubject

      public Subject getCreateSubject() throws SubjectNotFoundException
      Get subject that created this group.
       // Get creator of this group.
       try {
         Subject creator = g.getCreateSubject();
       }
       catch (SubjectNotFoundException e) {
         // Couldn't find subject
       }
       
      Returns:
      Subject that created this group.
      Throws:
      SubjectNotFoundException
    • getCreateTime

      public Date getCreateTime()
      Get creation time for this group.
       // Get create time.
       Date created = g.getCreateTime();
       
      Returns:
      Date that this group was created.
    • getDescription

      public String getDescription()
      Get group description.
       String description = g.getDescription();
       
      Specified by:
      getDescription in interface Entity
      Specified by:
      getDescription in interface GrouperObject
      Specified by:
      getDescription in interface Role
      Returns:
      Group's description or an empty string if no value set.
    • getDescriptionDb

      public String getDescriptionDb()
      Get group description for hibernate.
      Returns:
      Group's description or an empty string if no value set.
    • _internal_fieldAttribute

      public static boolean _internal_fieldAttribute(String attributeName)
      see if field attribute (name, description, extension, displayName, displayExtension)
      Parameters:
      attributeName -
      Returns:
      true if so
    • getDisplayExtension

      public String getDisplayExtension()
      Get group displayExtension.
       String displayExtn = g.getDisplayExtension();
       
      Specified by:
      getDisplayExtension in interface Entity
      Specified by:
      getDisplayExtension in interface Role
      Returns:
      Gruop displayExtension.
      Throws:
      GrouperException
    • getDisplayName

      public String getDisplayName() throws GrouperException
      Get group displayName.
       String displayName = g.getDisplayName();
       
      Specified by:
      getDisplayName in interface Entity
      Specified by:
      getDisplayName in interface GrouperObject
      Specified by:
      getDisplayName in interface Role
      Returns:
      Group displayName.
      Throws:
      GrouperException
    • getEffectiveMembers

      public Set<Member> getEffectiveMembers() throws GrouperException
      Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set effectives = g.getEffectiveMembers();
       
      Returns:
      A set of Member objects.
      Throws:
      GrouperException
    • getEffectiveMembers

      public Set<Member> getEffectiveMembers(Field f) throws SchemaException
      Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set effectives = g.getEffectiveMembers(f);
       
      Parameters:
      f - Get members in this list field.
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getEffectiveMembers

      public Set<Member> getEffectiveMembers(Field f, QueryOptions queryOptions) throws SchemaException
      Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set effectives = g.getEffectiveMembers(f);
       
      Parameters:
      f - Get members in this list field.
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getEffectiveMembers

      public Set<Member> getEffectiveMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException
      Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set effectives = g.getEffectiveMembers(f);
       
      Parameters:
      f - Get members in this list field.
      sources - sources to filter by, or null for all
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getEffectiveMemberships

      public Set<Membership> getEffectiveMemberships() throws GrouperException
      Get effective memberships of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set effectives = g.getEffectiveMemberships();
       
      Returns:
      A set of Membership objects.
      Throws:
      GrouperException
    • getEffectiveMemberships

      public Set<Membership> getEffectiveMemberships(Field f) throws SchemaException
      Get effective memberships of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       Set memberships = g.getEffectiveMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getExtension

      public String getExtension()
      Get group extension.
       String extension = g.getExtension();
       
      Specified by:
      getExtension in interface Entity
      Specified by:
      getExtension in interface Role
      Returns:
      Group extension.
      Throws:
      GrouperException
    • getImmediateMembers

      public Set<Member> getImmediateMembers() throws GrouperException
      Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set immediates = g.getImmediateMembers();
       
      Returns:
      A set of Member objects.
      Throws:
      GrouperException
    • getImmediateMembers

      public Set<Member> getImmediateMembers(Field f) throws SchemaException
      Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set immediates = g.getImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getImmediateMembers

      public Set<Member> getImmediateMembers(Field f, QueryOptions queryOptions) throws SchemaException
      Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set immediates = g.getImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getImmediateMembers

      public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException
      Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set immediates = g.getImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      sources - to search in or null if all
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • isHasMembers

      public boolean isHasMembers()
      more efficient? way to see if there are any members you need read on the group to call this method
      Returns:
      true if has members, false if not
    • getImmediateMembers

      public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions, SortStringEnum memberSortStringEnum, SearchStringEnum memberSearchStringEnum, String memberSearchStringValue) throws SchemaException
      Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set immediates = g.getImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      sources - to search in or null if all
      queryOptions -
      memberSortStringEnum - How to sort results or null for no sorting unless specified by queryOptions
      memberSearchStringEnum - Specify search string if searching for members in the group
      memberSearchStringValue - Search string value.
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getImmediateMemberships

      public Set<Membership> getImmediateMemberships() throws GrouperException
      Get immediate memberships of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set immediates = g.getImmediateMemberships();
       
      Returns:
      A set of Membership objects.
      Throws:
      GrouperException
    • getImmediateMemberships

      public Set<Membership> getImmediateMemberships(Field f) throws SchemaException
      An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set immediates = g.getImmediateMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getMembers

      public Set<Member> getMembers() throws GrouperException
      Get members of this group.
       Set members = g.getMembers();
       
      Returns:
      A set of Member objects.
      Throws:
      GrouperException
    • getMembers

      public Set<Member> getMembers(Field f) throws SchemaException
      Get members of this group.
       Set members = g.getMembers(f);
       
      Parameters:
      f - Get members in this list field.
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getMembers

      public Set<Member> getMembers(Field f, QueryOptions queryOptions) throws SchemaException
      Get members of this group.
       Set members = g.getMembers(f);
       
      Parameters:
      f - Get members in this list field.
      queryOptions - paging, sorting, count, etc
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getMembers

      public Set<Member> getMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException
      Get members of this group.
       Set members = g.getMembers(f);
       
      Parameters:
      f - Get members in this list field.to get members from, or null for all
      sources - to get members from, or null for all
      queryOptions - paging, sorting, count, etc
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getMemberships

      public Set<Membership> getMemberships() throws GrouperException
      Get memberships of this group. A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships();
       
      Returns:
      A set of Membership objects.
      Throws:
      GrouperException
    • getMemberships

      public Set<Membership> getMemberships(Field f) throws SchemaException
      Get memberships of this group. A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getMemberships

      public Set<Membership> getMemberships(Field f, Collection<Member> members) throws SchemaException
      Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getImmediateMemberships

      public Set<Membership> getImmediateMemberships(Field f, Collection<Member> members) throws SchemaException
      Get memberships of this group, for a certain collection of members, must be enabled A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getImmediateMemberships

      public Set<Membership> getImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly) throws SchemaException
      Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      enabledOnly -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getImmediateMembership

      public Membership getImmediateMembership(Field f, Subject subject, boolean enabledOnly, boolean exceptionIfNotFound) throws SchemaException, MembershipNotFoundException
      Get membership of this group, for a certain member A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Membership membership = g.getMembership(f, m, true);
       
      Parameters:
      f - Get memberships in this list field.
      subject -
      enabledOnly -
      exceptionIfNotFound - true if MembershipNotFoundException should be thrown if not found, otherwise null
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
      MembershipNotFoundException - if none found and exceptionIfNotFound
    • getImmediateMembership

      public Membership getImmediateMembership(Field f, Member member, boolean enabledOnly, boolean exceptionIfNotFound) throws SchemaException, MembershipNotFoundException
      Get membership of this group, for a certain member A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Membership membership = g.getMembership(f, m, true);
       
      Parameters:
      f - Get memberships in this list field.
      member -
      enabledOnly -
      exceptionIfNotFound - true if MembershipNotFoundException should be thrown if not found, otherwise null
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
      MembershipNotFoundException - if none found and exceptionIfNotFound
    • getEffectiveMemberships

      public Set<Membership> getEffectiveMemberships(Field f, Collection<Member> members) throws SchemaException
      Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getCompositeMemberships

      public Set<Membership> getCompositeMemberships(Collection<Member> members) throws SchemaException
      Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      members -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getModifySubject

      public Subject getModifySubject() throws SubjectNotFoundException
      Get subject that last modified this group.
       try {
         Subject modifier = g.getModifySubject();
       }
       catch (SubjectNotFoundException e) {
         // Couldn't find subject
       }
       
      Returns:
      Subject that last modified this group.
      Throws:
      SubjectNotFoundException
    • getModifyTime

      public Date getModifyTime()
      Get last modified time for this group.
       Date modified = g.getModifyTime();
       
      Returns:
      Date that this group was last modified.
    • getName

      public String getName() throws GrouperException
      Get group name.
       String name = g.getName();
       
      Specified by:
      getName in interface Entity
      Specified by:
      getName in interface GrouperObject
      Specified by:
      getName in interface Owner
      Specified by:
      getName in interface Role
      Returns:
      Group name.
      Throws:
      GrouperException
    • getOptins

      public Set<Subject> getOptins() throws GrouperException
      Get subjects with the OPTIN privilege on this group.
       Set optins = g.getOptins();
       
      Returns:
      Set of subjects with OPTIN
      Throws:
      GrouperException
    • getOptouts

      public Set<Subject> getOptouts() throws GrouperException
      Get subjects with the OPTOUT privilege on this group.
       Set admins = g.getOptouts();
       
      Returns:
      Set of subjects with OPTOUT
      Throws:
      GrouperException
    • getGroupAttrReaders

      public Set<Subject> getGroupAttrReaders() throws GrouperException
      Get subjects with the GROUP_ATTR_READ privilege on this group.
       Set subjects = g.getGroupAttrReaders();
       
      Returns:
      Set of subjects with GROUP_ATTR_READ
      Throws:
      GrouperException
    • getGroupAttrUpdaters

      public Set<Subject> getGroupAttrUpdaters() throws GrouperException
      Get subjects with the GROUP_ATTR_UPDATE privilege on this group.
       Set subjects = g.getGroupAttrUpdaters();
       
      Returns:
      Set of subjects with GROUP_ATTR_UPDATE
      Throws:
      GrouperException
    • getParentStemName

      public String getParentStemName()
      get the name of the parent stem
      Returns:
      the name of the parent stem
    • getParentStem

      public Stem getParentStem() throws IllegalStateException
      Get parent stem.
       Stem parent = g.getParentStem();
       
      Specified by:
      getParentStem in interface GrouperObject
      Returns:
      Parent Stem.
      Throws:
      IllegalStateException
    • getPrivs

      public Set<AccessPrivilege> getPrivs(Subject subj)
      Get privileges that the specified subject has on this group.
       Set privs = g.getPrivs(subj);
       
      Parameters:
      subj - Get privileges for this subject.
      Returns:
      Set of AccessPrivilege objects.
    • getReaders

      public Set<Subject> getReaders() throws GrouperException
      Get subjects with the READ privilege on this group.
       Set readers = g.getReaders();
       
      Returns:
      Set of subjects with READ
      Throws:
      GrouperException
    • getRemovableTypes

      public Set<GroupType> getRemovableTypes()
      Deprecated.
      Get removable group types for this group.
       Set types = g.getRemovableTypes();
       
      Returns:
      Set of removable group types.
      Since:
      1.0
    • getTypes

      public Set<GroupType> getTypes()
      Deprecated.
      Get group types for this group (secure method).
       Set types = g.getTypes();
       
      Returns:
      Set of group types.
    • getTypes

      public Set<GroupType> getTypes(boolean checkSecurity)
      Deprecated.
      Get group types for this group.
       Set types = g.getTypes(true);
       
      Parameters:
      checkSecurity -
      Returns:
      Set of group types.
    • getTypesDb

      public Set<GroupType> getTypesDb()
      Deprecated.
      get types in db
      Returns:
      types
    • getUpdaters

      public Set<Subject> getUpdaters() throws GrouperException
      Get subjects with the UPDATE privilege on this group.
       Set updaters = g.getUpdaters();
       
      Returns:
      Set of subjects with UPDATE
      Throws:
      GrouperException
    • getViewers

      public Set<Subject> getViewers() throws GrouperException
      Get subjects with the VIEW privilege on this group.
       Set viewers = g.getViewers();
       
      Specified by:
      getViewers in interface Entity
      Returns:
      Set of subjects with VIEW
      Throws:
      GrouperException
    • grantPriv

      Grant privilege to a subject on this group. This will throw an exception if the privilege already exists
       try {
         g.grantPriv(subj, AccessPrivilege.ADMIN);
       }
       catch (GrantPrivilegeException e0) {
         // Not privileged to grant this privilege
       }
       catch (InsufficientPrivilegeException e1) {
         // Unable to grant this privilege
       }
       
      Parameters:
      subj - Grant privilege to this subject.
      priv - Grant this privilege.
      Throws:
      GrantPrivilegeException
      InsufficientPrivilegeException
      SchemaException
    • grantPriv

      public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
      Grant privilege to a subject on this group.
       try {
         g.grantPriv(subj, AccessPrivilege.ADMIN);
       }
       catch (GrantPrivilegeException e0) {
         // Not privileged to grant this privilege
       }
       catch (InsufficientPrivilegeException e1) {
         // Unable to grant this privilege
       }
       
      Specified by:
      grantPriv in interface Entity
      Parameters:
      subj - Grant privilege to this subject.
      priv - Grant this privilege.
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      GrantPrivilegeException
      InsufficientPrivilegeException
      SchemaException
    • internal_grantPriv

      public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException
      Grant privilege to a subject on this group.
       try {
         g.grantPriv(subj, AccessPrivilege.ADMIN);
       }
       catch (GrantPrivilegeException e0) {
         // Not privileged to grant this privilege
       }
       catch (InsufficientPrivilegeException e1) {
         // Unable to grant this privilege
       }
       
      Parameters:
      subj - Grant privilege to this subject.
      priv - Grant this privilege.
      exceptionIfAlreadyMember - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      uuid -
      Returns:
      false if it already existed, true if it didnt already exist
      Throws:
      GrantPrivilegeException
      InsufficientPrivilegeException
      SchemaException
    • hasPrivilege

      public boolean hasPrivilege(Subject subject, String privilegeOrListName)
      see if the subject has a privilege
      Parameters:
      subject -
      privilegeOrListName -
      Returns:
      true if has privilege
    • hasAdmin

      public boolean hasAdmin(Subject subj)
      Check whether the subject has ADMIN on this group.
       if (g.hasAdmin(subj)) {
         // Has ADMIN
       }
       else {
         // Does not have ADMIN
       }
       
      Specified by:
      hasAdmin in interface Entity
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has ADMIN.
    • hasGroupAttrRead

      public boolean hasGroupAttrRead(Subject subj)
      Check whether the subject has GROUP_ATTR_READ on this group.
       if (g.hasGroupAttrRead(subj)) {
         // Has GROUP_ATTR_READ
       }
       else {
         // Does not have GROUP_ATTR_READ
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has GROUP_ATTR_READ.
    • hasGroupAttrUpdate

      public boolean hasGroupAttrUpdate(Subject subj)
      Check whether the subject has GROUP_ATTR_UPDATE on this group.
       if (g.hasGroupAttrUpdate(subj)) {
         // Has GROUP_ATTR_UPDATE
       }
       else {
         // Does not have GROUP_ATTR_UPDATE
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has GROUP_ATTR_UPDATE.
    • hasComposite

      public boolean hasComposite()
      Does this Group have a Composite membership.
       if (g.hasComposite()) {
         // this group has a composite membership
       }
       
      Returns:
      Boolean true if group has a composite membership.
    • isHasComposite

      public boolean isHasComposite()
      Does this Group have a Composite membership.
      Returns:
      Boolean true if group has a composite membership.
      See Also:
    • hasEffectiveMember

      public boolean hasEffectiveMember(Subject subj) throws GrouperException
      Check whether the subject is an effective member of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       if (g.hasEffectiveMember(subj)) {
         // Subject is an effective member of this group
       }
       else {
         // Subject is not an effective member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      GrouperException
    • hasEffectiveMember

      public boolean hasEffectiveMember(Subject subj, Field f) throws SchemaException
      Check whether the subject is an effective member of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships
       if (g.hasEffectiveMember(subj, f)) {
         // Subject is an effective member of this group
       }
       else {
         // Subject is not an effective member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      f - Check for membership in this list field.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      SchemaException
    • hasImmediateMember

      public boolean hasImmediateMember(Subject subj) throws GrouperException
      Check whether the subject is an immediate member of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       if (g.hasImmediateMember(subj)) {
         // Subject is an immediate member of this group
       }
       else {
         // Subject is not a immediate member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      GrouperException
    • hasImmediateMember

      public boolean hasImmediateMember(Subject subj, Field f) throws SchemaException
      Check whether the subject is an immediate member of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       if (g.hasImmediateMember(subj, f)) {
         // Subject is an immediate member of this group
       }
       else {
         // Subject is not a immediate member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      f - Check for membership in this list field.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      SchemaException
    • hasMember

      public boolean hasMember(Subject subj) throws GrouperException
      Check whether the subject is a member of this group. All immediate subjects, and effective members are members. No duplicates will be returned (e.g. if immediate and effective).
       if (g.hasMember(subj)) {
         // Subject is a member of this group
       }
       else {
         // Subject is not a member of this group
       } 
       
      Specified by:
      hasMember in interface Role
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      GrouperException
      See Also:
    • hasMemberAsGrouperSystem

      public boolean hasMemberAsGrouperSystem(Subject subj) throws GrouperException
      Check whether the subject is a member of this group. All immediate subjects, and effective members are members. No duplicates will be returned (e.g. if immediate and effective).
       if (g.hasMember(subj)) {
         // Subject is a member of this group
       }
       else {
         // Subject is not a member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      GrouperException
    • hasMember

      public boolean hasMember(Subject subj, Field f) throws SchemaException
      Check whether the subject is a member of this list on this group. All immediate subjects, and effective members are members. No duplicates will be returned (e.g. if immediate and effective).
       if (g.hasMember(subj, f)) {
         // Subject is a member of this group
       }
       else {
         // Subject is not a member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      f - Is subject a member of this list Field.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      SchemaException
    • hasOptin

      public boolean hasOptin(Subject subj)
      Check whether the subject has OPTIN on this group.
       if (g.hasOptin(subj)) {
         // Has OPTIN
       }
       else {
         // Does not have OPTIN
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has OPTIN.
    • hasOptout

      public boolean hasOptout(Subject subj)
      Check whether the subject has OPTOUT on this group.
       if (g.hasOptout(subj)) {
         // has OPTOUT
       }
       else {
         // Does not have OPTOUT
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has OPTOUT.
    • hasRead

      public boolean hasRead(Subject subj)
      Check whether the subject has READ on this group.
       if (g.hasRead(subj)) {
         // Has READ
       }
       else {
         // Does not have READ
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has READ.
    • hasType

      public boolean hasType(GroupType type, boolean checkSecurity)
      Check whether group has the specified type.
       GroupType custom = GroupTypeFinder.find("custom type");
       if (g.hasType(custom, true)) {
         // Group has type
       }
       
      Parameters:
      type - The GroupType to check.
      checkSecurity -
      Returns:
      if has type
    • hasType

      public boolean hasType(GroupType type)
      Check whether group has the specified type. This is a secure method
       GroupType custom = GroupTypeFinder.find("custom type");
       if (g.hasType(custom)) {
         // Group has type
       }
       
      Parameters:
      type - The GroupType to check.
      Returns:
      if has type
    • hasUpdate

      public boolean hasUpdate(Subject subj)
      Check whether the subject has UPDATE on this group.
       if (g.hasUpdate(subj)) {
         // Has UPDATE
       }
       else {
         // Does not have UPDATE
       }
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject has UPDATE.
    • hasView

      public boolean hasView(Subject subj)
      Check whether the subject has VIEW on this group.
       if (g.hasView(subj)) {
         // Has VIEW
       }
       else {
         // Does not have VIEW
       }
       
      Specified by:
      hasView in interface Entity
      Parameters:
      subj - Check this member.
      Returns:
      Boolean true if subject has VIEW.
    • isComposite

      public boolean isComposite()
      Is this Group a factor in a Composite membership.
       if (g.isComposite()) {
         // this group is a factor in one-or-more composite memberships.
       }
       
      Returns:
      Boolean true if group is a factor in a composite membership.
    • revokePriv

      Revoke all privileges of the specified type on this group.
       try {
         g.revokePriv(AccessPrivilege.OPTIN);
       }
       catch (InsufficientPrivilegeException eIP) {
         // Not privileged to revoke this privilege
       }
       catch (RevokePrivilegeException eRP) {
         // Unable to modify group
       }
       
      Parameters:
      priv - Revoke all instances of this privilege.
      Throws:
      InsufficientPrivilegeException
      RevokePrivilegeException
      SchemaException
    • revokePriv

      Revoke a privilege from the specified subject.
       try {
         g.revokePriv(subj, AccessPrivilege.OPTIN);
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to revoke this privilege
       }
       catch (RevokePrivilegeException eRP) {
         // Error revoking privilege
       }
       
      Parameters:
      subj - Revoke privilege from this subject.
      priv - Revoke this privilege.
      Throws:
      InsufficientPrivilegeException
      RevokePrivilegeException
      SchemaException
    • revokePriv

      public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException
      Revoke a privilege from the specified subject.
       try {
         g.revokePriv(subj, AccessPrivilege.OPTIN);
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to revoke this privilege
       }
       catch (RevokePrivilegeException eRP) {
         // Error revoking privilege
       }
       
      Specified by:
      revokePriv in interface Entity
      Parameters:
      subj - Revoke privilege from this subject.
      priv - Revoke this privilege.
      exceptionIfAlreadyRevoked - if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group
      Returns:
      false if it was already revoked, true if it wasnt already deleted
      Throws:
      InsufficientPrivilegeException
      RevokePrivilegeException
      SchemaException
    • setAttribute

      public void setAttribute(String attributeName, String value) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException
      Deprecated.
      Set an attribute value.
       try {
         g.attribute(attribute, value);
       } 
       catch (AttributeNotFoundException e0) {
         // Attribute doesn't exist
       }
       catch (GroupModifyException e1) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e2) {
         // Not privileged to modify this attribute
       }
       
      Parameters:
      attributeName - Set this attribute.
      value - Set to this value.
      Throws:
      AttributeNotFoundException
      GroupModifyException
      InsufficientPrivilegeException
    • setAttribute

      public void setAttribute(String attributeName, String value, boolean checkPrivileges) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException
      Deprecated.
      Set an attribute value.
       try {
         g.attribute(attribute, value);
       } 
       catch (AttributeNotFoundException e0) {
         // Attribute doesn't exist
       }
       catch (GroupModifyException e1) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e2) {
         // Not privileged to modify this attribute
       }
       
      Parameters:
      attributeName - Set this attribute.
      value - Set to this value.
      checkPrivileges -
      Throws:
      AttributeNotFoundException
      GroupModifyException
      InsufficientPrivilegeException
    • internal_setAttribute

      public Attribute internal_setAttribute(String attributeName, String value, boolean checkPrivileges, String uuid) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException
      Set an attribute value.
       try {
         g.attribute(attribute, value);
       } 
       catch (AttributeNotFoundException e0) {
         // Attribute doesn't exist
       }
       catch (GroupModifyException e1) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e2) {
         // Not privileged to modify this attribute
       }
       
      Parameters:
      attributeName - Set this attribute.
      value - Set to this value.
      checkPrivileges -
      uuid -
      Returns:
      the attribute
      Throws:
      AttributeNotFoundException
      GroupModifyException
      InsufficientPrivilegeException
    • store

      public void store()
      store this object to the DB.
      Specified by:
      store in interface Entity
    • validate

      public void validate()
    • setDescription

      public void setDescription(String value)
      Set group description. Note, you have to call store() at some point to make the kick off the sql
       try {
         g.setDescription(value);
       }
       catch (GroupModifyException e0) {
         // Unable to modify group
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to modify description
       }
       
      Specified by:
      setDescription in interface Entity
      Specified by:
      setDescription in interface Role
      Parameters:
      value - Set description to this value.
    • setDescriptionDb

      public void setDescriptionDb(String value)
      Set group description (hibernate method).
      Parameters:
      value - Set description to this value.
    • setExtension

      public void setExtension(String value)
      Set group extension. Note, you have to call store() at some point to make the kick off the sql
         g.setExtension(value);
       
      Specified by:
      setExtension in interface Entity
      Specified by:
      setExtension in interface Role
      Parameters:
      value - Set extension to this value.
    • setExtension

      public void setExtension(String value, boolean assignAlternateName)
      Set group extension. Note, you have to call store() at some point to make the kick off the sql
         g.setExtension(value, true);
       
      Parameters:
      value - Set extension to this value.
      assignAlternateName - Whether to add the old group name as an alternate name for the renamed group.
    • setName

      public void setName(String value)
      Set group name. This should not be called
      Specified by:
      setName in interface Entity
      Specified by:
      setName in interface Role
      Parameters:
      value - Set extension to this value.
    • setDisplayExtension

      public void setDisplayExtension(String value)
      Set group displayExtension. Note, you have to call store() at some point to make the kick off the sql
         g.setDisplayExtension(value);
       
      Specified by:
      setDisplayExtension in interface Entity
      Specified by:
      setDisplayExtension in interface Role
      Parameters:
      value - Set displayExtension to this value.
    • setDisplayExtensionDb

      public void setDisplayExtensionDb(String value)
      hibernate method
      Parameters:
      value -
    • setExtensionDb

      public void setExtensionDb(String value)
      hibernate method
      Parameters:
      value -
    • getDisplayExtensionDb

      public String getDisplayExtensionDb()
      hibernate method
      Returns:
      display extension
    • getExtensionDb

      public String getExtensionDb()
      hibernate method
      Returns:
      extension
    • setDisplayName

      public void setDisplayName(String value)
      This is really only for hibernate
      Specified by:
      setDisplayName in interface Entity
      Specified by:
      setDisplayName in interface Role
      Parameters:
      value - new display name
    • toMember

      public Member toMember() throws GrouperException
      Convert this group to a Member object.

       Member m = g.toMember();
       
      Specified by:
      toMember in interface Entity
      Returns:
      Group as a Member
      Throws:
      GrouperException
    • toSubject

      public Subject toSubject() throws GrouperException
      Convert this group to a Subject object.

       Subject subj = g.toSubject();
       
      Specified by:
      toSubject in interface Entity
      Returns:
      Group as a Subject
      Throws:
      GrouperException
    • toString

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

      public boolean internal_canWriteField(Subject subj, Field f) throws IllegalArgumentException, SchemaException
      TODO 20070531 make into some flavor of validator
      Parameters:
      subj -
      f -
      Returns:
      boolean
      Throws:
      IllegalArgumentException
      SchemaException
      Since:
      1.2.1
    • setDontSetModified

      public void setDontSetModified(boolean theDontSetModified)
      if we should not set the modified attributes on group save
      Parameters:
      theDontSetModified -
    • internal_addCompositeMember

      public Composite internal_addCompositeMember(GrouperSession session, CompositeType type, Group left, Group right, String uuid) throws InsufficientPrivilegeException, MemberAddException
      Parameters:
      session -
      type -
      left -
      right -
      uuid -
      Returns:
      composite
      Throws:
      InsufficientPrivilegeException
      MemberAddException
    • dbVersionDifferentFields

      public Set<String> dbVersionDifferentFields()
      Description copied from class: GrouperAPI
      see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName
      Overrides:
      dbVersionDifferentFields in class GrouperAPI
      Returns:
      the set of different fields
      See Also:
    • dbVersionDifferentFields

      public Set<String> dbVersionDifferentFields(boolean failIfNull)
      Parameters:
      failIfNull -
      Returns:
      the set of different fields
      See Also:
    • dbVersionReset

      public void dbVersionReset()
      take a snapshot of the data since this is what is in the db
      Overrides:
      dbVersionReset in class GrouperAPI
    • clone

      public Group 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:
    • equals

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

      public static void initData(Collection<Group> groups)
      init attributes etc for multiple groups at once
      Parameters:
      groups -
    • getAttributesMap

      public Map<String,Attribute> getAttributesMap(boolean checkSecurity)
      Deprecated.
      This is a direct access to the attributes (going around security checking etc). You probably shouldnt be calling this if not on the grouper team.
      Parameters:
      checkSecurity - if we should check if the current user can see each attribute
      Returns:
      attributes, will never be null
      Since:
      1.2.0
    • getAttributesDb

      @Deprecated public Map<String,String> getAttributesDb()
      Deprecated.
      This is a direct access to the attributes (going around security checking etc). Use the other get attributes map method
      Returns:
      attributes
      Since:
      1.2.0
    • getCreateTimeLong

      public long getCreateTimeLong()
      Returns:
      create time
      Since:
      1.2.0
    • getCreatorUuid

      public String getCreatorUuid()
      Returns:
      creator
      Since:
      1.2.0
    • dbVersion

      public Group dbVersion()
      Description copied from class: GrouperAPI
      version of this object in the database
      Overrides:
      dbVersion in class GrouperAPI
      Returns:
      the db version
      See Also:
    • getModifierUuid

      public String getModifierUuid()
      Returns:
      uuid
    • getModifyTimeLong

      public long getModifyTimeLong()
      Returns:
      modify time
      Since:
      1.2.0
    • getParentUuid

      public String getParentUuid()
      Returns:
      parent uuid
      Since:
      1.2.0
    • getUuid

      public String getUuid()
      Specified by:
      getUuid in interface Owner
      Returns:
      uuid
      Since:
      1.2.0
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      Returns:
      hashcode
      Since:
      1.2.0
    • onDelete

      public boolean onDelete(org.hibernate.Session hs) throws org.hibernate.CallbackException
      Specified by:
      onDelete in interface org.hibernate.classic.Lifecycle
      Overrides:
      onDelete in class GrouperAPI
      Throws:
      org.hibernate.CallbackException
      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:
    • onPostUpdate

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

      public Long getLastMembershipChangeDb()
      when the last member has changed
      Returns:
      when
    • setLastMembershipChangeDb

      public void setLastMembershipChangeDb(Long theMembershipLastChange)
      when the last member has changed
      Parameters:
      theMembershipLastChange -
    • getLastMembershipChange

      public Timestamp getLastMembershipChange()
      when the last member has changed
      Returns:
      the membership last change timestamp
    • getLastImmediateMembershipChangeDb

      public Long getLastImmediateMembershipChangeDb()
      when the last immediate member has changed
      Returns:
      when
    • setLastImmediateMembershipChangeDb

      public void setLastImmediateMembershipChangeDb(Long theImmediateMembershipLastChange)
      when the last immediate member has changed
      Parameters:
      theImmediateMembershipLastChange -
    • getLastImmediateMembershipChange

      public Timestamp getLastImmediateMembershipChange()
      when the last immediate member has changed
      Returns:
      the immediate membership last change timestamp
    • getAlternateNameDb

      public String getAlternateNameDb()
      Returns the alternate name for the group. Used by hibernate.
      Returns:
      the alternate name
    • getAlternateName

      public String getAlternateName()
      Returns the alternate name for the group. If multiple, this returns the first one
      Returns:
      the alternate name
    • setAlternateNameDb

      public void setAlternateNameDb(String alternateName)
      Set the group's alternate name Used by hibernate.
      Parameters:
      alternateName -
    • getAlternateNames

      public Set<String> getAlternateNames()
      Returns the alternate names for the group. Only one alternate name is supported currently, so a Set of size 0 or 1 will be returned.
      Returns:
      Set of alternate names.
    • addAlternateName

      public void addAlternateName(String alternateName)
      Add an alternate name for this group. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().
      Parameters:
      alternateName -
    • internal_addAlternateName

      protected void internal_addAlternateName(String alternateName, boolean validateName)
      Add an alternate name for this group. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().
      Parameters:
      alternateName -
      validateName -
    • deleteAlternateName

      public boolean deleteAlternateName(String alternateName)
      Delete the specified alternate name. This won't get saved until you call store().
      Parameters:
      alternateName -
      Returns:
      false if the group does not have the specified alternate name
    • onPostDelete

      public void onPostDelete(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      after a delete occurs
      Specified by:
      onPostDelete in interface HibGrouperLifecycle
      Overrides:
      onPostDelete in class GrouperAPI
      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:
    • onSave

      public boolean onSave(org.hibernate.Session hs) throws org.hibernate.CallbackException
      Specified by:
      onSave in interface org.hibernate.classic.Lifecycle
      Overrides:
      onSave in class GrouperAPI
      Throws:
      org.hibernate.CallbackException
      See Also:
    • onUpdate

      public boolean onUpdate(org.hibernate.Session s) throws org.hibernate.CallbackException
      Specified by:
      onUpdate in interface org.hibernate.classic.Lifecycle
      Overrides:
      onUpdate in class GrouperAPI
      Throws:
      org.hibernate.CallbackException
      See Also:
    • setAttributes

      public void setAttributes(Map<String,String> attributes)
      Deprecated.
      Parameters:
      attributes -
    • setCreateTimeLong

      public void setCreateTimeLong(long createTime)
      Parameters:
      createTime -
      Since:
      1.2.0
    • setCreatorUuid

      public void setCreatorUuid(String creatorUUID)
      Parameters:
      creatorUUID -
      Since:
      1.2.0
    • setModifierUuid

      public void setModifierUuid(String modifierUUID)
      Parameters:
      modifierUUID -
      Since:
      1.2.0
    • setModifyTimeLong

      public void setModifyTimeLong(long modifyTime)
      Parameters:
      modifyTime -
      Since:
      1.2.0
    • setParentUuid

      public void setParentUuid(String parentUUID)
      Parameters:
      parentUUID -
      Since:
      1.2.0
    • setTypes

      public void setTypes(Set<GroupType> types)
      Parameters:
      types -
      Since:
      1.2.0
    • internal_getGroupTypeAssignments

      public Map<String,AttributeAssign> internal_getGroupTypeAssignments()
      Returns:
      type assignments
    • setUuid

      public void setUuid(String uuid)
      Parameters:
      uuid -
      Since:
      1.2.0
    • toStringDb

      public String toStringDb()
      Returns:
      string
      Since:
      1.2.0
    • 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:
    • fieldValue

      public Object fieldValue(String fieldName)
      Description copied from class: GrouperAPI
      call this method to get the field value (e.g. from dbVersionDifferentFields). some objects have different interpretations (e.g. Group will process attribute__whatever)
      Specified by:
      fieldValue in interface GrouperUtil.FieldValuable
      Overrides:
      fieldValue in class GrouperAPI
      Parameters:
      fieldName -
      Returns:
      the value
      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:
    • compareTo

      public int compareTo(Object that)
      Specified by:
      compareTo in interface Comparable
      See Also:
    • manageIncludesExcludesRequiredGroups

      public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes)
      add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)
      Parameters:
      grouperSession -
      isIncludeExcludes -
    • manageIncludesExcludesRequiredGroups

      public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes, Group andGroup)
      add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)
      Parameters:
      grouperSession -
      isIncludeExcludes -
      andGroup - groups (like activeEmployee) which the user must also be in
    • manageIncludesExcludesRequiredGroups

      public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes, Set<Group> andGroups)
      add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)
      Parameters:
      grouperSession -
      isIncludeExcludes -
      andGroups - groups (like activeEmployee) which the user must also be in
    • getDisplayNameDb

      public String getDisplayNameDb() throws GrouperException
      Get group displayName for hibernate.
       String displayName = g.getDisplayName();
       
      Returns:
      Group displayName.
      Throws:
      GrouperException
    • getNameDb

      public String getNameDb()
      Get group name for hibernate.
      Returns:
      Group name db.
      Throws:
      GrouperException
    • setDisplayNameDb

      public void setDisplayNameDb(String value)
      This is really only for hibernate
      Parameters:
      value - new display name
    • setNameDb

      public void setNameDb(String value)
      Set group name. This should not be called
      Parameters:
      value - Set extension to this value.
    • move

      public void move(Stem stem) throws GroupModifyException, InsufficientPrivilegeException
      Move this group to another Stem. If you would like to specify options for the move, use GroupMove instead. This will use the default options.
      Specified by:
      move in interface Entity
      Parameters:
      stem -
      Throws:
      GroupModifyException
      InsufficientPrivilegeException
    • internal_move

      protected void internal_move(Stem stem, boolean assignAlternateName)
      Parameters:
      stem -
      assignAlternateName -
    • internal_copy

      protected Group internal_copy(Stem stem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes, boolean composite, boolean addDefaultGroupPrivileges, boolean checkSecurity, String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException
      Parameters:
      stem -
      privilegesOfGroup -
      groupAsPrivilege -
      listMembersOfGroup -
      listGroupAsMember -
      attributes -
      composite -
      addDefaultGroupPrivileges -
      checkSecurity - true to check that user can do this operation, false to ignore
      extension -
      displayExtension -
      Returns:
      group
      Throws:
      GroupAddException
      InsufficientPrivilegeException
    • copy

      Copy this group to another Stem. If you want to specify options for the copy, use GroupCopy. This will use the default options.
      Specified by:
      copy in interface Entity
      Parameters:
      stem -
      Returns:
      the new group
      Throws:
      InsufficientPrivilegeException
      GroupAddException
    • getTypeOfGroup

      public TypeOfGroup getTypeOfGroup()
      type of group, group or role
      Returns:
      group or role
    • setTypeOfGroup

      public void setTypeOfGroup(TypeOfGroup typeOfGroup1)
      type of group, group or role
      Parameters:
      typeOfGroup1 -
    • getTypeOfGroupDb

      public String getTypeOfGroupDb()
      type of group, group or role
      Returns:
      group or role
    • setTypeOfGroupDb

      public void setTypeOfGroupDb(String typeOfGroup1)
      type of group, group or role
      Parameters:
      typeOfGroup1 -
    • __getId

      public String __getId()
      Description copied from interface: GrouperSetElement
      if of this object
      Specified by:
      __getId in interface GrouperSetElement
      Returns:
      id
      See Also:
    • __getName

      public String __getName()
      Description copied from interface: GrouperSetElement
      name of this object (for logging)
      Specified by:
      __getName in interface GrouperSetElement
      Returns:
      name
      See Also:
    • getId

      public String getId()
      Description copied from interface: Role
      uuid of role
      Specified by:
      getId in interface Entity
      Specified by:
      getId in interface GrouperId
      Specified by:
      getId in interface Role
      Returns:
      id
      See Also:
    • getIdIndex

      public Long getIdIndex()
      id of the group as a unique integer
      Specified by:
      getIdIndex in interface Role
      Returns:
      id
    • setIdIndex

      public void setIdIndex(Long idIndex1)
      id of the group as a unique integer
      Parameters:
      idIndex1 -
    • getStemId

      public String getStemId()
      Description copied from interface: Role
      stem that this attribute is in
      Specified by:
      getStemId in interface Entity
      Specified by:
      getStemId in interface Role
      Returns:
      the stem id
      See Also:
    • setId

      public void setId(String id1)
      Description copied from interface: Role
      id of this attribute def name
      Specified by:
      setId in interface Entity
      Specified by:
      setId in interface Role
      See Also:
    • setStemId

      public void setStemId(String stemId1)
      Description copied from interface: Role
      stem that this attribute is in
      Specified by:
      setStemId in interface Entity
      Specified by:
      setStemId in interface Role
      See Also:
    • getRoleInheritanceDelegate

      public RoleInheritanceDelegate getRoleInheritanceDelegate()
      delegate calls to this class for role hierarchy stuff
      Specified by:
      getRoleInheritanceDelegate in interface Role
      Returns:
      the role inheritance hierarchy
    • getPermissionRoleDelegate

      public PermissionRoleDelegate getPermissionRoleDelegate()
      Description copied from interface: Role
      delegate calls to this class for permission role stuff
      Specified by:
      getPermissionRoleDelegate in interface Role
      Returns:
      the delegate
      See Also:
    • getNonImmediateMemberships

      public Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members) throws SchemaException
      Get memberships of this group, for a certain collection of members, must be enabled A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getNonImmediateMemberships

      public Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly) throws SchemaException
      Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set memberships = g.getMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      members -
      enabledOnly -
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • getNonImmediateMembers

      public Set<Member> getNonImmediateMembers() throws GrouperException
      Get non immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set nonImmediates = g.getNonImmediateMembers();
       
      Returns:
      A set of Member objects.
      Throws:
      GrouperException
    • getNonImmediateMembers

      public Set<Member> getNonImmediateMembers(Field f) throws SchemaException
      Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set nonImmediates = g.getNonImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getNonImmediateMembers

      public Set<Member> getNonImmediateMembers(Field f, QueryOptions queryOptions) throws SchemaException
      Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set nonImmediates = g.getNonImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getNonImmediateMembers

      public Set<Member> getNonImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException
      Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       Set nonImmediates = g.getNonImmediateMembers(f);
       
      Parameters:
      f - Get members in this list field.
      sources -
      queryOptions -
      Returns:
      A set of Member objects.
      Throws:
      SchemaException
    • getNonImmediateMemberships

      public Set<Membership> getNonImmediateMemberships() throws GrouperException
      Get nonimmediate memberships of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set immediates = g.getImmediateMemberships();
       
      Returns:
      A set of Membership objects.
      Throws:
      GrouperException
    • getNonImmediateMemberships

      public Set<Membership> getNonImmediateMemberships(Field f) throws SchemaException
      An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membership
       Set immediates = g.getNonImmediateMemberships(f);
       
      Parameters:
      f - Get memberships in this list field.
      Returns:
      A set of Membership objects.
      Throws:
      SchemaException
    • hasNonImmediateMember

      public boolean hasNonImmediateMember(Subject subj) throws GrouperException
      Check whether the subject is a non immediate member of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       if (g.hasImmediateMember(subj)) {
         // Subject is an immediate member of this group
       }
       else {
         // Subject is not a immediate member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      GrouperException
    • hasNonImmediateMember

      public boolean hasNonImmediateMember(Subject subj, Field f) throws SchemaException
      Check whether the subject is a non immediate member of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective memberships
       if (g.hasImmediateMember(subj, f)) {
         // Subject is an immediate member of this group
       }
       else {
         // Subject is not a immediate member of this group
       } 
       
      Parameters:
      subj - Check this subject.
      f - Check for membership in this list field.
      Returns:
      Boolean true if subject belongs to this group.
      Throws:
      SchemaException
    • getCompositeMembers

      public Set<Member> getCompositeMembers(Field field, Set<Source> sources, QueryOptions queryOptions)
      Get Composite Members of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.
       Set members = g.getCompositeMembers();
       
      Parameters:
      field -
      sources -
      queryOptions -
      Returns:
      A set of Member objects.
      Since:
      1.0
    • xmlCopyBusinessPropertiesToExisting

      public void xmlCopyBusinessPropertiesToExisting(Group existingRecord)
      Description copied from interface: XmlImportableBase
      copy business (non update) properties to an existing record
      Specified by:
      xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<Group>
      See Also:
    • xmlDifferentBusinessProperties

      public boolean xmlDifferentBusinessProperties(Group other)
      Description copied from interface: XmlImportableBase
      see if the non update cols are different (e.g. name)
      Specified by:
      xmlDifferentBusinessProperties in interface XmlImportableBase<Group>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlDifferentUpdateProperties

      public boolean xmlDifferentUpdateProperties(Group other)
      Description copied from interface: XmlImportableBase
      see if the update cols are different (e.g. last updated)
      Specified by:
      xmlDifferentUpdateProperties in interface XmlImportableBase<Group>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlRetrieveByIdOrKey

      public Group xmlRetrieveByIdOrKey()
      Description copied from interface: XmlImportable
      retrieve from db by id or key. throws exception if duplicate
      Specified by:
      xmlRetrieveByIdOrKey in interface XmlImportable<Group>
      Returns:
      the object or null if not found
      See Also:
    • assignIdIndex

      public boolean assignIdIndex(long theIdIndex)
      assign different id index
      Parameters:
      theIdIndex -
      Returns:
      if it was changed
    • xmlSaveBusinessProperties

      public Group xmlSaveBusinessProperties(Group existingRecord)
      Description copied from interface: XmlImportableBase
      save the business properties (not update properties)
      Specified by:
      xmlSaveBusinessProperties in interface XmlImportableBase<Group>
      Parameters:
      existingRecord - null if insert, the object if exists in DB generally just copy the hibernate version number, and last updated to the object and store it
      Returns:
      the new object or existing
      See Also:
    • xmlSaveUpdateProperties

      public void xmlSaveUpdateProperties()
      Description copied from interface: XmlImportableBase
      save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate
      Specified by:
      xmlSaveUpdateProperties in interface XmlImportableBase<Group>
      See Also:
    • xmlToExportGroup

      public XmlExportGroup xmlToExportGroup(GrouperVersion grouperVersion)
      convert to xml bean for export
      Parameters:
      grouperVersion -
      Returns:
      xml bean
    • xmlGetId

      public String xmlGetId()
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlGetId in interface XmlImportableBase<Group>
      Returns:
      id
      See Also:
    • xmlSetId

      public void xmlSetId(String theId)
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlSetId in interface XmlImportableBase<Group>
      See Also:
    • xmlToString

      public String xmlToString()
      Description copied from interface: XmlImportableBase
      convert to string for log
      Specified by:
      xmlToString in interface XmlImportableBase<Group>
      Returns:
      the string value for log
      See Also:
    • matchesLowerSearchStrings

      public boolean matchesLowerSearchStrings(Set<String> filterStrings)
      Description copied from interface: GrouperObject
      see if this object matches the filter strings
      Specified by:
      matchesLowerSearchStrings in interface GrouperObject
      Returns:
      true if matches
      See Also:
    • canHavePrivilege

      public boolean canHavePrivilege(Subject subject, String privilegeOrListName, boolean secure)
      see if the subject has a privilege or another privilege that implies this privilege.
      Parameters:
      subject -
      privilegeOrListName -
      secure - if the user must be an admin to check
      Returns:
      true if has privilege
    • deleteAllMemberships

      public void deleteAllMemberships() throws GroupDeleteException, InsufficientPrivilegeException
      Delete all direct memberships Groups Registry. And remove composites
       try {
         g.deleteAllMemberships();
       }
       catch (GroupDeleteException e0) {
         // Unable to delete group
       }
       catch (InsufficientPrivilegeException e1) {
         // Not privileged to delete this group
       }
       
      Throws:
      GroupDeleteException
      InsufficientPrivilegeException