# Path: monasca_notification/common/utils.py
# def get_db_repo():
#     repo_driver = CONF.database.repo_driver
#     LOG.debug('Enabling the %s RDB repository', repo_driver)
#     return repo_driver(CONF)
# 
# Path: monasca_notification/common/utils.py
# def get_statsd_client(dimensions=None):
#     local_dims = dimensions.copy() if dimensions else {}
#     local_dims.update(NOTIFICATION_DIMENSIONS)
#     if CONF.statsd.enable:
#         LOG.debug("Establishing connection with statsd on {0}:{1}"
#                   .format(CONF.statsd.host, CONF.statsd.port))
#         client = monascastatsd.Client(name='monasca',
#                                       host=CONF.statsd.host,
#                                       port=CONF.statsd.port,
#                                       dimensions=local_dims)
#     else:
#         LOG.warn("StatsD monitoring disabled. Overriding monascastatsd.Client to use it offline")
#         client = OfflineClient(name='monasca',
#                                host=CONF.statsd.host,
#                                port=CONF.statsd.port,
#                                dimensions=local_dims)
#     return client
# 
# Path: monasca_notification/types/notifiers.py
# CONF = cfg.CONF
# def init(statsd_obj):
# def load_plugins():
# def enabled_notifications():
# def config():
# def send_notifications(notifications):
# def send_single_notification(notification):


from oslo_log import log as logging
from monasca_notification.common.repositories import exceptions as exc
from monasca_notification.common.utils import get_db_repo
from monasca_notification.common.utils import get_statsd_client
from monasca_notification.types import notifiers
# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.



log = logging.getLogger(__name__)


class NotificationProcessor(object):

    def __init__(self):
        self.statsd = get_statsd_client()
        notifiers.init(self.statsd)

        notifiers.load_plugins()

# Path: monasca_notification/common/utils.py
# def get_db_repo():
#     repo_driver = CONF.database.repo_driver
#     LOG.debug('Enabling the %s RDB repository', repo_driver)
#     return repo_driver(CONF)
# 
# Path: monasca_notification/common/utils.py
# def get_statsd_client(dimensions=None):
#     local_dims = dimensions.copy() if dimensions else {}
#     local_dims.update(NOTIFICATION_DIMENSIONS)
#     if CONF.statsd.enable:
#         LOG.debug("Establishing connection with statsd on {0}:{1}"
#                   .format(CONF.statsd.host, CONF.statsd.port))
#         client = monascastatsd.Client(name='monasca',
#                                       host=CONF.statsd.host,
#                                       port=CONF.statsd.port,
#                                       dimensions=local_dims)
#     else:
#         LOG.warn("StatsD monitoring disabled. Overriding monascastatsd.Client to use it offline")
#         client = OfflineClient(name='monasca',
#                                host=CONF.statsd.host,
#                                port=CONF.statsd.port,
#                                dimensions=local_dims)
#     return client
# 
# Path: monasca_notification/types/notifiers.py
# CONF = cfg.CONF
# def init(statsd_obj):
# def load_plugins():
# def enabled_notifications():
# def config():
# def send_notifications(notifications):
# def send_single_notification(notification):


# Path: monasca_notification/processors/notification_processor.py
from oslo_log import log as logging
from monasca_notification.common.repositories import exceptions as exc
from monasca_notification.common.utils import get_db_repo
from monasca_notification.common.utils import get_statsd_client
from monasca_notification.types import notifiers

# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.



log = logging.getLogger(__name__)


class NotificationProcessor(object):

    def __init__(self):
        self.statsd = get_statsd_client()
        notifiers.init(self.statsd)

        notifiers.load_plugins()

        notifiers.config()