from abc import ABC, abstractmethod
from typing import List, Dict, Any, Optional

class VulnerabilityChecker(ABC):
    """
    Abstract base class for vulnerability checkers.
    This interface allows for plugging in different vulnerability checking services.
    """
    
    @abstractmethod
    def check_cms_vulnerabilities(self, cms_name: str, version: str) -> List[Dict[str, Any]]:
        """
        Check vulnerabilities for a CMS version.
        
        Args:
            cms_name (str): Name of the CMS (e.g., "WordPress", "Drupal").
            version (str): Version number of the CMS.
            
        Returns:
            List[Dict[str, Any]]: List of vulnerability information.
        """
        pass
    
    @abstractmethod
    def check_webserver_vulnerabilities(self, server_name: str, version: str) -> List[Dict[str, Any]]:
        """
        Check vulnerabilities for a web server version.
        
        Args:
            server_name (str): Name of the web server (e.g., "Apache", "Nginx").
            version (str): Version number of the web server.
            
        Returns:
            List[Dict[str, Any]]: List of vulnerability information.
        """
        pass
    
    @abstractmethod
    def get_vulnerability_summary(self, vulnerabilities: List[Dict[str, Any]]) -> Dict[str, Any]:
        """
        Generate a summary of vulnerabilities.
        
        Args:
            vulnerabilities (List[Dict[str, Any]]): List of vulnerability information.
            
        Returns:
            Dict[str, Any]: Summary information including counts by severity,
                            exploitability, and other relevant metrics.
        """
        pass
    
    @classmethod
    def create_empty_summary(cls) -> Dict[str, Any]:
        """
        Create an empty vulnerability summary.
        
        Returns:
            Dict[str, Any]: Empty summary with zero counts.
        """
        return {
            "total": 0,
            "critical": 0,
            "high": 0,
            "medium": 0,
            "low": 0,
            "exploitable": 0,
            "has_vulnerabilities": False,
            "highest_severity": "none",
        }