edu.internet2.middleware.grouper.group
Class GroupSet

java.lang.Object
  extended by edu.internet2.middleware.grouper.GrouperAPI
      extended by edu.internet2.middleware.grouper.group.GroupSet
All Implemented Interfaces:
HibGrouperLifecycle, Hib3GrouperVersioned, GrouperCloneable, GrouperHasContext, GrouperUtil.FieldValuable, Serializable, org.hibernate.classic.Lifecycle

public class GroupSet
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned

Author:
shilen $Id: GroupSet.java,v 1.12 2009-12-07 07:31:09 mchyzer Exp $
See Also:
Serialized Form

Field Summary
static String COLUMN_CONTEXT_ID
          Context id links together multiple operations into one high level action
static String COLUMN_CREATE_TIME
          number of millis since 1970 that this record was created
static String COLUMN_CREATOR_ID
          member uuid of the creator of this record
static String COLUMN_DEPTH
          number of hops in directed graph
static String COLUMN_FIELD_ID
          field represented by this group set
static String COLUMN_ID
          db id for this row
static String COLUMN_MEMBER_ATTR_DEF_ID
          member attr def if applicable
static String COLUMN_MEMBER_FIELD_ID
          field id used in joining this record with entries in grouper_memberships
static String COLUMN_MEMBER_GROUP_ID
          member group if applicable
static String COLUMN_MEMBER_ID
          member id
static String COLUMN_MEMBER_STEM_ID
          member stem if applicable
static String COLUMN_MSHIP_TYPE
          type of membership represented by this group set, immediate or composite or effective
static String COLUMN_OWNER_ATTR_DEF_ID
          owner attribute def if applicable
static String COLUMN_OWNER_ATTR_DEF_ID_NULL
          same as owner_attr_def_id except nulls are replaced with the string ''
static String COLUMN_OWNER_GROUP_ID
          owner group if applicable
static String COLUMN_OWNER_GROUP_ID_NULL
          same as owner_group_id except nulls are replaced with the string ''
static String COLUMN_OWNER_ID
          owner id
static String COLUMN_OWNER_STEM_ID
          owner stem if applicable
static String COLUMN_OWNER_STEM_ID_NULL
          same as owner_stem_id except nulls are replaced with the string ''
static String COLUMN_PARENT_ID
          parent group set
static String COLUMN_VIA_GROUP_ID
          same as member_group_id if depth is greater than 0, otherwise null.
static String FIELD_CONTEXT_ID
          constant for field name for: contextId
static String FIELD_CREATE_TIME
          constant for field name for: createTime
static String FIELD_CREATOR_ID
          constant for field name for: creatorId
static String FIELD_DEPTH
          constant for field name for: depth
static String FIELD_FIELD_ID
          constant for field name for: fieldId
static String FIELD_ID
          constant for field name for: id
static String FIELD_MEMBER_FIELD_ID
          constant for field name for: memberFieldId
static String FIELD_MEMBER_GROUP_ID
          constant for field name for: memberGroupId
static String FIELD_MEMBER_STEM_ID
          constant for field name for: memberStemId
static String FIELD_MSHIP_TYPE
          constant for field name for: type
static String FIELD_OWNER_GROUP_ID
          constant for field name for: ownerGroupId
static String FIELD_OWNER_GROUP_ID_NULL
          constant for field name for: ownerGroupIdNull
static String FIELD_OWNER_ID
          constant for field name for: ownerId
static String FIELD_OWNER_STEM_ID
          constant for field name for: ownerStemId
static String FIELD_OWNER_STEM_ID_NULL
          constant for field name for: ownerStemIdNull
static String FIELD_PARENT_ID
          constant for field name for: parentId
static String FIELD_VIA_GROUP_ID
          constant for field name for: viaGroupId
static String nullColumnValue
          the value we're storing in the db for nulls that need a value so that we can add a unique constraint.
static String TABLE_GROUPER_GROUP_SET
          name of the group set table in the database.
 
