Class AuthDataSource

java.lang.Object
org.conical.common.bbl.auth.AuthDataSource

public class AuthDataSource extends Object
The AuthDataSource class wraps a DataSource to be used in authenticating users and determining credentials. It cannot be instantiated but is retrieved via the instance method, which requires an AuthConfig. A static map is used to ensure that no more than one DB pool (as wrapped in the DataSource), is created per configuration. NOTE: despite the ability to pass connection URLs for other databases, currently only an Oracle database is supported for database authentication
Author:
rdoherty
  • Method Details

    • getInstance

      public static AuthDataSource getInstance(AuthConfig config) throws AuthenticationException
      Looks up the AuthDataSource for this configuration and returns it if it exists. If not, attempts to create one, stores it, and returns it.
      Parameters:
      config - configuration of the desired AuthDataSource
      Returns:
      an AuthDataSource for the given configuration
      Throws:
      AuthenticationException - if unable to create a connection pool for this configuration
    • getDataSource

      public DataSource getDataSource()
      Returns:
      DataSource wrapped by this object