Class RoleSet
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.permissions.role.RoleSet
- All Implemented Interfaces:
GrouperSet
,HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperHasContext
,GrouperUtil.FieldValuable
,XmlImportable<RoleSet>
,XmlImportableBase<RoleSet>
,Serializable
,org.hibernate.classic.Lifecycle
public class RoleSet
extends GrouperAPI
implements Hib3GrouperVersioned, GrouperSet, GrouperHasContext, XmlImportable<RoleSet>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
columnstatic final String
constant for field name for: contextIdstatic final String
constant for field name for: createdOnDbstatic final String
constant for field name for: depthstatic final String
constant for field name for: idstatic final String
constant for field name for: ifHasRoleIdstatic final String
constant for field name for: lastUpdatedDbstatic final String
constant for field name for: parentRoleSetIdstatic final String
constant for field name for: thenHasRoleIdstatic final String
constant for field name for: typestatic final String
name of the groups role table in the dbFields inherited from class edu.internet2.middleware.grouper.GrouperAPI
COLUMN_HIBERNATE_VERSION_NUMBER, dbVersion, FIELD_DB_VERSION, FIELD_HIBERNATE_VERSION_NUMBER, INITIAL_VERSION_NUMBER
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
depth of this relationship (0 means self, 1 means one hop, 2 means 2 hops, etc)__getId()
if of this objectif has this element then has another elementif has this element id then has another element idget the parent set the parent is the relationship leading up to this relationship.parent set idhas this element if it has anotherhas this element Id if it has another idvoid
__setParentGrouperSetId
(String grouperSetId) set the parent id of this set.clone()
deep clone the fields in this objectsave the state when retrieving from DBsee which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeNamevoid
take a snapshot of the data since this is what is in the dbvoid
delete()
save or update this objectboolean
static RoleSet
findInCollection
(Collection<RoleSet> roleSets, String ifHasId, String thenHasId, int depth, boolean exceptionIfNull) find role set, better be herecontext id of the transactionwhen createdwhen createdint
getDepth()
getId()
when last updatedwhen last updatedfor self, or immediate, just use this id.getType()
get string value of type for hibernateint
hashCode()
void
onPreDelete
(HibernateSession hibernateSession) before a delete (insert) occursvoid
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursvoid
save or update this objectvoid
setContextId
(String contextId) set context idvoid
setCreatedOn
(Timestamp createdOn1) when createdvoid
setCreatedOnDb
(Long createdOn1) when createdvoid
setDepth
(int depth) set depthvoid
set idvoid
setIfHasRoleId
(String memberRoleId) Set role id for the childvoid
setLastUpdated
(Timestamp lastUpdated1) when last updatedvoid
setLastUpdatedDb
(Long lastUpdated1) when last updatedvoid
setParentRoleSetId
(String parentId1) for self, or immediate, just use this id.void
setThenHasRoleId
(String thenHasRoleId) Set role id for the thenvoid
setType
(RoleHierarchyType type1) set group set assignment typevoid
set group set assignment typevoid
xmlCopyBusinessPropertiesToExisting
(RoleSet 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
(RoleSet existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set id key in dbxmlToExportRoleSet
(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, onPostDelete, onPostSave, onPostUpdate, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
TABLE_GROUPER_ROLE_SET
name of the groups role table in the db- See Also:
-
COLUMN_CONTEXT_ID
column- See Also:
-
COLUMN_CREATED_ON
column- See Also:
-
COLUMN_LAST_UPDATED
column- See Also:
-
COLUMN_ID
column- See Also:
-
COLUMN_DEPTH
column- See Also:
-
COLUMN_IF_HAS_ROLE_ID
column- See Also:
-
COLUMN_THEN_HAS_ROLE_ID
column- See Also:
-
COLUMN_PARENT_ROLE_SET_ID
column- See Also:
-
COLUMN_TYPE
column- See Also:
-
FIELD_CONTEXT_ID
constant for field name for: contextId- See Also:
-
FIELD_CREATED_ON_DB
constant for field name for: createdOnDb- See Also:
-
FIELD_DEPTH
constant for field name for: depth- See Also:
-
FIELD_ID
constant for field name for: id- See Also:
-
FIELD_IF_HAS_ROLE_ID
constant for field name for: ifHasRoleId- See Also:
-
FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb- See Also:
-
FIELD_THEN_HAS_ROLE_ID
constant for field name for: thenHasRoleId- See Also:
-
FIELD_PARENT_ROLE_SET_ID
constant for field name for: parentRoleSetId- See Also:
-
FIELD_TYPE
constant for field name for: type- See Also:
-
-
Constructor Details
-
RoleSet
public RoleSet()
-
-
Method Details
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
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:
-
findInCollection
public static RoleSet findInCollection(Collection<RoleSet> roleSets, String ifHasId, String thenHasId, int depth, boolean exceptionIfNull) find role set, better be here- Parameters:
roleSets
-ifHasId
-thenHasId
-depth
- is the depth expectingexceptionIfNull
-- Returns:
- the def name set
-
equals
-
hashCode
public int hashCode() -
clone
Description copied from class:GrouperAPI
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:
-
getParentRoleSet
- Returns:
- the parent group set or null if none
-
getIfHasRole
- Returns:
- the parent group set or null if none
-
getThenHasRole
- Returns:
- the parent group set or null if none
-
getId
- Returns:
- id
-
setId
set id- Parameters:
id
-
-
setContextId
set context id- Specified by:
setContextId
in interfaceGrouperHasContext
- Parameters:
contextId
-
-
getParentRoleSetId
for self, or immediate, just use this id. for effective, this is the first hop on the directed graph to get to this membership.- Returns:
- parent id
-
setParentRoleSetId
for self, or immediate, just use this id. for effective, this is the first hop on the directed graph to get to this membership.- Parameters:
parentId1
-
-
getThenHasRoleId
- Returns:
- role id for then
-
setThenHasRoleId
Set role id for the then- Parameters:
thenHasRoleId
-
-
getIfHasRoleId
- Returns:
- member role id for the child
-
setIfHasRoleId
Set role id for the child- Parameters:
memberRoleId
-
-
getType
- Returns:
- membership type (immediate, effective, or composite)
-
getTypeDb
get string value of type for hibernate- Returns:
- type
-
setType
set group set assignment type- Parameters:
type1
-
-
setTypeDb
set group set assignment type- Parameters:
type1
-
-
getDepth
public int getDepth()- Returns:
- depth
-
setDepth
public void setDepth(int depth) set depth- Parameters:
depth
-
-
getContextId
context id of the transaction- Returns:
- context id
-
getCreatedOn
when created- Returns:
- timestamp
-
getCreatedOnDb
when created- Returns:
- timestamp
-
getLastUpdated
when last updated- Returns:
- timestamp
-
getLastUpdatedDb
when last updated- Returns:
- timestamp
-
saveOrUpdate
public void saveOrUpdate()save or update this object- Specified by:
saveOrUpdate
in interfaceGrouperSet
-
delete
public void delete()save or update this object- Specified by:
delete
in interfaceGrouperSet
-
setCreatedOnDb
when created- Parameters:
createdOn1
-
-
setCreatedOn
when created- Parameters:
createdOn1
-
-
setLastUpdated
when last updated- Parameters:
lastUpdated1
-
-
setLastUpdatedDb
when last updated- Parameters:
lastUpdated1
-
-
__getId
Description copied from interface:GrouperSet
if of this object- Specified by:
__getId
in interfaceGrouperSet
- Returns:
- id
- See Also:
-
__getIfHasElementId
Description copied from interface:GrouperSet
if has this element id then has another element id- Specified by:
__getIfHasElementId
in interfaceGrouperSet
- Returns:
- id
- See Also:
-
__getThenHasElementId
Description copied from interface:GrouperSet
has this element Id if it has another id- Specified by:
__getThenHasElementId
in interfaceGrouperSet
- Returns:
- id
- See Also:
-
__getDepth
public int __getDepth()Description copied from interface:GrouperSet
depth of this relationship (0 means self, 1 means one hop, 2 means 2 hops, etc)- Specified by:
__getDepth
in interfaceGrouperSet
- Returns:
- depth
- See Also:
-
__getIfHasElement
Description copied from interface:GrouperSet
if has this element then has another element- Specified by:
__getIfHasElement
in interfaceGrouperSet
- Returns:
- id
- See Also:
-
__getThenHasElement
Description copied from interface:GrouperSet
has this element if it has another- Specified by:
__getThenHasElement
in interfaceGrouperSet
- Returns:
- id
- See Also:
-
__setParentGrouperSetId
Description copied from interface:GrouperSet
set the parent id of this set. the parent is the relationship leading up to this relationship. e.g. if this is the graph: A->B->C, and the relationship is A->C, then the parent is A->B- Specified by:
__setParentGrouperSetId
in interfaceGrouperSet
- See Also:
-
__getParentGrouperSet
Description copied from interface:GrouperSet
get the parent set the parent is the relationship leading up to this relationship. e.g. if this is the graph: A->B->C, and the relationship is A->C, then the parent is A->B- Specified by:
__getParentGrouperSet
in interfaceGrouperSet
- Returns:
- parent
- See Also:
-
__getParentGrouperSetId
Description copied from interface:GrouperSet
parent set id- Specified by:
__getParentGrouperSetId
in interfaceGrouperSet
- Returns:
- parent set id
- See Also:
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<RoleSet>
- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<RoleSet>
- 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<RoleSet>
- 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<RoleSet>
- 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<RoleSet>
- 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<RoleSet>
- See Also:
-
xmlToExportRoleSet
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<RoleSet>
- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<RoleSet>
- See Also:
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<RoleSet>
- Returns:
- the string value for log
- See Also:
-
dbVersion
save the state when retrieving from DB- Overrides:
dbVersion
in classGrouperAPI
- Returns:
- the dbVersion
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db- Overrides:
dbVersionReset
in classGrouperAPI
-
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:
- a set of attributes changed, or empty set if none
- See Also:
-