public final class DatabaseConnectionPoolMethods extends Object
Constructor and Description |
---|
DatabaseConnectionPoolMethods(DataSourceManager dataSourceManager) |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsConnectionWithName(String name)
Check if the instance has a connection pool with the provided name.
|
static void |
deletePool(String name)
Delete an existing connection pool by name.
|
static void |
disablePool(String name)
Disable a connection pool by name
|
static void |
enablePool(String name)
Enable a connection pool by name.
|
static GloopModel |
getConnectionPoolInfo(String name)
Get an existing connection pool by name.
|
static GloopModel |
getConnectionPoolInfos()
Get all existing connection pools in the instance.
|
static GloopModel |
getSystemConnectionPoolInfo(String name)
Get the information for a system data source.
|
static void |
savePool(GloopModel connectionPoolInfo)
Create a new connection pool.
|
static void |
startPool(String name)
Start a connection pool by name.
|
static void |
stopPool(String name)
Stop a connection pool by name.
|
static boolean |
supportsDriver(Class driverClass)
Determine whether Martini supports a database or not using its corresponding driver class.
|
static void |
testConnection(GloopModel connectionPoolInfo)
Test if a connection can be established to the database using the provided information.
|
@Autowired DatabaseConnectionPoolMethods(DataSourceManager dataSourceManager)
@GloopObjectParameter(value="connectionPoolInfos{\n connectionPoolInfos#io.toro.martini.jdbc.JDBCConnectionPoolInfo[]{\n }\n}") public static GloopModel getConnectionPoolInfos()
@GloopObjectParameter(value="connectionPoolInfo{\n connectionPoolInfo#io.toro.martini.jdbc.JDBCConnectionPoolInfo{\n }\n}") public static GloopModel getConnectionPoolInfo(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static boolean containsConnectionWithName(@GloopParameter(allowNull=false) String name)
name
- name of the connection pooltrue
if Martini has a connection pool with the given name; false
otherwisepublic static void enablePool(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static void startPool(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static void stopPool(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static void disablePool(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static void savePool(@GloopObjectParameter(value="connectionPoolInfo#io.toro.martini.jdbc.JDBCConnectionPoolInfo{\n}") GloopModel connectionPoolInfo)
connectionPoolInfo
- the new connection poolpublic static void deletePool(@GloopParameter(allowNull=false) String name)
name
- name of the connection poolpublic static void testConnection(@GloopObjectParameter(value="connectionPoolInfo#io.toro.martini.jdbc.JDBCConnectionPoolInfo{\n}") GloopModel connectionPoolInfo) throws Exception
connectionPoolInfo
- the connection pool to testException
- if a connection could not be establishedpublic static boolean supportsDriver(@GloopParameter(allowNull=false) Class driverClass)
driverClass
- the driver class of the database to checktrue
if the driver is supported; false
otherwise@GloopObjectParameter(value="connectionPoolInfo{\n connectionPoolInfo#io.toro.martini.jdbc.JDBCConnectionPoolInfo{\n }\n}") public static GloopModel getSystemConnectionPoolInfo(@GloopParameter(allowNull=false) String name)
name
- the name of the data sourceCopyright © 2023. All rights reserved.