from abc import abstractmethod
from logging import getLogger
from typing import Dict, Optional

from messagehandler import MessageHandler
from messagehandler import MessageHandlerBuilder
from messagebus import Message, Event

logger = getLogger(__name__)


class CommonMessageHandlerBuilder(MessageHandlerBuilder):
    def __init__(self, device_configurations):
        # type: (Dict[unicode, unicode]) -> None

        self.device_configurations = device_configurations

    def build_singletons(self):
        # type: () -> None

        return

    @abstractmethod
    def build_message_handler(self, message=None, event=None):
        # type: (Optional[Message], Optional[Event]) -> MessageHandler

        raise NotImplementedError()

    def destroy_message_handler(self, message_handler):
        # type: (MessageHandler) -> None

        return

    def destroy_singletons(self):
        # type: () -> None

        return
