|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.awakefw.sql.api.server.DefaultAwakeSqlConfigurator
public class DefaultAwakeSqlConfigurator
Default implementation of server side configuration for the Awake SQL Framework.
WARNING: This default implementation will allow to start immediate remote JDBC calls but is *not* secured.
It is highly recommended to override this class with your own secured implementation.
Constructor Summary | |
---|---|
DefaultAwakeSqlConfigurator()
Constructor. |
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)
The event will be logged as Level.WARNING in the
user.home/.awake/logs/Awake.log file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultAwakeSqlConfigurator()
Method Detail |
---|
public boolean allowExecute(String username, Connection connection) throws IOException, SQLException
AwakeSqlConfigurator
Statement.execute(String)
or PreparedStatement.execute()
allowExecute
in interface AwakeSqlConfigurator
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
. (Client programs will be allowed to call
Statement.execute
and PreparedStatement.execute
).
IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic boolean allowExecuteUpdate(String username, Connection connection) throws IOException, SQLException
AwakeSqlConfigurator
Statement.executeUpdate(String)
or PreparedStatement.executeUpdate()
allowExecuteUpdate
in interface AwakeSqlConfigurator
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
. (Client programs will be allowed to call
Statement.executeUpdate
and PreparedStatement.executeUpdate
).
IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic boolean allowGetMetaData(String username, Connection connection) throws IOException, SQLException
AwakeSqlConfigurator
Connection.getMetaData()
.
allowGetMetaData
in interface AwakeSqlConfigurator
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
. (Client programs will be allowed to use
Connection.getMetaData()
).
IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic boolean allowResultSetGetMetaData(String username, Connection connection) throws IOException, SQLException
AwakeSqlConfigurator
ResultSet
properties through ResultSet.getMetaData()
.
allowResultSetGetMetaData
in interface AwakeSqlConfigurator
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
. (Client programs will be allowed to use
ResulSet.getMetaData()
).
IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic boolean allowStatementAfterAnalysis(String username, Connection connection, String sql, List<Object> parameterValues) throws IOException, SQLException
AwakeSqlConfigurator
allowStatementAfterAnalysis
in interface AwakeSqlConfigurator
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 all following requirements are met:
';'
separator character.DELETE / INSERT / SELECT / UPDATE
.IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic boolean allowStatementClass(String username, Connection connection) throws IOException, SQLException
AwakeSqlConfigurator
Statement
instance that is not a PreparedStatement
allowStatementClass
in interface AwakeSqlConfigurator
username
- the client username to check the rule for.connection
- The current SQL/JDBC Connection
true
. (Client programs will be allowed to create raw
Statement
.)
IOException
- if an IOException occurs
SQLException
- if a SQLException occurspublic void runIfStatementRefused(String username, Connection connection, String ipAddress, String sql, List<Object> parameterValues) throws IOException, SQLException
Level.WARNING
in the
user.home/.awake/logs/Awake.log
file
runIfStatementRefused
in interface AwakeSqlConfigurator
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 |