edu.internet2.middleware.grouper
Class Group

java.lang.Object
  extended by edu.internet2.middleware.grouper.GrouperAPI
      extended by 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

public class Group
extends GrouperAPI
implements Role, GrouperHasContext, Owner, Hib3GrouperVersioned, Comparable, XmlImportable<Group>, AttributeAssignable, Entity, GrouperObject

A group within the Groups Registry.

Version:
$Id: Group.java,v 1.269 2009-12-15 06:47:06 mchyzer Exp $
Author:
blair christensen.
See Also:
Serialized Form

Field Summary
static String COLUMN_ALTERNATE_NAME
          an alternate name for this group
static String COLUMN_CREATE_TIME
          col in db
static String COLUMN_CREATOR_ID
          col in db
static String COLUMN_DESCRIPTION
          col in db
static String COLUMN_DISPLAY_EXTENSION
          col in db
static String COLUMN_DISPLAY_NAME
          col in db
static String COLUMN_EXTENSION
          col in db
static String COLUMN_ID
          id col in db
static String COLUMN_ID_INDEX
          unique number for this group
static String COLUMN_LAST_IMMEDIATE_MEMBERSHIP_CHANGE
          timestamp of the last immediate membership change for this group
static String COLUMN_LAST_MEMBERSHIP_CHANGE
          timestamp of the last membership change for this group
static String COLUMN_MODIFIER_ID
          col in db
static String COLUMN_MODIFY_TIME
          col in db
static String COLUMN_NAME
          col in db
static String COLUMN_OLD_ID
          old id col for id conversion
static String COLUMN_OLD_UUID
          old uuid id col for id conversion
static String COLUMN_PARENT_STEM
          col in db
static String COLUMN_TYPE_OF_GROUP
          if this is a group or role
static String COLUMN_UUID
          uuid col in db (not used anymore)
static String FIELD_ALTERNATE_NAME_DB
          constant for field name for: alternateNameDb
static String FIELD_CREATE_TIME
          constant for field name for: createTime
static String FIELD_CREATOR_UUID
          constant for field name for: creatorUUID
static String FIELD_DB_VERSION
          constant for field name for: dbVersion
static String FIELD_DESCRIPTION
          constant for field name for: description
static String FIELD_DISPLAY_EXTENSION
          constant for field name for: displayExtension
static String FIELD_DISPLAY_NAME
          constant for field name for: displayName
static String FIELD_EXTENSION
          constant for field name for: extension
static String FIELD_ID_INDEX
          constant for field name for: idIndex
static String FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB
          constant for field name for: lastImmediateMembershipChangeDb
static String FIELD_LAST_MEMBERSHIP_CHANGE_DB
          constant for field name for: lastMembershipChangeDb
static String FIELD_MODIFIER_UUID
          constant for field name for: modifierUUID
static String FIELD_MODIFY_TIME
          constant for field name for: modifyTime
static String FIELD_NAME
          constant for field name for: name
static String FIELD_PARENT_UUID
          constant for field name for: parentUuid
static String FIELD_TYPE_OF_GROUP
          constant for field name for: typeOfGroup
static String FIELD_UUID
          constant for field name for: uuid
static Set<String> INTERNAL_FIELD_ATTRIBUTES
          list of internal field attributes, access with method so it can lazy load
static String TABLE_GROUPER_GROUPS
          name of the groups table in the db
static String VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY
           
static String VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY
           
static String VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY
           
static String VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY
           
static String VALIDATION_GROUP_NAME_TOO_LONG_KEY
           
 
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
Group()
           
 
Method Summary
 String __getId()
          if of this object
 String __getName()
          name of this object (for logging)
