Domain Models API Reference¶
All domain models are immutable Java records in the io.patternops.core.model package.
Enums¶
ExecutionMode¶
StageType¶
public enum StageType {
SOURCE, INGESTION, VALIDATION, CDC, SECURITY,
QUALITY, TRANSFORMATION, SYNC, PUBLISH
}
ComputePlatformProfile¶
CanonicalUnit¶
public enum CanonicalUnit {
COUNT, BYTES, MILLISECONDS, SECONDS, PERCENT,
RECORDS_PER_SECOND, BYTES_PER_SECOND, RATIO, EVENTS_PER_SECOND
}
ErrorCategory¶
public enum ErrorCategory {
TRANSIENT, CONFIGURATION, SECURITY, RESOURCE,
DATA_QUALITY, CONTRACT, BOUNDARY, PLATFORM, VERSION
}
CompatibilityMode¶
LogLevel¶
Core Records¶
Pipeline¶
public record Pipeline(
String name,
String tenancy,
String namespace,
String dataset,
ExecutionMode executionMode,
List<Stage> stages,
Optional<String> schedule,
List<Map<String, Object>> policies,
List<Map<String, Object>> extensions,
Optional<ComputePlatformProfile> platformProfile
) { }
Validation: name, tenancy, namespace, dataset non-blank; executionMode non-null.
Stage¶
public record Stage(
String name,
StageType type,
String capability,
Optional<String> provider,
Map<String, Object> config,
List<String> extensions,
Duration timeout,
Optional<RetryPolicy> retryPolicy,
Optional<DualModeTransformation> transformation
) { }
Validation: name, capability non-blank; type, timeout non-null.
DualModeTransformation¶
public record DualModeTransformation(
Optional<TransformationDefinition> spark,
Optional<TransformationDefinition> sql
) { }
Validation: At least one of spark or sql must be present.
Factory methods: sparkOnly(def), sqlOnly(def), dual(spark, sql)
TransformationDefinition¶
public record TransformationDefinition(
String style, // sql, dataframe, stream, rule_based, ml_based, ai_generated
String reference, // Class name, file path, or inline SQL
Map<String, Object> config
) { }
RetryPolicy¶
public record RetryPolicy(
int maxAttempts, // Range: 1-10
Duration backoff,
String strategy // fixed, exponential, linear
) { }
StateKey¶
public record StateKey(
String tenancy,
String namespace,
String dataset,
String pipeline,
String businessDate,
String runId
) { }
Validation: All fields non-blank.
MetricsEnvelope¶
public record MetricsEnvelope(
String tenancy,
String namespace,
String dataset,
String pipeline,
String runId,
ExecutionMode executionMode,
String provider,
String stage,
String metricName, // max 128 characters
double metricValue,
CanonicalUnit metricUnit,
long timestamp, // UTC milliseconds
Map<String, String> dimensions // max 20 entries
) { }
LineageEvent¶
public record LineageEvent(
String sourceDataset,
String destinationDataset,
List<FieldMapping> fieldMappings,
String transformationReference,
String pipeline,
String runId,
String stage,
String timestamp,
String provider,
Map<String, Object> openLineageFacets
) { }
PatternOpsEvent¶
public record PatternOpsEvent(
String eventId,
String source,
String type,
String subject,
String time,
String dataContentType,
String dataSchema,
String tenancy,
String namespace,
String pipeline,
String runId,
String correlationId,
Object data
) { }
Validation: All fields except data must be non-blank.
PatternOpsError¶
public record PatternOpsError(
ErrorCategory category,
String message,
List<ErrorDetail> details,
boolean retryable,
String timestamp
) { }
ConfidenceScore¶
public record ConfidenceScore(
double overall, // Range: 0.0-1.0
Map<String, Double> components,
double threshold, // Range: 0.0-1.0
boolean humanReviewRequired
) { }
DataContract¶
public record DataContract(
String datasetName,
String owner,
Object schema,
List<Map<String, Object>> qualityExpectations,
List<Map<String, Object>> slaCommitments,
CompatibilityMode evolutionRules,
SemanticVersion version
) { }
SemanticVersion¶
Validation: All components non-negative. toString() returns "MAJOR.MINOR.PATCH".
StructuredLogEntry¶
public record StructuredLogEntry(
String timestamp,
LogLevel level,
String service,
String tenancy,
String namespace,
String pipeline,
String runId,
String correlationId,
String message
) { }
DistributionProfile¶
public record DistributionProfile(
String name,
ComputePlatformProfile targetPlatform,
List<String> requiredCapabilities,
List<String> requiredProviders,
List<String> excludedModules,
Map<String, Object> configDefaults
) { }
Immutability Guarantees¶
All records enforce immutability:
- Collections are defensive copies (
List.copyOf(),Map.copyOf()) - Mutating the original collection after construction has no effect
- Returned collections are unmodifiable (
UnsupportedOperationExceptionon mutation) - Optional fields default to
Optional.empty()when null is passed