Package edu.internet2.middleware.grouper
Class Membership
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Membership
- All Implemented Interfaces:
AttributeAssignable
,HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperHasContext
,GrouperUtil.FieldValuable
,XmlImportable<Membership>
,XmlImportableBase<Membership>
,Serializable
,org.hibernate.classic.Lifecycle
public class Membership
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned, XmlImportable<Membership>, AttributeAssignable
A list membership in the Groups Registry.
A membership is the object which represents a join of member
and group. Has metadata like type and creator,
and, if an effective membership, the parent membership
- Version:
- $Id: Membership.java,v 1.141 2009-12-21 06:15:02 mchyzer Exp $
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
colstatic final String
colstatic final String
static final String
static final String
epoch time of when to disable membershipstatic final String
whether the membership is enabled or disabled: T|Fstatic final String
epoch time of when to enable membershipstatic final String
id col in dbstatic final String
id col in dbstatic final String
list_name col in dbstatic final String
list_type col in dbstatic final String
colstatic final String
uuid col in dbstatic final String
colstatic final String
old id col for id conversionstatic final String
old_list_name col in dbstatic final String
old_list_type col in dbstatic final String
old uuid id col for id conversionstatic final String
static final String
static final String
static final String
static final String
static final String
colstatic final String
static final String
static final String
static final String
Deprecated.static final String
Deprecated.static final String
constant for field name for: contextIdstatic final String
constant for field name for: createTimeLongstatic final String
constant for field name for: creatorUUIDstatic final String
constant for field name for: dbVersionstatic final String
constant for field name for: depthstatic final String
constant for field name for: disabledTimeDbstatic final String
constant for field name for: enabledstatic final String
constant for field name for: enabledTimeDbstatic final String
constant for field name for: fieldIdstatic final String
constant for field name for: groupSetCreateTimeLongstatic final String
constant for field name for: groupSetCreatorUUIDstatic final String
constant for field name for: groupSetIdstatic final String
constant for field name for: groupSetParentIdstatic final String
constant for field name for: immediateMembershipIdstatic final String
constant for field name for: memberUUIDstatic final String
constant for field name for: ownerAttrDefIdstatic final String
constant for field name for: ownerGroupIdstatic final String
constant for field name for: ownerStemIdstatic final String
constant for field name for: typestatic final String
constant for field name for: uuidstatic final String
constant for field name for: viaCompositeIdstatic final String
constant for field name for: viaGroupIdstatic final String
Deprecated.static final String
separator used in the uuid field to split immediate_membership_id and group_set_idstatic final String
attr def owner type for change logstatic final String
group owner type for change logstatic final String
stem owner type for change logstatic final String
table name where memberships are storedFields 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 TypeMethodDescriptionvoid
addMembershipAddChangeLog
(String contextId) add a change log entry for a membership addvoid
addMembershipDeleteChangeLog
(Member member) add a change log entry for a membership deleteclone()
deep clone the fields in this objectsave the state when retrieving from DBnote, these are massaged so that name, extension, etc look like normal fields.void
take a snapshot of the data since this is what is in the dbvoid
delete()
delete this record (and security and actions etc, but not attribute def names yet)void
Deprecated.boolean
Deprecated.use getOwnerAttributeDef() insteadget the logic delegatedelegate for effective membershipsthis delegate works on attributes and values at the same timethis delegate works on attributes and values at the same timeGet child memberships of this membership.context id of the transactionlong
This returns the create time of the membership.This returns the creator of the membership.int
getDepth()
number of hops between this membership and direct membershipTime when this membership is disabled if the value is in the future.Time when this membership is disabled if the value is in the future.Whether or not this membership is enabled.Time when this membership is enabled if the value is in the future.Time when this membership is enabled if the value is in the future.getField()
get the field based on field id (if there is one there)id of the field which is the list name and typegetGroup()
Deprecated.use getOwnerGroup() insteadgetter for group name if group membershiplong
id of the field for the immediate membership that causes this membershipgetList()
Get this membership's list.Get this membership's member.if attrDef membership, this is the attrDef idGet this membership's group.Get this membership's group.if group membership, this is the group idget the owner idget the name of the owner (group or stem)if this is a stem membership, this is the stem idGet parent membership of this membership.getStem()
Deprecated.use getOwnerStem() insteadgetType()
get MembershipType of typegetUuid()
A composite group is composed of two groups and a set operator (stored in grouper_composites table) (e.g.if composite, this is composite idGet this membership's via group.if effective, this is group it is inint
hashCode()
static Membership
internal_addImmediateMembership
(GrouperSession s, AttributeDef attributeDef, Subject subj, Field f, String uuid) static Membership
internal_addImmediateMembership
(GrouperSession s, Group g, Subject subj, Field f, String uuid, Timestamp startDate, Timestamp endDate) static Membership
internal_addImmediateMembership
(GrouperSession s, Stem ns, Subject subj, Field f, String uuid) static void
internal_deleteAllField
(GrouperSession s, AttributeDef attributeDef, Field f) static void
internal_deleteAllField
(GrouperSession s, Group g, Field f) static void
internal_deleteAllField
(GrouperSession s, Stem ns, Field f) static void
internal_deleteAllFieldType
(GrouperSession s, AttributeDef attributeDef, FieldType type) static void
internal_deleteAllFieldType
(GrouperSession s, Group g, FieldType type) static void
internal_deleteAllFieldType
(GrouperSession s, Stem ns, FieldType type) static Membership
internal_delImmediateMembership
(GrouperSession s, AttributeDef attributeDef, Subject subj, Field f) static Membership
internal_delImmediateMembership
(GrouperSession s, Group g, Subject subj, Field f) static Membership
internal_delImmediateMembership
(GrouperSession s, Stem ns, Subject subj, Field f) boolean
Should this membership be enabled based on the enabled and disabled dates? Only applies to immediate/composite memberships.boolean
if this is a composite membershipboolean
if this is a effective membershipboolean
Is this membership enabled? Only applies to immediate/composite memberships.boolean
if this is a immediate membershipstatic String
membershipOwnerMemberToString
(Collection<Object[]> membershipGroupMembers) convert membership owner member to stringvoid
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 occursstatic void
resolveSubjects
(Collection<Object[]> rows) resolve subjects from a collection of arrays of rows of object (typically members are the 3rd index)retrieveGroups
(Collection<Membership> memberships) retrieve a set of groups based on some memberships (and store in each membership, like getGroupvoid
setContextId
(String contextId1) context id of the transactionvoid
setCreateTimeLong
(long createTime) void
setCreatorUuid
(String creatorUUID) void
setDepth
(int depth) void
setDisabledTime
(Timestamp disabledTimeDb) Set the time to disable this membership.void
setDisabledTimeDb
(Long disabledTimeDb) Set the time to disable this membership.void
setEnabled
(boolean enabled) Whether to enable or disable this membership.void
setEnabledDb
(String enabled) Whether to enable or disable this membership.void
setEnabledTime
(Timestamp enabledTimeDb) Set the time when this membership should be enabled.void
setEnabledTimeDb
(Long enabledTimeDb) Set the time when this membership should be enabled.void
setFieldId
(String fieldId1) id of the field which is the list name and typevoid
setGroupSetCreateTimeLong
(long groupSetCreateTimeLong) void
setGroupSetCreatorUuid
(String groupSetCreatorUUID) void
setGroupSetId
(String groupSetId) void
setGroupSetParentId
(String groupSetParentId) void
setImmediateFieldId
(String immediateFieldId) id of the field for the immediate membership that causes this membershipvoid
setImmediateMembershipId
(String immediateMembershipId) Set the immediate membership idvoid
this can be called to set the member object even though the memberuuid is not changingvoid
setMemberUuid
(String memberUUID) void
setOwnerAttrDefId
(String attrDefId1) if this is an attrDef membership, this is the attrDef idvoid
setOwnerAttributeDef
(AttributeDef attributeDef) set the owner attributeDefvoid
setOwnerGroup
(Group group) set the owner groupvoid
setOwnerGroupId
(String groupId1) if this is a group membership, this is the group idvoid
setOwnerId
(String owner) This is for internal use only.void
setOwnerStem
(Stem stem) set the owner stemvoid
setOwnerStemId
(String stemId1) if this is a stem membership, this is the stem idvoid
void
void
setViaCompositeId
(String viaCompositeId) if composite, this is composite idvoid
setViaGroupId
(String viaGroupId) if effective, this is group it is intoString()
void
update()
update this record to the DBstatic void
Update the last_membership_change for the ancestor groups and stems for the given groups.void
xmlCopyBusinessPropertiesToExisting
(Membership 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
(Membership existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set id key in dbxmlToExportMembership
(GrouperVersion grouperVersion) convert to xml bean for exportconvert to string for logMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersionClear, dbVersionIsDifferent, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
FIELD_CONTEXT_ID
constant for field name for: contextId- See Also:
-
TABLE_GROUPER_MEMBERSHIPS
table name where memberships are stored- See Also:
-
COLUMN_ID
id col in db- See Also:
-
COLUMN_FIELD_ID
id col in db- See Also:
-
COLUMN_LIST_NAME
list_name col in db- See Also:
-
COLUMN_LIST_TYPE
list_type col in db- See Also:
-
COLUMN_OLD_LIST_NAME
old_list_name col in db- See Also:
-
COLUMN_OLD_LIST_TYPE
old_list_type col in db- See Also:
-
COLUMN_MEMBERSHIP_UUID
uuid col in db- See Also:
-
COLUMN_OLD_ID
old id col for id conversion- See Also:
-
COLUMN_OLD_MEMBERSHIP_UUID
old uuid id col for id conversion- 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_CREATE_TIME_LONG
constant for field name for: createTimeLong- See Also:
-
FIELD_CREATOR_UUID
constant for field name for: creatorUUID- See Also:
-
FIELD_GROUP_SET_CREATE_TIME_LONG
constant for field name for: groupSetCreateTimeLong- See Also:
-
FIELD_GROUP_SET_CREATOR_UUID
constant for field name for: groupSetCreatorUUID- See Also:
-
FIELD_DB_VERSION
constant for field name for: dbVersion- See Also:
-
FIELD_DEPTH
constant for field name for: depth- See Also:
-
FIELD_FIELD_ID
constant for field name for: fieldId- See Also:
-
FIELD_MEMBER_UUID
constant for field name for: memberUUID- See Also:
-
FIELD_OWNER_GROUP_ID
constant for field name for: ownerGroupId- See Also:
-
FIELD_OWNER_STEM_ID
constant for field name for: ownerStemId- See Also:
-
FIELD_OWNER_ATTR_DEF_ID
constant for field name for: ownerAttrDefId- See Also:
-
FIELD_TYPE
constant for field name for: type- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
FIELD_GROUP_SET_ID
constant for field name for: groupSetId- See Also:
-
FIELD_VIA_COMPOSITE_ID
constant for field name for: viaCompositeId- See Also:
-
FIELD_VIA_GROUP_ID
constant for field name for: viaGroupId- See Also:
-
FIELD_GROUP_SET_PARENT_ID
constant for field name for: groupSetParentId- See Also:
-
FIELD_IMMEDIATE_MEMBERSHIP_ID
constant for field name for: immediateMembershipId- 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:
-
COMPOSITE
Deprecated.A member of a group (aka composite member) has either or both of an immediate (direct) membership, or an effective (indirect) membership use MembershipType.COMPOSITE.getTypeString() instead- See Also:
-
EFFECTIVE
Deprecated.An effective member has an indirect membership to a group (e.g. in a group within a group). All subjects in a composite group are effective members (since the composite group has two groups and a set operator and no other immediate members). Note that a member can have 0 to 1 immediate memberships to a single group, and 0 to many effective memberships to a group. 'group within a group' can be nested to any level so long as it does not become circular. A group can have potentially unlimited effective memberships use MembershipType.EFFECTIVE.getTypeString() instead- See Also:
-
IMMEDIATE
Deprecated.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 use MembershipType.IMMEDIATE.getTypeString() instead- See Also:
-
OWNER_TYPE_GROUP
group owner type for change log- See Also:
-
OWNER_TYPE_STEM
stem owner type for change log- See Also:
-
OWNER_TYPE_ATTRIBUTE_DEF
attr def owner type for change log- See Also:
-
membershipIdSeparator
separator used in the uuid field to split immediate_membership_id and group_set_id- See Also:
-
CACHE_GET_GROUP
-
CACHE_GET_ATTR_DEF
-
CACHE_GET_STEM
-
COLUMN_VIA_ID_BAK
- See Also:
-
COLUMN_VIA_COMPOSITE_ID
- See Also:
-
COLUMN_OWNER_STEM_ID
- See Also:
-
COLUMN_OWNER_GROUP_ID
- See Also:
-
COLUMN_OWNER_ATTR_DEF_ID
- See Also:
-
COLUMN_OWNER_ID
- See Also:
-
COLUMN_VIA_ID
- See Also:
-
COLUMN_DEPTH
- See Also:
-
COLUMN_DEPTH_BAK
- See Also:
-
COLUMN_PARENT_MEMBERSHIP
- See Also:
-
COLUMN_PARENT_MEMBERSHIP_BAK
col- See Also:
-
COLUMN_MEMBER_ID
col- See Also:
-
COLUMN_MSHIP_TYPE
col- See Also:
-
COLUMN_CREATOR_ID
col- See Also:
-
COLUMN_CREATE_TIME
col- See Also:
-
-
Constructor Details
-
Membership
public Membership()
-
-
Method Details
-
resolveSubjects
resolve subjects from a collection of arrays of rows of object (typically members are the 3rd index)- Parameters:
rows
-
-
update
public void update()update this record to the DB -
getOwnerName
get the name of the owner (group or stem)- Returns:
- the name
-
getAttributeDelegate
Description copied from interface:AttributeAssignable
get the logic delegate- Specified by:
getAttributeDelegate
in interfaceAttributeAssignable
- Returns:
- the delegate
-
getAttributeValueDelegate
this delegate works on attributes and values at the same time- Specified by:
getAttributeValueDelegate
in interfaceAttributeAssignable
- Returns:
- the delegate
-
internal_isEnabledUsingTimestamps
public boolean internal_isEnabledUsingTimestamps()Should this membership be enabled based on the enabled and disabled dates? Only applies to immediate/composite memberships.- Returns:
- boolean
-
isEnabled
public boolean isEnabled()Is this membership enabled? Only applies to immediate/composite memberships.- Returns:
- boolean
-
deleteAndStore
Deprecated.This shouldn't be used anymore delete this membership (and child objects) and recommit it (which will not have the child objects or will have this time) -
delete
public void delete()delete this record (and security and actions etc, but not attribute def names yet) -
setEnabled
public void setEnabled(boolean enabled) Whether to enable or disable this membership. Only applies to immediate/composite memberships.- Parameters:
enabled
-
-
getEnabledDb
Whether or not this membership is enabled. Only applies to immediate/composite memberships.- Returns:
- the enabled
-
setEnabledDb
Whether to enable or disable this membership. Only applies to immediate/composite memberships.- Parameters:
enabled
-
-
getEnabledTimeDb
Time when this membership is enabled if the value is in the future. Only applies to immediate memberships.- Returns:
- Long
-
getEnabledTime
Time when this membership is enabled if the value is in the future. Only applies to immediate memberships.- Returns:
- Timestamp
-
setEnabledTimeDb
Set the time when this membership should be enabled. Only applies to immediate memberships.- Parameters:
enabledTimeDb
-
-
setEnabledTime
Set the time when this membership should be enabled. Only applies to immediate memberships.- Parameters:
enabledTimeDb
-
-
getDisabledTimeDb
Time when this membership is disabled if the value is in the future. Only applies to immediate memberships.- Returns:
- Long
-
getDisabledTime
Time when this membership is disabled if the value is in the future. Only applies to immediate memberships.- Returns:
- Timestamp
-
setDisabledTimeDb
Set the time to disable this membership. Only applies to immediate memberships.- Parameters:
disabledTimeDb
-
-
setDisabledTime
Set the time to disable this membership. Only applies to immediate memberships.- Parameters:
disabledTimeDb
-
-
isComposite
public boolean isComposite()if this is a composite membership- Returns:
- true if composite
-
isImmediate
public boolean isImmediate()if this is a immediate membership- Returns:
- true if immediate
-
isEffective
public boolean isEffective()if this is a effective membership- Returns:
- true if effective
-
getChildMemberships
Get child memberships of this membership. 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 children = ms.getChildMemberships();
- Returns:
- Set of
Membership
objects.
-
getGroupSetParentId
- Returns:
- group set parent id
-
setGroupSetParentId
- Parameters:
groupSetParentId
-
-
getCreateTime
- Returns:
- create time
- Since:
- 1.2.0
-
getCreator
- Returns:
- creator
- Throws:
MemberNotFoundException
- Since:
- 1.2.0
-
getDepth
public int getDepth()number of hops between this membership and direct membership- Returns:
- depth
-
getGroupName
getter for group name if group membership- Returns:
- group name
-
getGroup
Deprecated.use getOwnerGroup() insteadGet this membership's group. To get the groups of a bunch of membership, might want to try retrieveGroups()Group g = ms.getGroup();
- Returns:
- A
Group
- Throws:
GroupNotFoundException
- if group not found
-
getAttributeDef
Deprecated.use getOwnerAttributeDef() insteadGet this membership's group. To get the groups of a bunch of membership, might want to try retrieveGroups()Group g = ms.getAttributeDef();
- Returns:
- A
AttributeDef
- Throws:
AttributeDefNotFoundException
- if attrDef not found
-
getOwnerAttributeDef
Get this membership's group. To get the groups of a bunch of membership, might want to try retrieveGroups()Group g = ms.getAttributeDef();
- Returns:
- A
AttributeDef
- Throws:
AttributeDefNotFoundException
- if attrDef not found
-
retrieveGroups
retrieve a set of groups based on some memberships (and store in each membership, like getGroup- Parameters:
memberships
-- Returns:
- the set of groups
-
getList
Get this membership's list.String list = g.getList();
- Returns:
- The
Field
type of this membership.
-
getMemberSubjectId
- Returns:
- the subject id of the member
-
getMemberSourceId
- Returns:
- the source id of the member
-
getMember
Get this membership's member. All immediate subjects, and effective members are members. No duplicates will be returned (e.g. if immediate and effective).Member m = ms.getMember();
- Returns:
- A
Member
- Throws:
MemberNotFoundException
-
getParentMembership
Get parent membership of this membership. 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 membershiptry { Membership parent = ms.getParentMembership(); } catch (MembershipNotFoundException e) { // Unable to retrieve parent membership }
- Returns:
- A
Membership
- Throws:
MembershipNotFoundException
-
getStem
Deprecated.use getOwnerStem() instead- Returns:
- stem
- Throws:
StemNotFoundException
- Since:
- 1.2.0
-
getType
- Returns:
- type effective, immediate, composite
- Since:
- 1.2.0
-
getTypeEnum
get MembershipType of type- Returns:
- type
-
getUuid
- Returns:
- uuid
-
getParentUuid
- Returns:
- the membership uuid of the parent
- Since:
- 1.2.0
-
getViaComposite
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.- Returns:
- composite
- Throws:
CompositeNotFoundException
- Since:
- 1.2.0
-
getViaGroup
Get this membership's via group.Group
s withComposite
memberships will not have a via group. Use thegetViaComposite()
method instead.try { Group via = ms.getViaGroup(); } catch (GroupNotFoundException e) { // Unable to retrieve via group }
- Returns:
- A
Group
- Throws:
GroupNotFoundException
-
internal_addImmediateMembership
public static Membership internal_addImmediateMembership(GrouperSession s, Group g, Subject subj, Field f, String uuid, Timestamp startDate, Timestamp endDate) throws MemberAddException - Parameters:
s
-g
-subj
-f
-uuid
- is uuid or nullstartDate
-endDate
-- Returns:
- the membership if available
- Throws:
MemberAddException
-
internal_addImmediateMembership
public static Membership internal_addImmediateMembership(GrouperSession s, Stem ns, Subject subj, Field f, String uuid) throws MemberAddException - Parameters:
s
-ns
-subj
-f
-uuid
-- Returns:
- Membership
- Throws:
MemberAddException
-
internal_delImmediateMembership
public static Membership internal_delImmediateMembership(GrouperSession s, Group g, Subject subj, Field f) throws MemberDeleteException - Parameters:
s
-g
-subj
-f
-- Returns:
- the deleted membership
- Throws:
MemberDeleteException
-
internal_delImmediateMembership
public static Membership internal_delImmediateMembership(GrouperSession s, Stem ns, Subject subj, Field f) throws MemberDeleteException - Parameters:
s
-ns
-subj
-f
-- Returns:
- the deleted membership
- Throws:
MemberDeleteException
-
internal_deleteAllField
public static void internal_deleteAllField(GrouperSession s, Group g, Field f) throws MemberDeleteException, SchemaException - Parameters:
s
-g
-f
-- Throws:
MemberDeleteException
SchemaException
- Since:
- 1.2.0
-
internal_deleteAllField
public static void internal_deleteAllField(GrouperSession s, Stem ns, Field f) throws MemberDeleteException - Parameters:
s
-ns
-f
-- Throws:
MemberDeleteException
- Since:
- 1.2.0
-
internal_deleteAllFieldType
public static void internal_deleteAllFieldType(GrouperSession s, Group g, FieldType type) throws MemberDeleteException, SchemaException - Parameters:
s
-g
-type
-- Throws:
MemberDeleteException
SchemaException
-
internal_deleteAllFieldType
public static void internal_deleteAllFieldType(GrouperSession s, Stem ns, FieldType type) throws MemberDeleteException, SchemaException - Parameters:
s
-ns
-type
-- Throws:
MemberDeleteException
SchemaException
-
equals
-
getCreateTimeLong
public long getCreateTimeLong()This returns the create time of the membership. If the membership is effective, this will be for the immediate membership that causes the effective membership.- Returns:
- create time
-
getCreatorUuid
This returns the creator of the membership. If the membership is effective, this will be for the immediate membership that causes the effective membership.- Returns:
- creator uuid
-
membershipOwnerMemberToString
convert membership owner member to string- Parameters:
membershipGroupMembers
-- Returns:
- the string
-
getListName
- Returns:
- list name
-
getField
get the field based on field id (if there is one there)- Returns:
- the field or null if not there
-
getListType
- Returns:
- list type
-
getMemberUuid
- Returns:
- member uuid
- Since:
- 1.2.0
-
getGroupSetId
- Returns:
- string
-
setGroupSetId
- Parameters:
groupSetId
-
-
hashCode
public int hashCode() -
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
in classGrouperAPI
- See Also:
-
setCreateTimeLong
public void setCreateTimeLong(long createTime) - Parameters:
createTime
-- Since:
- 1.2.0
-
setCreatorUuid
- Parameters:
creatorUUID
-- Since:
- 1.2.0
-
getGroupSetCreateTimeLong
public long getGroupSetCreateTimeLong()- Returns:
- long
-
setGroupSetCreateTimeLong
public void setGroupSetCreateTimeLong(long groupSetCreateTimeLong) - Parameters:
groupSetCreateTimeLong
-
-
getGroupSetCreatorUuid
- Returns:
- string
-
setGroupSetCreatorUuid
- Parameters:
groupSetCreatorUUID
-
-
setDepth
public void setDepth(int depth) - Parameters:
depth
-- Since:
- 1.2.0
-
setMember
this can be called to set the member object even though the memberuuid is not changing- Parameters:
member
-- Since:
- 1.3.0
-
setMemberUuid
- Parameters:
memberUUID
-
-
setType
- Parameters:
type
-- Since:
- 1.2.0
-
setUuid
- Parameters:
uuid
-- Since:
- 1.2.0
-
getViaGroupId
if effective, this is group it is in- Returns:
- group id
-
setViaGroupId
if effective, this is group it is in- Parameters:
viaGroupId
-
-
getViaCompositeId
if composite, this is composite id- Returns:
- composite id
-
setViaCompositeId
if composite, this is composite id- Parameters:
viaCompositeId
-
-
toString
-
onPostDelete
Description copied from interface:HibGrouperLifecycle
after a delete occurs- Specified by:
onPostDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPostDelete
in classGrouperAPI
- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycle
after a save (insert) occurs- Specified by:
onPostSave
in interfaceHibGrouperLifecycle
- Overrides:
onPostSave
in classGrouperAPI
- See Also:
-
updateLastMembershipChangeDuringMembersListUpdate
Update the last_membership_change for the ancestor groups and stems for the given groups.- Parameters:
groupIds
-
-
fixComposites
protected static Set<String> fixComposites(Set<Composite> composites, String ownerGroupId, Set<String> membersList) - Parameters:
composites
-ownerGroupId
-membersList
-- Returns:
- set of group ids with modified composite memberships
-
onPostUpdate
Description copied from interface:HibGrouperLifecycle
after an update occurs- Specified by:
onPostUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPostUpdate
in classGrouperAPI
- See Also:
-
onPreDelete
Description copied from interface:HibGrouperLifecycle
before a delete (insert) occurs- Specified by:
onPreDelete
in interfaceHibGrouperLifecycle
- Overrides:
onPreDelete
in classGrouperAPI
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPreUpdate
in classGrouperAPI
- See Also:
-
dbVersion
save the state when retrieving from DB- Overrides:
dbVersion
in classGrouperAPI
- Returns:
- the dbVersion
-
dbVersionDifferentFields
note, these are massaged so that name, extension, etc look like normal fields. access with fieldValue()- Overrides:
dbVersionDifferentFields
in classGrouperAPI
- Returns:
- a set of attributes changed, or empty set if none
- 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:
-
getFieldId
id of the field which is the list name and type- Returns:
- the field id
-
setFieldId
id of the field which is the list name and type- Parameters:
fieldId1
-
-
getImmediateFieldId
id of the field for the immediate membership that causes this membership- Returns:
- the field id
-
setImmediateFieldId
id of the field for the immediate membership that causes this membership- Parameters:
immediateFieldId
-
-
getOwnerId
get the owner id- Returns:
- the owner id
-
setOwnerId
This is for internal use only.- Parameters:
owner
-
-
getOwnerGroupId
if group membership, this is the group id- Returns:
- the group id
-
getOwnerAttrDefId
if attrDef membership, this is the attrDef id- Returns:
- the attrdef id
-
setOwnerGroupId
if this is a group membership, this is the group id- Parameters:
groupId1
-
-
getOwnerGroup
Get this membership's group. To get the groups of a bunch of membership, might want to try retrieveGroups()Group g = ms.getGroup();
- Returns:
- A
Group
- Throws:
GroupNotFoundException
- if group not found
-
setOwnerGroup
set the owner group- Parameters:
group
-
-
setOwnerAttributeDef
set the owner attributeDef- Parameters:
attributeDef
-
-
setOwnerStem
set the owner stem- Parameters:
stem
-
-
setOwnerAttrDefId
if this is an attrDef membership, this is the attrDef id- Parameters:
attrDefId1
-
-
getOwnerStemId
if this is a stem membership, this is the stem id- Returns:
- stem id
-
setOwnerStemId
if this is a stem membership, this is the stem id- Parameters:
stemId1
-
-
getContextId
context id of the transaction- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextId
in interfaceGrouperHasContext
- Parameters:
contextId1
-
-
setImmediateMembershipId
Set the immediate membership id- Parameters:
immediateMembershipId
-
-
getImmediateMembershipId
- Returns:
- the immediate membership id
-
internal_addImmediateMembership
public static Membership internal_addImmediateMembership(GrouperSession s, AttributeDef attributeDef, Subject subj, Field f, String uuid) throws MemberAddException - Parameters:
s
-attributeDef
-subj
-f
-uuid
-- Returns:
- Membership
- Throws:
MemberAddException
-
internal_deleteAllField
public static void internal_deleteAllField(GrouperSession s, AttributeDef attributeDef, Field f) throws MemberDeleteException - Parameters:
s
-attributeDef
-f
-- Throws:
MemberDeleteException
- Since:
- 1.2.0
-
internal_deleteAllFieldType
public static void internal_deleteAllFieldType(GrouperSession s, AttributeDef attributeDef, FieldType type) throws MemberDeleteException, SchemaException - Parameters:
s
-attributeDef
-type
-- Throws:
MemberDeleteException
SchemaException
-
internal_delImmediateMembership
public static Membership internal_delImmediateMembership(GrouperSession s, AttributeDef attributeDef, Subject subj, Field f) throws MemberDeleteException - Parameters:
s
-attributeDef
-subj
-f
-- Returns:
- the deleted membership
- Throws:
MemberDeleteException
-
addMembershipAddChangeLog
add a change log entry for a membership add -
addMembershipDeleteChangeLog
add a change log entry for a membership delete- Parameters:
member
-
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<Membership>
- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<Membership>
- 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<Membership>
- 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<Membership>
- Returns:
- the object or null if not found
- See Also:
-
xmlSaveBusinessProperties
Description copied from interface:XmlImportableBase
save the business properties (not update properties)- Specified by:
xmlSaveBusinessProperties
in interfaceXmlImportableBase<Membership>
- 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<Membership>
- See Also:
-
xmlToExportMembership
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<Membership>
- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<Membership>
- See Also:
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<Membership>
- Returns:
- the string value for log
- See Also:
-
getAttributeValueDelegateEffMship
this delegate works on attributes and values at the same time- Returns:
- the delegate
-
getAttributeDelegateEffMship
delegate for effective memberships- Returns:
- the delegate
-
getOwnerStem
- Returns:
- stem
- Throws:
StemNotFoundException
- Since:
- 1.2.0
-