告警规约算法 RealTimeAlarm 02

告警规则算法 RealTimeAlarm 02
doc=NotifyRequestDocument.Factory.newInstance();
                NotifyRequest notifyRequest=doc.addNewNotifyRequest();
                Header header=notifyRequest.addNewHeader();
                Body body=notifyRequest.addNewBody();
                header.setBrand(values.get("brand"));
                header.setSubBrand(values.get("subbrand"));
                header.setChannel(values.get("channel"));
                header.setTenantId(values.get("tenantid"));
                header.setHostName(values.get("host_name"));
               
                body.setAdapter(values.get("adapter"));
                body.setBusinessName(values.get("servicename"));
                body.setDuration(values.get("duration"));
                body.setFromSystem(values.get("fromsystem"));
                body.setNotifier(values.get("notifier"));
                body.setOccurTime(values.get("occurtime"));
                body.setRetCode(values.get("retcode"));
                body.setRetDesc(values.get("resdesc"));
                body.setRuleId(values.get("ruleid"));
                body.setServiceKey(values.get("servicekey"));
                body.setToSystem(values.get("tosystem"));
                body.setTrackingId(values.get("esb_tracking_id"));
              
                logger.debug("The real time message is NotifyRequestDocument xml: "
                        + doc.toString());
               
                stup=new EsbmIntfServiceStub(Tools.getENDPOINT());
                ResultHeaderDocument response=stup.notify(doc);
                response.getResultHeader().getRetCode();
                if(logger.isInfoEnabled())
                {
                    StringBuffer strBuffer=new StringBuffer(50);
                    strBuffer.append("Send a message to ESBM for real time alarm, Ruleid:")
                             .append(ruleid)
                             .append(" and esbm response code is: ")
                             .append(response.getResultHeader().getRetCode());
                    logger.info("The result of send real time message: "+response.toString());
                   
                }
         
            }
            catch (Exception e)
            {
                logger.error(
                        "send message to ESBM is fail endpoint:"
                                + Tools.getENDPOINT() + doc.toString(), e);
            }
        }
    }
}