|
Awake SQL v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AwakeCommonsConfigurator
Interface that defines the common User Configuration for the Awake File and Awake SQL Frameworks.
All the implemented methods will be called by the Awake Server programs when a client program asks for access to the database from the remote Client side.
A concrete implementation should be developed on the Server side by a Awake users in order to:
DefaultAwakeCommonsConfigurator
.
DefaultAwakeCommonsConfigurator
Method Summary | |
---|---|
String |
addSecretForAuthToken()
Allows to define a secret value that will enforce the security of the authentication defined in computeAuthToken . |
String |
computeAuthToken(String username)
Allows to compute a secret value that will secure the authentication. |
boolean |
forceSecureHttp()
Allows to define if the host url must be accessed in secured httpS. |
List<String> |
getBannedIPs()
Allows to define the list of banned IP addresses. |
Set<String> |
getBannedUsernames()
Allows to define the set of banned usernames. |
Connection |
getConnection()
Attempts to establish a connection with an underlying data source. |
char[] |
getEncryptionPassword()
Allows to define the password that is used to encrypt from the Client all the request parameters values for security reason (obfuscation and transport encryption). |
Logger |
getLogger()
Returns the Logger that will be used by Awake File or Awake SQL
logging:
All Exceptions thrown by server side will be logged. |
boolean |
login(String username,
char[] password)
Allows to authenticate the remote (username, password) couple send by the client side and to give access to the Awaker Server. |
Method Detail |
---|
String addSecretForAuthToken() throws IOException, SQLException
computeAuthToken
.
computeAuthToken
.
IOException
- if an IOException occurs
SQLException
- if a SQLException occurscomputeAuthToken(java.lang.String)
String computeAuthToken(String username) throws Exception
addSecretForAuthToken()
to build and Authentication Token
that will be use by each following client call in order to authenticate
the calls. DefaultAwakeCommonsConfigurator.computeAuthToken(String)
is: SHA-1(username + hostname + addSecretForAuthToken()
first 20
hexadecimal characters.
username
- the database user on whose behalf the connection is being made
Exception
- if an Exception occursboolean forceSecureHttp()
true
if the host url must be in httpSList<String> getBannedIPs() throws IOException, SQLException
Subnet notations are supported: 1.1.1.1/255.255.255.255 or 1.1.1.1/32 (CIDR-Notation).
IOException
- if an IOException occurs
SQLException
- if a SQLException occursSet<String> getBannedUsernames() throws IOException, SQLException
IOException
- if an IOException occurs
SQLException
- if a SQLException occursConnection getConnection() throws SQLException
Attempts to establish a connection with an underlying data source.
SQLException
- if a database access error occurschar[] getEncryptionPassword()
Logger getLogger() throws IOException
Logger
that will be used by Awake File or Awake SQL
logging:
Level.WARNING
.DefaultAwakeCommonsConfigurator.getLogger()
.
IOException
boolean login(String username, char[] password) throws IOException, SQLException
The Awake Server will call the method in order to grant or not client access.
Typical usage would be to check the (username, password) couple against a table in a SQL database or against a LDAP, etc.
username
- the username sent by the client loginpassword
- the password to connect to the server
true
if the (login, password) couple is
correct/valid. If false, the client side will not be authorized
to send any command.
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 |