Package edu.internet2.middleware.grouper
Class Composite
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.Composite
- All Implemented Interfaces:
HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperHasContext
,GrouperUtil.FieldValuable
,XmlImportable<Composite>
,XmlImportableBase<Composite>
,Serializable
,org.hibernate.classic.Lifecycle
public class Composite
extends GrouperAPI
implements GrouperHasContext, Hib3GrouperVersioned, XmlImportable<Composite>
A composite membership definition within the Groups Registry.
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.
- Since:
- 1.0
- Version:
- $Id: Composite.java,v 1.71 2009-12-07 07:31:08 mchyzer Exp $
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
id col in dbstatic final String
old id col for id conversionstatic final String
old uuid id col for id conversionstatic final String
uuid col in dbstatic 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: factorOwnerUUIDstatic final String
constant for field name for: leftFactorUUIDstatic final String
constant for field name for: rightFactorUUIDstatic final String
constant for field name for: typestatic final String
constant for field name for: uuidstatic final String
table for compositesFields 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 TypeMethodDescriptionclone()
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 dbboolean
context id of the transactionlong
Return thisComposite
's left factor.getName()
Return thisComposite
's owner.Return thisComposite
's right factor.getType()
Return this composite's type.simple getter for type for dbgetUuid()
int
hashCode()
static Membership
internal_createNewCompositeMembershipObject
(String ownerGroupId, String memberUuid, String viaCompositeId) left nameowner nameright namevoid
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 occursvoid
setContextId
(String contextId1) context id of the transactionvoid
setCreateTime
(long createTime) void
setCreatorUuid
(String creatorUUID) void
setFactorOwnerUuid
(String factorOwnerUUID) void
setLeftFactorUuid
(String leftFactorUUID) void
setRightFactorUuid
(String rightFactorUUID) void
void
void
store()
store this object to the DB.toString()
void
xmlCopyBusinessPropertiesToExisting
(Composite 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
(Composite existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set id key in dbxmlToExportComposite
(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
-
TABLE_GROUPER_COMPOSITES
table for composites- See Also:
-
COLUMN_ID
id col in db- See Also:
-
COLUMN_UUID
uuid 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:
-
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_FACTOR_OWNER_UUID
constant for field name for: factorOwnerUUID- See Also:
-
FIELD_LEFT_FACTOR_UUID
constant for field name for: leftFactorUUID- See Also:
-
FIELD_RIGHT_FACTOR_UUID
constant for field name for: rightFactorUUID- See Also:
-
FIELD_TYPE
constant for field name for: type- See Also:
-
FIELD_UUID
constant for field name for: uuid- See Also:
-
-
Constructor Details
-
Composite
public Composite()
-
-
Method Details
-
getLeftGroup
Return thisComposite
's left factor.try { Group left = c.getLeftGroup(); } catch (GroupNotFoundException eGNF) { // unable to retrieve group }
- Returns:
- Left factor
Group
. - Throws:
GroupNotFoundException
- Since:
- 1.0
-
getOwnerGroup
Return thisComposite
's owner.try { Group owner = c.geOwnerGroup(); } catch (GroupNotFoundException eGNF) { // unable to retrieve group }
- Returns:
- Owner
Group
. - Throws:
GroupNotFoundException
- Since:
- 1.0
-
getRightGroup
Return thisComposite
's right factor.try { Group right = c.getRightGroup(); } catch (GroupNotFoundException eGNF) { // unable to retrieve group }
- Returns:
- Right factor
Group
. - Throws:
GroupNotFoundException
- Since:
- 1.0
-
getType
Return this composite's type.CompositeType type = c.getType();
- Returns:
CompositeType
of thisComposite
.- Since:
- 1.0
-
getTypeDb
simple getter for type for db- Returns:
- type db
-
toString
-
getName
- Returns:
- name
-
internal_getLeftName
left name- Returns:
- left name
-
internal_getOwnerName
owner name- Returns:
- the owner name
-
internal_getRightName
right name- Returns:
- right name
-
equals
-
getCreateTime
public long getCreateTime()- Returns:
- create time
- Since:
- 1.2.0
-
getCreatorUuid
- Returns:
- creator uuid
- Since:
- 1.2.0
-
getFactorOwnerUuid
- Returns:
- factor owner uuid
- Since:
- 1.2.0
-
getLeftFactorUuid
- Returns:
- left factor uuid
- Since:
- 1.2.0
-
getRightFactorUuid
- Returns:
- right factor uuid
- Since:
- 1.2.0
-
getUuid
- Returns:
- uuid
- Since:
- 1.2.0
-
hashCode
public int hashCode() -
setCreateTime
public void setCreateTime(long createTime) - Parameters:
createTime
-- Since:
- 1.2.0
-
setCreatorUuid
- Parameters:
creatorUUID
-- Since:
- 1.2.0
-
setFactorOwnerUuid
- Parameters:
factorOwnerUUID
-- Since:
- 1.2.0
-
setLeftFactorUuid
- Parameters:
leftFactorUUID
-- Since:
- 1.2.0
-
setRightFactorUuid
- Parameters:
rightFactorUUID
-- Since:
- 1.2.0
-
setTypeDb
- Parameters:
type
-- Since:
- 1.2.0
-
setUuid
- Parameters:
uuid
-- Since:
- 1.2.0
-
toStringDto
- Returns:
- string
- Since:
- 1.2.0
-
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:
-
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:
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
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:
-
getContextId
context id of the transaction- Returns:
- context id
-
setContextId
context id of the transaction- Specified by:
setContextId
in interfaceGrouperHasContext
- Parameters:
contextId1
-
-
internal_createNewCompositeMembershipObject
public static Membership internal_createNewCompositeMembershipObject(String ownerGroupId, String memberUuid, String viaCompositeId) - Parameters:
ownerGroupId
-memberUuid
-viaCompositeId
-- Returns:
- membership
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<Composite>
- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<Composite>
- 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<Composite>
- 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<Composite>
- 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<Composite>
- 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:
-
store
public void store()store this object to the DB. -
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<Composite>
- See Also:
-
xmlToExportComposite
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<Composite>
- Returns:
- id
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<Composite>
- See Also:
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<Composite>
- Returns:
- the string value for log
- See Also:
-