Class NotificationDuplicationFilter.TableNameDuplicationFilter

java.lang.Object
dk.cloudcreate.essentials.components.foundation.postgresql.NotificationDuplicationFilter.TableNameDuplicationFilter
All Implemented Interfaces:
NotificationDuplicationFilter
Enclosing interface:
NotificationDuplicationFilter

public static class NotificationDuplicationFilter.TableNameDuplicationFilter extends Object implements NotificationDuplicationFilter
Default filter to extract the "table_name" property from a JSON parameter.
  • Constructor Details

    • TableNameDuplicationFilter

      public TableNameDuplicationFilter()
  • Method Details

    • extractDuplicationKey

      public Optional<String> extractDuplicationKey(com.fasterxml.jackson.databind.JsonNode parameterJson)
      Extracts the "table_name" field from the given JSON parameter. Example Notification.getParameter() content:
      
       {
         "table_name" : "table1",
         "sql_operation" : "INSERT",
         "id" : 2,
         "column1" : "Column1Value-2",
         "column2" : "Column2Value-2"
       }
       
      Specified by:
      extractDuplicationKey in interface NotificationDuplicationFilter
      Parameters:
      parameterJson - a JsonNode representing the JSON structure of the notification parameter
      Returns:
      an Optional containing the table name if it exists, otherwise an empty Optional