Class JsonLoggerSqlFirewallTrigger

java.lang.Object
org.kawanfw.sql.api.server.firewall.trigger.JsonLoggerSqlFirewallTrigger
All Implemented Interfaces:
SqlFirewallTrigger

public class JsonLoggerSqlFirewallTrigger
extends Object
implements SqlFirewallTrigger
A trigger that will log using JSON format the SqlEvent info and the sqlFirewallManager class name.
Since:
11.0
Author:
Nicolas de Pomereu
  • Constructor Details

    • JsonLoggerSqlFirewallTrigger

      public JsonLoggerSqlFirewallTrigger()
  • Method Details

    • runIfStatementRefused

      public void runIfStatementRefused​(SqlEvent sqlEvent, SqlFirewallManager sqlFirewallManager, Connection connection) throws IOException, SQLException
      Logs using JSON format the ClientEvent and the SqlFirewallManager class name into a Logger with parameters:
      • Output file pattern: user.home/.kawansoft/log/JsonLoggerSqlFirewallTrigger.log.
      • Limit: 1Gb.
      • Count (number of files to use): 3.
      Specified by:
      runIfStatementRefused in interface SqlFirewallTrigger
      Parameters:
      sqlEvent - the SQL event asked by the client side. Contains all info about the SQL call (client username, database name, IP Address of the client, and SQL statement details).
      sqlFirewallManager - the instance that triggers this call.
      connection - The current SQL/JDBC Connection
      Throws:
      IOException - if an IOException occurs
      SQLException - if a SQLException occurs