Fields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
GroupSet()
           
 
Method Summary
 GrouperAPI clone()
          deep clone the fields in this object
 void delete(boolean forceDisablePITEntry)
           
 boolean equals(Object other)
           
 String getContextId()
           
 Long getCreateTime()
           
 String getCreatorId()
           
 int getDepth()
          This is 0 for self memberships (where the owner and member are the same).
 String getFieldId()
           
 String getId()
           
 String getMemberAttrDefId()
           
 String getMemberFieldId()
           
 String getMemberGroupId()
           
 String getMemberId()
          get the member id
 String getMemberStemId()
           
 String getOwnerAttrDefId()
           
 String getOwnerAttrDefIdNull()
          This is for internal use only.
 String getOwnerGroupId()
           
 String getOwnerGroupIdNull()
          This is for internal use only.
 String getOwnerId()
           
 String getOwnerStemId()
           
 String getOwnerStemIdNull()
          This is for internal use only.
 GroupSet getParentGroupSet()
           
 String getParentId()
           
 String getType()
          This is 'immediate' for self memberships (owner and member are the same) except if the group is a composite in which case this will be 'composite'.
 String getViaGroupId()
           
 int hashCode()
           
 boolean internal_isCircular(GroupSet newGroupSet, GroupSet startGroupSet)
          Check if the new group set being added will cause a circular group set.
 void onPostSave(HibernateSession hibernateSession)
          after a save (insert) occurs
 void onPreDelete(HibernateSession hibernateSession)
          before a delete (insert) occurs
 void onPreSave(HibernateSession hibernateSession)
          before a save (insert) occurs
 void onPreUpdate(HibernateSession hibernateSession)
          before an update occurs
 void setContextId(String contextId)
          set context id
 void setCreateTime(Long createTime)
          set create time
 void setCreatorId(String creatorId)
          set creator
 void setDepth(int depth)
          set depth
 void setFieldId(String fieldId)
           
 void setId(String id)
          set id
 void setMemberAttrDefId(String memberAttrDefId1)
          Set attr def id for the member if the member is a attrdef
 void setMemberFieldId(String memberFieldId)
          Internal use only.
 void setMemberGroupId(String memberGroupId)
          Set group id for the member if the member is a group
 void setMemberId(String member)
          This is for internal use only.
 void setMemberStemId(String memberStemId)
          Set stem id for the member if the member is a stem
 void setOwnerAttrDefId(String ownerAttrDefId1)
          Set attrdef id for the owner if this is a attrdef membership
 void setOwnerAttrDefIdNull(String ownerAttrDefIdNull1)
          Set attrdef id for the owner if this is a attrdef membership.
 void setOwnerGroupId(String ownerGroupId)
          Set group id for the owner if this is a group membership
 void setOwnerGroupIdNull(String ownerGroupIdNull)
          Set group id for the owner if this is a group membership.
 void setOwnerId(String ownerId)
          Set owner id.
 void setOwnerStemId(String ownerStemId)
          Set stem id for the owner if this is a stem membership
 void setOwnerStemIdNull(String ownerStemIdNull)
          Set stem id for the owner if this is a stem membership.
 void setParentId(String parentId)
          set parent id
 void setType(String type)
          set membership type
 void setViaGroupId(String viaGroupId)
          Set via group id.
 String toString()
           
 
Methods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostUpdate, onSave, onUpdate, setHibernateVersionNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_ID

public static final String COLUMN_ID
db id for this row

See Also:
Constant Field Values

COLUMN_CONTEXT_ID

public static final String COLUMN_CONTEXT_ID
Context id links together multiple operations into one high level action

See Also:
Constant Field Values

COLUMN_FIELD_ID

public static final String COLUMN_FIELD_ID
field represented by this group set

See Also:
Constant Field Values

COLUMN_MSHIP_TYPE

public static final String COLUMN_MSHIP_TYPE
type of membership represented by this group set, immediate or composite or effective

See Also:
Constant Field Values

COLUMN_VIA_GROUP_ID

public static final String COLUMN_VIA_GROUP_ID
same as member_group_id if depth is greater than 0, otherwise null.

See Also:
Constant Field Values

COLUMN_DEPTH

public static final String COLUMN_DEPTH
number of hops in directed graph

See Also:
Constant Field Values

COLUMN_PARENT_ID

public static final String COLUMN_PARENT_ID
parent group set

See Also:
Constant Field Values

COLUMN_CREATOR_ID

