/** * Create an instance of {@link AddStatisticalDataRequestMsg } * */ public AddStatisticalDataRequestMsg createAddStatisticalDataRequestMsg() { return new AddStatisticalDataRequestMsg(); }
ps.executeUpdate(); ps.close(); AddStatisticalDataRequestMsg req = new AddStatisticalDataRequestMsg(); Map currenttopics = new HashMap(); while (iterator.hasNext()) { currenttopics.put(n.getCanonicalName(), QueueDepth); req.getData().add(updateData(modifiedurl, name, bigname, MessageCount, RecievedMessageCount, ConsumerCount, ActiveConsumerCount, QueueDepth, ExchangeType, 0, 0, 0, 0, perfcon)); req.setAgentType(AGENT); req.setBrokerURI(modifiedurl); req.setBrokerHostname(p.getMachineName()); req.setDomain(p.getDomainName()); req.setClassification(SLACommon.GetClassLevel(pooled)); req.setOperationalStatus(ok); req.setOperationalStatusMessage(status); SLACommon.ProcessStatisticalSLARules(req, pooled); c.close();
Utility.validateClassification(req.getClassification()); if (Utility.stringIsNullOrEmpty(req.getAgentType())) { throw new IllegalArgumentException("A agent type must be specified"); if (Utility.stringIsNullOrEmpty(req.getBrokerURI())) { throw new IllegalArgumentException("A uri must be specified"); if (Utility.stringIsNullOrEmpty(req.getBrokerHostname())) { throw new IllegalArgumentException("A hostname must be specified"); AuditLogger.logItem(this.getClass().getCanonicalName(), "addStatisticalData", currentUser, "uri=" + req.getBrokerURI() + " " + req.getAgentType(), req.getClassification(), ctx.getMessageContext()); UserIdentityUtil.assertAgentRole(currentUser, "addStatisticalData", req.getClassification(), ctx); if (!agents.containsKey(req.getAgentType())) { agents.put(req.getAgentType(), true); try { com = config.prepareStatement("INSERT INTO agents(agenttype) VALUES (?)"); com.setString(1, req.getAgentType()); com.execute(); com.close(); AuxHelper.CheckStatisticalPolicyAndCreate(req.getBrokerURI(), config, true, AuxHelper.UNSPECIFIED, req.getBrokerHostname()); } catch (Exception ex) { log.log(Level.DEBUG, null, ex); AuxHelper.TryUpdateStatus(req.isOperationalStatus(), req.getBrokerURI(), req.getOperationalStatusMessage(), true, PolicyType.STATISTICAL, "unspecified", req.getBrokerHostname()); com.setString(1, req.getBrokerURI());
if (cast != null && cast.CheckTransactionalRule(req.getBrokerURI(), req.getData(), x.getParameterNameValue(), f)) { alertType.set(cast.GetType()); outFaultMsg.set(f.get() + " " + outFaultMsg.get());
SetupBundle(); if (pooled) { pol = LoadPolicyPooled(req.getBrokerURI()); } else { pol = LoadPolicyNotPooled(req.getBrokerURI()); if (processStatisticalSLARulesRecursive(req, pooled, pol.getServiceLevelAggrements().getSLA().get(i).getRule(), ref, alertType)) { String id = UUID.randomUUID().toString(); RecordSLAFault(new AtomicReference<String>(ref.get()), req.getBrokerURI(), null, System.currentTimeMillis(), id, pooled); ProcessAlerts(ref.get(), Utility.encodeHTML(ref.get()), req.getBrokerURI(), null, System.currentTimeMillis(), id, pooled, false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, alertType.get());
req.setClassification(cfg.classlevel); int retrycount = 0; int urlcount = 0;