use std::sync::Arc;
use indexmap::IndexMap;
use crate::expression::TemplateValue;
use crate::util::{Locale, Utf16String};
use super::{IWebApplication, IWebRequest, IWebSession};
pub trait IWebExchange: Send + Sync {
fn as_servlet_web_exchange(&self) -> Option<&dyn IWebExchange> {
None
}
fn get_request(&self) -> &dyn IWebRequest;
fn get_session(&self) -> Option<&dyn IWebSession>;
fn get_application(&self) -> &dyn IWebApplication;
fn has_session(&self) -> bool {
self.get_session().is_some_and(IWebSession::exists)
}
fn get_principal(&self) -> Option<Arc<TemplateValue>>;
fn get_locale(&self) -> Option<Locale>;
fn get_content_type(&self) -> Option<Utf16String>;
fn get_character_encoding(&self) -> Option<Utf16String>;
fn contains_attribute(&self, name: Option<&Utf16String>) -> bool;
fn get_attribute_count(&self) -> i32;
fn get_all_attribute_names(&self) -> Vec<Option<Utf16String>>;
fn get_attribute_map(&self) -> IndexMap<Option<Utf16String>, Option<Arc<TemplateValue>>>;
fn get_attribute_value(&self, name: Option<&Utf16String>) -> Option<Arc<TemplateValue>>;
fn set_attribute_value(&self, name: Option<Utf16String>, value: Option<Arc<TemplateValue>>);
fn remove_attribute(&self, name: Option<&Utf16String>);
fn transform_url(&self, url: Option<&Utf16String>) -> Option<Utf16String>;
}