public static final String COLUMN_CREATOR_ID
member uuid of the creator of this record

See Also:
Constant Field Values

COLUMN_CREATE_TIME

public static final String COLUMN_CREATE_TIME
number of millis since 1970 that this record was created

See Also:
Constant Field Values

COLUMN_OWNER_ID

public static final String COLUMN_OWNER_ID
owner id

See Also:
Constant Field Values

COLUMN_OWNER_GROUP_ID

public static final String COLUMN_OWNER_GROUP_ID
owner group if applicable

See Also:
Constant Field Values

COLUMN_OWNER_GROUP_ID_NULL

public static final String COLUMN_OWNER_GROUP_ID_NULL
same as owner_group_id except nulls are replaced with the string ''

See Also:
Constant Field Values

COLUMN_OWNER_ATTR_DEF_ID

public static final String COLUMN_OWNER_ATTR_DEF_ID
owner attribute def if applicable

See Also:
Constant Field Values

COLUMN_OWNER_ATTR_DEF_ID_NULL

public static final String COLUMN_OWNER_ATTR_DEF_ID_NULL
same as owner_attr_def_id except nulls are replaced with the string ''

See Also:
Constant Field Values

COLUMN_OWNER_STEM_ID

public static final String COLUMN_OWNER_STEM_ID
owner stem if applicable

See Also:
Constant Field Values

COLUMN_OWNER_STEM_ID_NULL

public static final String COLUMN_OWNER_STEM_ID_NULL
same as owner_stem_id except nulls are replaced with the string ''

See Also:
Constant Field Values

COLUMN_MEMBER_GROUP_ID

public static final String COLUMN_MEMBER_GROUP_ID
member group if applicable

See Also:
Constant Field Values

COLUMN_MEMBER_ATTR_DEF_ID

public static final String COLUMN_MEMBER_ATTR_DEF_ID
member attr def if applicable

See Also:
Constant Field Values

COLUMN_MEMBER_STEM_ID

public static final String COLUMN_MEMBER_STEM_ID
member stem if applicable

See Also:
Constant Field Values

COLUMN_MEMBER_ID

public static final String COLUMN_MEMBER_ID
member id

See Also:
Constant Field Values

COLUMN_MEMBER_FIELD_ID

public static final String COLUMN_MEMBER_FIELD_ID
field id used in joining this record with entries in grouper_memberships

See Also:
Constant Field Values

FIELD_CONTEXT_ID

public static final String FIELD_CONTEXT_ID
constant for field name for: contextId

See Also:
Constant Field Values

FIELD_CREATE_TIME

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

See Also:
Constant Field Values

FIELD_CREATOR_ID

public static final String FIELD_CREATOR_ID
constant for field name for: creatorId

See Also:
Constant Field Values

FIELD_DEPTH

public static final String FIELD_DEPTH
constant for field name for: depth

See Also:
Constant Field Values

FIELD_VIA_GROUP_ID

public static final String FIELD_VIA_GROUP_ID
constant for field name for: viaGroupId

See Also:
Constant Field Values

FIELD_FIELD_ID

public static final String FIELD_FIELD_ID
constant for field name for: fieldId

See Also:
Constant Field Values

FIELD_MSHIP_TYPE

public static final String FIELD_MSHIP_TYPE
constant for field name for: type

See Also:
Constant Field Values

FIELD_ID

public static final String FIELD_ID
constant for field name for: id

See Also:
Constant Field Values

FIELD_MEMBER_GROUP_ID

public static final String FIELD_MEMBER_GROUP_ID
constant for field name for: memberGroupId

See Also:
Constant Field Values

FIELD_MEMBER_STEM_ID

public static final String FIELD_MEMBER_STEM_ID
constant for field name for: memberStemId

See Also:
Constant Field Values

FIELD_OWNER_ID

public static final String FIELD_OWNER_ID
constant for field name for: ownerId

See Also:
Constant Field Values

FIELD_OWNER_GROUP_ID

public static final String FIELD_OWNER_GROUP_ID
constant for field name for: ownerGroupId

See Also:
Constant Field Values

FIELD_OWNER_GROUP_ID_NULL

public static final String FIELD_OWNER_GROUP_ID_NULL
constant for field name for: ownerGroupIdNull