static boolean _internal_fieldAttribute(String attributeName)
          see if field attribute (name, description, extension, displayName, displayExtension)
 void addAlternateName(String alternateName)
          Add an alternate name for this group.
 Composite addCompositeMember(CompositeType type, Group left, Group right)
          Add a composite membership to this group.
 void addMember(edu.internet2.middleware.subject.Subject subj)
          Add a subject to this group as immediate member.
 boolean addMember(edu.internet2.middleware.subject.Subject subj, boolean exceptionIfAlreadyMember)
          Add a subject to this group as immediate member.
 boolean addMember(edu.internet2.middleware.subject.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
 boolean addMember(edu.internet2.middleware.subject.Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked)
          Deprecated. use addOrEditMember instead
 void addMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Add a subject to this group as immediate member.
 boolean addMember(edu.internet2.middleware.subject.Subject subj, Field f, boolean exceptionIfAlreadyMember)
          Add a subject to this group as immediate member.
 boolean addOrEditMember(edu.internet2.middleware.subject.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
 boolean addOrEditMember(edu.internet2.middleware.subject.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
 void addType(GroupType type)
          Deprecated.  
 boolean addType(GroupType type, boolean exceptionIfAlreadyHasType)
          Deprecated.  
 void assignCompositeMember(CompositeType type, Group left, Group right)
          Add ore replace a composite membership to this group.
 boolean assignIdIndex(long theIdIndex)
          assign different id index
 boolean canHavePrivilege(edu.internet2.middleware.subject.Subject subject, String privilegeOrListName, boolean secure)
          see if the subject has a privilege or another privilege that implies this privilege.
 boolean canReadField(Field f)
          Check whether the Subject that loaded this Group can read the specified Field.
 boolean canReadField(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the specified Subject can read the specified Field.
 boolean canWriteField(Field f)
          Check whether the Subject that loaded this Group can write the specified Field.
 boolean canWriteField(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the specified Subject can write the specified Field.
 Group clone()
          deep clone the fields in this object
 int compareTo(Object that)
           
 Group copy(Stem stem)
          Copy this group to another Stem.
 Group dbVersion()
          version of this object in the database
 Set<String> dbVersionDifferentFields()
          see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName
 Set<String> dbVersionDifferentFields(boolean failIfNull)
           
 void dbVersionReset()
          take a snapshot of the data since this is what is in the db
 void delete()
          Delete this group from the Groups Registry.
 boolean deleteAlternateName(String alternateName)
          Delete the specified alternate name.
 void deleteAttribute(String attrName)
          Deprecated.  
 void deleteAttribute(String attrName, boolean failOnRequiredAttribute)
          Deprecated.  
 void deleteCompositeMember()
          Delete a Composite membership from this group.
 void deleteMember(Member member)
          Delete a member from this group, and member must be immediate member.
 boolean deleteMember(Member member, boolean exceptionIfAlreadyDeleted)
          Delete a member from this group, and member must be immediate member.
 void deleteMember(Member member, Field f)
          Delete a member from this group, and member must be immediate member.
 boolean deleteMember(Member member, Field f, boolean exceptionIfAlreadyDeleted)
          Delete a member from this group, and member must be immediate member.
 void deleteMember(edu.internet2.middleware.subject.Subject subj)
          Delete a subject from this group, and subject must be immediate member.
 boolean deleteMember(edu.internet2.middleware.subject.Subject subj, boolean exceptionIfAlreadyDeleted)
          Delete a subject from this group, and subject must be immediate member.
 void deleteMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Delete a subject from this group, and subject must be immediate member.
 boolean deleteMember(edu.internet2.middleware.subject.Subject subj, Field f, boolean exceptionIfAlreadyDeleted)
          Delete a subject from this group, and subject must be immediate member.
static boolean deleteOccuring()
          see if we are in the middle of a delete (e.g.
 void deleteType(GroupType type)
          Deprecated.  
 boolean equals(Object other)
           
 Object fieldValue(String fieldName)
          call this method to get the field value (e.g.
 Set<edu.internet2.middleware.subject.Subject> getAdmins()
          Get subjects with the ADMIN privilege on this group.
 String getAlternateName()
          Returns the alternate name for the group.
 String getAlternateNameDb()
          Returns the alternate name for the group.
 Set<String> getAlternateNames()
          Returns the alternate names for the group.
 String getAttribute(String attr)
          Deprecated. 
 AttributeAssignGroupDelegate getAttributeDelegate()
          get the logic delegate
 AttributeAssignEffMshipDelegate getAttributeDelegateEffMship(Member member)
          delegate for effective memberships
 AttributeAssignMembershipDelegate getAttributeDelegateMembership(Member member)
          delegate for effective memberships
 AttributeAssignMembershipDelegate getAttributeDelegateMembership(Member member, Field field)
          delegate for effective memberships
 String getAttributeOrFieldValue(String attributeOrFieldName, boolean checkSecurity, boolean exceptionIfAttributeNotFound)
          Deprecated.  
 String getAttributeOrNull(String attributeName)
          Deprecated. use getAttributeValue()
 Map<String,String> getAttributes()
          Deprecated. use getAttributesMap
 Map<String,String> getAttributesDb()
          Deprecated. 
 Map<String,Attribute> getAttributesMap(boolean checkSecurity)
          Deprecated.  
 String getAttributeValue(String attributeName, boolean checkSecurity, boolean exceptionIfNotFound)
          Deprecated.  
 AttributeValueDelegate getAttributeValueDelegate()
          this delegate works on attributes and values at the same time
 AttributeValueDelegate getAttributeValueDelegateEffMship(Member member)
          this delegate works on attributes and values at the same time
 AttributeValueDelegate getAttributeValueDelegateMembership(Member member)
          this delegate works on attributes and values at the same time
 AttributeValueDelegate getAttributeValueDelegateMembership(Member member, Field field)
          this delegate works on attributes and values at the same time
 Composite getComposite()
          Deprecated. use the overload with boolean instead
 Composite getComposite(boolean throwExceptionIfNotFound)
          if this is a composite group, get the composite object for this group
 Set<Member> getCompositeMembers()
          Get Composite Members of this group.
 Set<Member> getCompositeMembers(Field field, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions)
          Get Composite Members of this group.
 Set<Member> getCompositeMembers(QueryOptions queryOptions)
          Get Composite Members of this group.
 Set<Membership> getCompositeMemberships()
          Get Composite Memberships of this group.
 Set<Membership> getCompositeMemberships(Collection<Member> members)
          Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group.
 String getContextId()
          context id of the transaction
 edu.internet2.middleware.subject.Subject getCreateSubject()
          Get subject that created this group.
 Date getCreateTime()
          Get creation time for this group.
 long getCreateTimeLong()
           
 String getCreatorUuid()
           
static Field getDefaultList()
          Retrieve default members Field.
 String getDescription()
          Get group description.
 String getDescriptionDb()
          Get group description for hibernate.
 String getDisplayExtension()
          Get group displayExtension.
 String getDisplayExtensionDb()
          hibernate method
 String getDisplayName()
          Get group displayName.
 String getDisplayNameDb()
          Get group displayName for hibernate.
 Set<Member> getEffectiveMembers()
          Get effective members of this group.
 Set<Member> getEffectiveMembers(Field f)
          Get effective members of this group.
 Set<Member> getEffectiveMembers(Field f, QueryOptions queryOptions)
          Get effective members of this group.
 Set<Member> getEffectiveMembers(Field f, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions)
          Get effective members of this group.
 Set<Membership> getEffectiveMemberships()
          Get effective memberships of this group.
 Set<Membership> getEffectiveMemberships(Field f)
          Get effective memberships of this group.
 Set<Membership> getEffectiveMemberships(Field f, Collection<Member> members)
          Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group.
 String getExtension()
          Get group extension.
 String getExtensionDb()
          hibernate method
 Set<edu.internet2.middleware.subject.Subject> getGroupAttrReaders()
          Get subjects with the GROUP_ATTR_READ privilege on this group.
 Set<edu.internet2.middleware.subject.Subject> getGroupAttrUpdaters()
          Get subjects with the GROUP_ATTR_UPDATE privilege on this group.
 String getId()
          uuid of role
 Long getIdIndex()
          id of the group as a unique integer
 Set<Member> getImmediateMembers()
          Get immediate members of this group.
 Set<Member> getImmediateMembers(Field f)
          Get immediate members of this group.
 Set<Member> getImmediateMembers(Field f, QueryOptions queryOptions)
          Get immediate members of this group.
 Set<Member> getImmediateMembers(Field f, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions)
          Get immediate members of this group.
 Set<Member> getImmediateMembers(Field f, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions, SortStringEnum memberSortStringEnum, SearchStringEnum memberSearchStringEnum, String memberSearchStringValue)
          Get immediate members of this group.
 Membership getImmediateMembership(Field f, Member member, boolean enabledOnly, boolean exceptionIfNotFound)
          Get membership of this group, for a certain member A membership is the object which represents a join of member and group.
 Membership getImmediateMembership(Field f, edu.internet2.middleware.subject.Subject subject, boolean enabledOnly, boolean exceptionIfNotFound)
          Get membership of this group, for a certain member A membership is the object which represents a join of member and group.
 Set<Membership> getImmediateMemberships()
          Get immediate memberships of this group.
 Set<Membership> getImmediateMemberships(Field f)
          An immediate member is directly assigned to a group.
 Set<Membership> getImmediateMemberships(Field f, Collection<Member> members)
          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.
 Set<Membership> getImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly)
          Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group.
 Timestamp getLastImmediateMembershipChange()
          when the last immediate member has changed
 Long getLastImmediateMembershipChangeDb()
          when the last immediate member has changed
 Timestamp getLastMembershipChange()
          when the last member has changed
 Long getLastMembershipChangeDb()
          when the last member has changed
 Set<Member> getMembers()
          Get members of this group.
 Set<Member> getMembers(Field f)
          Get members of this group.
 Set<Member> getMembers(Field f, QueryOptions queryOptions)
          Get members of this group.
 Set<Member> getMembers(Field f, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions)
          Get members of this group.
 Set<Membership> getMemberships()
          Get memberships of this group.
 Set<Membership> getMemberships(Field f)
          Get memberships of this group.
 Set<Membership> getMemberships(Field f, Collection<Member> members)
          Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group.
 String getModifierUuid()
           
 edu.internet2.middleware.subject.Subject getModifySubject()
          Get subject that last modified this group.
 Date getModifyTime()
          Get last modified time for this group.
 long getModifyTimeLong()
           
 String getName()
          Get group name.
 String getNameDb()
          Get group name for hibernate.
 Set<Member> getNonImmediateMembers()
          Get non immediate members of this group.
 Set<Member> getNonImmediateMembers(Field f)
          Get non-immediate members of this group.
 Set<Member> getNonImmediateMembers(Field f, QueryOptions queryOptions)
          Get non-immediate members of this group.
 Set<Member> getNonImmediateMembers(Field f, Set<edu.internet2.middleware.subject.Source> sources, QueryOptions queryOptions)
          Get non-immediate members of this group.
 Set<Membership> getNonImmediateMemberships()
          Get nonimmediate memberships of this group.
 Set<Membership> getNonImmediateMemberships(Field f)
          An immediate member is directly assigned to a group.
 Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members)
          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.
 Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly)
          Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group.
 Set<edu.internet2.middleware.subject.Subject> getOptins()
          Get subjects with the OPTIN privilege on this group.
 Set<edu.internet2.middleware.subject.Subject> getOptouts()
          Get subjects with the OPTOUT privilege on this group.
 Stem getParentStem()
          Get parent stem.
 String getParentStemName()
          get the name of the parent stem
 String getParentUuid()
           
 PermissionRoleDelegate getPermissionRoleDelegate()
          delegate calls to this class for permission role stuff
 Set<AccessPrivilege> getPrivs(edu.internet2.middleware.subject.Subject subj)
          Get privileges that the specified subject has on this group.
 Set<edu.internet2.middleware.subject.Subject> getReaders()
          Get subjects with the READ privilege on this group.
 Set<GroupType> getRemovableTypes()
          Deprecated.  
 RoleInheritanceDelegate getRoleInheritanceDelegate()
          delegate calls to this class for role hierarchy stuff
 String getStemId()
          stem that this attribute is in
 TypeOfGroup getTypeOfGroup()
          type of group, group or role
 String getTypeOfGroupDb()
          type of group, group or role
 Set<GroupType> getTypes()
          Deprecated.  
 Set<GroupType> getTypes(boolean checkSecurity)
          Deprecated.  
 Set<GroupType> getTypesDb()
          Deprecated.  
 Set<edu.internet2.middleware.subject.Subject> getUpdaters()
          Get subjects with the UPDATE privilege on this group.
 String getUuid()
           
 Set<edu.internet2.middleware.subject.Subject> getViewers()
          Get subjects with the VIEW privilege on this group.
 void grantPriv(edu.internet2.middleware.subject.Subject subj, Privilege priv)
          Grant privilege to a subject on this group.
 boolean grantPriv(edu.internet2.middleware.subject.Subject subj, Privilege priv, boolean exceptionIfAlreadyMember)
          Grant privilege to a subject on this group.
 boolean hasAdmin(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has ADMIN on this group.
 boolean hasComposite()
          Does this Group have a Composite membership.
 boolean hasEffectiveMember(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject is an effective member of this group.
 boolean hasEffectiveMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the subject is an effective member of this group.
 boolean hasGroupAttrRead(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has GROUP_ATTR_READ on this group.
 boolean hasGroupAttrUpdate(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has GROUP_ATTR_UPDATE on this group.
 int hashCode()
           
 boolean hasImmediateMember(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject is an immediate member of this group.
 boolean hasImmediateMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the subject is an immediate member of this group.
 boolean hasMember(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject is a member of this group.
 boolean hasMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the subject is a member of this list on this group.
 boolean hasNonImmediateMember(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject is a non immediate member of this group.
 boolean hasNonImmediateMember(edu.internet2.middleware.subject.Subject subj, Field f)
          Check whether the subject is a non immediate member of this group.
 boolean hasOptin(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has OPTIN on this group.
 boolean hasOptout(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has OPTOUT on this group.
 boolean hasPrivilege(edu.internet2.middleware.subject.Subject subject, String privilegeOrListName)
          see if the subject has a privilege
 boolean hasRead(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has READ on this group.
 boolean hasType(GroupType type)
          Check whether group has the specified type.
 boolean hasType(GroupType type, boolean checkSecurity)
          Check whether group has the specified type.
 boolean hasUpdate(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has UPDATE on this group.
 boolean hasView(edu.internet2.middleware.subject.Subject subj)
          Check whether the subject has VIEW on this group.
static void initData(Collection<Group> groups)
          init attributes etc for multiple groups at once
 Composite internal_addCompositeMember(GrouperSession session, CompositeType type, Group left, Group right, String uuid)
           
 boolean internal_addMember(edu.internet2.middleware.subject.Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate)
          Add a subject to this group as immediate member.
 boolean internal_addType(GroupType type, String groupTypeAssignmentId, boolean exceptionIfAlreadyHasType)
           
 boolean internal_canWriteField(edu.internet2.middleware.subject.Subject subj, Field f)
          TODO 20070531 make into some flavor of validator
 Map<String,AttributeAssign> internal_getGroupTypeAssignments()
           
 boolean internal_grantPriv(edu.internet2.middleware.subject.Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid)
          Grant privilege to a subject on this group.
 Attribute internal_setAttribute(String attributeName, String value, boolean checkPrivileges, String uuid)
          Set an attribute value.
 boolean isComposite()
          Is this Group a factor in a Composite membership.
 boolean isHasComposite()
          Does this Group have a Composite membership.
 boolean isHasMembers()
          more efficient? way to see if there are any members you need read on the group to call this method
 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)
 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)
 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)
 boolean matchesLowerSearchStrings(Set<String> filterStrings)
          see if this object matches the filter strings
 void move(Stem stem)
          Move this group to another Stem.
 boolean onDelete(org.hibernate.Session hs)
           
 void onPostDelete(HibernateSession hibernateSession)
          after a delete occurs
 void onPostSave(HibernateSession hibernateSession)
          after a save (insert) occurs
 void onPostUpdate(HibernateSession hibernateSession)
          after an update occurs
 void onPreDelete(HibernateSession hibernateSession)
          before a delete (insert) occurs
 void onPreSave(HibernateSession hibernateSession)
          before a save (insert) occurs
 void onPreUpdate(HibernateSession hibernateSession)
          before an update occurs
 boolean onSave(org.hibernate.Session hs)
           
 int replaceMembers(Collection<edu.internet2.middleware.subject.Subject> newSubjectList)
          replace the member list with new list.
 int replaceMembers(Collection<edu.internet2.middleware.subject.Subject> newSubjectList, Field field)
          replace the member list with new list.
 void revokePriv(Privilege priv)
          Revoke all privileges of the specified type on this group.
 void revokePriv(edu.internet2.middleware.subject.Subject subj, Privilege priv)
          Revoke a privilege from the specified subject.
 boolean revokePriv(edu.internet2.middleware.subject.Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked)
          Revoke a privilege from the specified subject.
static Group saveGroup(GrouperSession GROUPER_SESSION, String groupNameToEdit, String uuid, String name, String displayExtension, String description, SaveMode saveMode, boolean createParentStemsIfNotExist)
           create or update a group.
 void setAlternateNameDb(String alternateName)
          Set the group's alternate name Used by hibernate.
 void setAttribute(String attributeName, String value)
          Deprecated.  
 void setAttribute(String attributeName, String value, boolean checkPrivileges)
          Deprecated.  
 void setAttributes(Map<String,String> attributes)
          Deprecated.  
 void setContextId(String contextId1)
          context id of the transaction
 void setCreateTimeLong(long createTime)
           
 void setCreatorUuid(String creatorUUID)
           
 void setDescription(String value)
          Set group description.
 void setDescriptionDb(String value)
          Set group description (hibernate method).
 void setDisplayExtension(String value)
          Set group displayExtension.
 void setDisplayExtensionDb(String value)
          hibernate method
 void setDisplayName(String value)
          This is really only for hibernate
 void setDisplayNameDb(String value)
          This is really only for hibernate
 void setDontSetModified(boolean theDontSetModified)
          if we should not set the modified attributes on group save
 void setExtension(String value)
          Set group extension.
 void setExtension(String value, boolean assignAlternateName)
          Set group extension.
 void setExtensionDb(String value)
          hibernate method
 void setId(String id1)
          id of this attribute def name
 void setIdIndex(Long idIndex1)
          id of the group as a unique integer
 void setLastImmediateMembershipChangeDb(Long theImmediateMembershipLastChange)
          when the last immediate member has changed
 void setLastMembershipChangeDb(Long theMembershipLastChange)
          when the last member has changed
 void setModifierUuid(String modifierUUID)
           
 void setModifyTimeLong(long modifyTime)
           
 void setName(String value)
          Set group name.
 void setNameDb(String value)
          Set group name.
 void setParentUuid(String parentUUID)
           
 void setStemId(String stemId1)
          stem that this attribute is in
 void setTypeOfGroup(TypeOfGroup typeOfGroup1)
          type of group, group or role
 void setTypeOfGroupDb(String typeOfGroup1)
          type of group, group or role
 void setTypes(Set<GroupType> types)
           
 void setUuid(String uuid)
           
 void store()
          store this object to the DB.
 Member toMember()
          Convert this group to a Member object.
 String toString()
           
 String toStringDb()
           
 edu.internet2.middleware.subject.Subject toSubject()
          Convert this group to a Subject object.
 void validate()
           
 void xmlCopyBusinessPropertiesToExisting(Group existingRecord)
          copy business (non update) properties to an existing record
 boolean xmlDifferentBusinessProperties(Group other)
          see if the non update cols are different (e.g.
 boolean xmlDifferentUpdateProperties(Group other)
          see if the update cols are different (e.g.
 String xmlGetId()
          set id key in db
 Group xmlRetrieveByIdOrKey()
          retrieve from db by id or key.
 Group xmlSaveBusinessProperties(Group existingRecord)
          save the business properties (not update properties)
 void xmlSaveUpdateProperties()
          save the udpate properties (e.g.
 void xmlSetId(String theId)
          set id key in db
 XmlExportGroup xmlToExportGroup(GrouperVersion grouperVersion)
          convert to xml bean for export
 String xmlToString()
          convert to string for log
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, getHibernateVersionNumber, onLoad, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY

public static final String VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY
See Also:
Constant Field Values

VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY

public static final String VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY
See Also:
Constant Field Values

VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY

public static final String VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY
See Also:
Constant Field Values

VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY

public static final String VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY
See Also:
Constant Field Values

VALIDATION_GROUP_NAME_TOO_LONG_KEY

public static final String VALIDATION_GROUP_NAME_TOO_LONG_KEY
See Also:
Constant Field Values

TABLE_GROUPER_GROUPS

public static final String TABLE_GROUPER_GROUPS
name of the groups table in the db

See Also:
Constant Field Values

COLUMN_UUID

public static final String COLUMN_UUID
uuid col in db (not used anymore)

See Also:
Constant Field Values

COLUMN_ID

public static final String COLUMN_ID
id col in db

See Also:
Constant Field Values

COLUMN_PARENT_STEM

public static final String COLUMN_PARENT_STEM
col in db

See Also:
Constant Field Values

COLUMN_CREATOR_ID

public static final String COLUMN_CREATOR_ID
col in db

See Also:
Constant Field Values

COLUMN_CREATE_TIME

public static final String COLUMN_CREATE_TIME
col in db

See Also:
Constant Field Values

COLUMN_MODIFIER_ID

public static final String COLUMN_MODIFIER_ID
col in db

See Also:
Constant Field Values

COLUMN_MODIFY_TIME

public static final String COLUMN_MODIFY_TIME
col in db

See Also:
Constant Field Values

COLUMN_NAME

public static final String COLUMN_NAME
col in db

See Also:
Constant Field Values

COLUMN_DISPLAY_NAME

public static final String COLUMN_DISPLAY_NAME
col in db

See Also:
Constant Field Values

COLUMN_EXTENSION

public static final String COLUMN_EXTENSION
col in db

See Also:
Constant Field Values

COLUMN_DISPLAY_EXTENSION

public static final String COLUMN_DISPLAY_EXTENSION
col in db

See Also:
Constant Field Values

COLUMN_DESCRIPTION

public static final String COLUMN_DESCRIPTION
col in db

See Also:
Constant Field Values

COLUMN_OLD_ID

public static final String COLUMN_OLD_ID
old id col for id conversion

See Also:
Constant Field Values

COLUMN_OLD_UUID

public static final String COLUMN_OLD_UUID
old uuid id col for id conversion

See Also:
Constant Field Values

COLUMN_LAST_MEMBERSHIP_CHANGE

public static final String COLUMN_LAST_MEMBERSHIP_CHANGE
timestamp of the last membership change for this group

See Also:
Constant Field Values

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:
Constant Field Values

COLUMN_ALTERNATE_NAME

public static final String COLUMN_ALTERNATE_NAME
an alternate name for this group

See Also:
Constant Field Values

COLUMN_TYPE_OF_GROUP

public static final String COLUMN_TYPE_OF_GROUP
if this is a group or role

See Also:
Constant Field Values

COLUMN_ID_INDEX

public static final String COLUMN_ID_INDEX
unique number for this group

See Also:
Constant Field Values

FIELD_ALTERNATE_NAME_DB

public static final String FIELD_ALTERNATE_NAME_DB
constant for field name for: alternateNameDb

See Also:
Constant Field Values

FIELD_CREATE_TIME

public static final String FIELD_CREATE_TIME
constant for field name for: createTime

See Also:
Constant Field Values

FIELD_CREATOR_UUID

public static final String FIELD_CREATOR_UUID
constant for field name for: creatorUUID

See Also:
Constant Field Values

FIELD_DB_VERSION

public static final String FIELD_DB_VERSION
constant for field name for: dbVersion

See Also:
Constant Field Values

FIELD_DESCRIPTION

public static final String FIELD_DESCRIPTION
constant for field name for: description

See Also:
Constant Field Values

FIELD_DISPLAY_EXTENSION

public static final String FIELD_DISPLAY_EXTENSION
constant for field name for: displayExtension

See Also:
Constant Field Values

FIELD_DISPLAY_NAME

public static final String FIELD_DISPLAY_NAME
constant for field name for: displayName

See Also:
Constant Field Values

FIELD_EXTENSION

public static final String FIELD_EXTENSION
constant for field name for: extension

See Also:
Constant Field Values

FIELD_ID_INDEX

public static final String FIELD_ID_INDEX
constant for field name for: idIndex

See Also:
Constant Field Values

FIELD_LAST_MEMBERSHIP_CHANGE_DB

public static final String FIELD_LAST_MEMBERSHIP_CHANGE_DB
constant for field name for: lastMembershipChangeDb

See Also:
Constant Field Values

FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB

public static final String FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB
constant for field name for: lastImmediateMembershipChangeDb

See Also:
Constant Field Values

FIELD_MODIFIER_UUID

public static final String FIELD_MODIFIER_UUID
constant for field name for: modifierUUID

See Also:
Constant Field Values

FIELD_MODIFY_TIME

public static final String FIELD_MODIFY_TIME
constant for field name for: modifyTime

See Also:
Constant Field Values

FIELD_NAME

public static final String FIELD_NAME
constant for field name for: name

See Also:
Constant Field Values

FIELD_PARENT_UUID

public static final String FIELD_PARENT_UUID
constant for field name for: parentUuid

See Also:
Constant Field Values

FIELD_TYPE_OF_GROUP

public static final String FIELD_TYPE_OF_GROUP
constant for field name for: typeOfGroup

See Also:
Constant Field Values

FIELD_UUID

public static final String FIELD_UUID
constant for field name for: uuid

See Also:
Constant Field Values

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 Detail

Group

public Group()
Method Detail

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 -

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:
getAttributeDelegate()

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:
getAttributeValueDelegate()

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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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

public void addMember(edu.internet2.middleware.subject.Subject subj,
                      Field f)
               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.
Throws:
InsufficientPrivilegeException
MemberAddException
SchemaException

addMember

public boolean addMember(edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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

addType

public void addType(GroupType type)
             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.
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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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

public void delete()
            throws GroupDeleteException,
                   InsufficientPrivilegeException
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

public void deleteAttribute(String attrName)
                     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.
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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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

public void deleteMember(edu.internet2.middleware.subject.Subject subj,
                         Field f)
                  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.
Throws:
InsufficientPrivilegeException
MemberDeleteException
SchemaException

deleteMember

public boolean deleteMember(edu.internet2.middleware.subject.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

deleteType

public void deleteType(GroupType type)
                throws GroupModifyException,
                       InsufficientPrivilegeException,
                       SchemaException
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<edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Subject getCreateSubject()
                                                          throws edu.internet2.middleware.subject.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:
edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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,
                                         edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.Subject getModifySubject()
                                                          throws edu.internet2.middleware.subject.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:
edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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();
 

Returns:
Parent Stem.
Throws:
IllegalStateException

getPrivs

public Set<AccessPrivilege> getPrivs(edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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

public void grantPriv(edu.internet2.middleware.subject.Subject subj,
                      Privilege priv)
               throws GrantPrivilegeException,
                      InsufficientPrivilegeException,
                      SchemaException
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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.Subject subject,
                            String privilegeOrListName)
see if the subject has a privilege

Parameters:
subject -
privilegeOrListName -
Returns:
true if has privilege

hasAdmin

public boolean hasAdmin(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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:
hasComposite()

hasEffectiveMember

public boolean hasEffectiveMember(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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:
hasMember(Subject)

hasMember

public boolean hasMember(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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

public void revokePriv(Privilege priv)
                throws InsufficientPrivilegeException,
                       RevokePrivilegeException,
                       SchemaException
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

public void revokePriv(edu.internet2.middleware.subject.Subject subj,
                       Privilege priv)
                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
 }
 

Parameters:
subj - Revoke privilege from this subject.
priv - Revoke this privilege.
Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException

revokePriv

public boolean revokePriv(edu.internet2.middleware.subject.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 edu.internet2.middleware.subject.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:
Object.toString()

internal_canWriteField

public boolean internal_canWriteField(edu.internet2.middleware.subject.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:
GrouperAPI.dbVersionDifferentFields()

dbVersionDifferentFields

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

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:
Object.clone()

equals

public boolean equals(Object other)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

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:
GrouperAPI.dbVersion()

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:
GrouperAPI.onDelete(org.hibernate.Session)

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:
HibGrouperLifecycle.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
HibGrouperLifecycle.onPostUpdate(HibernateSession)

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 -

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:
GrouperAPI.onPostDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
GrouperAPI.onSave(org.hibernate.Session)

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:
GrouperAPI.onPreDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

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:
GrouperAPI.fieldValue(java.lang.String)

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:
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)

compareTo

public int compareTo(Object that)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

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

copy

public Group copy(Stem stem)
           throws GroupAddException,
                  InsufficientPrivilegeException
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:
GrouperSetElement.__getId()

__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:
GrouperSetElement.__getName()

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:
Role.getId()

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:
Role.getStemId()

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:
Role.setId(java.lang.String)

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:
Role.setStemId(java.lang.String)

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:
Role.getPermissionRoleDelegate()

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<edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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(edu.internet2.middleware.subject.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<edu.internet2.middleware.subject.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:
XmlImportableBase.xmlCopyBusinessPropertiesToExisting(java.lang.Object)

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:
XmlImportableBase.xmlDifferentBusinessProperties(java.lang.Object)

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:
XmlImportableBase.xmlDifferentUpdateProperties(java.lang.Object)

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:
XmlImportable.xmlRetrieveByIdOrKey()

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:
XmlImportableBase.xmlSaveBusinessProperties(java.lang.Object)

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:
XmlImportableBase.xmlSaveUpdateProperties()

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:
XmlImportableBase.xmlGetId()

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:
XmlImportableBase.xmlSetId(java.lang.String)

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:
XmlImportableBase.xmlToString()

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:
GrouperObject.matchesLowerSearchStrings(Set)

canHavePrivilege

public boolean canHavePrivilege(edu.internet2.middleware.subject.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