Skip to content

Commit

Permalink
Release: com.io7m.darco 2.0.0
Browse files Browse the repository at this point in the history
Change: (Backwards incompatible) Allow for passing in SAX parser factories explicitly.
Change: Update ch.qos.logback:logback-classic:1.5.7 → 1.5.8.
Change: Update io.opentelemetry:opentelemetry-bom:1.41.0 → 1.42.0.
  • Loading branch information
io7m committed Sep 7, 2024
2 parents 9a98716 + 02f3800 commit 7b203d8
Show file tree
Hide file tree
Showing 23 changed files with 127 additions and 32 deletions.
9 changes: 8 additions & 1 deletion README-CHANGES.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<c:changelog project="com.io7m.darco" xmlns:c="urn:com.io7m.changelog:4.0">
<c:releases>
<c:release date="2024-09-01T11:00:18+00:00" is-open="false" ticket-system="com.github.io7m.darco" version="1.0.0">
<c:release date="2024-09-01T00:00:00+00:00" is-open="false" ticket-system="com.github.io7m.darco" version="1.0.0">
<c:changes/>
</c:release>
<c:release date="2024-09-07T08:58:36+00:00" is-open="false" ticket-system="com.github.io7m.darco" version="2.0.0">
<c:changes>
<c:change compatible="false" date="2024-09-06T00:00:00+00:00" summary="Allow for passing in SAX parser factories explicitly."/>
<c:change date="2024-09-06T00:00:00+00:00" summary="Update ch.qos.logback:logback-classic:1.5.7 → 1.5.8."/>
<c:change date="2024-09-06T00:00:00+00:00" summary="Update io.opentelemetry:opentelemetry-bom:1.41.0 → 1.42.0."/>
</c:changes>
</c:release>
</c:releases>
<c:ticket-systems>
<c:ticket-system default="true" id="com.github.io7m.darco" url="https://www.github.com/io7m/darco/issues/"/>
Expand Down
6 changes: 5 additions & 1 deletion com.io7m.darco.api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.api</artifactId>

Expand Down Expand Up @@ -39,6 +39,10 @@
<groupId>com.io7m.jmulticlose</groupId>
<artifactId>com.io7m.jmulticlose.core</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.jxe</groupId>
<artifactId>com.io7m.jxe.core</artifactId>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@

package com.io7m.darco.api;

import com.io7m.jxe.core.JXEHardenedSAXParsers;

import java.util.Optional;

/**
* The base database configuration.
*/

