use std::sync::Arc;
use async_trait::async_trait;
use camel_api::{BoxProcessor, CamelError, RuntimeCommand, RuntimeCommandResult, StepLifecycle};
use crate::lifecycle::application::route_definition::RouteDefinition;
use crate::lifecycle::domain::CompiledPipeline;
use crate::lifecycle::domain::route_compilation::PreparedRoute;
#[cfg_attr(not(test), allow(dead_code))]
pub(crate) trait ReloadIntrospectionPort: Send + Sync {
fn route_ids(&self) -> Vec<String>;
fn route_from_uri(&self, route_id: &str) -> Option<String>;
fn route_source_hash(&self, route_id: &str) -> Option<u64>;
}
#[async_trait]
pub(crate) trait ReloadExecutorPort: Send + Sync {
async fn add_route_definition(&self, definition: RouteDefinition) -> Result<(), CamelError>;
async fn compile_route_definition_pipeline(
&self,
definition: RouteDefinition,
generation: u64,
) -> Result<CompiledPipeline, CamelError>;
async fn compile_route_definition_dry_pipeline(
&self,
definition: RouteDefinition,
) -> Result<CompiledPipeline, CamelError>;
async fn prepare_route_definition_with_generation(
&self,
definition: RouteDefinition,
generation: u64,
) -> Result<PreparedRoute, CamelError>;
async fn insert_prepared_route(&self, prepared: PreparedRoute) -> Result<(), CamelError>;
async fn discard_prepared_staging(&self, route_id: &str) -> Result<(), CamelError>;
async fn remove_route_preserving_functions(&self, route_id: String) -> Result<(), CamelError>;
async fn register_route_aggregate(&self, route_id: String) -> Result<(), CamelError>;
async fn swap_route_pipeline(
&self,
route_id: &str,
pipeline: BoxProcessor,
) -> Result<(), CamelError>;
async fn stop_route_reload(&self, route_id: &str) -> Result<(), CamelError>;
async fn start_route_reload(&self, route_id: &str) -> Result<(), CamelError>;
async fn swap_route_pipeline_raw(
&self,
route_id: &str,
pipeline: BoxProcessor,
lifecycle: Vec<Arc<dyn StepLifecycle>>,
) -> Result<(), CamelError>;
async fn execute_runtime_command(
&self,
cmd: RuntimeCommand,
) -> Result<RuntimeCommandResult, CamelError>;
async fn runtime_route_status(&self, route_id: &str) -> Result<Option<String>, CamelError>;
async fn in_flight_count(&self, route_id: &str) -> Result<u64, CamelError>;
async fn route_has_lifecycle(&self, route_id: &str) -> bool;
#[cfg(test)]
fn take_test_lifecycle_inject(&self) -> Option<Vec<Arc<dyn StepLifecycle>>>;
}