<commit_before>#!/usr/bin/env python

"""ION messaging endpoints"""

__author__ = '<NAME>'
__license__ = 'Apache 2.0'

from pyon.net.endpoint import ProcessRPCClient, ProcessRPCServer, Publisher, Subscriber
from pyon.public import CFG

class ProcessPublisher(Publisher):
    def __init__(self, process=None, **kwargs):
        self._process = process
        Publisher.__init__(self, **kwargs)

class EventPublisher(ProcessPublisher):
    """
    Class for process event publication - place holder
    """
    #XP = CFG.exchange_point


class StreamPublisher(ProcessPublisher):
    """
    Data management abstraction of EndPoint layer for publishing messages to a stream
    TODO: Could be an object that uses a publisher?
    """

    def __init__(self, stream_route, **kwargs):
        self._stream_route = stream_route

        ProcessPublisher.__init__(self, name=stream_route.exchange_name, **kwargs)
        # @TODO Cant distinguish my exchange name from the to_name in the endpoint layer. Need a concept of FROM

class StreamPublisherRegistrar(object):
    """
    A Data Management level object for creating a publisher for a stream
    This object manages registration of publishers for different streams and creates the abstracted endpoint with the
    publish method
    """

    def __init__(self, process):<commit_msg>added CFG entries for exchange names<commit_after>#!/usr/bin/env python

"""ION messaging endpoints"""

__author__ = '<NAME>'
__license__ = 'Apache 2.0'

from pyon.net.endpoint import ProcessRPCClient, ProcessRPCServer, Publisher, Subscriber
from pyon.public import CFG

class ProcessPublisher(Publisher):
    def __init__(self, process=None, **kwargs):
        self._process = process
        Publisher.__init__(self, **kwargs)

class EventPublisher(ProcessPublisher):
    """
    Class for process event publication - place holder
    """
    XS = CFG.exchanges.ioncore.name
    XP = CFG.exchanges.ioncore.exchange_points.events.name

class StreamPublisher(ProcessPublisher):
    """
    Data management abstraction of EndPoint layer for publishing messages to a stream
    TODO: Could be an object that uses a publisher?
    """

    XS = CFG.exchanges.ioncore.name
    XP = CFG.exchanges.ioncore.exchange_points.science_data.name

    def __init__(self, stream_route, **kwargs):
        self._stream_route = stream_route

        ProcessPublisher.__init__(self, name=stream_route.exchange_name, **kwargs)
        # @TODO Cant distinguish my exchange name from the to_name in the endpoint layer. Need a concept of FROM

class StreamPublisherRegistrar(object):
    """
    A Data Management level object for creating a publisher for a stream
    This object manages registration of publishers for different streams and creates the abstracted endpoint with the
    publish method
    """

    def __init__(self, process):
{'fraction_non_alphanumeric': 0.08023826208829712, 'fraction_numerical': 0.001401541695865452, 'mean_word_length': 3.9224137931034484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '312242', 'n_tokens_mistral': 802, 'n_tokens_neox': 735, 'n_words': 264}