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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dk.cloudcreate.essentials.components.foundation.postgresql.NotificationDuplicationFilter
NotificationDuplicationFilter.TableNameDuplicationFilter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractDuplicationKey(com.fasterxml.jackson.databind.JsonNode parameterJson) Extracts the "table_name" field from the given 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. ExampleNotification.getParameter()content:{ "table_name" : "table1", "sql_operation" : "INSERT", "id" : 2, "column1" : "Column1Value-2", "column2" : "Column2Value-2" }- Specified by:
extractDuplicationKeyin interfaceNotificationDuplicationFilter- 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
-