in broker-plugins/management-http/src/main/java/resources/js/qpid/management/Queue.js [280:452]
function QueueUpdater(tabObject)
{
var that = this;
this.management = tabObject.management;
this.controller = tabObject.controller;
this.modelObj = tabObject.modelObj;
this.tabObject = tabObject;
this.contentPane = tabObject.contentPane;
var containerNode = tabObject.contentPane.containerNode;
function findNode(name)
{
return query("." + name, containerNode)[0];
}
function storeNodes(names)
{
for (var i = 0; i < names.length; i++)
{
that[names[i]] = findNode(names[i]);
}
}
this.queueStatisticsNode = findNode("queueStatistics");
storeNodes(["name",
"state",
"durable",
"messageDurability",
"maximumMessageTtl",
"minimumMessageTtl",
"exclusive",
"owner",
"lifetimePolicy",
"overflowPolicy",
"maximumQueueDepth",
"maximumQueueDepthBytes",
"maximumQueueDepthBytesUnits",
"maximumQueueDepthMessages",
"type",
"typeQualifier",
"alertRepeatGap",
"alertRepeatGapUnits",
"alertThresholdMessageAge",
"alertThresholdMessageAgeUnits",
"alertThresholdMessageSize",
"alertThresholdMessageSizeUnits",
"alertThresholdQueueDepthBytes",
"alertThresholdQueueDepthBytesUnits",
"alertThresholdQueueDepthMessages",
"alternateBinding",
"messageGroups",
"messageGroupKeyOverride",
"messageGroupType",
"maximumDeliveryAttempts",
"holdOnPublishEnabled"]);
that.queueData = {};
that.bindingsGrid = new UpdatableStore([], findNode("bindings"), [{
name: "Binding Key",
field: "bindingKey",
width: "60%"
}, {
name: "Arguments",
field: "arguments",
width: "40%",
formatter: function (args)
{
return args ? json.stringify(args) : "";
}
}]);
this.consumersGrid = new QueryGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: lang.hitch(this, this._transformConsumerData),
management: this.management,
parentObject: this.modelObj,
category: "Consumer",
selectClause: "id, name, distributionMode, "
+ "session.$parent.id AS connectionId, session.$parent.name AS connectionName, session.$parent.principal AS connectionPrincipal,"
+ "messagesOut, bytesOut, unacknowledgedMessages, unacknowledgedBytes",
where: "to_string($parent.id) = '" + this.modelObj.id + "'",
orderBy: "name",
columns: [{
label: "Name",
field: "name"
}, {
label: "Mode",
field: "distributionMode"
}, {
label: "Connection",
field: "connectionName"
},{
label: "User",
field: "connectionPrincipal"
}, {
label: "Unacknowledged (msgs)",
field: "unacknowledgedMessages"
}, {
label: "Unacknowledged (bytes)",
field: "unacknowledgedBytes",
formatter: formatter.formatBytes
}, {
label: "Msgs Rate",
field: "msgOutRate"
}, {
label: "Bytes Rate",
field: "bytesOutRate"
}
]
}, findNode("consumers"));
this.consumersGrid.on('rowBrowsed',
lang.hitch(this, function(event)
{
var connectionId = this.consumersGrid.row(event.id).data.connectionId;
this.controller.showById(connectionId);
}));
this.consumersGrid.startup();
this.producersGrid = new QueryGrid({
detectChanges: true,
rowsPerPage: 10,
transformer: lang.hitch(this, this._transformProducerData),
management: this.management,
parentObject: this.modelObj,
category: "Producer",
selectClause: "id, name, deliveryType, destinationType, destination, destinationId, messagesOut, bytesOut",
where: "to_string(destinationId) = '" + this.modelObj.id + "'",
orderBy: "name",
columns: [{
label: "Name",
field: "name"
}, {
label: "Delivery Type",
field: "deliveryType"
}, {
label: "Destination Type",
field: "destinationType"
}, {
label: "Destination Name",
field: "destination"
}, {
label: "Msgs Out",
field: "messagesOut"
}, {
label: "Bytes Out",
field: "bytesOut",
formatter: formatter.formatBytes
}, {
label: "Msgs Rate",
field: "msgOutRate"
}, {
label: "Bytes Rate",
field: "bytesOutRate"
}
]
}, findNode("producers"));
this.producersGrid.startup();
// Add onShow handler to work around an issue with not rendering of grid columns before first update.
// It seems if dgrid is created when tab is not shown (not active) the grid columns are not rendered.
this.contentPane.on("show",
function()
{
that.consumersGrid.resize();
that.producersGrid.resize();
});
this._messagesGrid = this._buildMessagesGrid(findNode);
}