示例#1
0
文件: topic.py 项目: lulzzz/zato
    def handle(self):
        with closing(self.odb.session()) as session:
            topic = pubsub_topic(session, self.request.input.cluster_id, self.request.input.id)

        if topic.last_pub_time:
            topic.last_pub_time = datetime_from_ms(topic.last_pub_time)

        self.response.payload = topic
示例#2
0
def broker_message_hook(self, input, instance, attrs, service_type):
    if service_type == 'create_edit':
        with closing(self.odb.session()) as session:
            topic = pubsub_topic(session, input.cluster_id, instance.id)
            input.is_internal = topic.is_internal
            input.max_depth_gd = topic.max_depth_gd
            input.max_depth_non_gd = topic.max_depth_non_gd
            input.hook_service_id = topic.hook_service_id
            input.hook_service_name = topic.hook_service_name
示例#3
0
文件: topic.py 项目: HarshCasper/zato
    def handle(self):
        with closing(self.odb.session()) as session:
            topic = pubsub_topic(session, self.request.input.cluster_id, self.request.input.id)
            topic['current_depth_gd'] = get_gd_depth_topic(session, self.request.input.cluster_id, self.request.input.id)

        last_data = get_last_pub_data(self.kvdb.conn, self.server.cluster_id, self.request.input.id)
        if last_data:
            topic['last_pub_time'] = last_data['pub_time']

        self.response.payload = topic