Class SystemMetadataDeltaLogger

java.lang.Object
edu.ucsb.nceas.metacat.systemmetadata.log.SystemMetadataDeltaLogger

public class SystemMetadataDeltaLogger extends Object
A class can log the delta change of the system metadata when the updateSystemMetadata method is called.
Author:
Tao
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static String
    compare(String user, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys)
    Compare the oldSys and newSys and return the delta in the Json format.
    void
    log(String user, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys)
    Log the system metadata difference in another thread only when it set the trace debug level
    void
    log(org.dataone.service.types.v1.Session session, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys)
    Log the system metadata difference in another thread only when it set the trace debug level

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SystemMetadataDeltaLogger

      public SystemMetadataDeltaLogger()
      Default constructor
  • Method Details

    • log

      public void log(org.dataone.service.types.v1.Session session, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys)
      Log the system metadata difference in another thread only when it set the trace debug level
      Parameters:
      session - the session who requests the change
      oldSys - the old version of the system metadata
      newSys - the new version of the system metadata
    • log

      public void log(String user, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys)
      Log the system metadata difference in another thread only when it set the trace debug level
      Parameters:
      user - the user who requests the change
      oldSys - the old version of the system metadata
      newSys - the new version of the system metadata
    • compare

      protected static String compare(String user, org.dataone.service.types.v2.SystemMetadata oldSys, org.dataone.service.types.v2.SystemMetadata newSys) throws com.fasterxml.jackson.core.JsonProcessingException, InvocationTargetException, IllegalAccessException
      Compare the oldSys and newSys and return the delta in the Json format. The order changes don't count.
      Parameters:
      oldSys - the previous version of system metadata
      newSys - the new version of system metadata
      Returns:
      the delta change in the Json format
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
      InvocationTargetException
      IllegalAccessException