System Constants
Relevant source files
The following files were used as context for generating this wiki page:
The "System Constants" module in the flext-oracle-oic project provides a centralized, unified pattern for managing values, configurations, and enumerations essential for Oracle Integration Cloud (OIC) operations. It follows the FLEXT architectural standard by consolidating constants into a single FlextOracleOicConstants class (aliased as c), which inherits from the base flext_auth.c class to ensure global consistency across the FLEXT ecosystem.
Sources: src/flext_oracle_oic/constants.py:1-40
This module serves as the single source of truth for API versions, authentication scopes, integration statuses, and validation logic. By utilizing nested namespaces and StrEnum types, it ensures type safety and prevents duplication across the codebase.
Core Architectural Structure
The constants are organized into logical namespaces within the FlextOracleOicConstants class. This structure facilitates easy discovery and access to specific domain values, such as OIC-specific configurations, authentication parameters, and monitoring thresholds.
Hierarchy Diagram
The following diagram illustrates the nested structure of the constants class:
API and Connection Constants
The system defines specific constants for interacting with the OIC REST API, including default endpoints and supported HTTP methods.
| Constant Namespace | Variable | Value / Description |
|---|---|---|
OracleOic | DEFAULT_BASE_URL | https://localhost.integration.ocp.oraclecloud.com |
OracleOic | DEFAULT_API_VERSION | v1 |
OracleOic | DEFAULT_PAGE_SIZE | 100 |
API | ENDPOINT_HEALTH | /ic/api/integration/v1/health |
API | HTTP_STATUS_OK | 200 |
API | HTTP_ERROR_THRESHOLD | 400 |
Sources: src/flext_oracle_oic/constants.py:65-80, src/flext_oracle_oic/constants.py:155-170
Connection Types and Statuses
The Connection namespace defines the valid types of OIC adapters and their operational states.
- Connection Types:
REST,SOAP,DATABASE,FILE,FTP. - Connection Statuses:
ACTIVE,INACTIVE,ERROR,unknown.
Sources: src/flext_oracle_oic/constants.py:108-132
Validation and Performance Thresholds
The OracleOicValidation namespace contains regex patterns and numeric constraints used by utility modules like FlextOracleOicUtilitiesMonitoring to assess system health and performance.
Performance Metrics Evaluation
The system uses defined thresholds to categorize the health of integrations.
Validation Table
| Field | Validation Rule / Regex | Source File |
|---|---|---|
| Integration Name | ^[a-zA-Z0-9_\-\s]+$ | constants.py:183 |
| Client ID | ^[a-zA-Z0-9_\-\.]+$ | constants.py:184 |
| Version Pattern | ^\d{2}\.\d{2}\.\d{4}$ | constants.py:198 |
| Min Client Secret | 8 characters | constants.py:204 |
Runtime Settings Integration
The constants defined in FlextOracleOicConstants are utilized by the FlextOracleOicSettings class to provide default values for runtime configuration. This ensures that the application behaves predictably across environments (Development, Testing, Production) unless overridden by environment variables prefixed with FLEXT_ORACLE_OIC_.
class FlextOracleOicSettings(FlextSettingsBase):
"""Runtime configuration for Oracle OIC integration."""
base_url: Annotated[t.NonEmptyStr, u.Field(default=c.OracleOic.DEFAULT_BASE_URL)]
api_version: Annotated[c.OICApiVersion, u.Field(default=c.OICApiVersion.V1)]
request_timeout: Annotated[t.PositiveInt, u.Field(default=c.DEFAULT_TIMEOUT_SECONDS)]
Sources: src/flext_oracle_oic/settings.py:25-45
Conclusion
System constants in the flext-oracle-oic repository are the foundational building blocks for API interaction, data validation, and configuration management. By centralizing these values, the project maintains high technical accuracy and simplifies the implementation of complex OIC integration flows. The use of strict enumerations and regex-based validation ensures that only valid data interacts with the Oracle Integration Cloud environment.