Package guru.interlis.convconf.api
Class ConvConfService
java.lang.Object
guru.interlis.convconf.api.ConvConfService
Public façade for library users.
A conversion run follows three conceptual stages:
- Compile KM and parse both LM files.
- Validate semantic/data consistency and create a conversion plan.
- Execute the plan through source/target adapters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionValidates a single LM file against a KM model.convert(Path kmIli, Path sourceLm, Path targetLm, RecordSourceReader sourceReader, RecordTargetWriter targetWriter) Full convert flow with trace collection disabled.convert(Path kmIli, Path sourceLm, Path targetLm, RecordSourceReader sourceReader, RecordTargetWriter targetWriter, boolean traceEnabled) Full convert flow using LM paths (plan is built internally).convert(Path kmIli, Path sourceLm, Path targetLm, Connection source, Connection target) Convenience overload that wraps JDBC connections withJdbcRecordAdapter.executePlan(Path kmIli, ConversionPlan plan, RecordSourceReader sourceReader, RecordTargetWriter targetWriter, boolean traceEnabled) Executes a pre-built conversion plan.Builds a validated conversion plan from KM + source LM + target LM.
-
Constructor Details
-
ConvConfService
public ConvConfService()
-
-
Method Details
-
check
Validates a single LM file against a KM model.- Parameters:
kmIli- path to the INTERLIS KM modellmFile- path to the LM definition to validate- Returns:
- list of validation errors (empty if valid)
- Throws:
Exception- if KM compile or LM parse fails
-
plan
Builds a validated conversion plan from KM + source LM + target LM.- Parameters:
kmIli- path to the INTERLIS KM modelsourceLm- path to source LMtargetLm- path to target LM- Returns:
- plan including execution steps and parsed LM models
- Throws:
Exception- if parsing/compilation fails or semantic checks fail
-
executePlan
public ConversionEngine.ConversionResult executePlan(Path kmIli, ConversionPlan plan, RecordSourceReader sourceReader, RecordTargetWriter targetWriter, boolean traceEnabled) throws Exception Executes a pre-built conversion plan.- Parameters:
kmIli- path to KM model used for final result validationplan- pre-built conversion plansourceReader- adapter used to read source recordstargetWriter- adapter used to write target recordstraceEnabled- iftrue, runtime trace events are collected- Returns:
- conversion result with canonical records and optional trace events
- Throws:
Exception- if read/write fails or validation fails
-
convert
public ConversionEngine.ConversionResult convert(Path kmIli, Path sourceLm, Path targetLm, RecordSourceReader sourceReader, RecordTargetWriter targetWriter, boolean traceEnabled) throws Exception Full convert flow using LM paths (plan is built internally).- Throws:
Exception
-
convert
public ConversionEngine.ConversionResult convert(Path kmIli, Path sourceLm, Path targetLm, RecordSourceReader sourceReader, RecordTargetWriter targetWriter) throws Exception Full convert flow with trace collection disabled.- Throws:
Exception
-
convert
public ConversionEngine.ConversionResult convert(Path kmIli, Path sourceLm, Path targetLm, Connection source, Connection target) throws Exception Convenience overload that wraps JDBC connections withJdbcRecordAdapter.- Throws:
Exception
-