from abc import (
    ABCMeta,
    abstractmethod,
)
from typing import Any

from messagebus import Message


class MessageProcessorCallback(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def process_begun(self, processor_name, request_id, message):
        # type: (str, str, Message) -> None
        raise NotImplementedError()

    @abstractmethod
    def input_parsed(self, processor_name, request_id, input_obj):
        # type: (str, str, Any) -> None
        raise NotImplementedError()

    @abstractmethod
    def business_called(self, processor_name, request_id, input_obj, output_obj):
        # type: (str, str, Any, Any) -> None
        raise NotImplementedError()

    @abstractmethod
    def process_finished(self, processor_name, request_id, input_obj, output_obj):
        # type: (str, str, Any, Exception) -> None
        raise NotImplementedError()

    @abstractmethod
    def parse_exception(self, event_name, request_id, message, exception):
        # type: (str, str, Message, Exception) -> None
        raise NotImplementedError()

    @abstractmethod
    def unhandled_exception(self, event_name, request_id, input_obj, exception):
        # type: (str, str, Any, Exception) -> None
        raise NotImplementedError()
