Class DenyDclManager
java.lang.Object
org.kawanfw.sql.api.server.firewall.DefaultSqlFirewallManager
org.kawanfw.sql.api.server.firewall.DenyDclManager
- All Implemented Interfaces:
SqlFirewallManager
public class DenyDclManager extends DefaultSqlFirewallManager implements SqlFirewallManager
Firewall manager that denies any DCL (Data Control Language) call.
- Since:
- 4.0
- Author:
- Nicolas de Pomereu
-
Constructor Summary
Constructors Constructor Description DenyDclManager()
-
Method Summary
Modifier and Type Method Description boolean
allowSqlRunAfterAnalysis(String username, String database, Connection connection, String ipAddress, String sql, boolean isPreparedStatement, List<Object> parameterValues)
Allows, for the passed client username and its IP address, to know if statement is a prepared statement an to analyze the string representation of the SQL statement that is received on the server.void
runIfStatementRefused(String username, String database, Connection connection, String ipAddress, boolean isMetadataQuery, String sql, List<Object> parameterValues)
Logs the info usingDefaultDatabaseConfigurator.getLogger()
Logger
.Methods inherited from class org.kawanfw.sql.api.server.firewall.DefaultSqlFirewallManager
allowExecute, allowExecuteUpdate, allowMetadataQuery, allowStatementClass
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.kawanfw.sql.api.server.firewall.SqlFirewallManager
allowExecute, allowExecuteUpdate, allowMetadataQuery, allowStatementClass
-
Constructor Details
-
DenyDclManager
public DenyDclManager()
-
-
Method Details
-
allowSqlRunAfterAnalysis
public boolean allowSqlRunAfterAnalysis(String username, String database, Connection connection, String ipAddress, String sql, boolean isPreparedStatement, List<Object> parameterValues) throws IOException, SQLExceptionDescription copied from interface:SqlFirewallManager
Allows, for the passed client username and its IP address, to know if statement is a prepared statement an to analyze the string representation of the SQL statement that is received on the server.
If the analysis defined by the method returns false, the SQL statement won't be executed.- Specified by:
allowSqlRunAfterAnalysis
in interfaceSqlFirewallManager
- Overrides:
allowSqlRunAfterAnalysis
in classDefaultSqlFirewallManager
- Parameters:
username
- the client username to check the rule for.database
- the database name as defined in the JDBC URL fieldconnection
- The current SQL/JDBCConnection
ipAddress
- the IP address of the client usersql
- the SQL statementisPreparedStatement
- Says if the statement is a prepared statementparameterValues
- the parameter values of a prepared statement in the natural order, empty list for a (non prepared) statement- Returns:
false
if the SQL statement is DCL (Data Control Language).- Throws:
IOException
- if an IOException occursSQLException
- if a SQLException occurs
-
runIfStatementRefused
public void runIfStatementRefused(String username, String database, Connection connection, String ipAddress, boolean isMetadataQuery, String sql, List<Object> parameterValues) throws IOException, SQLExceptionLogs the info usingDefaultDatabaseConfigurator.getLogger()
Logger
.- Specified by:
runIfStatementRefused
in interfaceSqlFirewallManager
- Overrides:
runIfStatementRefused
in classDefaultSqlFirewallManager
- Parameters:
username
- the discarded client usernamedatabase
- the database name as defined in the JDBC URL fieldconnection
- The current SQL/JDBCConnection
ipAddress
- the IP address of the client userisMetadataQuery
- Says if the client request was an AceQL specific Metadata Query APIsql
- the SQL statementparameterValues
- the parameter values of a prepared statement in the natural order, empty list for a (non prepared) statement- Throws:
IOException
- if an IOException occursSQLException
- if a SQLException occurs
-