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
Modifier and TypeFieldDescriptionstatic final String
an alternate name for this groupstatic final String
col in dbstatic final String
col in dbstatic final String
col in dbstatic final String
epoch time of when to disable membershipstatic final String
col in dbstatic final String
col in dbstatic final String
whether the membership is enabled or disabled: T|Fstatic final String
epoch time of when to enable membershipstatic final String
col in dbstatic final String
id col in dbstatic final String
unique number for this groupstatic final String
inernal unique number for this groupstatic final String
timestamp of the last immediate membership change for this groupstatic final String
timestamp of the last membership change for this groupstatic final String
col in dbstatic final String
col in dbstatic final String
col in dbstatic final String
old id col for id conversionstatic final String
old uuid id col for id conversionstatic final String
col in dbstatic final String
if this is a group or rolestatic final String
uuid col in db (not used anymore)static final String
constant for field name for: alternateNameDbstatic final String
constant for field name for: createTimestatic final String
constant for field name for: creatorUUIDstatic final String
constant for field name for: dbVersionstatic final String
constant for field name for: descriptionstatic final String
constant for field name for: disabledTimeDbstatic final String
constant for field name for: displayExtensionstatic final String
constant for field name for: displayNamestatic final String
constant for field name for: enabledstatic final String
constant for field name for: enabledTimeDbstatic final String
constant for field name for: extensionstatic final String
constant for field name for: idIndexstatic final String
constant for field name for: internalIdstatic final String
constant for field name for: lastImmediateMembershipChangeDbstatic final String
constant for field name for: lastMembershipChangeDbstatic final String
constant for field name for: modifierUUIDstatic final String
constant for field name for: modifyTimestatic final String
constant for field name for: namestatic final String
constant for field name for: parentUuidstatic final String
constant for field name for: typeOfGroupstatic final String
constant for field name for: uuidlist of internal field attributes, access with method so it can lazy loadstatic final String
name of the groups table in the dbstatic final String
static final String
static final String
static final String
static final String
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
-
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)void
addAlternateName
(String alternateName) Add an alternate name for this group.addCompositeMember
(CompositeType type, Group left, Group right) Add a composite membership to this group.void
Add a subject to this group as immediate member.boolean
Add a subject to this group as immediate member.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 insteadboolean
addMember
(Subject subject, boolean defaultPrivs, boolean memberChecked, Date startDate, Date endDate, boolean revokeIfUnchecked) Deprecated.use addOrEditMember insteadvoid
Add a subject to this group as immediate member.boolean
Add a subject to this group as immediate member.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 changedboolean
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 changedvoid
Deprecated.boolean
Deprecated.void
assignCompositeMember
(CompositeType type, Group left, Group right) Add ore replace a composite membership to this group.boolean
assignIdIndex
(long theIdIndex) assign different id indexboolean
canHavePrivilege
(Subject subject, String privilegeOrListName, boolean secure) see if the subject has a privilege or another privilege that implies this privilege.boolean
boolean
canReadField
(Subject subj, Field f) boolean
boolean
canWriteField
(Subject subj, Field f) clone()
deep clone the fields in this objectint
Copy 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) void
take a snapshot of the data since this is what is in the dbvoid
delete()
Delete this group from the Groups Registry.void
Delete all direct memberships Groups Registry.boolean
deleteAlternateName
(String alternateName) Delete the specified alternate name.void
deleteAttribute
(String attrName) Deprecated.void
deleteAttribute
(String attrName, boolean failOnRequiredAttribute) Deprecated.void
Delete aComposite
membership from this group.void
deleteMember
(Member member) Delete a member from this group, and member must be immediate member.boolean
deleteMember
(Member member, boolean exceptionIfAlreadyDeleted) Delete a member from this group, and member must be immediate member.void
deleteMember
(Member member, Field f) Delete a member from this group, and member must be immediate member.boolean
deleteMember
(Member member, Field f, boolean exceptionIfAlreadyDeleted) Delete a member from this group, and member must be immediate member.void
deleteMember
(Subject subj) Delete a subject from this group, and subject must be immediate member.boolean
deleteMember
(Subject subj, boolean exceptionIfAlreadyDeleted) Delete a subject from this group, and subject must be immediate member.void
deleteMember
(Subject subj, Field f) Delete a subject from this group, and subject must be immediate member.boolean
deleteMember
(Subject subj, Field f, boolean exceptionIfAlreadyDeleted) Delete a subject from this group, and subject must be immediate member.static boolean
see if we are in the middle of a delete (e.g.void
deleteType
(GroupType type) Deprecated.boolean
fieldValue
(String fieldName) call this method to get the field value (e.g.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) GetComposite
Membership
s 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.long
static Field
Retrieve 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.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.long
getName()
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.void
Grant privilege to a subject on this group.boolean
Grant privilege to a subject on this group.boolean
Check whether the subject has ADMIN on this group.boolean
boolean
hasEffectiveMember
(Subject subj) Check whether the subject is an effective member of this group.boolean
hasEffectiveMember
(Subject subj, Field f) Check whether the subject is an effective member of this group.boolean
hasGroupAttrRead
(Subject subj) Check whether the subject has GROUP_ATTR_READ on this group.boolean
hasGroupAttrUpdate
(Subject subj) Check whether the subject has GROUP_ATTR_UPDATE on this group.int
hashCode()
boolean
hasImmediateMember
(Subject subj) Check whether the subject is an immediate member of this group.boolean
hasImmediateMember
(Subject subj, Field f) Check whether the subject is an immediate member of this group.boolean
Check whether the subject is a member of this group.boolean
Check whether the subject is a member of this list on this group.boolean
Check whether the subject is a member of this group.boolean
hasNonImmediateMember
(Subject subj) Check whether the subject is a non immediate member of this group.boolean
hasNonImmediateMember
(Subject subj, Field f) Check whether the subject is a non immediate member of this group.boolean
Check whether the subject has OPTIN on this group.boolean
Check whether the subject has OPTOUT on this group.boolean
hasPrivilege
(Subject subject, String privilegeOrListName) see if the subject has a privilegeboolean
Check whether the subject has READ on this group.boolean
Check whether group has the specified type.boolean
Check whether group has the specified type.boolean
Check whether the subject has UPDATE on this group.boolean
Check whether the subject has VIEW on this group.static void
initData
(Collection<Group> groups) init attributes etc for multiple groups at onceprotected void
internal_addAlternateName
(String alternateName, boolean validateName) Add an alternate name for this group.internal_addCompositeMember
(GrouperSession session, CompositeType type, Group left, Group right, String uuid) boolean
internal_addMember
(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate) Add a subject to this group as immediate member.boolean
internal_addMember
(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate, boolean checkSecurity) Add a subject to this group as immediate member.boolean
internal_addType
(GroupType type, String groupTypeAssignmentId, boolean exceptionIfAlreadyHasType) boolean
internal_canWriteField
(Subject subj, Field f) TODO 20070531 make into some flavor of validatorprotected 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) boolean
internal_deleteMember
(Subject subj, Field f, boolean exceptionIfAlreadyDeleted, boolean checkSecurity) Delete a subject from this group, and subject must be immediate member.boolean
internal_grantPriv
(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) Grant privilege to a subject on this group.boolean
Should this group be enabled based on the enabled and disabled dates?protected void
internal_move
(Stem stem, boolean assignAlternateName) internal_setAttribute
(String attributeName, String value, boolean checkPrivileges, String uuid) Set an attribute value.boolean
boolean
Is this group enabled?boolean
boolean
more efficient? way to see if there are any members you need read on the group to call this methodvoid
manageIncludesExcludesRequiredGroups
(GrouperSession grouperSession, boolean isIncludeExcludes) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)void
manageIncludesExcludesRequiredGroups
(GrouperSession grouperSession, boolean isIncludeExcludes, Group andGroup) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)void
manageIncludesExcludesRequiredGroups
(GrouperSession grouperSession, boolean isIncludeExcludes, Set<Group> andGroups) add or correct the includes/excludes group math structure for this group (as overall or system or record if named correctly)boolean
matchesLowerSearchStrings
(Set<String> filterStrings) see if this object matches the filter stringsvoid
Move this group to another Stem.boolean
onDelete
(org.hibernate.Session hs) void
onPostDelete
(HibernateSession hibernateSession) after a delete occursvoid
onPostSave
(HibernateSession hibernateSession) after a save (insert) occursvoid
onPostUpdate
(HibernateSession hibernateSession) after an update occursvoid
onPreDelete
(HibernateSession hibernateSession) before a delete (insert) occursvoid
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursboolean
onSave
(org.hibernate.Session hs) boolean
onUpdate
(org.hibernate.Session s) int
replaceMembers
(Collection<Subject> newSubjectList) replace the member list with new list.int
replaceMembers
(Collection<Subject> newSubjectList, Field field) replace the member list with new list.void
revokePriv
(Privilege priv) Revoke all privileges of the specified type on this group.void
revokePriv
(Subject subj, Privilege priv) Revoke a privilege from the specified subject.boolean
revokePriv
(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) Revoke a privilege from the specified subject.static Group
saveGroup
(GrouperSession GROUPER_SESSION, String groupNameToEdit, String uuid, String name, String displayExtension, String description, SaveMode saveMode, boolean createParentStemsIfNotExist) create or update a group.void
setAlternateNameDb
(String alternateName) Set the group's alternate name Used by hibernate.void
setAttribute
(String attributeName, String value) Deprecated.void
setAttribute
(String attributeName, String value, boolean checkPrivileges) Deprecated.void
setAttributes
(Map<String, String> attributes) Deprecated.void
setContextId
(String contextId1) context id of the transactionvoid
setCreateTimeLong
(long createTime) void
setCreatorUuid
(String creatorUUID) void
setDescription
(String value) Set group description.void
setDescriptionDb
(String value) Set group description (hibernate method).void
setDisabledTime
(Timestamp disabledTimeDb) Set the time to disable this group.void
setDisabledTimeDb
(Long disabledTimeDb) Set the time to disable this group.void
setDisplayExtension
(String value) Set group displayExtension.void
setDisplayExtensionDb
(String value) hibernate methodvoid
setDisplayName
(String value) This is really only for hibernatevoid
setDisplayNameDb
(String value) This is really only for hibernatevoid
setDontSetModified
(boolean theDontSetModified) if we should not set the modified attributes on group savevoid
setEnabled
(boolean enabled) Whether to enable or disable this group.void
setEnabledDb
(String enabled) Whether to enable or disable this group.void
setEnabledTime
(Timestamp enabledTimeDb) Set the time when this group should be enabled.void
setEnabledTimeDb
(Long enabledTimeDb) Set the time when this group should be enabled.void
setExtension
(String value) Set group extension.void
setExtension
(String value, boolean assignAlternateName) Set group extension.void
setExtensionDb
(String value) hibernate methodvoid
id of this attribute def namevoid
setIdIndex
(Long idIndex1) id of the group as a unique integervoid
setInternalId
(Long internalId) void
setLastImmediateMembershipChangeDb
(Long theImmediateMembershipLastChange) when the last immediate member has changedvoid
setLastMembershipChangeDb
(Long theMembershipLastChange) when the last member has changedvoid
setModifierUuid
(String modifierUUID) void
setModifyTimeLong
(long modifyTime) void
Set group name.void
Set group name.void
setParentUuid
(String parentUUID) void
stem that this attribute is invoid
setTypeOfGroup
(TypeOfGroup typeOfGroup1) type of group, group or rolevoid
setTypeOfGroupDb
(String typeOfGroup1) type of group, group or rolevoid
void
void
store()
store this object to the DB.toMember()
Convert this group to aMember
object.toString()
Convert this group to aSubject
object.void
validate()
void
xmlCopyBusinessPropertiesToExisting
(Group existingRecord) copy business (non update) properties to an existing recordboolean
see if the non update cols are different (e.g.boolean
see if the update cols are different (e.g.xmlGetId()
set id key in dbretrieve from db by id or key.xmlSaveBusinessProperties
(Group existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set 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:
StemNotFoundException
InsufficientPrivilegeException
StemAddException
GroupModifyException
GroupNotFoundException
GroupAddException
-
getContextId
context id of the transaction- Specified by:
getContextId
in interfaceEntity
- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextId
in 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:AttributeAssignable
get the logic delegate- Specified by:
getAttributeDelegate
in interfaceAttributeAssignable
- Specified by:
getAttributeDelegate
in interfaceEntity
- Specified by:
getAttributeDelegate
in interfaceRole
- Returns:
- the delegate
- See Also:
-
getAttributeValueDelegate
this delegate works on attributes and values at the same time- Specified by:
getAttributeValueDelegate
in interfaceAttributeAssignable
- Specified by:
getAttributeValueDelegate
in interfaceEntity
- Specified by:
getAttributeValueDelegate
in 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
-Group
that is left factor of of composite membership.right
-Group
that is right factor of composite membership.- Throws:
InsufficientPrivilegeException
MemberAddException
MemberDeleteException
- Since:
- 1.0
-
addCompositeMember
public Composite addCompositeMember(CompositeType type, Group left, Group right) throws InsufficientPrivilegeException, MemberAddException Add a composite membership to this group.try { g.addCompositeMember(CompositeType.UNION, leftGroup, rightGroup); } catch (InsufficientPrivilegeException eIP) { // Not privileged to add members } catch (MemberAddException eMA) { // Unable to add composite membership }
- Parameters:
type
- Add membership of thisCompositeType
.left
-Group
that is left factor of of composite membership.right
-Group
that is right factor of composite membership.- Returns:
- composite
- Throws:
InsufficientPrivilegeException
MemberAddException
- Since:
- 1.0
-
addMember
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:
InsufficientPrivilegeException
MemberAddException
-
addMember
public boolean addMember(Subject subj, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.addMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to add members } catch (MemberAddException eMA) { // Unable to add subject }
- Specified by:
addMember
in interfaceRole
- Parameters:
subj
- Add thisSubject
exceptionIfAlreadyMember
- if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the group- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
InsufficientPrivilegeException
MemberAddException
-
addMember
public void addMember(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 thisSubject
f
- Add subject to thisField
.- Throws:
InsufficientPrivilegeException
MemberAddException
SchemaException
-
addMember
public boolean addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember) throws InsufficientPrivilegeException, MemberAddException, SchemaException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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 thisSubject
f
- 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:
InsufficientPrivilegeException
MemberAddException
SchemaException
-
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 thisSubject
f
- 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:
InsufficientPrivilegeException
MemberAddException
SchemaException
-
internal_addMember
public boolean internal_addMember(Subject subj, Field f, boolean exceptionIfAlreadyMember, String uuid, Timestamp startDate, Timestamp endDate, boolean checkSecurity) throws InsufficientPrivilegeException, MemberAddException, SchemaException Add a subject to this group as immediate member. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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 thisSubject
f
- 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:
InsufficientPrivilegeException
MemberAddException
SchemaException
-
addType
public void addType(GroupType type) throws GroupModifyException, InsufficientPrivilegeException, SchemaException Deprecated.Add an additional group type.try { GroupType custom = GroupTypeFinder.find("custom type"); g.addType(custom); } catch (GroupModifyException eGM) { // Unable to add type } catch (InsufficientPrivilegeException eIP) { // Not privileged to add type } catch (SchemaException eS) { // Cannot add system-maintained types }
- Parameters:
type
- TheGroupType
to add.- Throws:
GroupModifyException
- if unable to add type.InsufficientPrivilegeException
- if subject not root-like.SchemaException
- if attempting to add a system group type.
-
addType
public boolean addType(GroupType type, boolean exceptionIfAlreadyHasType) throws GroupModifyException, InsufficientPrivilegeException, SchemaException Deprecated.Add an additional group type.try { GroupType custom = GroupTypeFinder.find("custom type"); g.addType(custom); } catch (GroupModifyException eGM) { // Unable to add type } catch (InsufficientPrivilegeException eIP) { // Not privileged to add type } catch (SchemaException eS) { // Cannot add system-maintained types }
- Parameters:
type
- TheGroupType
to add.exceptionIfAlreadyHasType
-- Returns:
- if it was added or not
- Throws:
GroupModifyException
- if unable to add type.InsufficientPrivilegeException
- if subject not root-like.SchemaException
- if attempting to add a system group type.
-
internal_addType
public boolean internal_addType(GroupType type, String groupTypeAssignmentId, boolean exceptionIfAlreadyHasType) throws GroupModifyException, InsufficientPrivilegeException, SchemaException - Parameters:
type
-groupTypeAssignmentId
-exceptionIfAlreadyHasType
-- Returns:
- if it was added or not
- Throws:
GroupModifyException
InsufficientPrivilegeException
SchemaException
-
canReadField
Check whether theSubject
that loaded thisGroup
can read the specifiedField
.try { boolean rv = g.canReadField(f); } catch (SchemaException eS) { // invalid field }
- Parameters:
f
- Check privileges on thisField
.- Returns:
- True if
Subject
can readField
, false otherwise. - Throws:
IllegalArgumentException
- if nullField
SchemaException
- if invalidField
- Since:
- 1.0
-
canReadField
Check whether the specifiedSubject
can 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
Subject
can readField
, false otherwise. - Throws:
IllegalArgumentException
- if nullSubject
orField
SchemaException
- if invalidField
orSubject
.- Since:
- 1.2.0
-
canWriteField
Check whether theSubject
that loaded thisGroup
can write the specifiedField
.try { boolean rv = g.canWriteField(f); } catch (SchemaException eS) { // invalid field }
- Parameters:
f
- Check privileges on thisField
.- Returns:
- True if
Subject
can writeField
, false otherwise. - Throws:
IllegalArgumentException
- if nullField
SchemaException
- if invalidField
- Since:
- 1.0
-
canWriteField
public boolean canWriteField(Subject subj, Field f) throws IllegalArgumentException, SchemaException Check whether the specifiedSubject
can 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
Subject
can writeField
, false otherwise. - Throws:
IllegalArgumentException
- if nullSubject
orField
SchemaException
- 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:
delete
in interfaceEntity
- Specified by:
delete
in interfaceRole
- Throws:
GroupDeleteException
InsufficientPrivilegeException
-
deleteAttribute
public void deleteAttribute(String attrName) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException Deprecated.Delete a group attribute.try { g.deleteAttribute(attribute); } catch (GroupModifyException e0) { // Unable to modify group } catch (InsufficientPrivilegeException e1) { // Not privileged to delete this attribute }
- Parameters:
attrName
- Delete this attribute.- Throws:
AttributeNotFoundException
GroupModifyException
InsufficientPrivilegeException
-
deleteAttribute
public void deleteAttribute(String attrName, boolean failOnRequiredAttribute) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException Deprecated.Delete a group attribute.try { g.deleteAttribute(attribute); } catch (GroupModifyException e0) { // Unable to modify group } catch (InsufficientPrivilegeException e1) { // Not privileged to delete this attribute }
- Parameters:
attrName
- Delete this attribute.failOnRequiredAttribute
- true if exception when attribute is required- Throws:
AttributeNotFoundException
GroupModifyException
InsufficientPrivilegeException
-
deleteCompositeMember
Delete aComposite
membership from this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.try { g.deleteCompositeMember(); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete members } catch (MemberDeleteException eMD) { // Unable to delete composite membership }
- Throws:
InsufficientPrivilegeException
MemberDeleteException
- Since:
- 1.0
-
deleteMember
public boolean deleteMember(Member member, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(member); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }
- Parameters:
member
- Delete thisMember
exceptionIfAlreadyDeleted
- throw exception if already deleted- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeException
MemberDeleteException
-
deleteMember
public void deleteMember(Member member) throws InsufficientPrivilegeException, MemberDeleteException Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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:
InsufficientPrivilegeException
MemberDeleteException
-
deleteMember
public boolean deleteMember(Member member, Field f, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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:
InsufficientPrivilegeException
MemberDeleteException
SchemaException
-
deleteMember
public void deleteMember(Member member, Field f) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException Delete a member from this group, and member must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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:
InsufficientPrivilegeException
MemberDeleteException
SchemaException
-
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:
InsufficientPrivilegeException
MemberDeleteException
-
deleteMember
public boolean deleteMember(Subject subj, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipstry { g.deleteMember(subj); } catch (InsufficientPrivilegeException eIP) { // Not privileged to delete this subject } catch (MemberDeleteException eMD) { // Unable to delete subject }
- Specified by:
deleteMember
in interfaceRole
- Parameters:
subj
- Delete thisSubject
exceptionIfAlreadyDeleted
-- Returns:
- false if it was already deleted, true if it wasnt already deleted
- Throws:
InsufficientPrivilegeException
MemberDeleteException
-
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:
InsufficientPrivilegeException
MemberDeleteException
SchemaException
-
deleteMember
public boolean deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted) throws InsufficientPrivilegeException, MemberDeleteException, SchemaException Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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:
InsufficientPrivilegeException
MemberDeleteException
SchemaException
-
internal_deleteMember
public boolean internal_deleteMember(Subject subj, Field f, boolean exceptionIfAlreadyDeleted, boolean checkSecurity) Delete a subject from this group, and subject must be immediate member. Will not delete the effective membership. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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:
InsufficientPrivilegeException
MemberDeleteException
SchemaException
-
deleteType
public void deleteType(GroupType type) throws GroupModifyException, InsufficientPrivilegeException, SchemaException Deprecated.Delete a group type.try { GroupType custom = GroupTypeFinder.find("custom type"); g.deleteType(custom); } catch (GroupModifyException eGM) { // Unable to delete type } catch (InsufficientPrivilegeException eIP) { // Not privileged to add type } catch (SchemaException eS) { // Cannot delete system-maintained types }
- Parameters:
type
- TheGroupType
to add.- Throws:
GroupModifyException
- if unable to delete type.InsufficientPrivilegeException
- if subject not root-like.SchemaException
- if attempting to delete a system group type.
-
getAdmins
Get subjects with the ADMIN privilege on this group.Set admins = g.getAdmins();
- Specified by:
getAdmins
in 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
GetComposite
Member
s of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.Set members = g.getCompositeMembers();
- Parameters:
queryOptions
-- Returns:
- A set of
Member
objects. - Since:
- 1.0
-
getAttributes
Deprecated.use getAttributesMapGet all attributes and values.Map attributes = g.getAttributes();
- Returns:
- A map of attributes and values.
-
getCompositeMembers
GetComposite
Member
s of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.Set members = g.getCompositeMembers();
- Returns:
- A set of
Member
objects. - Since:
- 1.0
-
getCompositeMemberships
GetComposite
Membership
s 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
Membership
objects. - 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:
Subject
that created this group.- Throws:
SubjectNotFoundException
-
getCreateTime
Get creation time for this group.// Get create time. Date created = g.getCreateTime();
- Returns:
Date
that this group was created.
-
getDescription
Get group description.String description = g.getDescription();
- Specified by:
getDescription
in interfaceEntity
- Specified by:
getDescription
in interfaceGrouperObject
- Specified by:
getDescription
in 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:
getDisplayExtension
in interfaceEntity
- Specified by:
getDisplayExtension
in interfaceRole
- Returns:
- Gruop displayExtension.
- Throws:
GrouperException
-
getDisplayName
Get group displayName.String displayName = g.getDisplayName();
- Specified by:
getDisplayName
in interfaceEntity
- Specified by:
getDisplayName
in interfaceGrouperObject
- Specified by:
getDisplayName
in 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
Member
objects. - 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
Member
objects. - 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
Member
objects. - Throws:
SchemaException
-
getEffectiveMembers
public Set<Member> getEffectiveMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get effective members of this group. An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective 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
Member
objects. - 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
Membership
objects. - 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
Membership
objects. - Throws:
SchemaException
-
getExtension
Get group extension.String extension = g.getExtension();
- Specified by:
getExtension
in interfaceEntity
- Specified by:
getExtension
in 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
Member
objects. - 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
Member
objects. - 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
Member
objects. - Throws:
SchemaException
-
getImmediateMembers
public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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
Member
objects. - Throws:
SchemaException
-
isHasMembers
public boolean isHasMembers()more efficient? way to see if there are any members you need read on the group to call this method- Returns:
- true if has members, false if not
-
getImmediateMembers
public Set<Member> getImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions, SortStringEnum memberSortStringEnum, SearchStringEnum memberSearchStringEnum, String memberSearchStringValue) throws SchemaException Get immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective 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
Member
objects. - 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
Membership
objects. - 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
Membership
objects. - Throws:
SchemaException
-
getMembers
Get members of this group.Set members = g.getMembers();
- Returns:
- A set of
Member
objects. - 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
Member
objects. - 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
Member
objects. - Throws:
SchemaException
-
getMembers
public Set<Member> getMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get members of this group.Set members = g.getMembers(f);
- Parameters:
f
- Get members in this list field.to get members from, or null for allsources
- to get members from, or null for allqueryOptions
- paging, sorting, count, etc- Returns:
- A set of
Member
objects. - 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
Membership
objects. - 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
Membership
objects. - 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
Membership
objects. - Throws:
SchemaException
-
getImmediateMemberships
public Set<Membership> getImmediateMemberships(Field f, Collection<Member> members) throws SchemaException Get memberships of this group, for a certain collection of members, must be enabled A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipSet memberships = g.getMemberships(f);
- Parameters:
f
- Get memberships in this list field.members
-- Returns:
- A set of
Membership
objects. - Throws:
SchemaException
-
getImmediateMemberships
public Set<Membership> getImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly) throws SchemaException Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipSet memberships = g.getMemberships(f);
- Parameters:
f
- Get memberships in this list field.members
-enabledOnly
-- Returns:
- A set of
Membership
objects. - Throws:
SchemaException
-
getImmediateMembership
public Membership getImmediateMembership(Field f, Subject subject, boolean enabledOnly, boolean exceptionIfNotFound) throws SchemaException, MembershipNotFoundException Get membership of this group, for a certain member A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent 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
Membership
objects. - Throws:
SchemaException
MembershipNotFoundException
- if none found and exceptionIfNotFound
-
getImmediateMembership
public Membership getImmediateMembership(Field f, Member member, boolean enabledOnly, boolean exceptionIfNotFound) throws SchemaException, MembershipNotFoundException Get membership of this group, for a certain member A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent 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
Membership
objects. - Throws:
SchemaException
MembershipNotFoundException
- if none found and exceptionIfNotFound
-
getEffectiveMemberships
public Set<Membership> getEffectiveMemberships(Field f, Collection<Member> members) throws SchemaException Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipSet memberships = g.getMemberships(f);
- Parameters:
f
- Get memberships in this list field.members
-- Returns:
- A set of
Membership
objects. - 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
Membership
objects. - Throws:
SchemaException
-
getModifySubject
Get subject that last modified this group.try { Subject modifier = g.getModifySubject(); } catch (SubjectNotFoundException e) { // Couldn't find subject }
- Returns:
Subject
that last modified this group.- Throws:
SubjectNotFoundException
-
getModifyTime
Get last modified time for this group.Date modified = g.getModifyTime();
- Returns:
Date
that this group was last modified.
-
getName
Get group name.String name = g.getName();
- Specified by:
getName
in interfaceEntity
- Specified by:
getName
in interfaceGrouperObject
- Specified by:
getName
in interfaceOwner
- Specified by:
getName
in 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:
getParentStem
in 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
AccessPrivilege
objects.
-
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:
getViewers
in 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:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
grantPriv
public boolean grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant privilege to a subject on this group.try { g.grantPriv(subj, AccessPrivilege.ADMIN); } catch (GrantPrivilegeException e0) { // Not privileged to grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }
- Specified by:
grantPriv
in 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:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
internal_grantPriv
public boolean internal_grantPriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyMember, String uuid) throws GrantPrivilegeException, InsufficientPrivilegeException, SchemaException Grant privilege to a subject on this group.try { g.grantPriv(subj, AccessPrivilege.ADMIN); } catch (GrantPrivilegeException e0) { // Not privileged to grant this privilege } catch (InsufficientPrivilegeException e1) { // Unable to grant this privilege }
- Parameters:
subj
- Grant privilege to this subject.priv
- Grant this privilege.exceptionIfAlreadyMember
- if false, and subject is already a member, then dont throw a MemberAddException if the member is already in the groupuuid
-- Returns:
- false if it already existed, true if it didnt already exist
- Throws:
GrantPrivilegeException
InsufficientPrivilegeException
SchemaException
-
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 thisGroup
have aComposite
membership.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:
hasMember
in 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
- TheGroupType
to 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
- TheGroupType
to 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 thisGroup
a factor in aComposite
membership.if (g.isComposite()) { // this group is a factor in one-or-more composite memberships. }
- Returns:
- Boolean true if group is a factor in a composite membership.
-
revokePriv
public void revokePriv(Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke all privileges of the specified type on this group.try { g.revokePriv(AccessPrivilege.OPTIN); } catch (InsufficientPrivilegeException eIP) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Unable to modify group }
- Parameters:
priv
- Revoke all instances of this privilege.- Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
revokePriv
public void revokePriv(Subject subj, Privilege priv) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke a privilege from the specified subject.try { g.revokePriv(subj, AccessPrivilege.OPTIN); } catch (InsufficientPrivilegeException e1) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
- Parameters:
subj
- Revoke privilege from this subject.priv
- Revoke this privilege.- Throws:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
revokePriv
public boolean revokePriv(Subject subj, Privilege priv, boolean exceptionIfAlreadyRevoked) throws InsufficientPrivilegeException, RevokePrivilegeException, SchemaException Revoke a privilege from the specified subject.try { g.revokePriv(subj, AccessPrivilege.OPTIN); } catch (InsufficientPrivilegeException e1) { // Not privileged to revoke this privilege } catch (RevokePrivilegeException eRP) { // Error revoking privilege }
- Specified by:
revokePriv
in 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:
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
-
setAttribute
public void setAttribute(String attributeName, String value) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException Deprecated.Set an attribute value.try { g.attribute(attribute, value); } catch (AttributeNotFoundException e0) { // Attribute doesn't exist } catch (GroupModifyException e1) { // Unable to modify group } catch (InsufficientPrivilegeException e2) { // Not privileged to modify this attribute }
- Parameters:
attributeName
- Set this attribute.value
- Set to this value.- Throws:
AttributeNotFoundException
GroupModifyException
InsufficientPrivilegeException
-
setAttribute
public void setAttribute(String attributeName, String value, boolean checkPrivileges) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException Deprecated.Set an attribute value.try { g.attribute(attribute, value); } catch (AttributeNotFoundException e0) { // Attribute doesn't exist } catch (GroupModifyException e1) { // Unable to modify group } catch (InsufficientPrivilegeException e2) { // Not privileged to modify this attribute }
- Parameters:
attributeName
- Set this attribute.value
- Set to this value.checkPrivileges
-- Throws:
AttributeNotFoundException
GroupModifyException
InsufficientPrivilegeException
-
internal_setAttribute
public Attribute internal_setAttribute(String attributeName, String value, boolean checkPrivileges, String uuid) throws AttributeNotFoundException, GroupModifyException, InsufficientPrivilegeException Set an attribute value.try { g.attribute(attribute, value); } catch (AttributeNotFoundException e0) { // Attribute doesn't exist } catch (GroupModifyException e1) { // Unable to modify group } catch (InsufficientPrivilegeException e2) { // Not privileged to modify this attribute }
- Parameters:
attributeName
- Set this attribute.value
- Set to this value.checkPrivileges
-uuid
-- Returns:
- the attribute
- Throws:
AttributeNotFoundException
GroupModifyException
InsufficientPrivilegeException
-
store
public void store()store this object to the DB. -
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:
setDescription
in interfaceEntity
- Specified by:
setDescription
in 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:
setExtension
in interfaceEntity
- Specified by:
setExtension
in 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:
setDisplayExtension
in interfaceEntity
- Specified by:
setDisplayExtension
in 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:
setDisplayName
in interfaceEntity
- Specified by:
setDisplayName
in interfaceRole
- Parameters:
value
- new display name
-
toMember
Convert this group to aMember
object.Member m = g.toMember();
- Specified by:
toMember
in interfaceEntity
- Returns:
Group
as aMember
- Throws:
GrouperException
-
toSubject
Convert this group to aSubject
object.Subject subj = g.toSubject();
- Specified by:
toSubject
in interfaceEntity
- Returns:
Group
as 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:
IllegalArgumentException
SchemaException
- Since:
- 1.2.1
-
setDontSetModified
public void setDontSetModified(boolean theDontSetModified) if we should not set the modified attributes on group save- Parameters:
theDontSetModified
-
-
internal_addCompositeMember
public Composite internal_addCompositeMember(GrouperSession session, CompositeType type, Group left, Group right, String uuid) throws InsufficientPrivilegeException, MemberAddException - Parameters:
session
-type
-left
-right
-uuid
-- Returns:
- composite
- Throws:
InsufficientPrivilegeException
MemberAddException
-
dbVersionDifferentFields
Description copied from class:GrouperAPI
see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName- Overrides:
dbVersionDifferentFields
in 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:
dbVersionReset
in classGrouperAPI
-
clone
deep clone the fields in this object- Specified by:
clone
in interfaceGrouperCloneable
- Specified by:
clone
in 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:GrouperAPI
version of this object in the database- Overrides:
dbVersion
in 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:
onDelete
in interfaceorg.hibernate.classic.Lifecycle
- Overrides:
onDelete
in classGrouperAPI
- Throws:
org.hibernate.CallbackException
- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycle
after a save (insert) occurs- Specified by:
onPostSave
in interfaceHibGrouperLifecycle
- Overrides:
onPostSave
in classGrouperAPI
- See Also:
-
onPostUpdate
Description copied from interface:HibGrouperLifecycle
after an update occurs- Specified by:
onPostUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPostUpdate
in 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:HibGrouperLifecycle
after a delete occurs- Specified by:
onPostDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPostDelete
in classGrouperAPI
- See Also:
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
in classGrouperAPI
- See Also:
-
onSave
public boolean onSave(org.hibernate.Session hs) throws org.hibernate.CallbackException - Specified by:
onSave
in interfaceorg.hibernate.classic.Lifecycle
- Overrides:
onSave
in classGrouperAPI
- Throws:
org.hibernate.CallbackException
- See Also:
-
onUpdate
public boolean onUpdate(org.hibernate.Session s) throws org.hibernate.CallbackException - Specified by:
onUpdate
in interfaceorg.hibernate.classic.Lifecycle
- Overrides:
onUpdate
in 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:HibGrouperLifecycle
before a delete (insert) occurs- Specified by:
onPreDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPreDelete
in classGrouperAPI
- See Also:
-
fieldValue
Description copied from class:GrouperAPI
call this method to get the field value (e.g. from dbVersionDifferentFields). some objects have different interpretations (e.g. Group will process attribute__whatever)- Specified by:
fieldValue
in interfaceGrouperUtil.FieldValuable
- Overrides:
fieldValue
in classGrouperAPI
- Parameters:
fieldName
-- Returns:
- the value
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPreUpdate
in classGrouperAPI
- See Also:
-
compareTo
- Specified by:
compareTo
in 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:
move
in interfaceEntity
- Parameters:
stem
-- Throws:
GroupModifyException
InsufficientPrivilegeException
-
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:
GroupAddException
InsufficientPrivilegeException
-
copy
Copy this group to another Stem. If you want to specify options for the copy, use GroupCopy. This will use the default options.- Specified by:
copy
in interfaceEntity
- Parameters:
stem
-- Returns:
- the new group
- Throws:
InsufficientPrivilegeException
GroupAddException
-
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:GrouperSetElement
if of this object- Specified by:
__getId
in interfaceGrouperSetElement
- Returns:
- id
- See Also:
-
__getName
Description copied from interface:GrouperSetElement
name of this object (for logging)- Specified by:
__getName
in interfaceGrouperSetElement
- Returns:
- name
- See Also:
-
getId
Description copied from interface:Role
uuid of role -
getIdIndex
id of the group as a unique integer- Specified by:
getIdIndex
in interfaceRole
- Returns:
- id
-
setIdIndex
id of the group as a unique integer- Parameters:
idIndex1
-
-
getStemId
Description copied from interface:Role
stem that this attribute is in -
setId
Description copied from interface:Role
id of this attribute def name -
setStemId
Description copied from interface:Role
stem that this attribute is in -
getRoleInheritanceDelegate
delegate calls to this class for role hierarchy stuff- Specified by:
getRoleInheritanceDelegate
in interfaceRole
- Returns:
- the role inheritance hierarchy
-
getPermissionRoleDelegate
Description copied from interface:Role
delegate calls to this class for permission role stuff- Specified by:
getPermissionRoleDelegate
in 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
Membership
objects. - Throws:
SchemaException
-
getNonImmediateMemberships
public Set<Membership> getNonImmediateMemberships(Field f, Collection<Member> members, boolean enabledOnly) throws SchemaException Get memberships of this group, for a certain collection of members A membership is the object which represents a join of member and group. Has metadata like type and creator, and, if an effective membership, the parent membershipSet memberships = g.getMemberships(f);
- Parameters:
f
- Get memberships in this list field.members
-enabledOnly
-- Returns:
- A set of
Membership
objects. - 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
Member
objects. - 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
Member
objects. - Throws:
SchemaException
-
getNonImmediateMembers
public Set<Member> getNonImmediateMembers(Field f, QueryOptions queryOptions) throws SchemaException Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipsSet nonImmediates = g.getNonImmediateMembers(f);
- Parameters:
f
- Get members in this list field.queryOptions
-- Returns:
- A set of
Member
objects. - Throws:
SchemaException
-
getNonImmediateMembers
public Set<Member> getNonImmediateMembers(Field f, Set<Source> sources, QueryOptions queryOptions) throws SchemaException Get non-immediate members of this group. An immediate member is directly assigned to a group. A composite group has no immediate members. Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. A group can have potentially unlimited effective membershipsSet nonImmediates = g.getNonImmediateMembers(f);
- Parameters:
f
- Get members in this list field.sources
-queryOptions
-- Returns:
- A set of
Member
objects. - 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
Membership
objects. - 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
Membership
objects. - 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
GetComposite
Member
s of this group. A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g. union, intersection, etc). A composite group has no immediate members. All subjects in a composite group are effective members.Set members = g.getCompositeMembers();
- Parameters:
field
-sources
-queryOptions
-- Returns:
- A set of
Member
objects. - Since:
- 1.0
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<Group>
- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<Group>
- Parameters:
other
- the one to compare with- Returns:
- true if so
- See Also:
-
xmlDifferentUpdateProperties
Description copied from interface:XmlImportableBase
see if the update cols are different (e.g. last updated)- Specified by:
xmlDifferentUpdateProperties
in interfaceXmlImportableBase<Group>
- Parameters:
other
- the one to compare with- Returns:
- true if so
- See Also:
-
xmlRetrieveByIdOrKey
Description copied from interface:XmlImportable
retrieve from db by id or key. throws exception if duplicate- Specified by:
xmlRetrieveByIdOrKey
in 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:XmlImportableBase
save the business properties (not update properties)- Specified by:
xmlSaveBusinessProperties
in 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:XmlImportableBase
save the udpate properties (e.g. last updated). Note, this is done with a sql update statement, not with hibernate- Specified by:
xmlSaveUpdateProperties
in interfaceXmlImportableBase<Group>
- See Also:
-
xmlToExportGroup
convert to xml bean for export- Parameters:
grouperVersion
-- Returns:
- xml bean
-
xmlGetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlGetId
in interfaceXmlImportableBase<Group>
- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<Group>
- See Also:
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<Group>
- Returns:
- the string value for log
- See Also:
-
matchesLowerSearchStrings
Description copied from interface:GrouperObject
see if this object matches the filter strings- Specified by:
matchesLowerSearchStrings
in 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 }
-