from abc import ABCMeta, abstractmethod

from typing import List

from ._Event import Event
from ._Message import Message
from ._SubscriptionInfo import SubscriptionInfo


class MessageBus(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def publish_event(self, event):
        # type: (Event) -> Message
        raise NotImplementedError()

    @abstractmethod
    def send_message(self, component, message):
        # type: (str, Message) -> Message
        raise NotImplementedError()

    @abstractmethod
    def subscribe(self, subscriptions):
        # type: (List[SubscriptionInfo]) -> None
        raise NotImplementedError()

    @abstractmethod
    def reply_message(self, message, reply_message):
        # type: (Message, Message) -> None
        raise NotImplementedError()

    @abstractmethod
    def reply_event(self, event, reply_message):
        # type: (Event, Message) -> None
        raise NotImplementedError()
