RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.service.ForumService Class Reference

Static Public Member Functions

static Connection getConnection () throws SQLException
static HikariDataSource getConnectionPool ()
static void start () throws Exception

Static Private Attributes

static HikariDataSource connectionPool
static final Logger logger = LogManager.getLogger(ForumService.class)

Detailed Description

Definition at line 12 of file ForumService.java.

Member Function Documentation

◆ getConnection()

Connection com.runehive.game.service.ForumService.getConnection ( ) throws SQLException
static

Definition at line 37 of file ForumService.java.

37 {
38 return connectionPool.getConnection();
39 }

References connectionPool.

◆ getConnectionPool()

HikariDataSource com.runehive.game.service.ForumService.getConnectionPool ( )
static

Definition at line 33 of file ForumService.java.

33 {
34 return connectionPool;
35 }

References connectionPool.

Referenced by com.runehive.net.session.LoginSession.authenticatedForumUser().

Here is the caller graph for this function:

◆ start()

void com.runehive.game.service.ForumService.start ( ) throws Exception
static

Definition at line 18 of file ForumService.java.

18 {
19 HikariConfig config = new HikariConfig();
20 config.setDriverClassName("com.mysql.jdbc.Driver");
21 config.setJdbcUrl(Config.FORUM_DB_URL);
22 config.setUsername(Config.FORUM_DB_USER);
23 config.setPassword(Config.FORUM_DB_PASS);
24 config.setMaximumPoolSize(10);
25 config.setConnectionTimeout(5_000);
26 config.setIdleTimeout(0);
27 config.setMaxLifetime(0);
28 config.addDataSourceProperty("cachePrepStmts", "true");
29 connectionPool = new HikariDataSource(config);
30 logger.info("Successfully connected to forum database.");
31 }

References connectionPool, com.runehive.Config.FORUM_DB_PASS, com.runehive.Config.FORUM_DB_URL, com.runehive.Config.FORUM_DB_USER, and logger.

Referenced by com.runehive.RuneHive.start().

Here is the caller graph for this function:

Member Data Documentation

◆ connectionPool

HikariDataSource com.runehive.game.service.ForumService.connectionPool
staticprivate

Definition at line 16 of file ForumService.java.

Referenced by getConnection(), getConnectionPool(), and start().

◆ logger

final Logger com.runehive.game.service.ForumService.logger = LogManager.getLogger(ForumService.class)
staticprivate

Definition at line 14 of file ForumService.java.

Referenced by start().


The documentation for this class was generated from the following file: