Class IdDatabase
java.lang.Object
com.io7m.idstore.database.postgres.internal.IdDatabase
- All Implemented Interfaces:
IdDatabaseType
,com.io7m.repetoir.core.RPServiceType
,AutoCloseable
The default postgres server database implementation.
-
Constructor Summary
ConstructorDescriptionIdDatabase
(IdDatabaseTelemetry inTelemetry, IdDatabaseConfiguration inConfiguration, Clock inClock, com.zaxxer.hikari.HikariDataSource inDataSource, com.io7m.jmulticlose.core.CloseableCollectionType<IdDatabaseException> inResources) The default postgres server database implementation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
openConnection
(IdDatabaseRole role) Open a database connection using the given role.toString()
io.opentelemetry.api.trace.Tracer
tracer()
-
Constructor Details
-
IdDatabase
public IdDatabase(IdDatabaseTelemetry inTelemetry, IdDatabaseConfiguration inConfiguration, Clock inClock, com.zaxxer.hikari.HikariDataSource inDataSource, com.io7m.jmulticlose.core.CloseableCollectionType<IdDatabaseException> inResources) The default postgres server database implementation.- Parameters:
inTelemetry
- A telemetryinConfiguration
- The configurationinClock
- The clockinDataSource
- A pooled data sourceinResources
- The resources to be closed
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceIdDatabaseType
- Throws:
IdDatabaseException
-
configuration
- Specified by:
configuration
in interfaceIdDatabaseType
- Returns:
- The configuration used to open the database
-
tracer
public io.opentelemetry.api.trace.Tracer tracer()- Returns:
- The OpenTelemetry tracer
-
openConnection
Description copied from interface:IdDatabaseType
Open a database connection using the given role.- Specified by:
openConnection
in interfaceIdDatabaseType
- Parameters:
role
- The role- Returns:
- A database connection
- Throws:
IdDatabaseException
- On errors
-
description
- Specified by:
description
in interfacecom.io7m.repetoir.core.RPServiceType
-
toString
-