Ejemplo n.º 1
0
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     caller.send(target, req_msg.to_xml())
Ejemplo n.º 2
0
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service,
                                   params)
     caller.send(target, req_msg.to_xml())
Ejemplo n.º 3
0
 def call(self, target, params, timeout=300, reverse=False):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target, reverse)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     ret = caller.call(target, req_msg.to_xml(), timeout)
     resp_parser = XmlResponseParser()
     return resp_parser.parse(ret)
Ejemplo n.º 4
0
 def call(self, target, params, timeout=300, reverse=False):
     target, category, service = self.parse_target(target)
     caller = self.choose_caller(target, reverse)
     if caller is None:
         raise Exception("Cannot connect to %s" % target)
     req_msg = XmlRequestGenerator(self.configuration, category, service,
                                   params)
     ret = caller.call(target, req_msg.to_xml(), timeout)
     resp_parser = XmlResponseParser()
     return resp_parser.parse(ret)
Ejemplo n.º 5
0
    def call(self, target, params, timeout=300):
        target, category, service = self.parse_target(target)
        if target == self.configuration.node_name:
            raise Exception("Target is self, cannot do RPC %s.%s.%s" % (target, category, service))

        if not self.ping(target):
            raise Exception("Cannot connect to %s" % target)
        caller = self.get_caller()
        req_msg = XmlRequestGenerator(self.configuration, category, service, params)
        ret = caller.call(target, req_msg.to_xml(), timeout)
        resp_parser = XmlResponseParser()
        return resp_parser.parse(ret)
Ejemplo n.º 6
0
 def send(self, target, params):
     target, category, service = self.parse_target(target)
     caller = self.get_caller()
     req_msg = XmlRequestGenerator(self.configuration, category, service, params)
     caller.send(target, req_msg.to_xml())