See Also:
Constant Field Values

FIELD_OWNER_STEM_ID

public static final String FIELD_OWNER_STEM_ID
constant for field name for: ownerStemId

See Also:
Constant Field Values

FIELD_OWNER_STEM_ID_NULL

public static final String FIELD_OWNER_STEM_ID_NULL
constant for field name for: ownerStemIdNull

See Also:
Constant Field Values

FIELD_PARENT_ID

public static final String FIELD_PARENT_ID
constant for field name for: parentId

See Also:
Constant Field Values

FIELD_MEMBER_FIELD_ID

public static final String FIELD_MEMBER_FIELD_ID
constant for field name for: memberFieldId

See Also:
Constant Field Values

TABLE_GROUPER_GROUP_SET

public static final String TABLE_GROUPER_GROUP_SET
name of the group set table in the database.

See Also:
Constant Field Values

nullColumnValue

public static final String nullColumnValue
the value we're storing in the db for nulls that need a value so that we can add a unique constraint.

See Also:
Constant Field Values
Constructor Detail

GroupSet

public GroupSet()
Method Detail

toString

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

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

clone

public GrouperAPI clone()
Description copied from class: GrouperAPI
deep clone the fields in this object

Specified by:
clone in interface GrouperCloneable
Specified by:
clone in class GrouperAPI
Returns:
the clone of the object
See Also:
GrouperAPI.clone()

onPreSave

