use ockam::identity::Identifier;
use ockam_core::async_trait;
use ockam_core::Result;
use crate::cli_state::NodeInfo;
use crate::config::lookup::InternetAddress;
#[async_trait]
pub trait NodesRepository: Send + Sync + 'static {
async fn store_node(&self, node_info: &NodeInfo) -> Result<()>;
async fn get_nodes(&self) -> Result<Vec<NodeInfo>>;
async fn get_node(&self, node_name: &str) -> Result<Option<NodeInfo>>;
async fn get_nodes_by_identifier(&self, identifier: &Identifier) -> Result<Vec<NodeInfo>>;
async fn get_default_node(&self) -> Result<Option<NodeInfo>>;
async fn set_default_node(&self, node_name: &str) -> Result<()>;
async fn is_default_node(&self, node_name: &str) -> Result<bool>;
async fn delete_node(&self, node_name: &str) -> Result<()>;
async fn set_tcp_listener_address(&self, node_name: &str, address: &str) -> Result<()>;
async fn set_as_authority_node(&self, node_name: &str) -> Result<()>;
async fn get_tcp_listener_address(&self, node_name: &str) -> Result<Option<InternetAddress>>;
async fn set_node_pid(&self, node_name: &str, pid: u32) -> Result<()>;
async fn set_no_node_pid(&self, node_name: &str) -> Result<()>;
async fn set_node_project_name(&self, node_name: &str, project_name: &str) -> Result<()>;
async fn get_node_project_name(&self, node_name: &str) -> Result<Option<String>>;
}