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 Details

    • FIELD_ACT_AS_MEMBER_ID

      public static final String FIELD_ACT_AS_MEMBER_ID
      constant for field name for: actAsMemberId
      See Also:
    • FIELD_AUDIT_TYPE_ID

      public static final String FIELD_AUDIT_TYPE_ID
      constant for field name for: auditTypeId
      See Also:
    • FIELD_CONTEXT_ID

      public static final String FIELD_CONTEXT_ID
      constant for field name for: contextId
      See Also:
    • FIELD_CREATED_ON_DB

      public static final String FIELD_CREATED_ON_DB
      constant for field name for: createdOnDb
      See Also:
    • FIELD_DESCRIPTION

      public static final String FIELD_DESCRIPTION
      constant for field name for: description
      See Also:
    • FIELD_DURATION_MICROSECONDS

      public static final String FIELD_DURATION_MICROSECONDS
      constant for field name for: durationMicroseconds
      See Also:
    • FIELD_ENV_NAME

      public static final String FIELD_ENV_NAME
      constant for field name for: envName
      See Also:
    • FIELD_GROUPER_ENGINE

      public static final String FIELD_GROUPER_ENGINE
      constant for field name for: grouperEngine
      See Also:
    • FIELD_GROUPER_VERSION

      public static final String FIELD_GROUPER_VERSION
      constant for field name for: grouperVersion
      See Also:
    • FIELD_ID

      public static final String FIELD_ID
      constant for field name for: id
      See Also:
    • FIELD_INT01

      public static final String FIELD_INT01
      constant for field name for: int01
      See Also:
    • FIELD_INT02

      public static final String FIELD_INT02
      constant for field name for: int02
      See Also:
    • FIELD_INT03

      public static final String FIELD_INT03
      constant for field name for: int03
      See Also:
    • FIELD_INT04

      public static final String FIELD_INT04
      constant for field name for: int04
      See Also:
    • FIELD_INT05

      public static final String FIELD_INT05
      constant for field name for: int05
      See Also:
    • FIELD_LAST_UPDATED_DB

      public static final String FIELD_LAST_UPDATED_DB
      constant for field name for: lastUpdatedDb
      See Also:
    • FIELD_LOGGED_IN_MEMBER_ID

      public static final String FIELD_LOGGED_IN_MEMBER_ID
      constant for field name for: loggedInMemberId
      See Also:
    • FIELD_QUERY_COUNT

      public static final String FIELD_QUERY_COUNT
      constant for field name for: queryCount
      See Also:
    • FIELD_SERVER_HOST

      public static final String FIELD_SERVER_HOST
      constant for field name for: serverHost
      See Also:
    • FIELD_SERVER_USER_NAME

      public static final String FIELD_SERVER_USER_NAME
      constant for field name for: serverUserName
      See Also:
    • FIELD_STRING01

      public static final String FIELD_STRING01
      constant for field name for: string01
      See Also:
    • FIELD_STRING02

      public static final String FIELD_STRING02
      constant for field name for: string02
      See Also:
    • FIELD_STRING03

      public static final String FIELD_STRING03
      constant for field name for: string03
      See Also:
    • FIELD_STRING04

      public static final String FIELD_STRING04
      constant for field name for: string04
      See Also:
    • FIELD_STRING05

      public static final String FIELD_STRING05
      constant for field name for: string05
      See Also:
    • FIELD_STRING06

      public static final String FIELD_STRING06
      constant for field name for: string06
      See Also:
    • FIELD_STRING07

      public static final String FIELD_STRING07
      constant for field name for: string07
      See Also:
    • FIELD_STRING08

      public static final String FIELD_STRING08
      constant for field name for: string08
      See Also:
    • FIELD_USER_IP_ADDRESS

      public static final String FIELD_USER_IP_ADDRESS
      constant for field name for: userIpAddress
      See Also:
    • TABLE_GROUPER_AUDIT_ENTRY

      public static final String TABLE_GROUPER_AUDIT_ENTRY
      name of the grouper audit entry table in the db
      See Also:
  • Constructor Details

    • AuditEntry

      public AuditEntry()
      construct
    • AuditEntry

      public AuditEntry(AuditTypeIdentifier auditTypeIdentifier, String... labelNamesAndValues)
      construct, assign an id
      Parameters:
      auditTypeIdentifier - points to audit type
      labelNamesAndValues - alternate label name and value
  • Method Details

    • equalsDeep

      public boolean equalsDeep(AuditEntry auditEntry)
      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

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getAuditType

      public AuditType getAuditType()
      get the audit type, it better be there
      Returns:
      the audit type
    • toStringReport

      public String toStringReport(boolean extended)
      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

      public void assignStringValue(AuditType auditType, String label, String value)
      Parameters:
      auditType -
      label -
      value -
    • assignIntValue

      public void assignIntValue(AuditType auditType, String label, Long value)
      Parameters:
      auditType -
      label -
      value -
    • getAuditTypeId

      public String getAuditTypeId()
      foreign key to the type of audit entry this is
      Returns:
      the audit type id
    • setAuditTypeId

      public void setAuditTypeId(String auditTypeId1)
      foreign key to the type of audit entry this is
      Parameters:
      auditTypeId1 -
    • getId

      public String getId()
      primary key uuid of this record
      Returns:
      the id
    • setId

      public void setId(String id1)
      primary key uuid of this record
      Parameters:
      id1 -
    • getActAsMemberId

      public String getActAsMemberId()
      member uuid of the user being acted as
      Returns:
      uuid
    • getContextId

      public String getContextId()
      context id ties multiple db changes
      Returns:
      id
    • getLoggedInMemberId

      public String getLoggedInMemberId()
      member uuid of the user logged in to grouper ui or ws etc
      Returns:
      uuid
    • getServerHost

      public String getServerHost()
      host of the server that executed the transaction
      Returns:
      host
    • getUserIpAddress

      public String getUserIpAddress()
      ip address of user (from WS or UI etc)
      Returns:
      user ip address
    • setActAsMemberId

      public void setActAsMemberId(String actAsMemberUuid1)
      member uuid of the user being acted as
      Parameters:
      actAsMemberUuid1 -
    • setContextId

      public void setContextId(String contextId1)
      context id ties multiple db changes
      Parameters:
      contextId1 -
    • setLoggedInMemberId

      public void setLoggedInMemberId(String loggedInMemberUuid)
      member uuid of the user logged in to grouper ui or ws etc
      Parameters:
      loggedInMemberUuid -
    • setServerHost

      public void setServerHost(String serverHost1)
      host of the server that executed the transaction
      Parameters:
      serverHost1 -
    • setUserIpAddress

      public void setUserIpAddress(String userIpAddress1)
      ip address of user (from WS or UI etc)
      Parameters:
      userIpAddress1 -
    • getEnvName

      public String getEnvName()
      env label from grouper.properties
      Returns:
      env label
    • setEnvName

      public void setEnvName(String envLabel1)
      env label from grouper.properties
      Parameters:
      envLabel1 -
    • getGrouperEngine

      public String getGrouperEngine()
      WS, UI, loader, GSH, etc
      Returns:
      grouper system
    • setGrouperEngine

      public void setGrouperEngine(String grouperSystem1)
      WS, UI, loader, GSH, etc
      Parameters:
      grouperSystem1 -
    • getString01

      public String getString01()
      misc field 1
      Returns:
      field
    • setString01

      public void setString01(String string01a)
      misc field 1
      Parameters:
      string01a -
    • getString02

      public String getString02()
      misc field 2
      Returns:
      field
    • setString02

      public void setString02(String string02a)
      misc field 2
      Parameters:
      string02a -
    • getString03

      public String getString03()
      misc field 3
      Returns:
      field
    • setString03

      public void setString03(String string03a)
      misc field 3
      Parameters:
      string03a -
    • getString04

      public String getString04()
      misc field 4
      Returns:
      field
    • setString04

      public void setString04(String string04a)
      misc field 4
      Parameters:
      string04a -
    • getString05

      public String getString05()
      misc field 5
      Returns:
      field
    • setString05

      public void setString05(String string05a)
      misc field 5
      Parameters:
      string05a -
    • getString06

      public String getString06()
      misc field 6
      Returns:
      field
    • setString06

      public void setString06(String string06a)
      misc field 6
      Parameters:
      string06a -
    • getString07

      public String getString07()
      misc field 7
      Returns:
      field
    • setString07

      public void setString07(String string07a)
      misc field 7
      Parameters:
      string07a -
    • getString08

      public String getString08()
      misc field 8
      Returns:
      field
    • setString08

      public void setString08(String string08a)
      misc field 8
      Parameters:
      string08a -
    • getInt01

      public Long getInt01()
      misc integer field 1
      Returns:
      field
    • setInt01

      public void setInt01(Long int01a)
      misc integer field 1
      Parameters:
      int01a -
    • getInt02

      public Long getInt02()
      misc integer field 2
      Returns:
      field
    • setInt02

      public void setInt02(Long int02a)
      misc integer field 2
      Parameters:
      int02a -
    • getInt03

      public Long getInt03()
      misc integer field 3
      Returns:
      field
    • setInt03

      public void setInt03(Long int03a)
      misc integer field 3
      Parameters:
      int03a -
    • getInt04

      public Long getInt04()
      misc integer field 4
      Returns:
      field
    • setInt04

      public void setInt04(Long int04a)
      misc integer field 4
      Parameters:
      int04a -
    • getInt05

      public Long getInt05()
      misc integer field 5
      Returns:
      field
    • setInt05

      public void setInt05(Long int05a)
      misc integer field 5
      Parameters:
      int05a -
    • getDescription

      public String getDescription()
      description of what happened in paragraph form
      Returns:
      description
    • setDescription

      public void setDescription(String description1)
      description of what happened in paragraph form
      Parameters:
      description1 -
    • getCreatedOn

      public Timestamp getCreatedOn()
      when created
      Returns:
      timestamp
    • getLastUpdated

      public Timestamp getLastUpdated()
      when last updated
      Returns:
      timestamp
    • getCreatedOnDb

      public Long getCreatedOnDb()
      when created
      Returns:
      timestamp
    • getLastUpdatedDb

      public Long getLastUpdatedDb()
      when last updated
      Returns:
      timestamp
    • setCreatedOn

      public void setCreatedOn(Timestamp createdOn1)
      when created
      Parameters:
      createdOn1 -
    • setLastUpdated

      public void setLastUpdated(Timestamp lastUpdated1)
      when last updated
      Parameters:
      lastUpdated1 -
    • truncate

      public void truncate()
      make sure this object will fit in the DB
    • getGrouperVersion

      public String getGrouperVersion()
      version of the grouper API, e.g. 1.4.0
      Returns:
      version
    • setGrouperVersion

      public void setGrouperVersion(String grouperVersion1)
      version of the grouper API, e.g. 1.4.0
      Parameters:
      grouperVersion1 -
    • clone

      public GrouperAPI clone()
      Description copied from class: GrouperAPI
      deep clone the fields in this object
      Specified by:
      clone in interface GrouperCloneable
      Specified by:
      clone in class GrouperAPI
      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

      public void onPreSave(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before a save (insert) occurs
      Specified by:
      onPreSave in interface HibGrouperLifecycle
      Overrides:
      onPreSave in class GrouperAPI
      See Also:
    • onPreUpdate

      public void onPreUpdate(HibernateSession hibernateSession)
      Description copied from interface: HibGrouperLifecycle
      before an update occurs
      Specified by:
      onPreUpdate in interface HibGrouperLifecycle
      Overrides:
      onPreUpdate in class GrouperAPI
      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

      public String getServerUserName()
      Username of the OS user running the API. This might identify who ran a GSH call
      Returns:
      server user name
    • setServerUserName

      public void setServerUserName(String serverUserName1)
      Username of the OS user running the API. This might identify who ran a GSH call
      Parameters:
      serverUserName1 -
    • setCreatedOnDb

      public void setCreatedOnDb(Long createdOn1)
      when created
      Parameters:
      createdOn1 -
    • setLastUpdatedDb

      public void setLastUpdatedDb(Long lastUpdated1)
      when last updated
      Parameters:
      lastUpdated1 -
    • toStringDeep

      public String toStringDeep()
      the string repre
      Returns:
      string
    • xmlRetrieveByIdOrKey

      public XmlImportable<AuditEntry> xmlRetrieveByIdOrKey()
      Description copied from interface: XmlImportable
      retrieve from db by id or key. throws exception if duplicate
      Specified by:
      xmlRetrieveByIdOrKey in interface XmlImportable<AuditEntry>
      Returns:
      the object or null if not found
      See Also:
    • xmlCopyBusinessPropertiesToExisting

      public void xmlCopyBusinessPropertiesToExisting(AuditEntry existingRecord)
      Description copied from interface: XmlImportableBase
      copy business (non update) properties to an existing record
      Specified by:
      xmlCopyBusinessPropertiesToExisting in interface XmlImportableBase<AuditEntry>
      See Also:
    • xmlDifferentBusinessProperties

      public boolean xmlDifferentBusinessProperties(AuditEntry other)
      Description copied from interface: XmlImportableBase
      see if the non update cols are different (e.g. name)
      Specified by:
      xmlDifferentBusinessProperties in interface XmlImportableBase<AuditEntry>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlDifferentUpdateProperties

      public boolean xmlDifferentUpdateProperties(AuditEntry other)
      Description copied from interface: XmlImportableBase
      see if the update cols are different (e.g. last updated)
      Specified by:
      xmlDifferentUpdateProperties in interface XmlImportableBase<AuditEntry>
      Parameters:
      other - the one to compare with
      Returns:
      true if so
      See Also:
    • xmlGetId

      public String xmlGetId()
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlGetId in interface XmlImportableBase<AuditEntry>
      Returns:
      id
      See Also:
    • xmlSaveBusinessProperties

      public AuditEntry xmlSaveBusinessProperties(AuditEntry existingRecord)
      Description copied from interface: XmlImportableBase
      save the business properties (not update properties)
      Specified by:
      xmlSaveBusinessProperties in interface XmlImportableBase<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 interface XmlImportableBase<AuditEntry>
      See Also:
    • xmlSetId

      public void xmlSetId(String theId)
      Description copied from interface: XmlImportableBase
      set id key in db
      Specified by:
      xmlSetId in interface XmlImportableBase<AuditEntry>
      See Also:
    • xmlToExportAuditEntry

      public XmlExportAuditEntry xmlToExportAuditEntry(GrouperVersion grouperVersion)
      convert to xml bean for export
      Parameters:
      grouperVersion -
      Returns:
      xml bean
    • retrieveStringValue

      public String retrieveStringValue(String label)
      get a string value from name value pairs
      Parameters:
      label -
      Returns:
      value
    • retrieveStringValue

      public String retrieveStringValue(AuditType auditType, String label)
      get a string value from name value pairs
      Parameters:
      auditType -
      label -
      Returns:
      value
    • xmlToString

      public String xmlToString()
      Description copied from interface: XmlImportableBase
      convert to string for log
      Specified by:
      xmlToString in interface XmlImportableBase<AuditEntry>
      Returns:
      the string value for log
      See Also: