Package edu.internet2.middleware.grouper
Class Group
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Group
- All Implemented Interfaces:
AttributeAssignable,Entity,GrouperSetElement,HibGrouperLifecycle,Hib3GrouperVersioned,GrouperCloneable,GrouperHasContext,GrouperId,GrouperObject,Owner,Role,GrouperUtil.FieldValuable,XmlImportable<Group>,XmlImportableBase<Group>,Serializable,Comparable,org.hibernate.classic.Lifecycle
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 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringan alternate name for this groupstatic final Stringcol in dbstatic final Stringcol in dbstatic final Stringcol in dbstatic final Stringepoch time of when to disable membershipstatic final Stringcol in dbstatic final Stringcol in dbstatic final Stringwhether the membership is enabled or disabled: T|Fstatic final Stringepoch time of when to enable membershipstatic final Stringcol in dbstatic final Stringid col in dbstatic final Stringunique number for this groupstatic final Stringinernal unique number for this groupstatic final Stringtimestamp of the last immediate membership change for this groupstatic final Stringtimestamp of the last membership change for this groupstatic final Stringcol in dbstatic final Stringcol in dbstatic final Stringcol in dbstatic final Stringold id col for id conversionstatic final Stringold uuid id col for id conversionstatic final Stringcol in dbstatic final Stringif this is a group or rolestatic final Stringuuid col in db (not used anymore)static final Stringconstant for field name for: alternateNameDbstatic final Stringconstant for field name for: createTimestatic final Stringconstant for field name for: creatorUUIDstatic final Stringconstant for field name for: dbVersionstatic final Stringconstant for field name for: descriptionstatic final Stringconstant for field name for: disabledTimeDbstatic final Stringconstant for field name for: displayExtensionstatic final Stringconstant for field name for: displayNamestatic final Stringconstant for field name for: enabledstatic final Stringconstant for field name for: enabledTimeDbstatic final Stringconstant for field name for: extensionstatic final Stringconstant for field name for: idIndexstatic final Stringconstant for field name for: internalIdstatic final Stringconstant for field name for: lastImmediateMembershipChangeDbstatic final Stringconstant for field name for: lastMembershipChangeDbstatic final Stringconstant for field name for: modifierUUIDstatic final Stringconstant for field name for: modifyTimestatic final Stringconstant for field name for: namestatic final Stringconstant for field name for: parentUuidstatic final Stringconstant for field name for: typeOfGroupstatic final Stringconstant for field name for: uuidlist of internal field attributes, access with method so it can lazy loadstatic final Stringname of the groups table in the dbstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBERFields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription__getId()if of this objectname of this object (for logging)static boolean_internal_fieldAttribute(String attributeName) see if field attribute (name, description, extension, displayName, displayExtension)voidaddAlternateName(String alternateName) Add an alternate name for this group.addCompositeMember(CompositeType type, Group left, Group right) Add a composite membership to this group.voidAdd a subject to this group as immediate member.booleanAdd a subject to this group as immediate member.booleanaddMember(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 insteadbooleanaddMember(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) Deprecated.use addOrEditMember insteadvoidAdd a subject to this group as immediate member.booleanAdd a subject to this group as immediate member.booleanaddOrEditMember(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 changedbooleanaddOrEditMember(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 changedvoidDeprecated.booleanDeprecated.voidassignCompositeMember(CompositeType type, Group left, Group right) Add ore replace a composite membership to this group.booleanassignIdIndex(long theIdIndex) assign different id indexbooleancanHavePrivilege(Subject subject, String privilegeOrListName, boolean secure) see if the subject has a privilege or another privilege that implies this privilege.booleanbooleancanReadField(Subject subj, Field f) booleanbooleancanWriteField(Subject subj, Field f) clone()deep clone the fields in this objectintCopy this group to another Stem.version of this object in the databasesee which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeNamedbVersionDifferentFields(boolean failIfNull) voidtake a snapshot of the data since this is what is in the dbvoiddelete()Delete this group from the Groups Registry.voidDelete all direct memberships Groups Registry.booleandeleteAlternateName(String alternateName) Delete the specified alternate name.voiddeleteAttribute(String attrName) Deprecated.voiddeleteAttribute(String attrName, boolean failOnRequiredAttribute) Deprecated.voidDelete aCompositemembership from this group.voiddeleteMember(Member member) Delete a member from this group, and member must be immediate member.booleandeleteMember(Member member, boolean exceptionIfAlreadyDeleted) Delete a member from this group, and member must be immediate member.voiddeleteMember(Member member, Field f) Delete a member from this group, and member must be immediate member.booleandeleteMember(Member member, Field f, boolean exceptionIfAlreadyDeleted) Delete a member from this group, and member must be immediate member.voiddeleteMember(Subject subj) Delete a subject from this group, and subject must be immediate member.booleandeleteMember(Subject subj, boolean exceptionIfAlreadyDeleted) Delete a subject from this group, and subject must be immediate member.voiddeleteMember(Subject subj, Field f) Delete a subject from this group, and subject must be immediate member.booleandeleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted) Delete a subject from this group, and subject must be immediate member.static booleansee if we are in the middle of a delete (e.g. for hook)voiddeleteType(GroupType type) Deprecated.booleanfieldValue(String fieldName) call this method to get the field value (e.g. from dbVersionDifferentFields).Get subjects with the ADMIN privilege on this group.Returns the alternate name for the group.Returns the alternate name for the group.Returns the alternate names for the group.getAttribute(String attr) Deprecated.get the logic delegategetAttributeDelegateEffMship(Member member) delegate for effective membershipsgetAttributeDelegateMembership(Member member) delegate for effective membershipsgetAttributeDelegateMembership(Member member, Field field) delegate for effective membershipsgetAttributeOrFieldValue(String attributeOrFieldName, boolean checkSecurity, boolean exceptionIfAttributeNotFound) Deprecated.getAttributeOrNull(String attributeName) Deprecated.use getAttributeValue()Deprecated.use getAttributesMapDeprecated.getAttributesMap(boolean checkSecurity) Deprecated.getAttributeValue(String attributeName, boolean checkSecurity, boolean exceptionIfNotFound) Deprecated.this delegate works on attributes and values at the same timethis delegate works on attributes and values at the same timethis delegate works on attributes and values at the same timegetAttributeValueDelegateMembership(Member member, Field field) this delegate works on attributes and values at the same timeDeprecated.use the overload with boolean insteadgetComposite(boolean throwExceptionIfNotFound) if this is a composite group, get the composite object for this groupgetCompositeMembers(Field field, Set<Source> sources, QueryOptions queryOptions) getCompositeMembers(QueryOptions queryOptions) GetCompositeMemberships of this group.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.context id of the transactionGet subject that created this group.Get creation time for this group.longstatic FieldRetrieve default membersField.Get group description.Get group description for hibernate.Time when this group is disabled if the value is in the future.Time when this group is disabled if the value is in the future.Get group displayExtension.hibernate methodGet group displayName.Get group displayName for hibernate.Get effective members of this group.Get effective members of this group.getEffectiveMembers(Field f, QueryOptions queryOptions) Get effective members of this group.getEffectiveMembers(Field f, Set<Source> sources, QueryOptions queryOptions) Get effective members of this group.Get effective memberships of this group.Get effective memberships of this group.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.Whether or not this group is enabled.Time when this group is enabled if the value is in the future.Time when this group is enabled if the value is in the future.Get group extension.hibernate methodGet subjects with the GROUP_ATTR_READ privilege on this group.Get subjects with the GROUP_ATTR_UPDATE privilege on this group.getId()uuid of roleid of the group as a unique integerGet immediate members of this group.Get immediate members of this group.getImmediateMembers(Field f, QueryOptions queryOptions) Get immediate members of this group.getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) Get immediate members of this group.getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions, SortStringEnum memberSortStringEnum, SearchStringEnum memberSearchStringEnum, String memberSearchStringValue) Get immediate members of this group.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.getImmediateMembership(Field f, 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.Get immediate memberships of this group.An immediate member is directly assigned to a group.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.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.when the last immediate member has changedwhen the last immediate member has changedwhen the last member has changedwhen the last member has changedGet members of this group.getMembers(Field f) Get members of this group.getMembers(Field f, QueryOptions queryOptions) Get members of this group.getMembers(Field f, Set<Source> sources, QueryOptions queryOptions) Get members of this group.Get memberships of this group.getMemberships(boolean enabledOnly) Get memberships of this group.Get memberships of this group.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.Get subject that last modified this group.Get last modified time for this group.longgetName()Get group name.Get group name for hibernate.Get non immediate members of this group.Get non-immediate members of this group.getNonImmediateMembers(Field f, QueryOptions queryOptions) Get non-immediate members of this group.getNonImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) Get non-immediate members of this group.Get nonimmediate memberships of this group.An immediate member is directly assigned to a group.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.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.Get subjects with the OPTIN privilege on this group.Get subjects with the OPTOUT privilege on this group.Get parent stem.get the name of the parent stemdelegate calls to this class for permission role stuffGet privileges that the specified subject has on this group.Get subjects with the READ privilege on this group.Deprecated.delegate calls to this class for role hierarchy stuffstem that this attribute is intype of group, group or roletype of group, group or rolegetTypes()Deprecated.getTypes(boolean checkSecurity) Deprecated.Deprecated.Get subjects with the UPDATE privilege on this group.getUuid()Get subjects with the VIEW privilege on this group.voidGrant privilege to a subject on this group.booleanGrant privilege to a subject on this group.booleanCheck whether the subject has ADMIN on this group.booleanbooleanhasEffectiveMember(Subject subj) Check whether the subject is an effective member of this group.booleanhasEffectiveMember(Subject subj, Field f) Check whether the subject is an effective member of this group.booleanhasGroupAttrRead(Subject subj) Check whether the subject has GROUP_ATTR_READ on this group.booleanhasGroupAttrUpdate(Subject subj) Check whether the subject has GROUP_ATTR_UPDATE on this group.inthashCode()booleanhasImmediateMember(Subject subj) Check whether the subject is an immediate member of this group.booleanhasImmediateMember(Subject subj, Field f) Check whether the subject is an immediate member of this group.booleanCheck whether the subject is a member of this group.booleanCheck whether the subject is a member of this list on this group.booleanCheck whether the subject is a member of this group.booleanhasNonImmediateMember(Subject subj) Check whether the subject is a non immediate member of this group.booleanhasNonImmediateMember(Subject subj, Field f) Check whether the subject is a non immediate member of this group.booleanCheck whether the subject has OPTIN on this group.booleanCheck whether the subject has OPTOUT on this group.booleanhasPrivilege(Subject subject, String privilegeOrListName) see if the subject has a privilegebooleanCheck whether the subject has READ on this group.booleanCheck whether group has the specified type.booleanCheck whether group has the specified type.booleanCheck whether the subject has UPDATE on this group.booleanCheck whether the subject has VIEW on this group.static voidinitData(Collection<Group> groups) init attributes etc for multiple groups at onceprotected voidinternal_addAlternateName(String alternateName, boolean validateName) Add an alternate name for this group.internal_addCompositeMember(GrouperSession session, CompositeType type, Group left, Group right, String uuid) booleaninternal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate) Add a subject to this group as immediate member.booleaninternal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate, boolean checkSecurity) Add a subject to this group as immediate member.booleaninternal_addType(GroupType type, String groupTypeAssignmentId, boolean exceptionIfAlreadyHasType) booleaninternal_canWriteField(Subject subj, Field f) TODO 20070531 make into some flavor of validatorprotected Groupinternal_copy(Stem stem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes, boolean composite, boolean addDefaultGroupPrivileges, boolean checkSecurity, String extension, String displayExtension) booleaninternal_deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted, boolean checkSecurity) Delete a subject from this group, and subject must be immediate member.booleaninternal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) Grant privilege to a subject on this group.booleanShould this group be enabled based on the enabled and disabled dates?protected voidinternal_move(Stem stem, boolean assignAlternateName) internal_setAttribute(String attributeName, String value, boolean checkPrivileges, String uuid) Set an attribute value.booleanbooleanIs this group enabled?booleanbooleanmore efficient?voidmanageIncludesExcludesRequiredGroups(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)voidmanageIncludesExcludesRequiredGroups(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)voidmanageIncludesExcludesRequiredGroups(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)booleanmatchesLowerSearchStrings(Set<String> filterStrings) see if this object matches the filter stringsvoidMove this group to another Stem.booleanonDelete(org.hibernate.Session hs) voidonPostDelete(HibernateSession hibernateSession) after a delete occursvoidonPostSave(HibernateSession hibernateSession) after a save (insert) occursvoidonPostUpdate(HibernateSession hibernateSession) after an update occursvoidonPreDelete(HibernateSession hibernateSession) before a delete (insert) occursvoidonPreSave(HibernateSession hibernateSession) before a save (insert) occursvoidonPreUpdate(HibernateSession hibernateSession) before an update occursbooleanonSave(org.hibernate.Session hs) booleanonUpdate(org.hibernate.Session s) intreplaceMembers(Collection<Subject> newSubjectList) replace the member list with new list.intreplaceMembers(Collection<Subject> newSubjectList, Field field) replace the member list with new list.voidrevokePriv(Privilege priv) Revoke all privileges of the specified type on this group.voidrevokePriv(Subject subj, Privilege priv) Revoke a privilege from the specified subject.booleanrevokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) Revoke a privilege from the specified subject.static GroupsaveGroup(GrouperSession GROUPER_SESSION, String groupNameToEdit, String uuid, String name, String displayExtension, String description, SaveMode saveMode, boolean createParentStemsIfNotExist) create or update a group.voidsetAlternateNameDb(String alternateName) Set the group's alternate name Used by hibernate.voidsetAttribute(String attributeName, String value) Deprecated.voidsetAttribute(String attributeName, String value, boolean checkPrivileges) Deprecated.voidsetAttributes(Map<String, String> attributes) Deprecated.voidsetContextId(String contextId1) context id of the transactionvoidsetCreateTimeLong(long createTime) voidsetCreatorUuid(String creatorUUID) voidsetDescription(String value) Set group description.voidsetDescriptionDb(String value) Set group description (hibernate method).voidsetDisabledTime(Timestamp disabledTimeDb) Set the time to disable this group.voidsetDisabledTimeDb(Long disabledTimeDb) Set the time to disable this group.voidsetDisplayExtension(String value) Set group displayExtension.voidsetDisplayExtensionDb(String value) hibernate methodvoidsetDisplayName(String value) This is really only for hibernatevoidsetDisplayNameDb(String value) This is really only for hibernatevoidsetDontSetModified(boolean theDontSetModified) if we should not set the modified attributes on group savevoidsetEnabled(boolean enabled) Whether to enable or disable this group.voidsetEnabledDb(String enabled) Whether to enable or disable this group.voidsetEnabledTime(Timestamp enabledTimeDb) Set the time when this group should be enabled.voidsetEnabledTimeDb(Long enabledTimeDb) Set the time when this group should be enabled.voidsetExtension(String value) Set group extension.voidsetExtension(String value, boolean assignAlternateName) Set group extension.voidsetExtensionDb(String value) hibernate methodvoidid of this attribute def namevoidsetIdIndex(Long idIndex1) id of the group as a unique integervoidsetInternalId(Long internalId) voidsetLastImmediateMembershipChangeDb(Long theImmediateMembershipLastChange) when the last immediate member has changedvoidsetLastMembershipChangeDb(Long theMembershipLastChange) when the last member has changedvoidsetModifierUuid(String modifierUUID) voidsetModifyTimeLong(long modifyTime) voidSet group name.voidSet group name.voidsetParentUuid(String parentUUID) voidstem that this attribute is invoidsetTypeOfGroup(TypeOfGroup typeOfGroup1) type of group, group or rolevoidsetTypeOfGroupDb(String typeOfGroup1) type of group, group or rolevoidvoidvoidstore()store this object to the DB.toMember()Convert this group to aMemberobject.toString()Convert this group to aSubjectobject.voidvalidate()voidxmlCopyBusinessPropertiesToExisting(Group existingRecord) copy business (non update) properties to an existing recordbooleansee if the non update cols are different (e.g. name)booleansee if the update cols are different (e.g. last updated)xmlGetId()set id key in dbretrieve from db by id or key.xmlSaveBusinessProperties(Group existingRecord) save the business properties (not update properties)voidsave the udpate properties (e.g. last updated).voidset id key in dbxmlToExportGroup(GrouperVersion grouperVersion) convert to xml bean for exportconvert to string for logMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, getHibernateVersionNumber, onLoad, setHibernateVersionNumber
-
Field Details
-
VALIDATION_GROUP_DESCRIPTION_TOO_LONG_KEY
- See Also:
-
VALIDATION_GROUP_DISPLAY_EXTENSION_TOO_LONG_KEY
- See Also:
-
VALIDATION_GROUP_EXTENSION_TOO_LONG_KEY
- See Also:
-
VALIDATION_GROUP_DISPLAY_NAME_TOO_LONG_KEY
- See Also:
-
VALIDATION_GROUP_NAME_TOO_LONG_KEY
- See Also:
-
TABLE_GROUPER_GROUPS
name of the groups table in the db- See Also:
-
COLUMN_UUID
uuid col in db (not used anymore)- See Also:
-
COLUMN_ID
id col in db- See Also:
-
COLUMN_PARENT_STEM
col in db- See Also:
-
COLUMN_CREATOR_ID
col in db- See Also:
-
COLUMN_CREATE_TIME
col in db- See Also:
-
COLUMN_MODIFIER_ID
col in db- See Also:
-
COLUMN_MODIFY_TIME
col in db- See Also:
-
COLUMN_NAME
col in db- See Also:
-
COLUMN_DISPLAY_NAME
col in db- See Also:
-
COLUMN_EXTENSION
col in db- See Also:
-
COLUMN_DISPLAY_EXTENSION
col in db- See Also:
-
COLUMN_DESCRIPTION
col in db- See Also:
-
COLUMN_OLD_ID
old id col for id conversion- See Also:
-
COLUMN_OLD_UUID
old uuid id col for id conversion- See Also:
-
COLUMN_LAST_MEMBERSHIP_CHANGE
timestamp of the last membership change for this group- See Also:
-
COLUMN_LAST_IMMEDIATE_MEMBERSHIP_CHANGE
timestamp of the last immediate membership change for this group- See Also:
-
COLUMN_ALTERNATE_NAME
an alternate name for this group- See Also:
-
COLUMN_TYPE_OF_GROUP
if this is a group or role- See Also:
-
COLUMN_ID_INDEX
unique number for this group- See Also:
-
COLUMN_INTERNAL_ID
inernal unique number for this group- See Also:
-
COLUMN_DISABLED_TIMESTAMP
epoch time of when to disable membership- See Also:
-
COLUMN_ENABLED_TIMESTAMP
epoch time of when to enable membership- See Also:
-
COLUMN_ENABLED
whether the membership is enabled or disabled: T|F- See Also:
-
FIELD_ALTERNATE_NAME_DB
constant for field name for: alternateNameDb- See Also:
-
FIELD_CREATE_TIME
constant for field name for: createTime- See Also:
-
FIELD_CREATOR_UUID
constant for field name for: creatorUUID- See Also:
-
FIELD_DB_VERSION
constant for field name for: dbVersion- See Also:
-
FIELD_DESCRIPTION
constant for field name for: description- See Also:
-
FIELD_DISPLAY_EXTENSION
constant for field name for: displayExtension- See Also:
-
FIELD_DISPLAY_NAME
constant for field name for: displayName- See Also:
-
FIELD_EXTENSION
constant for field name for: extension- See Also:
-
FIELD_ID_INDEX
constant for field name for: idIndex- See Also:
-
FIELD_INTERNAL_ID
constant for field name for: internalId- See Also:
-
FIELD_LAST_MEMBERSHIP_CHANGE_DB
constant for field name for: lastMembershipChangeDb- See Also:
-
FIELD_LAST_IMMEDIATE_MEMBERSHIP_CHANGE_DB
constant for field name for: lastImmediateMembershipChangeDb- See Also:
-
FIELD_MODIFIER_UUID
constant for field name for: modifierUUID- See Also:
-
FIELD_MODIFY_TIME
constant for field name for: modifyTime- See Also:
-
FIELD_NAME
constant for field name for: name- See Also:
-
FIELD_PARENT_UUID
constant for field name for: parentUuid- See Also:
-
FIELD_TYPE_OF_GROUP
constant for field name for: typeOfGroup- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
FIELD_DISABLED_TIME_DB
constant for field name for: disabledTimeDb- See Also:
-
FIELD_ENABLED
constant for field name for: enabled- See Also:
-
FIELD_ENABLED_TIME_DB
constant for field name for: enabledTimeDb- See Also:
-
INTERNAL_FIELD_ATTRIBUTES
list of internal field attributes, access with method so it can lazy load
-
-
Constructor Details
-
Group
public Group()
-
-
Method Details
-
getComposite
Deprecated.use the overload with boolean insteadif this is a composite group, get the composite object for this group- Returns:
- the composite group
- Throws:
CompositeNotFoundException- if composite not found
-
getComposite
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 asgroupNameToEdit- is the name of the group to edit (or null if insert)description- new description for groupdisplayExtension- 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 truesaveMode- to constrain if insert only or update only, if null defaults to INSERT_OR_UPDATEcreateParentStemsIfNotExist- 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:
StemNotFoundExceptionInsufficientPrivilegeExceptionStemAddExceptionGroupModifyExceptionGroupNotFoundExceptionGroupAddException
-
getContextId
context id of the transaction- Specified by:
getContextIdin interfaceEntity- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextIdin interfaceGrouperHasContext- Parameters:
contextId1-
-
internal_isEnabledUsingTimestamps
public boolean internal_isEnabledUsingTimestamps()Should this group be enabled based on the enabled and disabled dates?- Returns:
- boolean
-
isEnabled
public boolean isEnabled()Is this group enabled?- Returns:
- boolean
-
setEnabled
public void setEnabled(boolean enabled) Whether to enable or disable this group.- Parameters:
enabled-
-
getEnabledDb
Whether or not this group is enabled.- Returns:
- the enabled
-
setEnabledDb
Whether to enable or disable this group.- Parameters:
enabled-
-
getEnabledTimeDb
Time when this group is enabled if the value is in the future.- Returns:
- Long
-
getEnabledTime
Time when this group is enabled if the value is in the future.- Returns:
- Timestamp
-
setEnabledTimeDb
Set the time when this group should be enabled.- Parameters:
enabledTimeDb-
-
setEnabledTime
Set the time when this group should be enabled.- Parameters:
enabledTimeDb-
-
getDisabledTimeDb
Time when this group is disabled if the value is in the future.- Returns:
- Long
-
getDisabledTime
Time when this group is disabled if the value is in the future.- Returns:
- Timestamp
-
setDisabledTimeDb
Set the time to disable this group.- Parameters:
disabledTimeDb-
-
setDisabledTime
Set the time to disable this group.- Parameters:
disabledTimeDb-
-
getInternalId
-
setInternalId
-
getAttributeDelegate
Description copied from interface:AttributeAssignableget the logic delegate- Specified by:
getAttributeDelegatein interfaceAttributeAssignable- Specified by:
getAttributeDelegatein interfaceEntity- Specified by:
getAttributeDelegatein interfaceRole- Returns:
- the delegate
- See Also:
-
getAttributeValueDelegate
this delegate works on attributes and values at the same time- Specified by:
getAttributeValueDelegatein interfaceAttributeAssignable- Specified by:
getAttributeValueDelegatein interfaceEntity- Specified by:
getAttributeValueDelegatein interfaceRole- Returns:
- the delegate
- See Also:
-
getAttributeDelegateEffMship
delegate for effective memberships- Parameters:
member-- Returns:
- the delegate
-
getAttributeValueDelegateEffMship
this delegate works on attributes and values at the same time- Parameters:
member-- Returns:
- the delegate
-
getAttributeDelegateMembership
delegate for effective memberships- Parameters:
member-- Returns:
- the delegate
-
getAttributeDelegateMembership
delegate for effective memberships- Parameters:
member-field-- Returns:
- the delegate
-
getAttributeValueDelegateMembership
this delegate works on attributes and values at the same time- Parameters:
member-field-- Returns:
- the delegate
-
getAttributeValueDelegateMembership
this delegate works on attributes and values at the same time- Parameters:
member-- Returns:
- the delegate
-
getDefaultList
Retrieve default membersField.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 thisCompositeType.left-Groupthat is left factor of of composite membership.right-Groupthat is right factor of composite membership.- Throws:
InsufficientPrivilegeExceptionMemberAddExceptionMemberDeleteException- 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 thisCompositeType.left-Groupthat is left factor of of composite membership.right-Groupthat is right factor of composite membership.- Returns:
- composite
- Throws:
InsufficientPrivilegeExceptionMemberAddException- Since:
- 1.0
-
addMember
Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.addMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to add members } catch (MemberAddException eMA) { // Unable to add subject }- Parameters:
subj- Add thisSubject- Throws:
InsufficientPrivilegeExceptionMemberAddException
-
addMember
public boolean addMember(Subject subj, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.addMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to add members } catch (MemberAddException eMA) { // Unable to add subject }- Specified by:
addMemberin interfaceRole- Parameters:
subj- Add thisSubjectexceptionIfAlreadyMember- 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:
InsufficientPrivilegeExceptionMemberAddException
-
addMember
public void addMember(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 membershipstry { 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 thisSubjectf- Add subject to thisField.- Throws:
InsufficientPrivilegeExceptionMemberAddExceptionSchemaException
-
addMember
public boolean addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException, SchemaException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { 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 thisSubjectf- Add subject to thisField.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:
InsufficientPrivilegeExceptionMemberAddExceptionSchemaException
-
replaceMembers
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
replace the member list with new list. Note this is not done in a tx so it can make as much progress as possible though feel free to put a tx outside of the call if you need it- Parameters:
newSubjectList-field-- Returns:
- the number of members changed
-
addMember
@Deprecated public boolean addMember(Subject subject, boolean defaultPrivs, boolean memberChecked, boolean adminChecked, boolean updateChecked, boolean readChecked, boolean viewChecked, boolean optinChecked, boolean optoutChecked, boolean attrReadChecked, boolean attrUpdateChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) Deprecated.use addOrEditMember insteadadd a member to group, take into account if any default privs should be changed- Parameters:
subject- to adddefaultPrivs- if true, forget about all the other checked paramsmemberChecked-adminChecked-updateChecked-readChecked-viewChecked-optinChecked-optoutChecked-attrReadChecked-attrUpdateChecked-startDate- on membershipendDate- on membershiprevokeIfUnchecked-- Returns:
- if something was changed
-
addOrEditMember
public boolean addOrEditMember(Subject subject, boolean defaultPrivs, boolean memberChecked, boolean adminChecked, boolean updateChecked, boolean readChecked, boolean viewChecked, boolean optinChecked, boolean optoutChecked, boolean attrReadChecked, boolean attrUpdateChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) add a member to group, take into account if any default privs should be changed- Parameters:
subject- to adddefaultPrivs- if true, forget about all the other checked paramsmemberChecked-adminChecked-updateChecked-readChecked-viewChecked-optinChecked-optoutChecked-attrReadChecked-attrUpdateChecked-startDate- on membershipendDate- on membershiprevokeIfUnchecked-- Returns:
- if something was changed
-
addMember
@Deprecated public boolean addMember(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) Deprecated.use addOrEditMember insteadadd a member to group, take into account if any default privs should be changed- Parameters:
subject- to adddefaultPrivs- if true, forget about all the other checked paramsmemberChecked-startDate- on membershipendDate- on membershiprevokeIfUnchecked-- Returns:
- if something was changed
-
addOrEditMember
public boolean addOrEditMember(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) add a member to group, take into account if any default privs should be changed- Parameters:
subject- to adddefaultPrivs- if true, forget about all the other checked paramsmemberChecked-startDate- on membershipendDate- on membershiprevokeIfUnchecked-- Returns:
- if something was changed
-
internal_addMember
public boolean internal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate) throws InsufficientPrivilegeException, MemberAddException, SchemaException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { 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 thisSubjectf- Add subject to thisField.exceptionIfAlreadyMember- if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the groupuuid- is uuid or null for generatedstartDate-endDate-- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
InsufficientPrivilegeExceptionMemberAddExceptionSchemaException
-
internal_addMember
public boolean internal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate, boolean checkSecurity) throws InsufficientPrivilegeException, MemberAddException, SchemaException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { 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 thisSubjectf- Add subject to thisField.exceptionIfAlreadyMember- if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the groupuuid- is uuid or null for generatedstartDate-endDate-- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
InsufficientPrivilegeExceptionMemberAddExceptionSchemaException
-
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- TheGroupTypeto 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- TheGroupTypeto 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:
GroupModifyExceptionInsufficientPrivilegeExceptionSchemaException
-
canReadField
Check whether theSubjectthat loaded thisGroupcan read the specifiedField.try { boolean rv = g.canReadField(f); } catch (SchemaException eS) { // invalid field }- Parameters:
f- Check privileges on thisField.- Returns:
- True if
Subjectcan readField, false otherwise. - Throws:
IllegalArgumentException- if nullFieldSchemaException- if invalidField- Since:
- 1.0
-
canReadField
Check whether the specifiedSubjectcan read the specifiedField.try { boolean rv = g.canReadField(subj, f); } catch (SchemaException eS) { // invalid field }- Parameters:
subj- Check privileges for thisSubject.f- Check privileges on thisField.- Returns:
- True if
Subjectcan readField, false otherwise. - Throws:
IllegalArgumentException- if nullSubjectorFieldSchemaException- if invalidFieldorSubject.- Since:
- 1.2.0
-
canWriteField
Check whether theSubjectthat loaded thisGroupcan write the specifiedField.try { boolean rv = g.canWriteField(f); } catch (SchemaException eS) { // invalid field }- Parameters:
f- Check privileges on thisField.- Returns:
- True if
Subjectcan writeField, false otherwise. - Throws:
IllegalArgumentException- if nullFieldSchemaException- if invalidField- Since:
- 1.0
-
canWriteField
public boolean canWriteField(Subject subj, Field f) throws IllegalArgumentException, SchemaException Check whether the specifiedSubjectcan write the specifiedField.try { boolean rv = g.canWriteField(subj, f); } catch (SchemaException eS) { // invalid field }- Parameters:
subj- Check privileges for thisSubject.f- Check privileges on thisField.- Returns:
- True if
Subjectcan writeField, false otherwise. - Throws:
IllegalArgumentException- if nullSubjectorFieldSchemaException- if invalidField- Since:
- 1.0
-
deleteOccuring
public static boolean deleteOccuring()see if we are in the middle of a delete (e.g. for hook)- Returns:
- true if delete is occurring
-
delete
Delete this group from the Groups Registry.try { g.delete(); } catch (GroupDeleteException e0) { // Unable to delete group } catch (InsufficientPrivilegeException e1) { // Not privileged to delete this group }- Specified by:
deletein interfaceEntity- Specified by:
deletein interfaceRole- Throws:
GroupDeleteExceptionInsufficientPrivilegeException
-
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:
AttributeNotFoundExceptionGroupModifyExceptionInsufficientPrivilegeException
-
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:
AttributeNotFoundExceptionGroupModifyExceptionInsufficientPrivilegeException
-
deleteCompositeMember
Delete aCompositemembership 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:
InsufficientPrivilegeExceptionMemberDeleteException- 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 membershipstry { g.deleteMember(member); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
member- Delete thisMemberexceptionIfAlreadyDeleted- throw exception if already deleted- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeExceptionMemberDeleteException
-
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 membershipstry { g.deleteMember(member); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
member- Delete thisMember- Throws:
InsufficientPrivilegeExceptionMemberDeleteException
-
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 membershipstry { g.deleteMember(m, f); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
member- Delete thisMember.f- Delete subject from thisField.exceptionIfAlreadyDeleted-- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeExceptionMemberDeleteExceptionSchemaException
-
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 membershipstry { g.deleteMember(m, f); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
member- Delete thisMember.f- Delete subject from thisField.- Throws:
InsufficientPrivilegeExceptionMemberDeleteExceptionSchemaException
-
deleteMember
Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
subj- Delete thisSubject- Throws:
InsufficientPrivilegeExceptionMemberDeleteException
-
deleteMember
public boolean deleteMember(Subject subj, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Specified by:
deleteMemberin interfaceRole- Parameters:
subj- Delete thisSubjectexceptionIfAlreadyDeleted-- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeExceptionMemberDeleteException
-
deleteMember
public void deleteMember(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 membershipstry { g.deleteMember(m, f); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
subj- Delete thisSubject.f- Delete subject from thisField.- Throws:
InsufficientPrivilegeExceptionMemberDeleteExceptionSchemaException
-
deleteMember
public boolean deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(m, f); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
subj- Delete thisSubject.f- Delete subject from thisField.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:
InsufficientPrivilegeExceptionMemberDeleteExceptionSchemaException
-
internal_deleteMember
public boolean internal_deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted, boolean checkSecurity) Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(m, f); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }- Parameters:
subj- Delete thisSubject.f- Delete subject from thisField.exceptionIfAlreadyDeleted- true if an exception should be thrown if the member is already deletedcheckSecurity- false if should not check security- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeExceptionMemberDeleteExceptionSchemaException
-
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- TheGroupTypeto add.- Throws:
GroupModifyException- if unable to delete type.InsufficientPrivilegeException- if subject not root-like.SchemaException- if attempting to delete a system group type.
-
getAdmins
Get subjects with the ADMIN privilege on this group.Set admins = g.getAdmins();
- Specified by:
getAdminsin interfaceEntity- Returns:
- Set of subjects with ADMIN
- Throws:
GrouperException
-
getAttributeOrNull
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.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
GetCompositeMembers 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
Memberobjects. - Since:
- 1.0
-
getAttributes
Deprecated.use getAttributesMapGet all attributes and values.Map attributes = g.getAttributes();
- Returns:
- A map of attributes and values.
-
getCompositeMembers
GetCompositeMembers 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
Memberobjects. - Since:
- 1.0
-
getCompositeMemberships
GetCompositeMemberships 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 membershipSet mships = g.getCompositeMembers();
- Returns:
- A set of
Membershipobjects. - Since:
- 1.0
-
getCreateSubject
Get subject that created this group.// Get creator of this group. try { Subject creator = g.getCreateSubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }- Returns:
Subjectthat created this group.- Throws:
SubjectNotFoundException
-
getCreateTime
Get creation time for this group.// Get create time. Date created = g.getCreateTime();
- Returns:
Datethat this group was created.
-
getDescription
Get group description.String description = g.getDescription();
- Specified by:
getDescriptionin interfaceEntity- Specified by:
getDescriptionin interfaceGrouperObject- Specified by:
getDescriptionin interfaceRole- Returns:
- Group's description or an empty string if no value set.
-
getDescriptionDb
Get group description for hibernate.- Returns:
- Group's description or an empty string if no value set.
-
_internal_fieldAttribute
see if field attribute (name, description, extension, displayName, displayExtension)- Parameters:
attributeName-- Returns:
- true if so
-
getDisplayExtension
Get group displayExtension.String displayExtn = g.getDisplayExtension();
- Specified by:
getDisplayExtensionin interfaceEntity- Specified by:
getDisplayExtensionin interfaceRole- Returns:
- Gruop displayExtension.
- Throws:
GrouperException
-
getDisplayName
Get group displayName.String displayName = g.getDisplayName();
- Specified by:
getDisplayNamein interfaceEntity- Specified by:
getDisplayNamein interfaceGrouperObject- Specified by:
getDisplayNamein interfaceRole- Returns:
- Group displayName.
- Throws:
GrouperException
-
getEffectiveMembers
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 membershipsSet effectives = g.getEffectiveMembers();
- Returns:
- A set of
Memberobjects. - Throws:
GrouperException
-
getEffectiveMembers
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 membershipsSet effectives = g.getEffectiveMembers(f);
- Parameters:
f- Get members in this list field.- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getEffectiveMembers
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 membershipsSet effectives = g.getEffectiveMembers(f);
- Parameters:
f- Get members in this list field.queryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getEffectiveMembers
public Set<Member> getEffectiveMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective membershipsSet effectives = g.getEffectiveMembers(f);
- Parameters:
f- Get members in this list field.sources- sources to filter by, or null for allqueryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getEffectiveMemberships
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 membershipsSet effectives = g.getEffectiveMemberships();
- Returns:
- A set of
Membershipobjects. - Throws:
GrouperException
-
getEffectiveMemberships
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 membershipsSet memberships = g.getEffectiveMemberships(f);
- Parameters:
f- Get memberships in this list field.- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getExtension
Get group extension.String extension = g.getExtension();
- Specified by:
getExtensionin interfaceEntity- Specified by:
getExtensionin interfaceRole- Returns:
- Group extension.
- Throws:
GrouperException
-
getImmediateMembers
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 membershipsSet immediates = g.getImmediateMembers();
- Returns:
- A set of
Memberobjects. - Throws:
GrouperException
-
getImmediateMembers
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 membershipsSet immediates = g.getImmediateMembers(f);
- Parameters:
f- Get members in this list field.- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getImmediateMembers
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 membershipsSet immediates = g.getImmediateMembers(f);
- Parameters:
f- Get members in this list field.queryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getImmediateMembers
public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipsSet immediates = g.getImmediateMembers(f);
- Parameters:
f- Get members in this list field.sources- to search in or null if allqueryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
isHasMembers
public boolean isHasMembers()more efficient? way to see if there are any members you need read on the group to call this method- Returns:
- true if has members, false if not
-
getImmediateMembers
public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions, SortStringEnum memberSortStringEnum, SearchStringEnum memberSearchStringEnum, String memberSearchStringValue) throws SchemaException Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipsSet immediates = g.getImmediateMembers(f);
- Parameters:
f- Get members in this list field.sources- to search in or null if allqueryOptions-memberSortStringEnum- How to sort results or null for no sorting unless specified by queryOptionsmemberSearchStringEnum- Specify search string if searching for members in the groupmemberSearchStringValue- Search string value.- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getImmediateMemberships
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 membershipSet immediates = g.getImmediateMemberships();
- Returns:
- A set of
Membershipobjects. - Throws:
GrouperException
-
getImmediateMemberships
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 membershipSet immediates = g.getImmediateMemberships(f);
- Parameters:
f- Get memberships in this list field.- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getMembers
Get members of this group.Set members = g.getMembers();
- Returns:
- A set of
Memberobjects. - Throws:
GrouperException
-
getMembers
Get members of this group.Set members = g.getMembers(f);
- Parameters:
f- Get members in this list field.- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getMembers
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
Memberobjects. - Throws:
SchemaException
-
getMembers
public Set<Member> getMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get members of this group.Set members = g.getMembers(f);
- Parameters:
f- Get members in this list field.to get members from, or null for allsources- to get members from, or null for allqueryOptions- paging, sorting, count, etc- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getMemberships
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 membershipSet memberships = g.getMemberships();
- Returns:
- A set of
Membershipobjects. - Throws:
GrouperException
-
getMemberships
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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getMemberships
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 membershipSet memberships = g.getMemberships(f);
- Parameters:
enabledOnly-- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getMemberships
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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-- Returns:
- A set of
Membershipobjects. - 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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-- Returns:
- A set of
Membershipobjects. - 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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-enabledOnly-- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getImmediateMembership
public Membership getImmediateMembership(Field f, Subject subject, boolean enabledOnly, boolean exceptionIfNotFound) throws SchemaException, MembershipNotFoundException Get membership of this group, for a certain member A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipMembership 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
Membershipobjects. - Throws:
SchemaExceptionMembershipNotFoundException- 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 membershipMembership 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
Membershipobjects. - Throws:
SchemaExceptionMembershipNotFoundException- 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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getCompositeMemberships
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 membershipSet memberships = g.getMemberships(f);
- Parameters:
members-- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getModifySubject
Get subject that last modified this group.try { Subject modifier = g.getModifySubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }- Returns:
Subjectthat last modified this group.- Throws:
SubjectNotFoundException
-
getModifyTime
Get last modified time for this group.Date modified = g.getModifyTime();
- Returns:
Datethat this group was last modified.
-
getName
Get group name.String name = g.getName();
- Specified by:
getNamein interfaceEntity- Specified by:
getNamein interfaceGrouperObject- Specified by:
getNamein interfaceOwner- Specified by:
getNamein interfaceRole- Returns:
- Group name.
- Throws:
GrouperException
-
getOptins
Get subjects with the OPTIN privilege on this group.Set optins = g.getOptins();
- Returns:
- Set of subjects with OPTIN
- Throws:
GrouperException
-
getOptouts
Get subjects with the OPTOUT privilege on this group.Set admins = g.getOptouts();
- Returns:
- Set of subjects with OPTOUT
- Throws:
GrouperException
-
getGroupAttrReaders
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
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
get the name of the parent stem- Returns:
- the name of the parent stem
-
getParentStem
Get parent stem.Stem parent = g.getParentStem();
- Specified by:
getParentStemin interfaceGrouperObject- Returns:
- Parent
Stem. - Throws:
IllegalStateException
-
getPrivs
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
AccessPrivilegeobjects.
-
getReaders
Get subjects with the READ privilege on this group.Set readers = g.getReaders();
- Returns:
- Set of subjects with READ
- Throws:
GrouperException
-
getRemovableTypes
Deprecated.Get removable group types for this group.Set types = g.getRemovableTypes();
- Returns:
- Set of removable group types.
- Since:
- 1.0
-
getTypes
Deprecated.Get group types for this group (secure method).Set types = g.getTypes();
- Returns:
- Set of group types.
-
getTypes
Deprecated.Get group types for this group.Set types = g.getTypes(true);
- Parameters:
checkSecurity-- Returns:
- Set of group types.
-
getTypesDb
Deprecated.get types in db- Returns:
- types
-
getUpdaters
Get subjects with the UPDATE privilege on this group.Set updaters = g.getUpdaters();
- Returns:
- Set of subjects with UPDATE
- Throws:
GrouperException
-
getViewers
Get subjects with the VIEW privilege on this group.Set viewers = g.getViewers();
- Specified by:
getViewersin interfaceEntity- Returns:
- Set of subjects with VIEW
- Throws:
GrouperException
-
grantPriv
public void grantPriv(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 existstry { 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:
GrantPrivilegeExceptionInsufficientPrivilegeExceptionSchemaException
-
grantPriv
public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant privilege to a subject on this group.try { g.grantPriv(subj, AccessPrivilege.ADMIN); } catch (GrantPrivilegeException e0) { // Not privileged to grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }- Specified by:
grantPrivin interfaceEntity- 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:
GrantPrivilegeExceptionInsufficientPrivilegeExceptionSchemaException
-
internal_grantPriv
public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant privilege to a subject on this group.try { g.grantPriv(subj, AccessPrivilege.ADMIN); } catch (GrantPrivilegeException e0) { // Not privileged to grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }- Parameters:
subj- Grant privilege to this subject.priv- Grant this privilege.exceptionIfAlreadyMember- if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the groupuuid-- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
GrantPrivilegeExceptionInsufficientPrivilegeExceptionSchemaException
-
hasPrivilege
see if the subject has a privilege- Parameters:
subject-privilegeOrListName-- Returns:
- true if has privilege
-
hasAdmin
Check whether the subject has ADMIN on this group.if (g.hasAdmin(subj)) { // Has ADMIN } else { // Does not have ADMIN } -
hasGroupAttrRead
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
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 thisGrouphave aCompositemembership.if (g.hasComposite()) { // this group has a composite membership }- Returns:
- Boolean true if group has a composite membership.
-
isHasComposite
public boolean isHasComposite()- Returns:
- Boolean true if group has a composite membership.
- See Also:
-
hasEffectiveMember
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 membershipsif (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
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 membershipsif (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
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 membershipsif (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
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 membershipsif (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
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:
hasMemberin interfaceRole- Parameters:
subj- Check this subject.- Returns:
- Boolean true if subject belongs to this group.
- Throws:
GrouperException- See Also:
-
hasMemberAsGrouperSystem
Check whether the subject is a member of this group. All immediate subjects, and effective members are members. No duplicates will be returned (e.g. if immediate and effective).if (g.hasMember(subj)) { // Subject is a member of this group } else { // Subject is not a member of this group }- Parameters:
subj- Check this subject.- Returns:
- Boolean true if subject belongs to this group.
- Throws:
GrouperException
-
hasMember
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 listField.- Returns:
- Boolean true if subject belongs to this group.
- Throws:
SchemaException
-
hasOptin
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
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
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
Check whether group has the specified type.GroupType custom = GroupTypeFinder.find("custom type"); if (g.hasType(custom, true)) { // Group has type }- Parameters:
type- TheGroupTypeto check.checkSecurity-- Returns:
- if has type
-
hasType
Check whether group has the specified type. This is a secure methodGroupType custom = GroupTypeFinder.find("custom type"); if (g.hasType(custom)) { // Group has type }- Parameters:
type- TheGroupTypeto check.- Returns:
- if has type
-
hasUpdate
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
Check whether the subject has VIEW on this group.if (g.hasView(subj)) { // Has VIEW } else { // Does not have VIEW } -
isComposite
public boolean isComposite()Is thisGroupa factor in aCompositemembership.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:
InsufficientPrivilegeExceptionRevokePrivilegeExceptionSchemaException
-
revokePriv
public void revokePriv(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:
InsufficientPrivilegeExceptionRevokePrivilegeExceptionSchemaException
-
revokePriv
public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke a privilege from the specified subject.try { g.revokePriv(subj, AccessPrivilege.OPTIN); } catch (InsufficientPrivilegeException e1) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }- Specified by:
revokePrivin interfaceEntity- 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:
InsufficientPrivilegeExceptionRevokePrivilegeExceptionSchemaException
-
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:
AttributeNotFoundExceptionGroupModifyExceptionInsufficientPrivilegeException
-
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:
AttributeNotFoundExceptionGroupModifyExceptionInsufficientPrivilegeException
-
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:
AttributeNotFoundExceptionGroupModifyExceptionInsufficientPrivilegeException
-
store
public void store()store this object to the DB. -
validate
public void validate() -
setDescription
Set group description. Note, you have to call store() at some point to make the kick off the sqltry { g.setDescription(value); } catch (GroupModifyException e0) { // Unable to modify group } catch (InsufficientPrivilegeException e1) { // Not privileged to modify description }- Specified by:
setDescriptionin interfaceEntity- Specified by:
setDescriptionin interfaceRole- Parameters:
value- Set description to this value.
-
setDescriptionDb
Set group description (hibernate method).- Parameters:
value- Set description to this value.
-
setExtension
Set group extension. Note, you have to call store() at some point to make the kick off the sqlg.setExtension(value);
- Specified by:
setExtensionin interfaceEntity- Specified by:
setExtensionin interfaceRole- Parameters:
value- Set extension to this value.
-
setExtension
Set group extension. Note, you have to call store() at some point to make the kick off the sqlg.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
Set group name. This should not be called -
setDisplayExtension
Set group displayExtension. Note, you have to call store() at some point to make the kick off the sqlg.setDisplayExtension(value);
- Specified by:
setDisplayExtensionin interfaceEntity- Specified by:
setDisplayExtensionin interfaceRole- Parameters:
value- Set displayExtension to this value.
-
setDisplayExtensionDb
hibernate method- Parameters:
value-
-
setExtensionDb
hibernate method- Parameters:
value-
-
getDisplayExtensionDb
hibernate method- Returns:
- display extension
-
getExtensionDb
hibernate method- Returns:
- extension
-
setDisplayName
This is really only for hibernate- Specified by:
setDisplayNamein interfaceEntity- Specified by:
setDisplayNamein interfaceRole- Parameters:
value- new display name
-
toMember
Convert this group to aMemberobject.Member m = g.toMember();
- Specified by:
toMemberin interfaceEntity- Returns:
Groupas aMember- Throws:
GrouperException
-
toSubject
Convert this group to aSubjectobject.Subject subj = g.toSubject();
- Specified by:
toSubjectin interfaceEntity- Returns:
Groupas aSubject- Throws:
GrouperException
-
toString
-
internal_canWriteField
public boolean internal_canWriteField(Subject subj, Field f) throws IllegalArgumentException, SchemaException TODO 20070531 make into some flavor of validator- Parameters:
subj-f-- Returns:
- boolean
- Throws:
IllegalArgumentExceptionSchemaException- 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:
InsufficientPrivilegeExceptionMemberAddException
-
dbVersionDifferentFields
Description copied from class:GrouperAPIsee which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName- Overrides:
dbVersionDifferentFieldsin classGrouperAPI- Returns:
- the set of different fields
- See Also:
-
dbVersionDifferentFields
- Parameters:
failIfNull-- Returns:
- the set of different fields
- See Also:
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db- Overrides:
dbVersionResetin classGrouperAPI
-
clone
deep clone the fields in this object- Specified by:
clonein interfaceGrouperCloneable- Specified by:
clonein classGrouperAPI- Returns:
- the clone of the object
- See Also:
-
equals
-
initData
init attributes etc for multiple groups at once- Parameters:
groups-
-
getAttributesMap
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.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
- Returns:
- creator
- Since:
- 1.2.0
-
dbVersion
Description copied from class:GrouperAPIversion of this object in the database- Overrides:
dbVersionin classGrouperAPI- Returns:
- the db version
- See Also:
-
getModifierUuid
- Returns:
- uuid
-
getModifyTimeLong
public long getModifyTimeLong()- Returns:
- modify time
- Since:
- 1.2.0
-
getParentUuid
- Returns:
- parent uuid
- Since:
- 1.2.0
-
getUuid
-
hashCode
public int hashCode() -
onDelete
public boolean onDelete(org.hibernate.Session hs) throws org.hibernate.CallbackException - Specified by:
onDeletein interfaceorg.hibernate.classic.Lifecycle- Overrides:
onDeletein classGrouperAPI- Throws:
org.hibernate.CallbackException- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycleafter a save (insert) occurs- Specified by:
onPostSavein interfaceHibGrouperLifecycle- Overrides:
onPostSavein classGrouperAPI- See Also:
-
onPostUpdate
Description copied from interface:HibGrouperLifecycleafter an update occurs- Specified by:
onPostUpdatein interfaceHibGrouperLifecycle- Overrides:
onPostUpdatein classGrouperAPI- See Also:
-
getLastMembershipChangeDb
when the last member has changed- Returns:
- when
-
setLastMembershipChangeDb
when the last member has changed- Parameters:
theMembershipLastChange-
-
getLastMembershipChange
when the last member has changed- Returns:
- the membership last change timestamp
-
getLastImmediateMembershipChangeDb
when the last immediate member has changed- Returns:
- when
-
setLastImmediateMembershipChangeDb
when the last immediate member has changed- Parameters:
theImmediateMembershipLastChange-
-
getLastImmediateMembershipChange
when the last immediate member has changed- Returns:
- the immediate membership last change timestamp
-
getAlternateNameDb
Returns the alternate name for the group. Used by hibernate.- Returns:
- the alternate name
-
getAlternateName
Returns the alternate name for the group. If multiple, this returns the first one- Returns:
- the alternate name
-
setAlternateNameDb
Set the group's alternate name Used by hibernate.- Parameters:
alternateName-
-
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
Add an alternate name for this group. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().- Parameters:
alternateName-
-
internal_addAlternateName
Add an alternate name for this group. Only one alternate name is supported currently, so this will replace any existing alternate name. This won't get saved until you call store().- Parameters:
alternateName-validateName-
-
deleteAlternateName
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
Description copied from interface:HibGrouperLifecycleafter a delete occurs- Specified by:
onPostDeletein interfaceHibGrouperLifecycle- Overrides:
onPostDeletein classGrouperAPI- See Also:
-
onPreSave
Description copied from interface:HibGrouperLifecyclebefore a save (insert) occurs- Specified by:
onPreSavein interfaceHibGrouperLifecycle- Overrides:
onPreSavein classGrouperAPI- See Also:
-
onSave
public boolean onSave(org.hibernate.Session hs) throws org.hibernate.CallbackException - Specified by:
onSavein interfaceorg.hibernate.classic.Lifecycle- Overrides:
onSavein classGrouperAPI- Throws:
org.hibernate.CallbackException- See Also:
-
onUpdate
public boolean onUpdate(org.hibernate.Session s) throws org.hibernate.CallbackException - Specified by:
onUpdatein interfaceorg.hibernate.classic.Lifecycle- Overrides:
onUpdatein classGrouperAPI- Throws:
org.hibernate.CallbackException- See Also:
-
setAttributes
Deprecated.- Parameters:
attributes-
-
setCreateTimeLong
public void setCreateTimeLong(long createTime) - Parameters:
createTime-- Since:
- 1.2.0
-
setCreatorUuid
- Parameters:
creatorUUID-- Since:
- 1.2.0
-
setModifierUuid
- Parameters:
modifierUUID-- Since:
- 1.2.0
-
setModifyTimeLong
public void setModifyTimeLong(long modifyTime) - Parameters:
modifyTime-- Since:
- 1.2.0
-
setParentUuid
- Parameters:
parentUUID-- Since:
- 1.2.0
-
setTypes
- Parameters:
types-- Since:
- 1.2.0
-
internal_getGroupTypeAssignments
- Returns:
- type assignments
-
setUuid
- Parameters:
uuid-- Since:
- 1.2.0
-
toStringDb
- Returns:
- string
- Since:
- 1.2.0
-
onPreDelete
Description copied from interface:HibGrouperLifecyclebefore a delete (insert) occurs- Specified by:
onPreDeletein interfaceHibGrouperLifecycle- Overrides:
onPreDeletein classGrouperAPI- See Also:
-
fieldValue
Description copied from class:GrouperAPIcall 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:
fieldValuein interfaceGrouperUtil.FieldValuable- Overrides:
fieldValuein classGrouperAPI- Parameters:
fieldName-- Returns:
- the value
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecyclebefore an update occurs- Specified by:
onPreUpdatein interfaceHibGrouperLifecycle- Overrides:
onPreUpdatein classGrouperAPI- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable- See Also:
-
manageIncludesExcludesRequiredGroups
public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)- Parameters:
grouperSession-isIncludeExcludes-
-
manageIncludesExcludesRequiredGroups
public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes, Group andGroup) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)- Parameters:
grouperSession-isIncludeExcludes-andGroup- groups (like activeEmployee) which the user must also be in
-
manageIncludesExcludesRequiredGroups
public void manageIncludesExcludesRequiredGroups(GrouperSession grouperSession, boolean isIncludeExcludes, Set<Group> andGroups) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)- Parameters:
grouperSession-isIncludeExcludes-andGroups- groups (like activeEmployee) which the user must also be in
-
getDisplayNameDb
Get group displayName for hibernate.String displayName = g.getDisplayName();
- Returns:
- Group displayName.
- Throws:
GrouperException
-
getNameDb
Get group name for hibernate.- Returns:
- Group name db.
- Throws:
GrouperException
-
setDisplayNameDb
This is really only for hibernate- Parameters:
value- new display name
-
setNameDb
Set group name. This should not be called- Parameters:
value- Set extension to this value.
-
move
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:
movein interfaceEntity- Parameters:
stem-- Throws:
GroupModifyExceptionInsufficientPrivilegeException
-
internal_move
- Parameters:
stem-assignAlternateName-
-
internal_copy
protected Group internal_copy(Stem stem, boolean privilegesOfGroup, boolean groupAsPrivilege, boolean listMembersOfGroup, boolean listGroupAsMember, boolean attributes, boolean composite, boolean addDefaultGroupPrivileges, boolean checkSecurity, String extension, String displayExtension) throws GroupAddException, InsufficientPrivilegeException - Parameters:
stem-privilegesOfGroup-groupAsPrivilege-listMembersOfGroup-listGroupAsMember-attributes-composite-addDefaultGroupPrivileges-checkSecurity- true to check that user can do this operation, false to ignoreextension-displayExtension-- Returns:
- group
- Throws:
GroupAddExceptionInsufficientPrivilegeException
-
copy
Copy this group to another Stem. If you want to specify options for the copy, use GroupCopy. This will use the default options.- Specified by:
copyin interfaceEntity- Parameters:
stem-- Returns:
- the new group
- Throws:
InsufficientPrivilegeExceptionGroupAddException
-
getTypeOfGroup
type of group, group or role- Returns:
- group or role
-
setTypeOfGroup
type of group, group or role- Parameters:
typeOfGroup1-
-
getTypeOfGroupDb
type of group, group or role- Returns:
- group or role
-
setTypeOfGroupDb
type of group, group or role- Parameters:
typeOfGroup1-
-
__getId
Description copied from interface:GrouperSetElementif of this object- Specified by:
__getIdin interfaceGrouperSetElement- Returns:
- id
- See Also:
-
__getName
Description copied from interface:GrouperSetElementname of this object (for logging)- Specified by:
__getNamein interfaceGrouperSetElement- Returns:
- name
- See Also:
-
getId
Description copied from interface:Roleuuid of role -
getIdIndex
id of the group as a unique integer- Specified by:
getIdIndexin interfaceRole- Returns:
- id
-
setIdIndex
id of the group as a unique integer- Parameters:
idIndex1-
-
getStemId
Description copied from interface:Rolestem that this attribute is in -
setId
Description copied from interface:Roleid of this attribute def name -
setStemId
Description copied from interface:Rolestem that this attribute is in -
getRoleInheritanceDelegate
delegate calls to this class for role hierarchy stuff- Specified by:
getRoleInheritanceDelegatein interfaceRole- Returns:
- the role inheritance hierarchy
-
getPermissionRoleDelegate
Description copied from interface:Roledelegate calls to this class for permission role stuff- Specified by:
getPermissionRoleDelegatein interfaceRole- Returns:
- the delegate
- See Also:
-
getNonImmediateMemberships
public Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members) throws SchemaException Get memberships of this group, for a certain collection of members, must be enabled A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-- Returns:
- A set of
Membershipobjects. - 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 membershipSet memberships = g.getMemberships(f);
- Parameters:
f- Get memberships in this list field.members-enabledOnly-- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
getNonImmediateMembers
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 membershipsSet nonImmediates = g.getNonImmediateMembers();
- Returns:
- A set of
Memberobjects. - Throws:
GrouperException
-
getNonImmediateMembers
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 membershipsSet nonImmediates = g.getNonImmediateMembers(f);
- Parameters:
f- Get members in this list field.- Returns:
- A set of
Memberobjects. - 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 membershipsSet nonImmediates = g.getNonImmediateMembers(f);
- Parameters:
f- Get members in this list field.queryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getNonImmediateMembers
public Set<Member> getNonImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipsSet nonImmediates = g.getNonImmediateMembers(f);
- Parameters:
f- Get members in this list field.sources-queryOptions-- Returns:
- A set of
Memberobjects. - Throws:
SchemaException
-
getNonImmediateMemberships
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 membershipSet immediates = g.getImmediateMemberships();
- Returns:
- A set of
Membershipobjects. - Throws:
GrouperException
-
getNonImmediateMemberships
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 membershipSet immediates = g.getNonImmediateMemberships(f);
- Parameters:
f- Get memberships in this list field.- Returns:
- A set of
Membershipobjects. - Throws:
SchemaException
-
hasNonImmediateMember
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 membershipsif (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
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 membershipsif (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
GetCompositeMembers 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
Memberobjects. - Since:
- 1.0
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBasecopy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExistingin interfaceXmlImportableBase<Group>- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBasesee if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessPropertiesin interfaceXmlImportableBase<Group>- Parameters:
other- the one to compare with- Returns:
- true if so
- See Also:
-
xmlDifferentUpdateProperties
Description copied from interface:XmlImportableBasesee if the update cols are different (e.g. last updated)- Specified by:
xmlDifferentUpdatePropertiesin interfaceXmlImportableBase<Group>- Parameters:
other- the one to compare with- Returns:
- true if so
- See Also:
-
xmlRetrieveByIdOrKey
Description copied from interface:XmlImportableretrieve from db by id or key. throws exception if duplicate- Specified by:
xmlRetrieveByIdOrKeyin interfaceXmlImportable<Group>- Returns:
- the object or null if not found
- See Also:
-
assignIdIndex
public boolean assignIdIndex(long theIdIndex) assign different id index- Parameters:
theIdIndex-- Returns:
- if it was changed
-
xmlSaveBusinessProperties
Description copied from interface:XmlImportableBasesave the business properties (not update properties)- Specified by:
xmlSaveBusinessPropertiesin interfaceXmlImportableBase<Group>- Parameters:
existingRecord- null if insert, the object if exists in DB generally just copy the hibernate version number, and last updated to the object and store it- Returns:
- the new object or existing
- See Also:
-
xmlSaveUpdateProperties
public void xmlSaveUpdateProperties()Description copied from interface:XmlImportableBasesave the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate- Specified by:
xmlSaveUpdatePropertiesin interfaceXmlImportableBase<Group>- See Also:
-
xmlToExportGroup
convert to xml bean for export- Parameters:
grouperVersion-- Returns:
- xml bean
-
xmlGetId
Description copied from interface:XmlImportableBaseset id key in db- Specified by:
xmlGetIdin interfaceXmlImportableBase<Group>- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBaseset id key in db- Specified by:
xmlSetIdin interfaceXmlImportableBase<Group>- See Also:
-
xmlToString
Description copied from interface:XmlImportableBaseconvert to string for log- Specified by:
xmlToStringin interfaceXmlImportableBase<Group>- Returns:
- the string value for log
- See Also:
-
matchesLowerSearchStrings
Description copied from interface:GrouperObjectsee if this object matches the filter strings- Specified by:
matchesLowerSearchStringsin interfaceGrouperObject- Returns:
- true if matches
- See Also:
-
canHavePrivilege
see if the subject has a privilege or another privilege that implies this privilege.- Parameters:
subject-privilegeOrListName-secure- if the user must be an admin to check- Returns:
- true if has privilege
-
deleteAllMemberships
Delete all direct memberships Groups Registry. And remove compositestry { g.deleteAllMemberships(); } catch (GroupDeleteException e0) { // Unable to delete group } catch (InsufficientPrivilegeException e1) { // Not privileged to delete this group }
-