aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src-tauri/src/core/java/provider.rs
blob: 1b7968119a9773f1af9cad280b72ec7c91e1c865 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use crate::core::java::{ImageType, JavaCatalog, JavaDownloadInfo};
use tauri::AppHandle;

pub trait JavaProvider: Send + Sync {
    /// Fetch the Java catalog (all available versions for this provider)
    async fn fetch_catalog(
        &self,
        app_handle: &AppHandle,
        force_refresh: bool,
    ) -> Result<JavaCatalog, String>;

    /// Fetch a specific Java release
    async fn fetch_release(
        &self,
        major_version: u32,
        image_type: ImageType,
    ) -> Result<JavaDownloadInfo, String>;

    /// Get list of available major versions
    async fn available_versions(&self) -> Result<Vec<u32>, String>;

    /// Get provider name (e.g., "adoptium", "corretto")
    #[allow(dead_code)]
    fn provider_name(&self) -> &'static str;

    /// Get OS name for this provider's API
    fn os_name(&self) -> &'static str;

    /// Get architecture name for this provider's API
    fn arch_name(&self) -> &'static str;

    /// Get installation directory prefix (e.g., "temurin", "corretto")
    fn install_prefix(&self) -> &'static str;
}