from typing import Optional

from pip_services3_commons.config import IConfigurable, ConfigParams
from pip_services3_commons.refer import IReferenceable, IUnreferenceable, IReferences
from pip_services3_commons.run import IOpenable, IExecutable, INotifiable, ICleanable, Parameters


class MyComponent(IConfigurable, IReferenceable, IUnreferenceable, IOpenable, IExecutable, INotifiable, ICleanable):

    def __init__(self):
        """Initialize the component"""
    def configure(self, config: ConfigParams):
        """configure the component"""

    def set_references(self, references: IReferences):
        """set component dependencies"""

    def unset_references(self):
        """unset component references"""

    def is_open(self) -> bool:
        """return the component open state"""

    def open(self, correlation_id: Optional[str]):
        """open the component"""

    def close(self, correlation_id: Optional[str]):
        """close the component"""

    def execute(self, correlation_id: Optional[str], args: Parameters):
        """execute the component transaction"""

    def notify(self, correlation_id: Optional[str], args: Parameters):
        """notify the component about events"""

    def clear(self, correlation_id: Optional[str]):
        """clear the component state"""