public void onPreSave(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before a save (insert) occurs

Specified by:
onPreSave in interface HibGrouperLifecycle
Overrides:
onPreSave in class GrouperAPI
See Also:
GrouperAPI.onPreSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

onPostSave

public void onPostSave(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
after a save (insert) occurs

Specified by:
onPostSave in interface HibGrouperLifecycle
Overrides:
onPostSave in class GrouperAPI
See Also:
GrouperAPI.onPostSave(edu.internet2.middleware.grouper.hibernate.HibernateSession)

onPreDelete

public void onPreDelete(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before a delete (insert) occurs

Specified by:
onPreDelete in interface HibGrouperLifecycle
Overrides:
onPreDelete in class GrouperAPI
See Also:
GrouperAPI.onPreDelete(edu.internet2.middleware.grouper.hibernate.HibernateSession)

internal_isCircular

public boolean internal_isCircular(GroupSet newGroupSet,
                                   GroupSet startGroupSet)
Check if the new group set being added will cause a circular group set.

Parameters:
newGroupSet - group set being added
startGroupSet - group set that's a parent of newGroupSet which will be used as a starting point to check if we're forming a circular group set
Returns:
true if the new group set will cause a circular group set.

getParentGroupSet

public GroupSet getParentGroupSet()
Returns:
the parent group set

getId

public String getId()
Returns:
id

setId

public void setId(String id)
set id

Parameters:
id -

getContextId

public String getContextId()
Returns:
context id

setContextId

public void setContextId(String contextId)
set context id

Specified by:
setContextId in interface GrouperHasContext
Parameters:
contextId -

getFieldId

public String getFieldId()
Returns:
field id

setFieldId

public void setFieldId(String fieldId)
Parameters:
fieldId -

getMemberFieldId

public String getMemberFieldId()
Returns:
field id used in joining with grouper_memberships table

setMemberFieldId

public void setMemberFieldId(String memberFieldId)
Internal use only.

Parameters:
memberFieldId -

getDepth

public int getDepth()
This is 0 for self memberships (where the owner and member are the same). Otherwise, it's the number of hops in a directed graph from the member to the group.

Returns:
depth

setDepth

public void setDepth(int depth)
set depth

Parameters:
depth -

getViaGroupId

public String getViaGroupId()
Returns:
via group id

setViaGroupId

public void setViaGroupId(String viaGroupId)
Set via group id. This is for internal use only.

Parameters:
viaGroupId -

getParentId

public String getParentId()
Returns:
parent id

setParentId

public void setParentId(String parentId)
set parent id

Parameters:
parentId -

getCreatorId

public String getCreatorId()
Returns:
creator

setCreatorId

public void setCreatorId(String creatorId)
set creator

Parameters:
creatorId -

getCreateTime

public Long getCreateTime()
Returns:
create time

setCreateTime

public void setCreateTime(Long createTime)
set create time

Parameters:
createTime -

getOwnerId

public String getOwnerId()
Returns:
owner id

setOwnerId

public void setOwnerId(String ownerId)
Set owner id. This is for internal use only.

Parameters:
ownerId -

getOwnerGroupId

public String getOwnerGroupId()
Returns:
group id for the owner if this is a group membership

setOwnerGroupId

public void setOwnerGroupId(String ownerGroupId)
Set group id for the owner if this is a group membership

Parameters:
ownerGroupId -

getOwnerGroupIdNull

public String getOwnerGroupIdNull()
This is for internal use only. This is the same as getOwnerGroupId() except nulls are replaced with a constant string.

Returns:
group id for the owner if this is a group membership

setOwnerGroupIdNull

public void setOwnerGroupIdNull(String ownerGroupIdNull)
Set group id for the owner if this is a group membership. This is for internal use only.

Parameters:
ownerGroupIdNull -

getOwnerStemId

public String getOwnerStemId()
Returns:
stem id for the owner if this is a stem membership

setOwnerStemId

public void setOwnerStemId(String ownerStemId)
Set stem id for the owner if this is a stem membership

Parameters:
ownerStemId -

getOwnerStemIdNull

public String getOwnerStemIdNull()
This is for internal use only. This is the same as getOwnerStemId() except nulls are replaced with a constant string.

Returns:
stem id for the owner if this is a stem membership

setOwnerStemIdNull

public void setOwnerStemIdNull(String ownerStemIdNull)
Set stem id for the owner if this is a stem membership. This is for internal use only.

Parameters:
ownerStemIdNull -

getMemberGroupId

public String getMemberGroupId()
Returns:
group id for the member if the member is a group

setMemberGroupId

public void setMemberGroupId(String memberGroupId)
Set group id for the member if the member is a group

Parameters:
memberGroupId -

getMemberStemId

public String getMemberStemId()
Returns:
stem id for the member if the member is a stem

setMemberStemId

public void setMemberStemId(String memberStemId)
Set stem id for the member if the member is a stem

Parameters:
memberStemId -

getType

public String getType()
This is 'immediate' for self memberships (owner and member are the same) except if the group is a composite in which case this will be 'composite'. For non-self memberships, this is 'effective'.

Returns:
membership type (immediate, effective, or composite)

setType

public void setType(String type)
set membership type

Parameters:
type -

getMemberAttrDefId

public String getMemberAttrDefId()
Returns:
group id for the member if the member is a group

getOwnerAttrDefId

public String getOwnerAttrDefId()
Returns:
attrdef id for the owner if this is a attrdef membership

getOwnerAttrDefIdNull

public String getOwnerAttrDefIdNull()
This is for internal use only. This is the same as getOwnerAttrDefId() except nulls are replaced with a constant string.

Returns:
attr def id for the owner if this is a attrdef membership

setMemberAttrDefId

public void setMemberAttrDefId(String memberAttrDefId1)
Set attr def id for the member if the member is a attrdef

Parameters:
memberAttrDefId1 -

setOwnerAttrDefId

public void setOwnerAttrDefId(String ownerAttrDefId1)
Set attrdef id for the owner if this is a attrdef membership

Parameters:
ownerAttrDefId1 -

setOwnerAttrDefIdNull

public void setOwnerAttrDefIdNull(String ownerAttrDefIdNull1)
Set attrdef id for the owner if this is a attrdef membership. This is for internal use only.

Parameters:
ownerAttrDefIdNull1 -

getMemberId

public String getMemberId()
get the member id

Returns:
the member id

setMemberId

public void setMemberId(String member)
This is for internal use only.

Parameters:
member -

onPreUpdate

public void onPreUpdate(HibernateSession hibernateSession)
Description copied from interface: HibGrouperLifecycle
before an update occurs

Specified by:
onPreUpdate in interface HibGrouperLifecycle
Overrides:
onPreUpdate in class GrouperAPI
See Also:
GrouperAPI.onPreUpdate(edu.internet2.middleware.grouper.hibernate.HibernateSession)

delete

public void delete(boolean forceDisablePITEntry)
Parameters:
forceDisablePITEntry - should only be used if we're removing a corrupt group set