Class DriverCatalog
java.lang.Object
com.darkcollective.relix.connectors.std.DriverCatalog
A catalog of downloadable JDBC drivers — the manifest that lets relix fetch a
driver it does not have locally, complementing the external driver directory.
Each DriverCatalog.Entry maps a JDBC URL scheme prefix (e.g.
"jdbc:postgresql:") to one or more downloadable Artifacts (a URL
plus a SHA-256 checksum). forUrl(String) resolves the entry whose
scheme prefixes a connection URL, so a DriverProvisioner knows what to
fetch for jdbc:postgresql://host/db.
A default catalog ships as the relix-drivers.json resource; it can be
overridden by a file named in $RELIX_DRIVER_CATALOG. The manifest format
is a JSON array of entries:
[
{ "name": "PostgreSQL", "scheme": "jdbc:postgresql:",
"artifacts": [ { "url": "https://.../postgresql-42.7.4.jar", "sha256": "…" } ] }
]
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA driver: a JDBC scheme prefix it satisfies and the artifacts to download. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEnvironment variable naming a manifest file that overrides the bundled default. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DriverCatalogentries()Finds the catalog entry whose scheme prefixes the given JDBC URL (case-insensitive).static DriverCatalogload()Loads the active catalog: the file named by$RELIX_DRIVER_CATALOGif set and present, otherwise the bundled default.static DriverCatalogParses a manifest from JSON text.
-
Field Details
-
CATALOG_ENV
Environment variable naming a manifest file that overrides the bundled default.- See Also:
-
-
Constructor Details
-
DriverCatalog
-
-
Method Details
-
entries
- Returns:
- all catalog entries, in manifest order
-
forUrl
Finds the catalog entry whose scheme prefixes the given JDBC URL (case-insensitive). When several match, the longest (most specific) scheme wins.- Parameters:
jdbcUrl- the connection URL, e.g."jdbc:postgresql://host/db"- Returns:
- the matching entry, or empty when no catalog entry covers the URL
-
load
Loads the active catalog: the file named by$RELIX_DRIVER_CATALOGif set and present, otherwise the bundled default.- Returns:
- the resolved catalog
-
bundledDefault
- Returns:
- the catalog bundled as the
relix-drivers.jsonresource
-
parse
Parses a manifest from JSON text.- Parameters:
json- the manifest JSON (a top-level array of entries)- Returns:
- the parsed catalog
- Throws:
IllegalArgumentException- if the manifest is malformed
-