Class ChangeLogEntry
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.changeLog.ChangeLogEntry
- All Implemented Interfaces:
HibGrouperLifecycle
,GrouperCloneable
,GrouperUtil.FieldValuable
,Serializable
,org.hibernate.classic.Lifecycle
represents a user change log record. This is a change to a record in the DB (insert/update/delete). note: if this object is headed for the temp table, then the getters in the composite key will not be null, will be empty. this is a hibernate constraint
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
entity name for change logstatic final String
entity name for change log tempstatic 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
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: changeLogTypeIdstatic final String
constant for field name for: contextIdstatic final String
constant for field name for: createdOnDbstatic final String
constant for field name for: idstatic final String
constant for field name for: string01static final String
constant for field name for: string02static final String
constant for field name for: string03static final String
constant for field name for: string04static final String
constant for field name for: string05static final String
constant for field name for: string06static final String
constant for field name for: string07static final String
constant for field name for: string08static final String
constant for field name for: string09static final String
constant for field name for: string10static final String
constant for field name for: string11static final String
constant for field name for: string12static final String
name of the grouper changeLog entry table in the dbstatic final String
name of the grouper changeLog entry temp table in the db, where records go first before being moved to the real tableFields 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
ConstructorDescriptionconstructChangeLogEntry
(boolean tempObject1, ChangeLogTypeIdentifier changeLogTypeIdentifier, String... labelNamesAndValues) construct, assign an id -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignStringValue
(ChangeLogType changeLogType, String label, String value) static void
clear the sequence number so the next call to nextSequenceNumber() will requery the max.clone()
deep clone the fields in this objectvoid
delete()
delete the change log entry from either the temp table or the entity tableboolean
boolean
equalsCategoryAndAction
(ChangeLogTypeIdentifier changeLogTypeIdentifier) see if this identifier matches the change log type by category and actionvoid
fromJsonHelper
(com.fasterxml.jackson.databind.JsonNode jsonObject) convert to one json objectstatic Collection<ChangeLogEntry>
fromJsonToCollection
(String json) convert json to a collection (generally of size one) of change log entriesget the changeLog type, it better be thereforeign key to the type of changeLog entry this iscontext id ties multiple db changeswhen createdwhen created, microseconds since 1970getId()
uuid for temp objectoptional sequence for orderingmisc field 1misc field 2misc field 3misc field 4misc field 5misc field 6misc field 7misc field 8get string 10get string 12int
hashCode()
boolean
if this is a temp object, destined for the temp tablestatic Long
maxSequenceNumber
(boolean considerConsumers) max sequence number in DBvoid
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursretrieveValueForLabel
(ChangeLogLabel changeLogLabel) reutrn the value based on friendly label.retrieveValueForLabel
(String label) reutrn the value based on friendly label.void
save()
save this object (insert) to the temp table if configured to do so, and set context id and other things save (insert) this objectstatic void
saveTempUpdates
(ChangeLogTypeIdentifier changeLogTypeIdentifier, Object theObject, Object dbVersion, List<String> labelNamesAndValues, List<String> objectPropertyNames, List<String> changeLogPropertyNames) void
setChangeLogTypeId
(String changeLogTypeId1) foreign key to the type of changeLog entry this isvoid
setContextId
(String contextId1) context id ties multiple db changesvoid
setCreatedOn
(Timestamp createdOn1) when createdvoid
setCreatedOnDb
(Long createdOn1) when created, microseconds since 1970void
set uuid for temp objectvoid
setSequenceNumber
(Long sequenceNumber1) optional sequence for orderingvoid
setString01
(String string01a) misc field 1void
setString02
(String string02a) misc field 2void
setString03
(String string03a) misc field 3void
setString04
(String string04a) misc field 4void
setString05
(String string05a) misc field 5void
setString06
(String string06a) misc field 6void
setString07
(String string07a) misc field 7void
setString08
(String string08a) misc field 8void
setString09
(String theString09) set the string 09void
setString10
(String theString10) set string 10void
setString11
(String _string11) set string 11void
setString12
(String _string12) set string 12void
setTempObject
(boolean tempObject1) if this is a temp object headed for the temp tabletoJson
(boolean includeContainer) the string repretoStringReport
(boolean extended) void
truncate()
make sure this object will fit in the DBvoid
update()
update this object to the temp or entity table if configured to do so, and set context id and other things save (insert) this objectMethods inherited from class edu.internet2.middleware.grouper.GrouperAPI
dbVersion, dbVersionClear, dbVersionDifferentFields, dbVersionIsDifferent, dbVersionReset, fieldValue, getHibernateVersionNumber, onDelete, onLoad, onPostDelete, onPostSave, onPostUpdate, onPreDelete, onSave, onUpdate, setHibernateVersionNumber
-
Field Details
-
COLUMN_ID
column- See Also:
-
COLUMN_CHANGE_LOG_TYPE_ID
column- See Also:
-
COLUMN_CONTEXT_ID
column- See Also:
-
COLUMN_CREATED_ON
column- See Also:
-
COLUMN_STRING01
column- See Also:
-
COLUMN_STRING02
column- See Also:
-
COLUMN_STRING03
column- See Also:
-
COLUMN_STRING04
column- See Also:
-
COLUMN_STRING05
column- See Also:
-
COLUMN_STRING06
column- See Also:
-
COLUMN_STRING07
column- See Also:
-
COLUMN_STRING08
column- See Also:
-
COLUMN_STRING09
column- See Also:
-
COLUMN_STRING10
column- See Also:
-
COLUMN_STRING11
column- See Also:
-
COLUMN_STRING12
column- See Also:
-
COLUMN_SEQUENCE_NUMBER
column- See Also:
-
CHANGE_LOG_ENTRY_TEMP_ENTITY_NAME
entity name for change log temp- See Also:
-
CHANGE_LOG_ENTRY_ENTITY_NAME
entity name for change log- See Also:
-
FIELD_CHANGE_LOG_TYPE_ID
constant for field name for: changeLogTypeId- See Also:
-
FIELD_ID
constant for field name for: id- 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_STRING01
constant for field name for: string01- See Also:
-
FIELD_STRING02
constant for field name for: string02- See Also:
-
FIELD_STRING03
constant for field name for: string03- See Also:
-
FIELD_STRING04
constant for field name for: string04- See Also:
-
FIELD_STRING05
constant for field name for: string05- See Also:
-
FIELD_STRING06
constant for field name for: string06- See Also:
-
FIELD_STRING07
constant for field name for: string07- See Also:
-
FIELD_STRING08
constant for field name for: string08- See Also:
-
FIELD_STRING09
constant for field name for: string09- See Also:
-
FIELD_STRING10
constant for field name for: string10- See Also:
-
FIELD_STRING11
constant for field name for: string11- See Also:
-
FIELD_STRING12
constant for field name for: string12- See Also:
-
TABLE_GROUPER_CHANGE_LOG_ENTRY
name of the grouper changeLog entry table in the db- See Also:
-
TABLE_GROUPER_CHANGE_LOG_ENTRY_TEMP
name of the grouper changeLog entry temp table in the db, where records go first before being moved to the real table- See Also:
-
-
Constructor Details
-
ChangeLogEntry
public ChangeLogEntry()construct -
ChangeLogEntry
public ChangeLogEntry(boolean tempObject1, ChangeLogTypeIdentifier changeLogTypeIdentifier, String... labelNamesAndValues) construct, assign an id- Parameters:
tempObject1
- if this is a temp object, or a normal change log entrychangeLogTypeIdentifier
- points to changeLog typelabelNamesAndValues
- alternate label name and value
-
-
Method Details
-
saveTempUpdates
public static void saveTempUpdates(ChangeLogTypeIdentifier changeLogTypeIdentifier, Object theObject, Object dbVersion, List<String> labelNamesAndValues, List<String> objectPropertyNames, List<String> changeLogPropertyNames) - Parameters:
changeLogTypeIdentifier
-theObject
-dbVersion
-labelNamesAndValues
-objectPropertyNames
-changeLogPropertyNames
-
-
equals
-
hashCode
public int hashCode() -
getChangeLogType
get the changeLog type, it better be there- Returns:
- the changeLog type
-
toStringReport
- Parameters:
extended
- if all fields should be printed- Returns:
- the report
-
save
public void save()save this object (insert) to the temp table if configured to do so, and set context id and other things save (insert) this object -
update
public void update()update this object to the temp or entity table if configured to do so, and set context id and other things save (insert) this object -
delete
public void delete()delete the change log entry from either the temp table or the entity table -
retrieveValueForLabel
reutrn the value based on friendly label. ChangeLogEntry keeps data in string01, string02, etc. But it is more useful when querying by group id. so pass in the fiendly label from the ChangeLogType, and it will look up which field, and return the value of that field- Parameters:
changeLogLabel
- is probably from ChangeLogLabels constants- Returns:
- the value
-
retrieveValueForLabel
reutrn the value based on friendly label. ChangeLogEntry keeps data in string01, string02, etc. But it is more useful when querying by group id. so pass in the fiendly label from the ChangeLogType, and it will look up which field, and return the value of that field- Parameters:
label
-- Returns:
- the value
-
assignStringValue
- Parameters:
changeLogType
-label
-value
-
-
getSequenceNumber
optional sequence for ordering- Returns:
- sequence number
-
setSequenceNumber
optional sequence for ordering- Parameters:
sequenceNumber1
-
-
getId
uuid for temp object- Returns:
- uuid for temp object
-
setId
set uuid for temp object- Parameters:
id
-
-
getChangeLogTypeId
foreign key to the type of changeLog entry this is- Returns:
- the changeLog type id
-
setChangeLogTypeId
foreign key to the type of changeLog entry this is- Parameters:
changeLogTypeId1
-
-
getContextId
context id ties multiple db changes- Returns:
- id
-
setContextId
context id ties multiple db changes- Parameters:
contextId1
-
-
getString01
misc field 1- Returns:
- field
-
setString01
misc field 1- Parameters:
string01a
-
-
getString02
misc field 2- Returns:
- field
-
setString02
misc field 2- Parameters:
string02a
-
-
getString03
misc field 3- Returns:
- field
-
setString03
misc field 3- Parameters:
string03a
-
-
getString04
misc field 4- Returns:
- field
-
setString04
misc field 4- Parameters:
string04a
-
-
getString05
misc field 5- Returns:
- field
-
setString05
misc field 5- Parameters:
string05a
-
-
getString06
misc field 6- Returns:
- field
-
setString06
misc field 6- Parameters:
string06a
-
-
getString07
misc field 7- Returns:
- field
-
setString07
misc field 7- Parameters:
string07a
-
-
getString08
misc field 8- Returns:
- field
-
setString08
misc field 8- Parameters:
string08a
-
-
getCreatedOn
when created- Returns:
- timestamp
-
getCreatedOnDb
when created, microseconds since 1970- Returns:
- timestamp
-
setCreatedOn
when created- Parameters:
createdOn1
-
-
truncate
public void truncate()make sure this object will fit in the DB -
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:
-
onPreSave
Description copied from interface:HibGrouperLifecycle
before a save (insert) occurs- Specified by:
onPreSave
in interfaceHibGrouperLifecycle
- Overrides:
onPreSave
in classGrouperAPI
- See Also:
-
clearNextSequenceNumberCache
public static void clearNextSequenceNumberCache()clear the sequence number so the next call to nextSequenceNumber() will requery the max. -
maxSequenceNumber
max sequence number in DB- Parameters:
considerConsumers
- if the consumers should be considered- Returns:
- the max sequence number (or null if not there)
-
onPreUpdate
Description copied from interface:HibGrouperLifecycle
before an update occurs- Specified by:
onPreUpdate
in interfaceHibGrouperLifecycle
- Overrides:
onPreUpdate
in classGrouperAPI
- See Also:
-
setCreatedOnDb
when created, microseconds since 1970- Parameters:
createdOn1
-
-
toStringDeep
the string repre- Returns:
- string
-
getString09
- Returns:
- the string 09
-
setString09
set the string 09- Parameters:
theString09
-
-
getString10
get string 10- Returns:
- string 10
-
setString10
set string 10- Parameters:
theString10
-
-
getString11
- Returns:
- string 11
-
setString11
set string 11- Parameters:
_string11
-
-
getString12
get string 12- Returns:
- string 12
-
setString12
set string 12- Parameters:
_string12
-
-
isTempObject
public boolean isTempObject()if this is a temp object, destined for the temp table- Returns:
- temp object
-
setTempObject
public void setTempObject(boolean tempObject1) if this is a temp object headed for the temp table- Parameters:
tempObject1
-
-
equalsCategoryAndAction
see if this identifier matches the change log type by category and action- Parameters:
changeLogTypeIdentifier
-- Returns:
- true if matches
-
fromJsonToCollection
convert json to a collection (generally of size one) of change log entries- Parameters:
json
-- Returns:
- the change log entry
-
fromJsonHelper
public void fromJsonHelper(com.fasterxml.jackson.databind.JsonNode jsonObject) convert to one json object- Parameters:
jsonObject
-
-
toJson
- Parameters:
includeContainer
- true will include a container and an array of events- Returns:
- json
-