"""Definition of ConnectionAwareInterface abstract base class.""" from abc import ABC, abstractmethod class ConnectionAwareInterface(ABC): """Interface that defines connection-related methods.""" @abstractmethod def connect(self) -> None: """Connect to resource. Implementations should be idempotent: calling connect while already connected and healthy is a no-op. """ ... @abstractmethod def disconnect(self) -> None: """Disconnect from resource.""" ... @abstractmethod def is_connected(self) -> bool: """Return whether the adapter has an active, reachable connection. Implementations may perform a cached network probe to verify liveness. """ ...