Service Runtime Manager
Relevant source files
The following files were used as context for generating this wiki page:
The Service Runtime Manager in flext-target-oracle-oic acts as an internal adapter layer that bridges the high-level service orchestrator with the underlying Singer target implementation. Its primary purpose is to provide the necessary runtime environment and factory logic to instantiate stream-specific sinks for the Oracle Integration Cloud (OIC) target.
This module ensures that service-level requests to process data are correctly mapped to the specialized Singer sinks (e.g., Connections, Integrations, Packages) while maintaining strict type validation and configuration normalization. It operates within the context of the FlextMeltanoTargetServiceBase architecture.
Sources: src/flext_target_oracle_oic/api.py:11-20, src/flext_target_oracle_oic/_utilities/service_runtime.py:1-12
Core Architecture and Components
The Service Runtime Manager is primarily composed of the FlextTargetOracleOicServiceRuntime class and its nested internal Target class. It manages the lifecycle and instantiation of OIC sinks by interacting with the FlextTargetOracleOic target entry point.
Service Runtime Adapter
The FlextTargetOracleOicServiceRuntime class provides a factory method, create_sink, which is the entry point for generating operational sinks. It handles the conversion of raw configuration into validated Python objects and resolves the appropriate sink class based on the stream name.
Sources: src/flext_target_oracle_oic/_utilities/service_runtime.py:14-25
Runtime Data Flow
When the FlextTargetOracleOicService is requested to create a sink, it passes the stream name, schema, and any settings overrides to the runtime manager.
The diagram above illustrates the sequence of operations from the service facade through the runtime manager to the creation of a functional Singer sink.
Sources: src/flext_target_oracle_oic/api.py:31-45, src/flext_target_oracle_oic/_utilities/service_runtime.py:20-45
Sink Instantiation Logic
The runtime manager implements logic to resolve specific OIC stream sinks from the main target registry.
Sink Mapping
The FlextTargetOracleOic class maintains a mapping of stream names to specialized sink implementations. The runtime manager utilizes fetch_sink_class to determine which implementation to use.
| Stream Name | Sink Class | Description |
|---|---|---|
connections | FlextTargetOracleOicConnectionsSink | Handles OIC Connection resources. |
integrations | FlextTargetOracleOicIntegrationsSink | Handles OIC Integration flows. |
packages | FlextTargetOracleOicPackagesSink | Handles OIC Package deployments. |
lookups | FlextTargetOracleOicLookupsSink | Handles OIC Lookup tables. |
| Default | FlextTargetOracleOicBaseSink | Fallback for unrecognized streams. |
Sources: src/flext_target_oracle_oic/target.py:59-75
Component Relationship
The following class diagram shows the relationships between the service runtime, the target abstractions, and the various sink implementations.
Configuration and Validation
The runtime manager relies on FlextTargetOracleOicSettings and FlextTargetOracleOicUtilities to ensure that data passed into the sinks is valid and follows the Oracle OIC requirements.
Runtime Configuration Keys
The FlextTargetOracleOicUtilities.TargetOracleOic.Validation static method requires specific keys for a successful runtime initialization:
base_url: The endpoint for the OIC instance.oauth_client_id: The client ID for OAuth2 authentication.oauth_client_secret: The client secret (handled as aSecretStr).
Sources: src/flext_target_oracle_oic/utilities.py:26-33, src/flext_target_oracle_oic/settings.py:27-42
Implementation Detail: Sink Creation
The create_sink method performs runtime normalization and validation using Pydantic adapters before passing the data to the sink constructor.
# From src/flext_target_oracle_oic/_utilities/service_runtime.py:22-45
@classmethod
def create_sink(
cls,
*,
stream_name: str,
schema: t.JsonMapping,
target_config: t.JsonMapping,
) -> FlextTargetOracleOicBaseSink:
normalized_target_config = u.normalize_to_json_mapping(target_config)
runtime_target = FlextTargetOracleOic()
sink_class = runtime_target.fetch_sink_class(stream_name)
return sink_class(
target=cls.Target(
config=t.json_dict_adapter().validate_python(normalized_target_config),
validate_config=False,
),
stream_name=stream_name,
schema=t.json_dict_adapter().validate_python(schema),
key_properties=[],
)
Sources: src/flext_target_oracle_oic/_utilities/service_runtime.py:22-45
Conclusion
The Service Runtime Manager provides the necessary glue code to transform high-level service requests into operational Singer sinks within the flext-target-oracle-oic module. By encapsulating sink resolution logic and configuration normalization, it maintains a clean separation between the service orchestration layer and the low-level data processing implementations.