Class HikariConnectionFactory
java.lang.Object
me.lucko.luckperms.common.storage.implementation.sql.connection.hikari.HikariConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
- Direct Known Subclasses:
DriverBasedHikariConnectionFactory
Abstract
ConnectionFactory using a HikariDataSource.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidconfigureDatabase(com.zaxxer.hikari.HikariConfig config, String address, String port, String databaseName, String username, String password) Configures theHikariConfigwith the relevant database properties.protected abstract StringGets the default port used by the databasegetMeta()voidinit(LuckPermsPlugin plugin) protected voidoverrideProperties(Map<String, Object> properties) Allows the connection factory instance to override certain properties before they are set.protected voidCalled after the Hikari pool has been initialisedprotected voidsetProperties(com.zaxxer.hikari.HikariConfig config, Map<String, Object> properties) Sets the given connection properties onto the config.voidshutdown()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ConnectionFactory
getImplementationName, getStatementProcessor
-
Constructor Details
-
HikariConnectionFactory
-
-
Method Details
-
defaultPort
Gets the default port used by the database- Returns:
- the default port
-
configureDatabase
protected abstract void configureDatabase(com.zaxxer.hikari.HikariConfig config, String address, String port, String databaseName, String username, String password) Configures theHikariConfigwith the relevant database properties.Each driver does this slightly differently...
- Parameters:
config- the hikari configaddress- the database addressport- the database portdatabaseName- the database nameusername- the database usernamepassword- the database password
-
overrideProperties
-
setProperties
-
postInitialize
protected void postInitialize()Called after the Hikari pool has been initialised -
init
- Specified by:
initin interfaceConnectionFactory
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceConnectionFactory
-
getConnection
- Specified by:
getConnectionin interfaceConnectionFactory- Throws:
SQLException
-
getMeta
- Specified by:
getMetain interfaceConnectionFactory
-