MLPConnectorCoreExt.java 文件源码

java
阅读 15 收藏 0 点赞 0 评论 0

项目:CommonInformationSpace 作者:
/**
 * This method receives an Object (MLP as String) and forwards it to the CIS CIS Core
 * 
 * @param msg the MLP String
 * @throws InvalidObjectException when the String is not valid MLP
 */
public void notify(Object msg, Map<DEParameters, String> deParameters, boolean dontEnvelope) throws InvalidObjectException {
    log.info("--> notify");

    String msgStr = null;
    if (msg instanceof String) {
        msgStr = (String)msg;
        if (msgStr.startsWith("<?xml version")) {
            int idx = msgStr.indexOf("<svc_");
            if (idx != -1) {
                msgStr = msgStr.substring(idx);
            }
        }
    } else {
        throw new InvalidObjectException("Given Object is no valid MLP Message!");
    }

    try {
        CISXMLContent xmlCont = new CISXMLContent();
        xmlCont.setEmbeddedXMLContent(msgStr);
        restSender.notify(CoreConstants.MSGTYPE_MLP, xmlCont, null, false);
    } catch (CISCommunicationException | CISInvalidXMLObject e) {
        log.error("notify: " + e);
    }

    log.info("notify -->");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号