Class AuditedDataObject

java.lang.Object
com.sap.cloud.sdk.cloudplatform.auditlog.AuditedDataObject

public class AuditedDataObject extends Object
This class stores auditing information about the object being accessed. The type and keys should be set such that from the audit log entry, one can find the object in the application's persistence (e.g. database).
  • Constructor Details

    • AuditedDataObject

      public AuditedDataObject(@Nonnull String type)
      Creates an audited data object instance with provided object type and randomly generated identifier.
      Parameters:
      type - The type of the object being accessed.
    • AuditedDataObject

      public AuditedDataObject(@Nonnull String type, @Nonnull String id)
      Creates an audited data object instance with provided object type and identifier.
      Parameters:
      type - The type of the object being accessed.
      id - The identifier value for property "AuditedDataObject".
  • Method Details

    • setIdentifier

      public void setIdentifier(@Nonnull String propertyName, @Nullable String value)
      Sets a key property that identifies the accessed object. Entries can be overwritten if the same propertyName is passed in.
      Parameters:
      propertyName - Name of the key property.
      value - Value of the key property.
    • getIdentifier

      @Nullable public String getIdentifier(@Nonnull String propertyName)
      Gets the value of a key property that identifies the accessed object.
      Parameters:
      propertyName - Name of the key property.
      Returns:
      Value of the key property.
    • getAllIdentifiers

      @Nonnull public Map<String,String> getAllIdentifiers()
      Gets all properties that identify the accessed object.
      Returns:
      Map of name-value pairs.
    • getType

      public String getType()
      This represents the type of the object being accessed.
    • setType

      public void setType(String type)
      This represents the type of the object being accessed.