1
0

Optimierung: Konfigurationspakete kohärenter zugeschnitten

This commit is contained in:
2026-04-05 11:17:33 +02:00
parent 5b95cc2561
commit 94728c270f
10 changed files with 49 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
package de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

View File

@@ -14,12 +14,14 @@ import java.util.function.Function;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.port.out.ConfigurationPort;
/**
* Properties-based implementation of {@link ConfigurationPort}.
* AP-005: Loads configuration from config/application.properties with environment variable precedence.
* <p>
* Loads configuration from config/application.properties with environment variable
* precedence for sensitive values like the API key.
*/
public class PropertiesConfigurationPortAdapter implements ConfigurationPort {

View File

@@ -1,5 +1,12 @@
/**
* Configuration adapters for outbound infrastructure access.
* Contains implementations of configuration loading from external sources.
* Configuration loading adapters.
* <p>
* Contains implementations of the {@link de.gecheckt.pdf.umbenenner.application.port.out.ConfigurationPort}
* that load the bootstrap-layer {@link de.gecheckt.pdf.umbenenner.bootstrap.configuration.StartConfiguration}
* from external sources (e.g., properties files, environment variables).
* <p>
* These adapters bridge the outbound port contract with concrete infrastructure
* (property file parsing, environment variable lookup) without leaking infrastructure
* details into the application or bootstrap layers.
*/
package de.gecheckt.pdf.umbenenner.adapter.out.configuration;

View File

@@ -1,6 +1,6 @@
package de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

View File

@@ -1,5 +1,14 @@
/**
* Configuration model types for the PDF Umbenenner application.
* Contains typed configuration objects representing startup parameters.
* Application-layer runtime configuration model.
* <p>
* Contains only the minimal runtime configuration contract ({@link RuntimeConfiguration})
* that the application layer actually depends on during batch document processing.
* <p>
* This is intentionally small and focused: it includes only the parameters the
* application needs (e.g., maxPages), not the broader infrastructure configuration
* (paths, API keys, persistence settings, etc.) which are handled at the bootstrap layer.
* <p>
* This separation follows hexagonal architecture principles by ensuring the application
* layer depends only on configuration values it actually uses.
*/
package de.gecheckt.pdf.umbenenner.application.config;

View File

@@ -1,10 +1,15 @@
package de.gecheckt.pdf.umbenenner.application.config;
package de.gecheckt.pdf.umbenenner.application.config.startup;
import java.net.URI;
import java.nio.file.Path;
/**
* Typed immutable configuration model for PDF Umbenenner startup parameters.
* <p>
* Contains all technical infrastructure and runtime configuration parameters
* loaded and validated at bootstrap time. This is a complete configuration model
* for the entire application startup, including paths, API settings, persistence,
* and operational parameters.
*/
public record StartConfiguration(
Path sourceFolder,
@@ -22,4 +27,4 @@ public record StartConfiguration(
String logLevel,
String apiKey
)
{ }
{ }

View File

@@ -0,0 +1,13 @@
/**
* Startup configuration model types.
* <p>
* Contains the complete technical startup configuration model ({@link StartConfiguration})
* that encompasses all infrastructure parameters, paths, API settings, and operational
* parameters required to initialize and run the application.
* <p>
* This is separate from the minimal {@link de.gecheckt.pdf.umbenenner.application.config.RuntimeConfiguration}
* which represents only the configuration values the application layer actually depends on
* during batch processing. The startup configuration is the complete technical model used
* by bootstrap and adapter layers for initialization, validation, and infrastructure wiring.
*/
package de.gecheckt.pdf.umbenenner.application.config.startup;

View File

@@ -1,6 +1,6 @@
package de.gecheckt.pdf.umbenenner.application.port.out;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
/**
* Outbound port for configuration access.

View File

@@ -21,7 +21,7 @@ import de.gecheckt.pdf.umbenenner.adapter.out.sqlite.SqliteProcessingAttemptRepo
import de.gecheckt.pdf.umbenenner.adapter.out.sqlite.SqliteSchemaInitializationAdapter;
import de.gecheckt.pdf.umbenenner.adapter.out.sqlite.SqliteUnitOfWorkAdapter;
import de.gecheckt.pdf.umbenenner.application.config.RuntimeConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunOutcome;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase;
import de.gecheckt.pdf.umbenenner.application.port.out.ConfigurationPort;

View File

@@ -3,7 +3,7 @@ package de.gecheckt.pdf.umbenenner.bootstrap;
import de.gecheckt.pdf.umbenenner.adapter.in.cli.SchedulerBatchCommand;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.InvalidStartConfigurationException;
import de.gecheckt.pdf.umbenenner.adapter.out.bootstrap.validation.StartConfigurationValidator;
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.config.startup.StartConfiguration;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunOutcome;
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase;
import de.gecheckt.pdf.umbenenner.application.port.out.ConfigurationPort;