|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.rad.server.security.AbstractSecurityManager
com.sibvisions.rad.server.security.AbstractDBSecurityManager
public abstract class AbstractDBSecurityManager
The AbstractDBSecurityManager is the base class for all security managers that use a database for
authentication.
| Constructor Summary | |
|---|---|
AbstractDBSecurityManager()
|
|
| Method Summary | |
|---|---|
protected void |
close(Statement... pStatement)
Closes and unregisters the given statements. |
protected void |
closeConnection()
Close all statements and the connection. |
protected void |
closeStatements()
Close all registered statements. |
protected void |
commit()
Commits all changes. |
protected IAccessController |
createAccessController(ISession pSession)
Creates an access controller for a ISession. |
protected void |
finalize()
|
protected abstract String |
getAliveQuery()
Gets the query which should be use for connection check. |
Connection |
getConnection()
Gets the current connection to the database. |
Connection |
getConnection(ISession pSession)
Gets the connection to the database. |
static DBCredentials |
getCredentials(IConfiguration pConfig)
Gets the configured database credentials from a given configuration. |
protected DBCredentials |
getCredentials(ISession pSession)
Gets the configured database credentials for the given session. |
protected abstract void |
initStatements(Connection pConnection)
Initializes all statements after opening a database connection. |
protected boolean |
isConnectionAlive()
Checks whether the connection is still alive, means whether the connection can be used. |
protected Connection |
openConnection(ISession pSession)
Opens a database connection to the database of an application. |
protected CallableStatement |
prepareCall(Connection pConnection,
String pSql)
Creates a new instance of CallableStatement. |
protected PreparedStatement |
prepareStatement(Connection pConnection,
String pSql)
Creates a new instance of PreparedStatement. |
protected void |
register(Statement pStatement)
Registers a statment as closable statement. |
void |
release()
Releases all used resources. |
protected void |
rollback()
Reverts all changes. |
protected boolean |
unregister(Statement pStatement)
Unregisters a statement. |
protected abstract void |
updateConfiguration(IConfiguration pConfig)
Updates relevant information after configuration was changed. |
| Methods inherited from class com.sibvisions.rad.server.security.AbstractSecurityManager |
|---|
addHiddenPackage, checkPassword, comparePassword, createSecurityManager, createSecurityManager, createSecurityManager, debug, error, getEncryptedPassword, getPasswordValidator, info, isAllowEncryptedUserPassword, isHiddenPackage, isPasswordEncrypted, isPasswordEncryptionEnabled, prepareException, prepareException, removeHiddenPackage, setAllowEncryptedUserPassword, validatePassword |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sibvisions.rad.server.security.ISecurityManager |
|---|
changePassword, getAccessController, logout, validateAuthentication |
| Constructor Detail |
|---|
public AbstractDBSecurityManager()
| Method Detail |
|---|
protected abstract void updateConfiguration(IConfiguration pConfig)
throws Exception
pConfig - the session configuration
Exception - if an exception occurs during statement creation
protected abstract void initStatements(Connection pConnection)
throws Exception
pConnection - the connection to use
Exception - if an exception occurs during statement creationprotected abstract String getAliveQuery()
select 1 from dual is enough.
public void release()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected Connection openConnection(ISession pSession)
throws Exception
pSession - the session for which the connection should be opened
Exception - if the application zone is invalid or the connection can not be opened
IllegalArgumentException - if the database configuration is invalid (parameters are missing, ...)
protected void closeConnection()
throws Exception
Exception - if one statement can not be closedprotected void closeStatements()
protected void close(Statement... pStatement)
pStatement - the statements to close and unregisterprotected DBCredentials getCredentials(ISession pSession)
pSession - the session
getCredentials(IConfiguration)public static DBCredentials getCredentials(IConfiguration pConfig)
pConfig - the configuration
public Connection getConnection()
throws Exception
null if the security manager did
not open a connection
Exception - if db access fails
public Connection getConnection(ISession pSession)
throws Exception
pSession - the session that wants access to the database
Exception - if db access failsprotected IAccessController createAccessController(ISession pSession)
ISession.
pSession - the session which requests the access controller
protected void commit()
throws SQLException
SQLException - if commit failsprotected void rollback()
protected boolean isConnectionAlive()
true if the connection is alive/validgetAliveQuery()protected void register(Statement pStatement)
pStatement - the statementprotected boolean unregister(Statement pStatement)
pStatement - the statement
true if unregistration was successful, false if statement was not registered
as closableregister(Statement)
protected PreparedStatement prepareStatement(Connection pConnection,
String pSql)
throws SQLException
PreparedStatement. The statement will be registered for automatic close.
pConnection - the database connectionpSql - the SQL statement, e.g. a query
SQLException - if statement creation fails
protected CallableStatement prepareCall(Connection pConnection,
String pSql)
throws SQLException
CallableStatement. The statement will be registered for automatic close.
pConnection - the database connectionpSql - the call statement
SQLException - if statement creation fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||