Class AuditEntry
java.lang.Object
edu.internet2.middleware.grouper.GrouperAPI
edu.internet2.middleware.grouper.audit.AuditEntry
- All Implemented Interfaces:
HibGrouperLifecycle
,Hib3GrouperVersioned
,GrouperCloneable
,GrouperUtil.FieldValuable
,XmlImportable<AuditEntry>
,XmlImportableBase<AuditEntry>
,Serializable
,org.hibernate.classic.Lifecycle
public class AuditEntry
extends GrouperAPI
implements Hib3GrouperVersioned, XmlImportable<AuditEntry>
represents a user audit record. This is one unit of work that could
contain multiple operations.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
constant for field name for: actAsMemberIdstatic final String
constant for field name for: auditTypeIdstatic final String
constant for field name for: contextIdstatic final String
constant for field name for: createdOnDbstatic final String
constant for field name for: descriptionstatic final String
constant for field name for: durationMicrosecondsstatic final String
constant for field name for: envNamestatic final String
constant for field name for: grouperEnginestatic final String
constant for field name for: grouperVersionstatic final String
constant for field name for: idstatic final String
constant for field name for: int01static final String
constant for field name for: int02static final String
constant for field name for: int03static final String
constant for field name for: int04static final String
constant for field name for: int05static final String
constant for field name for: lastUpdatedDbstatic final String
constant for field name for: loggedInMemberIdstatic final String
constant for field name for: queryCountstatic final String
constant for field name for: serverHoststatic final String
constant for field name for: serverUserNamestatic 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: userIpAddressstatic final String
name of the grouper audit entry 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
ConstructorDescriptionconstructAuditEntry
(AuditTypeIdentifier auditTypeIdentifier, String... labelNamesAndValues) construct, assign an id -
Method Summary
Modifier and TypeMethodDescriptionvoid
assignIntValue
(AuditType auditType, String label, Long value) void
assignStringValue
(AuditType auditType, String label, String value) clone()
deep clone the fields in this objectboolean
equalsDeep
(AuditEntry auditEntry) see if one audit type is the same as another (not looking at last update, id, etc)member uuid of the user being acted asget the audit type, it better be thereforeign key to the type of audit entry this iscontext id ties multiple db changeswhen createdwhen createddescription of what happened in paragraph formlong
number of nanos that the duration of the context tookenv label from grouper.propertiesWS, UI, loader, GSH, etcversion of the grouper API, e.g.getId()
primary key uuid of this recordgetInt01()
misc integer field 1getInt02()
misc integer field 2getInt03()
misc integer field 3getInt04()
misc integer field 4getInt05()
misc integer field 5when last updatedwhen last updatedmember uuid of the user logged in to grouper ui or ws etcint
number of queries (count be db or otherwise)host of the server that executed the transactionUsername of the OS user running the API.misc field 1misc field 2misc field 3misc field 4misc field 5misc field 6misc field 7misc field 8ip address of user (from WS or UI etc)void
onPreSave
(HibernateSession hibernateSession) before a save (insert) occursvoid
onPreUpdate
(HibernateSession hibernateSession) before an update occursretrieveStringValue
(AuditType auditType, String label) get a string value from name value pairsretrieveStringValue
(String label) get a string value from name value pairsvoid
saveOrUpdate
(boolean copyContextData) save or update this objectvoid
setActAsMemberId
(String actAsMemberUuid1) member uuid of the user being acted asvoid
setAuditTypeId
(String auditTypeId1) foreign key to the type of audit entry this isvoid
setContextId
(String contextId1) context id ties multiple db changesvoid
setCreatedOn
(Timestamp createdOn1) when createdvoid
setCreatedOnDb
(Long createdOn1) when createdvoid
setDescription
(String description1) description of what happened in paragraph formvoid
setDurationMicroseconds
(long durationMicroseconds1) number of nanos that the duration of the context tookvoid
setEnvName
(String envLabel1) env label from grouper.propertiesvoid
setGrouperEngine
(String grouperSystem1) WS, UI, loader, GSH, etcvoid
setGrouperVersion
(String grouperVersion1) version of the grouper API, e.g.void
primary key uuid of this recordvoid
misc integer field 1void
misc integer field 2void
misc integer field 3void
misc integer field 4void
misc integer field 5void
setLastUpdated
(Timestamp lastUpdated1) when last updatedvoid
setLastUpdatedDb
(Long lastUpdated1) when last updatedvoid
setLoggedInMemberId
(String loggedInMemberUuid) member uuid of the user logged in to grouper ui or ws etcvoid
setQueryCount
(int queryCount) number of queries (count be db or otherwise)void
setServerHost
(String serverHost1) host of the server that executed the transactionvoid
setServerUserName
(String serverUserName1) Username of the OS user running the API.void
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
setUserIpAddress
(String userIpAddress1) ip address of user (from WS or UI etc)toString()
the string repretoStringReport
(boolean extended) void
truncate()
make sure this object will fit in the DBvoid
xmlCopyBusinessPropertiesToExisting
(AuditEntry 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
(AuditEntry existingRecord) save the business properties (not update properties)void
save the udpate properties (e.g.void
set id key in dbxmlToExportAuditEntry
(GrouperVersion grouperVersion) convert to xml bean for exportconvert to string for logMethods 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
-
FIELD_ACT_AS_MEMBER_ID
constant for field name for: actAsMemberId- See Also:
-
FIELD_AUDIT_TYPE_ID
constant for field name for: auditTypeId- 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_DESCRIPTION
constant for field name for: description- See Also:
-
FIELD_DURATION_MICROSECONDS
constant for field name for: durationMicroseconds- See Also:
-
FIELD_ENV_NAME
constant for field name for: envName- See Also:
-
FIELD_GROUPER_ENGINE
constant for field name for: grouperEngine- See Also:
-
FIELD_GROUPER_VERSION
constant for field name for: grouperVersion- See Also:
-
FIELD_ID
constant for field name for: id- See Also:
-
FIELD_INT01
constant for field name for: int01- See Also:
-
FIELD_INT02
constant for field name for: int02- See Also:
-
FIELD_INT03
constant for field name for: int03- See Also:
-
FIELD_INT04
constant for field name for: int04- See Also:
-
FIELD_INT05
constant for field name for: int05- See Also:
-
FIELD_LAST_UPDATED_DB
constant for field name for: lastUpdatedDb- See Also:
-
FIELD_LOGGED_IN_MEMBER_ID
constant for field name for: loggedInMemberId- See Also:
-
FIELD_QUERY_COUNT
constant for field name for: queryCount- See Also:
-
FIELD_SERVER_HOST
constant for field name for: serverHost- See Also:
-
FIELD_SERVER_USER_NAME
constant for field name for: serverUserName- 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_USER_IP_ADDRESS
constant for field name for: userIpAddress- See Also:
-
TABLE_GROUPER_AUDIT_ENTRY
name of the grouper audit entry table in the db- See Also:
-
-
Constructor Details
-
AuditEntry
public AuditEntry()construct -
AuditEntry
construct, assign an id- Parameters:
auditTypeIdentifier
- points to audit typelabelNamesAndValues
- alternate label name and value
-
-
Method Details
-
equalsDeep
see if one audit type is the same as another (not looking at last update, id, etc)- Parameters:
auditEntry
-- Returns:
- true if equals, false if not
-
toString
-
getAuditType
get the audit type, it better be there- Returns:
- the audit type
-
toStringReport
- Parameters:
extended
- if all fields should be printed- Returns:
- the report
-
saveOrUpdate
public void saveOrUpdate(boolean copyContextData) save or update this object- Parameters:
copyContextData
-
-
assignStringValue
- Parameters:
auditType
-label
-value
-
-
assignIntValue
- Parameters:
auditType
-label
-value
-
-
getAuditTypeId
foreign key to the type of audit entry this is- Returns:
- the audit type id
-
setAuditTypeId
foreign key to the type of audit entry this is- Parameters:
auditTypeId1
-
-
getId
primary key uuid of this record- Returns:
- the id
-
setId
primary key uuid of this record- Parameters:
id1
-
-
getActAsMemberId
member uuid of the user being acted as- Returns:
- uuid
-
getContextId
context id ties multiple db changes- Returns:
- id
-
getLoggedInMemberId
member uuid of the user logged in to grouper ui or ws etc- Returns:
- uuid
-
getServerHost
host of the server that executed the transaction- Returns:
- host
-
getUserIpAddress
ip address of user (from WS or UI etc)- Returns:
- user ip address
-
setActAsMemberId
member uuid of the user being acted as- Parameters:
actAsMemberUuid1
-
-
setContextId
context id ties multiple db changes- Parameters:
contextId1
-
-
setLoggedInMemberId
member uuid of the user logged in to grouper ui or ws etc- Parameters:
loggedInMemberUuid
-
-
setServerHost
host of the server that executed the transaction- Parameters:
serverHost1
-
-
setUserIpAddress
ip address of user (from WS or UI etc)- Parameters:
userIpAddress1
-
-
getEnvName
env label from grouper.properties- Returns:
- env label
-
setEnvName
env label from grouper.properties- Parameters:
envLabel1
-
-
getGrouperEngine
WS, UI, loader, GSH, etc- Returns:
- grouper system
-
setGrouperEngine
WS, UI, loader, GSH, etc- Parameters:
grouperSystem1
-
-
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
-
-
getInt01
misc integer field 1- Returns:
- field
-
setInt01
misc integer field 1- Parameters:
int01a
-
-
getInt02
misc integer field 2- Returns:
- field
-
setInt02
misc integer field 2- Parameters:
int02a
-
-
getInt03
misc integer field 3- Returns:
- field
-
setInt03
misc integer field 3- Parameters:
int03a
-
-
getInt04
misc integer field 4- Returns:
- field
-
setInt04
misc integer field 4- Parameters:
int04a
-
-
getInt05
misc integer field 5- Returns:
- field
-
setInt05
misc integer field 5- Parameters:
int05a
-
-
getDescription
description of what happened in paragraph form- Returns:
- description
-
setDescription
description of what happened in paragraph form- Parameters:
description1
-
-
getCreatedOn
when created- Returns:
- timestamp
-
getLastUpdated
when last updated- Returns:
- timestamp
-
getCreatedOnDb
when created- Returns:
- timestamp
-
getLastUpdatedDb
when last updated- Returns:
- timestamp
-
setCreatedOn
when created- Parameters:
createdOn1
-
-
setLastUpdated
when last updated- Parameters:
lastUpdated1
-
-
truncate
public void truncate()make sure this object will fit in the DB -
getGrouperVersion
version of the grouper API, e.g. 1.4.0- Returns:
- version
-
setGrouperVersion
version of the grouper API, e.g. 1.4.0- Parameters:
grouperVersion1
-
-
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:
-
getDurationMicroseconds
public long getDurationMicroseconds()number of nanos that the duration of the context took- Returns:
- duration nanos
-
setDurationMicroseconds
public void setDurationMicroseconds(long durationMicroseconds1) number of nanos that the duration of the context took- Parameters:
durationMicroseconds1
-
-
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:
-
getQueryCount
public int getQueryCount()number of queries (count be db or otherwise)- Returns:
- query count
-
setQueryCount
public void setQueryCount(int queryCount) number of queries (count be db or otherwise)- Parameters:
queryCount
-
-
getServerUserName
Username of the OS user running the API. This might identify who ran a GSH call- Returns:
- server user name
-
setServerUserName
Username of the OS user running the API. This might identify who ran a GSH call- Parameters:
serverUserName1
-
-
setCreatedOnDb
when created- Parameters:
createdOn1
-
-
setLastUpdatedDb
when last updated- Parameters:
lastUpdated1
-
-
toStringDeep
the string repre- Returns:
- string
-
xmlRetrieveByIdOrKey
Description copied from interface:XmlImportable
retrieve from db by id or key. throws exception if duplicate- Specified by:
xmlRetrieveByIdOrKey
in interfaceXmlImportable<AuditEntry>
- Returns:
- the object or null if not found
- See Also:
-
xmlCopyBusinessPropertiesToExisting
Description copied from interface:XmlImportableBase
copy business (non update) properties to an existing record- Specified by:
xmlCopyBusinessPropertiesToExisting
in interfaceXmlImportableBase<AuditEntry>
- See Also:
-
xmlDifferentBusinessProperties
Description copied from interface:XmlImportableBase
see if the non update cols are different (e.g. name)- Specified by:
xmlDifferentBusinessProperties
in interfaceXmlImportableBase<AuditEntry>
- 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<AuditEntry>
- Parameters:
other
- the one to compare with- Returns:
- true if so
- See Also:
-
xmlGetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlGetId
in interfaceXmlImportableBase<AuditEntry>
- Returns:
- id
- See Also:
-
xmlSaveBusinessProperties
Description copied from interface:XmlImportableBase
save the business properties (not update properties)- Specified by:
xmlSaveBusinessProperties
in interfaceXmlImportableBase<AuditEntry>
- 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<AuditEntry>
- See Also:
-
xmlSetId
Description copied from interface:XmlImportableBase
set id key in db- Specified by:
xmlSetId
in interfaceXmlImportableBase<AuditEntry>
- See Also:
-
xmlToExportAuditEntry
convert to xml bean for export- Parameters:
grouperVersion
-- Returns:
- xml bean
-
retrieveStringValue
get a string value from name value pairs- Parameters:
label
-- Returns:
- value
-
retrieveStringValue
get a string value from name value pairs- Parameters:
auditType
-label
-- Returns:
- value
-
xmlToString
Description copied from interface:XmlImportableBase
convert to string for log- Specified by:
xmlToString
in interfaceXmlImportableBase<AuditEntry>
- Returns:
- the string value for log
- See Also:
-