|
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
AwakeSqlConfiguratorStatement.execute(String) or PreparedStatement.execute()
allowExecute in interface AwakeSqlConfiguratorusername - 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 occurs
public boolean allowExecuteUpdate(String username,
Connection connection)
throws IOException,
SQLException
AwakeSqlConfiguratorStatement.executeUpdate(String) or PreparedStatement.executeUpdate()
allowExecuteUpdate in interface AwakeSqlConfiguratorusername - 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 occurs
public boolean allowGetMetaData(String username,
Connection connection)
throws IOException,
SQLException
AwakeSqlConfiguratorConnection.getMetaData().
allowGetMetaData in interface AwakeSqlConfiguratorusername - 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 occurs
public boolean allowResultSetGetMetaData(String username,
Connection connection)
throws IOException,
SQLException
AwakeSqlConfiguratorResultSet properties through ResultSet.getMetaData()
.
allowResultSetGetMetaData in interface AwakeSqlConfiguratorusername - 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 occurs
public boolean allowStatementAfterAnalysis(String username,
Connection connection,
String sql,
List<Object> parameterValues)
throws IOException,
SQLException
AwakeSqlConfigurator
allowStatementAfterAnalysis in interface AwakeSqlConfiguratorusername - the client username to check the rule for.connection - The current SQL/JDBC Connectionsql - 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 occurs
public boolean allowStatementClass(String username,
Connection connection)
throws IOException,
SQLException
AwakeSqlConfiguratorStatement instance that is not a PreparedStatement
allowStatementClass in interface AwakeSqlConfiguratorusername - 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 occurs
public 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 AwakeSqlConfiguratorusername - the discarded client usernameconnection - The current SQL/JDBC ConnectionipAddress - 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 | ||||||||