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

__author__ = '<NAME>'

from pyon.public import CFG, IonObject, log, RT, AT

from interface.services.coi.iexchange_management_service import BaseExchangeManagementService

class ExchangeManagementService(BaseExchangeManagementService):

    def create_exchange_space(self, xs=None, org_id=''):
        log.debug("create_exchange_space(%s, org_id=%s)" % (xs, org_id))
        self.assert_condition(xs and org_id, "Arguments not set")
        xs_id,rev = self.clients.resource_registry.create(xs)

        aid = self.clients.resource_registry.create_association(org_id, AT.hasExchangeSpace, xs_id)

        # Now do the work
        if xs.name == "ioncore":
            # Bottom turtle initialization
            pass
        else:
            # All other XS initialization
            pass
        
        return xs_id

    def update_exchange_space(self, xs=None):
        log.debug("update_exchange_space(%s)" % xs)
        xs_id,rev = self.clients.resource_registry.update(xs)
        return True

    def read_exchange_space(self, exchange_space_id=""):
        xs = self.clients.resource_registry.read(exchange_space_id)
        return xs

    def delete_exchange_space(self, exchange_space_id=""):
        raise NotImplementedError()

    def find_exchange_spaces(self, name='*'):
        raise NotImplementedError()


    def declare_exchange_name(exchange_name=None, exchange_space_id=''):
        res,rev = self.clients.resource_registry.create(exchange_name)

        aid = self.clients.resource_registry.create_association(exchange_space, AT.hasExchangeName, res)

        return res

    def undeclare_exchange_name(canonical_name='', exchange_space_id=''):
        raise NotImplementedError()

    def find_exchange_names(self, name='*'):
        raise NotImplementedError()

    def create_exchange_point(self, name=''):
        xp = IonObject(RT.ExchangePoint, dict(name=name))
        res,rev = self.clients.resource_registry.create(xp)

        #aid = self.clients.resource_registry.create_association(exchange_space, AT.hasExchangePoint, res)
        return res

    def update_exchange_point(self, exchange_point_id=''):
        raise NotImplementedError()

    def delete_exchange_point(self, exchange_point_id=''):
        raise NotImplementedError()

    def find_exchange_points(self, name='*'):
        raise NotImplementedError()
<commit_msg>fix service operation signatures - for now to defaults<commit_after>#!/usr/bin/env python

__author__ = '<NAME>'

from pyon.public import CFG, IonObject, log, RT, AT

from interface.services.coi.iexchange_management_service import BaseExchangeManagementService

class ExchangeManagementService(BaseExchangeManagementService):

    def create_exchange_space(self, xs={}, org_id=''):
        log.debug("create_exchange_space(%s, org_id=%s)" % (xs, org_id))
        self.assert_condition(xs and org_id, "Arguments not set")
        xs_id,rev = self.clients.resource_registry.create(xs)

        aid = self.clients.resource_registry.create_association(org_id, AT.hasExchangeSpace, xs_id)

        # Now do the work
        if xs.name == "ioncore":
            # Bottom turtle initialization
            pass
        else:
            # All other XS initialization
            pass
        
        return xs_id

    def update_exchange_space(self, xs={}):
        log.debug("update_exchange_space(%s)" % xs)
        xs_id,rev = self.clients.resource_registry.update(xs)
        return True

    def read_exchange_space(self, exchange_space_id=""):
        xs = self.clients.resource_registry.read(exchange_space_id)
        return xs

    def delete_exchange_space(self, exchange_space_id=""):
        raise NotImplementedError()

    def find_exchange_spaces(self, name='*'):
        raise NotImplementedError()


    def declare_exchange_name(exchange_name=None, exchange_space_id=''):
        res,rev = self.clients.resource_registry.create(exchange_name)

        aid = self.clients.resource_registry.create_association(exchange_space, AT.hasExchangeName, res)

        return res

    def undeclare_exchange_name(canonical_name='', exchange_space_id=''):
        raise NotImplementedError()

    def find_exchange_names(self, name='*'):
        raise NotImplementedError()

    def create_exchange_point(self, name=''):
        xp = IonObject(RT.ExchangePoint, dict(name=name))
        res,rev = self.clients.resource_registry.create(xp)

        #aid = self.clients.resource_registry.create_association(exchange_space, AT.hasExchangePoint, res)
        return res

    def update_exchange_point(self, exchange_point_id=''):
        raise NotImplementedError()

    def delete_exchange_point(self, exchange_point_id=''):
        raise NotImplementedError()

    def find_exchange_points(self, name='*'):
        raise NotImplementedError()

{'fraction_non_alphanumeric': 0.09969040247678018, 'fraction_numerical': 0.0, 'mean_word_length': 3.5205223880597014, 'pattern_counts': {'":': 2, '<': 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': '3932728', 'n_tokens_mistral': 1515, 'n_tokens_neox': 1387, 'n_words': 273}