public interface DDatabaseConfigurationType
{
/**
* @return A factory of SAX parsers used to parse database schemas
*/

Optional<JXEHardenedSAXParsers> saxParsers();

/**
* @return The database telemetry interface
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

@Export
@Version("1.0.0")
@Version("2.0.0")
package com.io7m.darco.api;

import org.osgi.annotation.bundle.Export;
Expand Down
1 change: 1 addition & 0 deletions com.io7m.darco.api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
requires static org.osgi.annotation.versioning;

requires com.io7m.jmulticlose.core;
requires com.io7m.jxe.core;
requires com.io7m.lanark.core;
requires com.io7m.seltzer.api;
requires io.opentelemetry.api;
Expand Down
6 changes: 5 additions & 1 deletion com.io7m.darco.examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.examples</artifactId>

Expand All @@ -35,6 +35,10 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.io7m.jxe</groupId>
<artifactId>com.io7m.jxe.core</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.jmulticlose</groupId>
<artifactId>com.io7m.jmulticlose.core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

@Export
@Version("1.0.0")
@Version("2.0.0")
package com.io7m.darco.examples;

import org.osgi.annotation.bundle.Export;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
import com.io7m.darco.api.DDatabaseUpgrade;
import com.io7m.darco.api.DUsernamePassword;
import com.io7m.darco.postgres.DPQDatabaseConfigurationType;
import com.io7m.jxe.core.JXEHardenedSAXParsers;

import java.util.Objects;
import java.util.Optional;

/**
* The configuration information for the example PostgreSQL database.
*
* @param saxParsers The SAX parser factory
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
Expand All @@ -40,6 +43,7 @@
*/

public record EPQDatabaseConfiguration(
Optional<JXEHardenedSAXParsers> saxParsers,
DDatabaseTelemetryType telemetry,
DDatabaseCreate create,
DDatabaseUpgrade upgrade,
Expand All @@ -54,6 +58,7 @@ public record EPQDatabaseConfiguration(
/**
* The configuration information for the example PostgreSQL database.
*
* @param saxParsers The SAX parser factory
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
Expand All @@ -67,6 +72,7 @@ public record EPQDatabaseConfiguration(

public EPQDatabaseConfiguration
{
Objects.requireNonNull(saxParsers, "saxParsers");
Objects.requireNonNull(telemetry, "telemetry");
Objects.requireNonNull(create, "create");
Objects.requireNonNull(upgrade, "upgrade");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

@Export
@Version("1.0.0")
@Version("2.0.0")
package com.io7m.darco.examples.postgresql;

import org.osgi.annotation.bundle.Export;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@
import com.io7m.darco.api.DDatabaseTelemetryType;
import com.io7m.darco.api.DDatabaseUpgrade;
import com.io7m.darco.sqlite.DSDatabaseConfigurationType;
import com.io7m.jxe.core.JXEHardenedSAXParsers;

import java.nio.file.Path;
import java.util.Objects;
import java.util.Optional;

/**
* The configuration information for the example SQLite database.
*
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
* @param file The database file
* @param saxParsers The SAX parsers
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
* @param file The database file
*/

public record ESDatabaseConfiguration(
Optional<JXEHardenedSAXParsers> saxParsers,
DDatabaseTelemetryType telemetry,
DDatabaseCreate create,
DDatabaseUpgrade upgrade,
Expand All @@ -44,14 +48,16 @@ public record ESDatabaseConfiguration(
/**
* The configuration information for the example SQLite database.
*
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
* @param file The database file
* @param saxParsers The SAX parsers
* @param telemetry The telemetry interface
* @param create The database creation option
* @param upgrade The database upgrade option
* @param file The database file
*/

public ESDatabaseConfiguration
{
Objects.requireNonNull(saxParsers, "saxParsers");
Objects.requireNonNull(telemetry, "telemetry");
Objects.requireNonNull(create, "create");
Objects.requireNonNull(upgrade, "upgrade");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/

@Export
@Version("1.0.0")
@Version("2.0.0")
package com.io7m.darco.examples.sqlite;

import org.osgi.annotation.bundle.Export;
Expand Down
1 change: 1 addition & 0 deletions com.io7m.darco.examples/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
requires io.opentelemetry.api;
requires org.slf4j;
requires org.xerial.sqlitejdbc;
requires com.io7m.jxe.core;

uses ESDatabaseQueryProviderType;
uses EPQDatabaseQueryProviderType;
Expand Down
10 changes: 9 additions & 1 deletion com.io7m.darco.postgres/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.postgres</artifactId>

Expand All @@ -25,6 +25,14 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.io7m.jxe</groupId>
<artifactId>com.io7m.jxe.core</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.anethum</groupId>
<artifactId>com.io7m.anethum.api</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.jmulticlose</groupId>
<artifactId>com.io7m.jmulticlose.core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.io7m.darco.api.DDatabaseType;
import com.io7m.jmulticlose.core.CloseableCollection;
import com.io7m.jmulticlose.core.CloseableCollectionType;
import com.io7m.jxe.core.JXEHardenedSAXParsers;
import com.io7m.lanark.core.RDottedName;
import com.io7m.trasco.api.TrArguments;
import com.io7m.trasco.api.TrEventExecutingSQL;
Expand Down Expand Up @@ -367,7 +368,17 @@ private void createOrUpgrade(
final var parsers = new TrSchemaRevisionSetParsers();
final TrSchemaRevisionSet revisions;
try (var stream = this.onRequireDatabaseSchemaXML()) {
revisions = parsers.parse(URI.create("urn:source"), stream);
final var parser =
parsers.createParserWithContext(
configuration.saxParsers()
.orElseGet(JXEHardenedSAXParsers::new),
URI.create("urn:source"),
stream,
parseStatus -> {

}
);
revisions = parser.execute();
}

try (var connection = installDataSource.getConnection()) {
Expand Down
2 changes: 2 additions & 0 deletions com.io7m.darco.postgres/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
requires java.sql;
requires java.naming;

requires com.io7m.anethum.api;
requires com.io7m.jmulticlose.core;
requires com.io7m.jxe.core;
requires com.io7m.lanark.core;
requires com.io7m.trasco.api;
requires com.io7m.trasco.vanilla;
Expand Down
10 changes: 9 additions & 1 deletion com.io7m.darco.sqlite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.sqlite</artifactId>

Expand All @@ -25,6 +25,14 @@
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>com.io7m.jxe</groupId>
<artifactId>com.io7m.jxe.core</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.anethum</groupId>
<artifactId>com.io7m.anethum.api</artifactId>
</dependency>
<dependency>
<groupId>com.io7m.jmulticlose</groupId>
<artifactId>com.io7m.jmulticlose.core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.io7m.darco.api.DDatabaseType;
import com.io7m.jmulticlose.core.CloseableCollection;
import com.io7m.jmulticlose.core.CloseableCollectionType;
import com.io7m.jxe.core.JXEHardenedSAXParsers;
import com.io7m.lanark.core.RDottedName;
import com.io7m.trasco.api.TrArguments;
import com.io7m.trasco.api.TrEventExecutingSQL;
Expand Down Expand Up @@ -295,7 +296,17 @@ private SQLiteDataSource openDataSourceInSpan(
final var parsers = new TrSchemaRevisionSetParsers();
final TrSchemaRevisionSet revisions;
try (var stream = this.onRequireDatabaseSchemaXML()) {
revisions = parsers.parse(URI.create("urn:source"), stream);
final var parser =
parsers.createParserWithContext(
configuration.saxParsers()
.orElseGet(JXEHardenedSAXParsers::new),
URI.create("urn:source"),
stream,
parseStatus -> {

}
);
revisions = parser.execute();
}

final var arguments =
Expand Down
10 changes: 6 additions & 4 deletions com.io7m.darco.sqlite/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@

requires java.sql;

requires com.io7m.anethum.api;
requires com.io7m.jmulticlose.core;
requires com.io7m.jxe.core;
requires com.io7m.lanark.core;
requires com.io7m.trasco.api;
requires com.io7m.trasco.vanilla;
requires com.io7m.lanark.core;
requires org.slf4j;
requires org.xerial.sqlitejdbc;
requires io.opentelemetry.api;
requires io.opentelemetry.context;
requires com.io7m.jmulticlose.core;
requires org.slf4j;
requires org.xerial.sqlitejdbc;

exports com.io7m.darco.sqlite;
}
2 changes: 1 addition & 1 deletion com.io7m.darco.templating/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.templating</artifactId>

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.darco.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.darco</artifactId>
<groupId>com.io7m.darco</groupId>
<version>1.0.0</version>
<version>2.0.0</version>
</parent>
<artifactId>com.io7m.darco.tests</artifactId>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import java.util.Optional;

import static com.io7m.darco.api.DDatabaseUnit.UNIT;
import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -68,6 +70,7 @@ public void setup()
this.database =
this.databases.open(
new EPQDatabaseConfiguration(
Optional.empty(),
DDatabaseTelemetryNoOp.get(),
DDatabaseCreate.CREATE_DATABASE,
DDatabaseUpgrade.UPGRADE_DATABASE,
Expand Down
Loading

0 comments on commit 7b203d8

Please sign in to comment.