|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AwakeSqlConfigurator
Interface that defines the User Security Configuration for the Awake SQL Framework on the server side.
The implemented methods will be called by the Awake SQL Server programs when a client program, referred by a user username, asks for a JDBC operation from the Client side.
A concrete implementation should be developed on the server side in order to:
Statement.execute
/ PreparedStatement.execute
.Statement.executeUpdate
/
PreparedStatement.executeUpdate
.Statement
that is not a PreparedStatement
.Connection.getMetaData()
.ResultSet
properties through ResultSet.getMetaData()
.
Note that the helper class StatementAnalyser
allows to do some simple
tests on the SQL statement string representation.
Note that Awake SQL comes with a Default AwakeSqlConfigurator
implementation that is *not* secured and should be extended:
DefaultAwakeSqlConfigurator
.
Method Summary | |
---|---|
boolean |
allowExecute(String username,
Connection connection)
Allows to define if the passed username is allowed to call a Statement.execute(String) or PreparedStatement.execute() |
boolean |
allowExecuteUpdate(String username,
Connection connection)
Allows to define if the passed username is allowed to call a Statement.executeUpdate(String) or PreparedStatement.executeUpdate() |
boolean |
allowGetMetaData(String username,
Connection connection)
Allows to define if the passed username is allowed to query the database catalog through Connection.getMetaData() . |
boolean |
allowResultSetGetMetaData(String username,
Connection connection)
Allows to define if the passed username is allowed to query the ResultSet properties through ResultSet.getMetaData()
. |
boolean |
allowStatementAfterAnalysis(String username,
Connection connection,
String sql,
List<Object> parameterValues)
Allows, for the passed client username, to analyze the string representation of the SQL statement that is received on the server. |
boolean |
allowStatementClass(String username,
Connection connection)
Allows to define if the passed username is allowed to create and use a Statement instance that is not a PreparedStatement |
void |
runIfStatementRefused(String username,
Connection connection,
String ipAddress,
String sql,
List<Object> parameterValues)
Allows to implement specific a Java rule immediately after a SQL statement has been refused because one of the AwakeSqlConfigurator.allowXxx method
returned false. |
Method Detail |
---|
boolean allowExecute(String username, Connection connection) throws IOException, SQLException
Statement.execute(String)
or PreparedStatement.execute()
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
if the user has the right to call a raw execute
IOException
- if an IOException occurs
SQLException
- if a SQLException occursboolean allowExecuteUpdate(String username, Connection connection) throws IOException, SQLException
Statement.executeUpdate(String)
or PreparedStatement.executeUpdate()
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
if the user has the right to call a raw execute
IOException
- if an IOException occurs
SQLException
- if a SQLException occursboolean allowGetMetaData(String username, Connection connection) throws IOException, SQLException
Connection.getMetaData()
.
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
if the user has the right to query the Database
catalog.
IOException
- if an IOException occurs
SQLException
- if a SQLException occursboolean allowResultSetGetMetaData(String username, Connection connection) throws IOException, SQLException
ResultSet
properties through ResultSet.getMetaData()
.
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
if the user has the right to query ResultSet
properties
IOException
- if an IOException occurs
SQLException
- if a SQLException occursboolean allowStatementAfterAnalysis(String username, Connection connection, String sql, List<Object> parameterValues) throws IOException, SQLException
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
sql
- the SQL statementparameterValues
- the parameter values of a prepared statement in the natural
order, empty list for a (non prepared) statement
true
if the analyzed statement or prepared statement
is validated.
IOException
- if an IOException occurs
SQLException
- if a SQLException occursboolean allowStatementClass(String username, Connection connection) throws IOException, SQLException
Statement
instance that is not a PreparedStatement
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
if the user has the right to call a raw execute
IOException
- if an IOException occurs
SQLException
- if a SQLException occursvoid runIfStatementRefused(String username, Connection connection, String ipAddress, String sql, List<Object> parameterValues) throws IOException, SQLException
AwakeSqlConfigurator.allowXxx
method
returned false.
username
- the discarded client usernameconnection
- The current SQL/JDBC Connection
ipAddress
- the IP address of the client usersql
- the SQL statementparameterValues
- the parameter values of a prepared statement in the natural
order, empty list for a (non prepared) statement
IOException
- if an IOException occurs
SQLException
- if a SQLException occurs
|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |