通过XML入库操作 EsbmMessageProcessor 03

logger.debug("req_timestamp date format:" + req_timestamp);
long req_date = 0l;
if (req_timestamp == null || req_timestamp.trim().isEmpty())
{
req_date = System.currentTimeMillis();
}
else
{
req_date = Tools.stringFormatDate(req_timestamp).getTime();
}

logger.debug("rsp_timestamp date format:" + rsp_timestamp);
Date rsp_date = null;
if (rsp_timestamp == null || req_timestamp.trim().isEmpty())
{
rsp_date = new Date();
}
else
{
rsp_date = Tools.stringFormatDate(rsp_timestamp);
}

logger.debug("duration:" + (rsp_date.getTime() - req_date));
int duration = (int) (rsp_date.getTime() - req_date);

propertiesValue.put("duration", String.valueOf(duration));
// partition_id 是取响应时间月日,直接在代码存入不在properties文件中配置
propertiesValue.put("partition_id", Tools.getMMDD(rsp_date));

propertiesValue.put("seq_id", Tools.getSeq_id_DFX());

return propertiesValue;
}

/**
* 提供原始报文解析
*
* @param doc
* @param interfaceMap
* @return
*/
public static Map<String, String> getMatchValue(Document doc,
Map<Object, Object> interfaceMap)
{
return getMatchValue(doc, interfaceMap, null);
}

public static Map<String, String> getMatchValue(Document doc,
Map<Object, Object> interfaceMap, Map<Object, Object> namespaceMap)
{
XPath xPath = null;
Node node = null;
Iterator<Map.Entry<Object, Object>> iterator = interfaceMap.entrySet()
.iterator();
String value = null;
Map.Entry<Object, Object> entry = null;
String xpathStr = null;
Map<String, String> propertiesValue = new Hashtable<String, String>(
interfaceMap.size());
while (iterator.hasNext())
{
// 对应的数据库的字段
entry = iterator.next();
// 数据库字段对应的XPath 字符串
xpathStr = (String) entry.getValue();
if (null == xpathStr || xpathStr.trim().equals(""))
{
value = "";
}
else
{
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值