DRDE/ACTK1_0/se/LPE/LPChkRespExtension.cpp

46 lines
1.0 KiB
C++
Raw Normal View History

2014-01-25 17:30:04 +00:00
#include "xml/XMLDocument.hpp"
#include "se/Response.hpp"
#include "se/ResponseExtension.hpp"
#include "se/LPE/LPChkRespExtension.hpp"
2014-01-27 03:33:17 +00:00
#include <xalanc/XalanDOM/XalanNamedNodeMap.hpp>
#include <xalanc/XalanDOM/XalanDOMString.hpp>
extern mdLogger mdLog;
2014-01-25 17:30:04 +00:00
2014-01-27 17:24:42 +00:00
XALAN_USING_XALAN(XalanDOMString)
2014-01-25 17:30:04 +00:00
/*
* Have to use static funcion instead of static variable
* since there is not guarantee about the construct/destruct
* order of a static instance of any types
*/
2014-01-27 03:33:17 +00:00
const std::string LPChkRespExtension::CKCLAIM_EXPR()
2014-01-25 17:30:04 +00:00
{
2014-01-27 17:24:42 +00:00
return EXTENSION_EXPR() + "//launch:name@exists";
2014-01-25 17:30:04 +00:00
}
2014-01-27 17:24:42 +00:00
LPChkRespExtension::LPChkRespExtension() : typeIsClaims(true), initialised(false)
2014-01-25 17:30:04 +00:00
{
}
void LPChkRespExtension::fromXML(XMLDocument *xmlDoc)
{
2014-01-27 17:24:42 +00:00
const std::string respElement = CKCLAIM_EXPR();
const XalanNode * responSE = xmlDoc->getElement(respElement);
const XalanDOMString respValue("false");
2014-01-27 04:02:34 +00:00
2014-01-27 17:24:42 +00:00
initialised = true;
2014-01-27 04:02:34 +00:00
if (!responSE) {
mdLog.logN(0,"Parse error in LPChkResponse");
}
else {
2014-01-27 17:24:42 +00:00
if (responSE->getNodeValue().compare(respValue) != 0)
response = true;
2014-01-27 04:02:34 +00:00
}
2014-01-25 17:30:04 +00:00
}