/** * Create an instance of {@link BrokerData } * */ public BrokerData createBrokerData() { return new BrokerData(); }
final long QueueDepth, final String ExchangeType, final long bytesin, final long bytesout, final long bytesdrop, final long MessageDropCount, final Connection perf) { BrokerData bd = new BrokerData(); bd.setActiveConsumers(QueueDepth); bd.setQueueOrTopicCanonicalName(bigname); bd.setQueueOrTopicName(name); bd.setMessagesIn(RecievedMessageCount); bd.setMessagesDropped(MessageDropCount); bd.setDepth(QueueDepth); bd.setActiveConsumers(ActiveConsumerCount); bd.setBytesDropped(bytesdrop); bd.setBytesIn(bytesin); bd.setBytesOut(bytesout); bd.setItemType(ExchangeType); bd.setMessagesOut(MessageCount); bd.setTotalConsumers(ConsumerCount); if (!Utility.stringIsNullOrEmpty(name)) { try {
com.execute(); for (int i = 0; i < req.getData().size(); i++) { updateBrokerData(req.getBrokerURI(), req.getData().get(i).getQueueOrTopicName(), req.getData().get(i).getQueueOrTopicCanonicalName(), req.getData().get(i).getMessagesOut(), req.getData().get(i).getMessagesIn(), req.getData().get(i).getTotalConsumers(), req.getData().get(i).getActiveConsumers(), req.getData().get(i).getDepth(), req.getData().get(i).getItemType(), req.getData().get(i).getBytesIn(), req.getData().get(i).getBytesOut(), req.getData().get(i).getBytesDropped(), req.getData().get(i).getMessagesDropped(), con, req.getAgentType());
@Override public boolean CheckTransactionalRule(String url, List<BrokerData> data, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair val = Utility.getNameValuePairByName(params, "value"); long value = 0; if (val.isEncrypted()) { value = Long.parseLong(Utility.DE(val.getValue())); } else { value = Long.parseLong(val.getValue()); } StringBuilder msg = new StringBuilder(); for (int i = 0; i < data.size(); i++) { if (data.get(i).getDepth() > value) { msg.append("The queue named ").append(data.get(i).getQueueOrTopicName()).append(" has a queue size of "). append(data.get(i).getDepth()).append(" which is greater than the SLA parameter of ").append(value).append(". "); } } String s = msg.toString(); if (Utility.stringIsNullOrEmpty(s)) { return false; } else { nullableFaultMsg.set(s + "," + nullableFaultMsg.get()); return true; } }
@Override public boolean CheckTransactionalRule(String url, List<BrokerData> data, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg) { if (nullableFaultMsg == null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair val = Utility.getNameValuePairByName(params, "value"); String value = null; if (val.isEncrypted()) { value = (Utility.DE(val.getValue())); } else { value = (val.getValue()); } StringBuilder msg = new StringBuilder(); for (int i = 0; i < data.size(); i++) { if (data.get(i).getQueueOrTopicCanonicalName().equalsIgnoreCase(value)) { return false; } } msg.append("The queue or topic named ").append(value).append(" does not exist!"); String s = msg.toString(); if (Utility.stringIsNullOrEmpty(s)) { return false; } else { nullableFaultMsg.set(s + "," + nullableFaultMsg.get()); return true; } }