Package edu.internet2.middleware.grouper
Class GrouperAPI
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
- All Implemented Interfaces:
HibGrouperLifecycle
,GrouperCloneable
,GrouperUtil.FieldValuable
,Serializable
,org.hibernate.classic.Lifecycle
- Direct Known Subclasses:
Attribute
,AttributeAssign
,AttributeAssignAction
,AttributeAssignActionSet
,AttributeAssignValue
,AttributeDef
,AttributeDefName
,AttributeDefNameSet
,AttributeDefScope
,AuditEntry
,AuditType
,ChangeLogConsumer
,ChangeLogEntry
,ChangeLogType
,Composite
,ExternalSubject
,ExternalSubjectAttribute
,Field
,Group
,GrouperConfigHibernate
,GrouperFile
,GrouperMessageHibernate
,GrouperPassword
,GrouperPasswordRecentlyUsed
,GrouperPIT
,GroupSet
,GroupType
,GroupTypeTuple
,Member
,Membership
,PermissionEntryBase
,RegistrySubject
,RoleSet
,ServiceRoleView
,Stem
,StemSet
,TableIndex
public abstract class GrouperAPI
extends Object
implements GrouperUtil.FieldValuable, Serializable, HibGrouperLifecycle, org.hibernate.classic.Lifecycle, GrouperCloneable
Base Grouper API class.
- Since:
- 1.2.0
- Version:
- $Id: GrouperAPI.java,v 1.23 2009-11-01 14:57:22 mchyzer Exp $
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
columnprotected Object
save the state when retrieving from DBstatic final String
field name for db versionstatic final String
constant name of field (and javabean property) for hibernateVersionstatic final long
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract GrouperAPI
clone()
deep clone the fields in this objectversion of this object in the databasevoid
set to null (e.g.see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeNameboolean
see if the state of this object has changed compared to the DB state (last known)void
take a snapshot of the data since this is what is in the dbfieldValue
(String fieldName) call this method to get the field value (e.g.hibernate increments with each insert/update (-1 means insert, 0+ means update, null means 0)boolean
onDelete
(org.hibernate.Session s) void
onLoad
(org.hibernate.Session s, Serializable id) 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 s) boolean
onUpdate
(org.hibernate.Session s) void
setHibernateVersionNumber
(Long hibernateVersionNumber) hibernate increments with each insert/update (-1 means insert, 0+ means update, null means 0)
-
Field Details
-
INITIAL_VERSION_NUMBER
public static final long INITIAL_VERSION_NUMBER- See Also:
-
COLUMN_HIBERNATE_VERSION_NUMBER
column- See Also:
-
dbVersion
save the state when retrieving from DB -
FIELD_DB_VERSION
field name for db version- See Also:
-
FIELD_HIBERNATE_VERSION_NUMBER
constant name of field (and javabean property) for hibernateVersion- See Also:
-
-
Constructor Details
-
GrouperAPI
public GrouperAPI()
-
-
Method Details
-
fieldValue
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
- Parameters:
fieldName
-- Returns:
- the value
-
dbVersion
version of this object in the database- Returns:
- the db version
-
dbVersionIsDifferent
public boolean dbVersionIsDifferent()see if the state of this object has changed compared to the DB state (last known)- Returns:
- true if changed, false if not
-
dbVersionDifferentFields
see which fields have changed compared to the DB state (last known) note that attributes will print out: attribute__attributeName- Returns:
- a set of attributes changed, or empty set if none
-
dbVersionReset
public void dbVersionReset()take a snapshot of the data since this is what is in the db -
dbVersionClear
public void dbVersionClear()set to null (e.g. on delete) -
onDelete
public boolean onDelete(org.hibernate.Session s) throws org.hibernate.CallbackException - Specified by:
onDelete
in interfaceorg.hibernate.classic.Lifecycle
- Throws:
org.hibernate.CallbackException
- See Also:
-
Lifecycle.onDelete(org.hibernate.Session)
-
onLoad
- Specified by:
onLoad
in interfaceorg.hibernate.classic.Lifecycle
- See Also:
-
Lifecycle.onLoad(org.hibernate.Session, java.io.Serializable)
-
onPostDelete
Description copied from interface:HibGrouperLifecycle
after a delete occurs- Specified by:
onPostDelete
in interfaceHibGrouperLifecycle
- See Also:
-
onPostSave
Description copied from interface:HibGrouperLifecycle
after a save (insert) occurs- Specified by:
onPostSave
in interfaceHibGrouperLifecycle
- See Also:
-
onPostUpdate
Description copied from interface:HibGrouperLifecycle
after an update occurs- Specified by:
onPostUpdate
in interfaceHibGrouperLifecycle
- See Also:
-
onPreDelete
Description copied from interface:HibGrouperLifecycle
before a delete (insert) occurs- Specified by:
onPreDelete
in interfaceHibGrouperLifecycle
- See Also:
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- See Also:
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- See Also:
-
onSave
public boolean onSave(org.hibernate.Session s) throws org.hibernate.CallbackException - Specified by:
onSave
in interfaceorg.hibernate.classic.Lifecycle
- Throws:
org.hibernate.CallbackException
- See Also:
-
Lifecycle.onSave(org.hibernate.Session)
-
onUpdate
public boolean onUpdate(org.hibernate.Session s) throws org.hibernate.CallbackException - Specified by:
onUpdate
in interfaceorg.hibernate.classic.Lifecycle
- Throws:
org.hibernate.CallbackException
- See Also:
-
Lifecycle.onUpdate(org.hibernate.Session)
-
clone
deep clone the fields in this object- Specified by:
clone
in interfaceGrouperCloneable
- Overrides:
clone
in classObject
- Returns:
- the clone of the object
- See Also:
-
getHibernateVersionNumber
hibernate increments with each insert/update (-1 means insert, 0+ means update, null means 0)- Returns:
- the hibernateVersion
-
setHibernateVersionNumber
hibernate increments with each insert/update (-1 means insert, 0+ means update, null means 0)- Parameters:
hibernateVersionNumber
- the hibernateVersion to set
-