corelib.security
Class JdbcSecurityManager

java.lang.Object
  extended by corelib.security.JdbcSecurityManager
All Implemented Interfaces:
SecurityManager

public class JdbcSecurityManager
extends java.lang.Object
implements SecurityManager

This security manager (see interface corelib.security.SercurityManager) use a relational database to store the security informations. Actually two relational database management systems (also known as RDBMS) are supported : Apache Derby ou Sun MySql. In future versions, other RDBMS will be supported. The JDBC API is used by this implementation to provide RDBMS access.

To specify the used RDBMS, you must pass a data source that describe the JDBC connection. A data source is defined by the JdbcSecurityManager.DataSource.

Since:
0.3.6
Author:
Dominique Liard
See Also:
SecurityManager, DataSource

Constructor Summary
JdbcSecurityManager(java.sql.Connection connection)
          This constructor produces an instance of security manager that has based on a JDBC connection.
JdbcSecurityManager(DataSource dataSource)
          This constructor produces an instance of security manager that has based on a JDBC data source.
 
Method Summary
 void closeSession()
          Close the session with the considered security service.
 java.sql.Connection getConnection()
          Return the underlying JDBC connection to the database.
 RoleManager getRoleManager()
          Returns the role manager associated to this security manager.
 UserManager getUserManager()
          Returns the user manager associated to this security manager.
 void openSession()
          Open a session to the considered security service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcSecurityManager

public JdbcSecurityManager(DataSource dataSource)
                    throws SecurityManagerException
This constructor produces an instance of security manager that has based on a JDBC data source.

Parameters:
dataSource - The JDBC data source
Throws:
SecurityManagerException - Thrown if the system cannot connect to the database.

JdbcSecurityManager

public JdbcSecurityManager(java.sql.Connection connection)
This constructor produces an instance of security manager that has based on a JDBC connection.

Parameters:
connection - The JDBC connection to use.
Since:
0.4.0
Method Detail

openSession

public void openSession()
                 throws SecurityManagerException
Description copied from interface: SecurityManager
Open a session to the considered security service.

Specified by:
openSession in interface SecurityManager
Throws:
SecurityManagerException - Thrown when connection to the security service cannot be established.

closeSession

public void closeSession()
                  throws SecurityManagerException
Description copied from interface: SecurityManager
Close the session with the considered security service.

Specified by:
closeSession in interface SecurityManager
Throws:
SecurityManagerException - Thrown when connection to the security service cannot be closed.

getRoleManager

public RoleManager getRoleManager()
Description copied from interface: SecurityManager
Returns the role manager associated to this security manager. A role manager provided methods to manage roles.

Specified by:
getRoleManager in interface SecurityManager
Returns:
The role manager associated to this security manager.

getUserManager

public UserManager getUserManager()
Description copied from interface: SecurityManager
Returns the user manager associated to this security manager. A user manager provided methods to manage users.

Specified by:
getUserManager in interface SecurityManager
Returns:
The user manager associated to this security manager.

getConnection

public java.sql.Connection getConnection()
Return the underlying JDBC connection to the database.

Returns:
The underlying connection.
Since:
0.4.0


CAUTION: Ellipse is proposed to you in BETA version to allow evaluation of this framework. Infini Software is released from any responsibility for the use of Ellipse Framework.

Copyright 2012 Infini Software - All Rights Reserved.