qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1650338 - in /qpid/dispatch/trunk: include/qpid/dispatch/container.h python/qpid_dispatch/management/qdrouter.json python/qpid_dispatch_internal/management/agent.py src/container.c src/router_agent.c
Date Thu, 08 Jan 2015 17:22:11 GMT
Author: aconway
Date: Thu Jan  8 17:22:11 2015
New Revision: 1650338

URL: http://svn.apache.org/r1650338
Log:
DISPATCH-95: Use containerName for container managemenet identity.

- Use (configured or default) containerName for container managemenet identity.
- Add linkName and remoteContainer to router.link entity.

Modified:
    qpid/dispatch/trunk/include/qpid/dispatch/container.h
    qpid/dispatch/trunk/python/qpid_dispatch/management/qdrouter.json
    qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
    qpid/dispatch/trunk/src/container.c
    qpid/dispatch/trunk/src/router_agent.c

Modified: qpid/dispatch/trunk/include/qpid/dispatch/container.h
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/include/qpid/dispatch/container.h?rev=1650338&r1=1650337&r2=1650338&view=diff
==============================================================================
--- qpid/dispatch/trunk/include/qpid/dispatch/container.h (original)
+++ qpid/dispatch/trunk/include/qpid/dispatch/container.h Thu Jan  8 17:22:11 2015
@@ -157,6 +157,7 @@ void *qd_link_get_conn_context(qd_link_t
 
 qd_connection_t *qd_link_connection(qd_link_t *link);
 pn_link_t *qd_link_pn(qd_link_t *link);
+pn_session_t *qd_link_pn_session(qd_link_t *link);
 pn_terminus_t *qd_link_source(qd_link_t *link);
 pn_terminus_t *qd_link_target(qd_link_t *link);
 pn_terminus_t *qd_link_remote_source(qd_link_t *link);

Modified: qpid/dispatch/trunk/python/qpid_dispatch/management/qdrouter.json
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch/management/qdrouter.json?rev=1650338&r1=1650337&r2=1650338&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch/management/qdrouter.json (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch/management/qdrouter.json Thu Jan  8 17:22:11
2015
@@ -371,11 +371,13 @@
             "description": "Link to another AMQP endpoint: router node, client or other AMQP
process.",
             "extends": "operationalEntity",
             "attributes": {
+                "linkName": {"type": "String"},
                 "linkType": {"type": ["endpoint", "waypoint", "inter-router", "inter-area"]},
                 "linkDir": {"type": ["in", "out"]},
                 "owningAddr": {"type": "String"},
                 "eventFifoDepth": {"type": "Integer"},
-                "msgFifoDepth": {"type": "Integer"}
+                "msgFifoDepth": {"type": "Integer"},
+                "remoteContainer": {"type": "String"}
             }
         },
 

Modified: qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py?rev=1650338&r1=1650337&r2=1650338&view=diff
==============================================================================
--- qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py (original)
+++ qpid/dispatch/trunk/python/qpid_dispatch_internal/management/agent.py Thu Jan  8 17:22:11
2015
@@ -173,9 +173,13 @@ class AgentEntity(SchemaEntity):
         pass
 
 class ContainerEntity(AgentEntity):
+
     def create(self):
         self._qd.qd_dispatch_configure_container(self._dispatch, self)
 
+    def _identifier(self):
+        self.attributes.setdefault("containerName", "00000000-0000-0000-0000-000000000000")
+        return self.attributes["containerName"]
 
 class RouterEntity(AgentEntity):
     def __init__(self, agent, entity_type, attributes=None):

Modified: qpid/dispatch/trunk/src/container.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/container.c?rev=1650338&r1=1650337&r2=1650338&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/container.c (original)
+++ qpid/dispatch/trunk/src/container.c Thu Jan  8 17:22:11 2015
@@ -694,6 +694,11 @@ pn_link_t *qd_link_pn(qd_link_t *link)
     return link->pn_link;
 }
 
+pn_session_t *qd_link_pn_session(qd_link_t *link)
+{
+    return link->pn_sess;
+}
+
 
 qd_connection_t *qd_link_connection(qd_link_t *link)
 {

Modified: qpid/dispatch/trunk/src/router_agent.c
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/src/router_agent.c?rev=1650338&r1=1650337&r2=1650338&view=diff
==============================================================================
--- qpid/dispatch/trunk/src/router_agent.c (original)
+++ qpid/dispatch/trunk/src/router_agent.c Thu Jan  8 17:22:11 2015
@@ -103,18 +103,25 @@ static const char *qd_router_addr_text(q
     return addr ? (const char*)qd_hash_key_by_handle(addr->hash_handle) : NULL;
 }
 
+static const char* qd_router_link_remote_container(qd_router_link_t* link) {
+    return pn_connection_remote_container(
+        pn_session_connection(qd_link_pn_session(link->link)));
+}
+
+static const char* qd_router_link_name(qd_router_link_t* link) {
+    return pn_link_name(qd_link_pn(link->link));
+}
+
 qd_error_t qd_entity_refresh_router_link(qd_entity_t* entity, void *impl)
 {
     qd_router_link_t *link = (qd_router_link_t*) impl;
-    /* FIXME aconway 2014-10-17: old management used link->bit_mask as name/identity,
-     * but even when prefixed with router.link this is not unique. Let python agent
-     * generate a name for now. A better ID would be router.link:<remote container>.<link
name>.
-     */
     if (!qd_entity_set_string(entity, "linkType", qd_link_type_name(link->link_type))
&&
         !qd_entity_set_string(entity, "linkDir", (link->link_direction == QD_INCOMING)
? "in": "out") &&
+        !qd_entity_set_string(entity, "linkName", qd_router_link_name(link)) &&
         !qd_entity_set_string(entity, "owningAddr", qd_router_addr_text(link->owning_addr))
&&
         !qd_entity_set_long(entity, "eventFifoDepth", DEQ_SIZE(link->event_fifo)) &&
-        !qd_entity_set_long(entity, "msgFifoDepth", DEQ_SIZE(link->msg_fifo))
+        !qd_entity_set_long(entity, "msgFifoDepth", DEQ_SIZE(link->msg_fifo)) &&
+        !qd_entity_set_string(entity, "remoteContainer", qd_router_link_remote_container(link))
     )
         return QD_ERROR_NONE;
     return qd_error_code();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message