com.holonplatform.jdbc.internal

## Class DefaultDataSourceBuilderConfiguration

- java.lang.Object
- - com.holonplatform.jdbc.internal.DefaultDataSourceBuilderConfiguration

- All Implemented Interfaces:
    Serializable

      public final class DefaultDataSourceBuilderConfiguration
      extends Object
      implements Serializable

  Class to load and provide default `DataSourceFactory`s and `DataSourcePostProcessor`s obtained using standard Java extensions loader from `MET-INF/services`.
  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `buildMissingDriverClassMessage(String type, String dataContextId)` Build the missing JDBC driver class name error message.
    `static String` | `buildMissingJdbcUrlMessage(String type, String dataContextId)` Build the missing JDBC url error message.
    `static String` | `buildMissingJNDINameMessage(String dataContextId)` Build the missing JNDI name error message.
    `static void` | `ensureInited(ClassLoader classLoader)` Ensure the default factories and post processors are inited for given classloader.
    `static Optional<DataSourceFactory>` | `getDataSourceFactory(ClassLoader classLoader, String type)` Get the default `DataSourceFactory` bound to given `type` and ClassLoader, if available.
    `static List<DataSourcePostProcessor>` | `getDataSourcePostProcessors(ClassLoader classLoader)` Get the default `DataSourcePostProcessor`s for given ClassLoader.
    `static Optional<String>` | `getDefaultType(ClassLoader classLoader)` Get the default DataSource type name for given ClassLoader.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getDefaultType

          public static Optional<String> getDefaultType(ClassLoader classLoader)

      Get the default DataSource type name for given ClassLoader.
      Parameters:
        `classLoader` - ClassLoader (not null)
      Returns:
        Optional default DataSource type name

    - #### getDataSourceFactory

          public static Optional<DataSourceFactory> getDataSourceFactory(ClassLoader classLoader,
                                                                         String type)

      Get the default `DataSourceFactory` bound to given `type` and ClassLoader, if available.
      Parameters:
        `classLoader` - ClassLoader to use (not null)
        `type` - Type name (not null)
      Returns:
        Optional factory bound to given type

    - #### getDataSourcePostProcessors

          public static List<DataSourcePostProcessor> getDataSourcePostProcessors(ClassLoader classLoader)

      Get the default `DataSourcePostProcessor`s for given ClassLoader.
      Parameters:
        `classLoader` - ClassLoader to use (not null)
      Returns:
        Post processors list

    - #### ensureInited

          public static void ensureInited(ClassLoader classLoader)

      Ensure the default factories and post processors are inited for given classloader.
      Parameters:
        `classLoader` - ClassLoader to use

    - #### buildMissingJdbcUrlMessage

          public static String buildMissingJdbcUrlMessage(String type,
                                                          String dataContextId)

      Build the missing JDBC url error message.
      Parameters:
        `type` - DataSource type
        `dataContextId` - Optional data context id
      Returns:
        the error message

    - #### buildMissingDriverClassMessage

          public static String buildMissingDriverClassMessage(String type,
                                                              String dataContextId)

      Build the missing JDBC driver class name error message.
      Parameters:
        `type` - DataSource type
        `dataContextId` - Optional data context id
      Returns:
        the error message

    - #### buildMissingJNDINameMessage

          public static String buildMissingJNDINameMessage(String dataContextId)

      Build the missing JNDI name error message.
      Parameters:
        `dataContextId` - Optional data context id
      Returns:
        the error message

Copyright © 2019 The Holon Platform. All rights reserved.