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

public class ChangeLogEntry extends GrouperAPI
 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 Details

  • 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 entry
      changeLogTypeIdentifier - points to changeLog type
      labelNamesAndValues - 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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • getChangeLogType

      public ChangeLogType getChangeLogType()
      get the changeLog type, it better be there
      Returns:
      the changeLog type
    • toStringReport

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

      public String retrieveValueForLabel(ChangeLogLabel changeLogLabel)
      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

      public String retrieveValueForLabel(String label)
      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

      public void assignStringValue(ChangeLogType changeLogType, String label, String value)
      Parameters:
      changeLogType -
      label -
      value -
    • getSequenceNumber

      public Long getSequenceNumber()
      optional sequence for ordering
      Returns:
      sequence number
    • setSequenceNumber

      public void setSequenceNumber(Long sequenceNumber1)
      optional sequence for ordering
      Parameters:
      sequenceNumber1 -
    • getId

      public String getId()
      uuid for temp object
      Returns:
      uuid for temp object
    • setId

      public void setId(String id)
      set uuid for temp object
      Parameters:
      id -
    • getChangeLogTypeId

      public String getChangeLogTypeId()
      foreign key to the type of changeLog entry this is
      Returns:
      the changeLog type id
    • setChangeLogTypeId

      public void setChangeLogTypeId(String changeLogTypeId1)
      foreign key to the type of changeLog entry this is
      Parameters:
      changeLogTypeId1 -
    • getContextId

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

      public void setContextId(String contextId1)
      context id ties multiple db changes
      Parameters:
      contextId1 -
    • 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 -
    • getCreatedOn

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

      public Long getCreatedOnDb()
      when created, microseconds since 1970
      Returns:
      timestamp
    • setCreatedOn

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

      public void truncate()
      make sure this object will fit in the DB
    • 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:
    • 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:
    • clearNextSequenceNumberCache

      public static void clearNextSequenceNumberCache()
      clear the sequence number so the next call to nextSequenceNumber() will requery the max.
    • maxSequenceNumber

      public static Long maxSequenceNumber(boolean considerConsumers)
      max sequence number in DB
      Parameters:
      considerConsumers - if the consumers should be considered
      Returns:
      the max sequence number (or null if not there)
    • 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:
    • setCreatedOnDb

      public void setCreatedOnDb(Long createdOn1)
      when created, microseconds since 1970
      Parameters:
      createdOn1 -
    • toStringDeep

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

      public String getString09()
      Returns:
      the string 09
    • setString09

      public void setString09(String theString09)
      set the string 09
      Parameters:
      theString09 -
    • getString10

      public String getString10()
      get string 10
      Returns:
      string 10
    • setString10

      public void setString10(String theString10)
      set string 10
      Parameters:
      theString10 -
    • getString11

      public String getString11()
      Returns:
      string 11
    • setString11

      public void setString11(String _string11)
      set string 11
      Parameters:
      _string11 -
    • getString12

      public String getString12()
      get string 12
      Returns:
      string 12
    • setString12

      public void setString12(String _string12)
      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

      public boolean equalsCategoryAndAction(ChangeLogTypeIdentifier changeLogTypeIdentifier)
      see if this identifier matches the change log type by category and action
      Parameters:
      changeLogTypeIdentifier -
      Returns:
      true if matches
    • fromJsonToCollection

      public static Collection<ChangeLogEntry> fromJsonToCollection(String json)
      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

      public String toJson(boolean includeContainer)
      Parameters:
      includeContainer - true will include a container and an array of events
      Returns:
      json