Esempio n. 1
0
SmartPtrCDiagRequestDoc DiagRequestXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DiagRequestXml", "parse");

	SmartPtrCDiagRequestDoc diagRequestDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string clientIdStrVal =
			thisXml->findRequiredAttribute("clientId");
		UUID clientIdVal = CAFCOMMON_GUID_NULL;
		if (! clientIdStrVal.empty()) {
			BasePlatform::UuidFromString(clientIdStrVal.c_str(), clientIdVal);
		}

		const std::string requestIdStrVal =
			thisXml->findRequiredAttribute("requestId");
		UUID requestIdVal = CAFCOMMON_GUID_NULL;
		if (! requestIdStrVal.empty()) {
			BasePlatform::UuidFromString(requestIdStrVal.c_str(), requestIdVal);
		}

		const std::string pmeIdVal =
			thisXml->findRequiredAttribute("pmeId");

		const SmartPtrCXmlElement requestHeaderXml =
			thisXml->findRequiredChild("requestHeader");

		SmartPtrCRequestHeaderDoc requestHeaderVal;
		if (! requestHeaderXml.IsNull()) {
			requestHeaderVal = RequestHeaderXml::parse(requestHeaderXml);
		}

		const SmartPtrCXmlElement batchXml =
			thisXml->findRequiredChild("batch");

		SmartPtrCDiagBatchDoc batchVal;
		if (! batchXml.IsNull()) {
			batchVal = DiagBatchXml::parse(batchXml);
		}

		diagRequestDoc.CreateInstance();
		diagRequestDoc->initialize(
			clientIdVal,
			requestIdVal,
			pmeIdVal,
			requestHeaderVal,
			batchVal);
	}
	CAF_CM_EXIT;

	return diagRequestDoc;
}
Esempio n. 2
0
SmartPtrCCmdlMetadataDoc CmdlMetadataXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("CmdlMetadataXml", "parse");

	SmartPtrCCmdlMetadataDoc cmdlMetadataDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const SmartPtrCXmlElement valueXml =
			thisXml->findRequiredChild("value");

		std::string valueVal;
		if (! valueXml.IsNull()) {
			valueVal = valueXml->getValue();
		}

		cmdlMetadataDoc.CreateInstance();
		cmdlMetadataDoc->initialize(
			nameVal,
			valueVal);
	}
	CAF_CM_EXIT;

	return cmdlMetadataDoc;
}
Esempio n. 3
0
SmartPtrCXmlElement CConfigProvider::findXmlElement(
	const std::deque<std::string>& keyPathCollection,
	const SmartPtrCXmlElement& rootXml) const {
	CAF_CM_FUNCNAME("findXmlElement");

	SmartPtrCXmlElement xmlRc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_STL(keyPathCollection);
		CAF_CM_VALIDATE_SMARTPTR(rootXml);

		xmlRc = rootXml;
		for (std::deque<std::string>::const_iterator keyPathIter = keyPathCollection.begin();
			keyPathIter != keyPathCollection.end();
			keyPathIter++) {
			const std::string keyPath = *keyPathIter;

			if (keyPathIter == keyPathCollection.begin()) {
				if (xmlRc->getName().compare(keyPath) != 0) {
					CAF_CM_EXCEPTIONEX_VA2(NoSuchElementException, ERROR_NOT_FOUND,
						"Root element does not match - %s != %s", keyPath.c_str(), xmlRc->getName().c_str());
				}
			} else {
				xmlRc = xmlRc->findRequiredChild(keyPath);
			}
		}
	}
	CAF_CM_EXIT;

	return xmlRc;
}
Esempio n. 4
0
SmartPtrCJoinTypeDoc JoinTypeXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("JoinTypeXml", "parse");

	SmartPtrCJoinTypeDoc joinTypeDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string operandStrVal =
			thisXml->findRequiredAttribute("operand");
		OPERATOR_TYPE operandVal = OPERATOR_NONE;
		if (! operandStrVal.empty()) {
			operandVal = EnumConvertersXml::convertStringToOperatorType(operandStrVal);
		}

		const SmartPtrCXmlElement dataClassLeftXml =
			thisXml->findRequiredChild("dataClassLeft");

		SmartPtrCClassFieldDoc dataClassLeftVal;
		if (! dataClassLeftXml.IsNull()) {
			dataClassLeftVal = ClassFieldXml::parse(dataClassLeftXml);
		}

		const SmartPtrCXmlElement dataClassRightXml =
			thisXml->findRequiredChild("dataClassRight");

		SmartPtrCClassFieldDoc dataClassRightVal;
		if (! dataClassRightXml.IsNull()) {
			dataClassRightVal = ClassFieldXml::parse(dataClassRightXml);
		}

		const std::string descriptionStrVal =
			thisXml->findOptionalAttribute("description");
		const std::string descriptionVal = descriptionStrVal;

		joinTypeDoc.CreateInstance();
		joinTypeDoc->initialize(
			operandVal,
			dataClassLeftVal,
			dataClassRightVal,
			descriptionVal);
	}
	CAF_CM_EXIT;

	return joinTypeDoc;
}
SmartPtrCProviderEventResponseDoc ProviderEventResponseXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ProviderEventResponseXml", "parse");

	SmartPtrCProviderEventResponseDoc providerEventResponseDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string pmeIdVal =
			thisXml->findRequiredAttribute("pmeId");

		const SmartPtrCXmlElement responseHeaderXml =
			thisXml->findOptionalChild("responseHeader");
		SmartPtrCResponseHeaderDoc responseHeaderVal;
		if (! responseHeaderXml.IsNull()) {
			responseHeaderVal = ResponseHeaderXml::parse(responseHeaderXml);
		}

		const SmartPtrCXmlElement manifestXml =
			thisXml->findRequiredChild("manifest");
		SmartPtrCEventManifestDoc manifestVal;
		if (! manifestXml.IsNull()) {
			manifestVal = EventManifestXml::parse(manifestXml);
		}

		const SmartPtrCXmlElement eventKeyCollectionXml =
			thisXml->findOptionalChild("eventKeyCollection");
		SmartPtrCEventKeyCollectionDoc eventKeyCollectionVal;
		if (! eventKeyCollectionXml.IsNull()) {
			eventKeyCollectionVal = EventKeyCollectionXml::parse(eventKeyCollectionXml);
		}

		const SmartPtrCXmlElement statisticsXml =
			thisXml->findOptionalChild("statistics");
		SmartPtrCStatisticsDoc statisticsVal;
		if (! statisticsXml.IsNull()) {
			statisticsVal = StatisticsXml::parse(statisticsXml);
		}

		providerEventResponseDoc.CreateInstance();
		providerEventResponseDoc->initialize(
			pmeIdVal,
			responseHeaderVal,
			manifestVal,
			eventKeyCollectionVal,
			statisticsVal);
	}
	CAF_CM_EXIT;

	return providerEventResponseDoc;
}
SmartPtrCSchemaSummaryDoc SchemaSummaryXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("SchemaSummaryXml", "parse");

	SmartPtrCSchemaSummaryDoc schemaSummaryDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string providerNamespaceStrVal =
			thisXml->findRequiredAttribute("providerNamespace");
		const std::string providerNamespaceVal = providerNamespaceStrVal;

		const std::string providerNameStrVal =
			thisXml->findRequiredAttribute("providerName");
		const std::string providerNameVal = providerNameStrVal;

		const std::string providerVersionStrVal =
			thisXml->findRequiredAttribute("providerVersion");
		const std::string providerVersionVal = providerVersionStrVal;

		const SmartPtrCXmlElement classCollectionXml =
			thisXml->findRequiredChild("classCollection");

		SmartPtrCClassCollectionDoc classCollectionVal;
		if (! classCollectionXml.IsNull()) {
			classCollectionVal = ClassCollectionXml::parse(classCollectionXml);
		}

		const std::string invokerPathStrVal =
			thisXml->findOptionalAttribute("invokerPath");
		const std::string invokerPathVal = invokerPathStrVal;

		schemaSummaryDoc.CreateInstance();
		schemaSummaryDoc->initialize(
			providerNamespaceVal,
			providerNameVal,
			providerVersionVal,
			classCollectionVal,
			invokerPathVal);
	}
	CAF_CM_EXIT;

	return schemaSummaryDoc;
}
SmartPtrCActionClassInstanceDoc ActionClassInstanceXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("ActionClassInstanceXml", "parse");

	SmartPtrCActionClassInstanceDoc actionClassInstanceDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string namespaceValStrVal =
			thisXml->findRequiredAttribute("namespace");
		const std::string namespaceValVal = namespaceValStrVal;

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string versionStrVal =
			thisXml->findRequiredAttribute("version");
		const std::string versionVal = versionStrVal;

		const SmartPtrCXmlElement instanceOperationCollectionXml =
			thisXml->findRequiredChild("instanceOperationCollection");

		SmartPtrCInstanceOperationCollectionDoc instanceOperationCollectionVal;
		if (! instanceOperationCollectionXml.IsNull()) {
			instanceOperationCollectionVal = InstanceOperationCollectionXml::parse(instanceOperationCollectionXml);
		}

		actionClassInstanceDoc.CreateInstance();
		actionClassInstanceDoc->initialize(
			namespaceValVal,
			nameVal,
			versionVal,
			instanceOperationCollectionVal);
	}
	CAF_CM_EXIT;

	return actionClassInstanceDoc;
}
SmartPtrCDiagDeleteValueDoc DiagDeleteValueXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("DiagDeleteValueXml", "parse");

	SmartPtrCDiagDeleteValueDoc diagDeleteValueDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string jobIdStrVal =
			thisXml->findRequiredAttribute("jobId");
		UUID jobIdVal = CAFCOMMON_GUID_NULL;
		if (! jobIdStrVal.empty()) {
			BasePlatform::UuidFromString(jobIdStrVal.c_str(), jobIdVal);
		}

		const std::string fileAliasStrVal =
			thisXml->findRequiredAttribute("fileAlias");
		const std::string fileAliasVal = fileAliasStrVal;

		const SmartPtrCXmlElement valueNameXml =
			thisXml->findRequiredChild("valueName");

		std::string valueNameVal;
		if (! valueNameXml.IsNull()) {
			valueNameVal = valueNameXml->getValue();
		}

		diagDeleteValueDoc.CreateInstance();
		diagDeleteValueDoc->initialize(
			jobIdVal,
			fileAliasVal,
			valueNameVal);
	}
	CAF_CM_EXIT;

	return diagDeleteValueDoc;
}
SmartPtrCLogicalRelationshipDoc LogicalRelationshipXml::parse(
	const SmartPtrCXmlElement thisXml) {
	CAF_CM_STATIC_FUNC_VALIDATE("LogicalRelationshipXml", "parse");

	SmartPtrCLogicalRelationshipDoc logicalRelationshipDoc;

	CAF_CM_ENTER {
		CAF_CM_VALIDATE_SMARTPTR(thisXml);

		const std::string namespaceValStrVal =
			thisXml->findRequiredAttribute("namespace");
		const std::string namespaceValVal = namespaceValStrVal;

		const std::string nameStrVal =
			thisXml->findRequiredAttribute("name");
		const std::string nameVal = nameStrVal;

		const std::string versionStrVal =
			thisXml->findRequiredAttribute("version");
		const std::string versionVal = versionStrVal;

		const std::string arityStrVal =
			thisXml->findRequiredAttribute("arity");
		ARITY_TYPE arityVal = ARITY_NONE;
		if (! arityStrVal.empty()) {
			arityVal = EnumConvertersXml::convertStringToArityType(arityStrVal);
		}

		const SmartPtrCXmlElement dataClassLeftXml =
			thisXml->findRequiredChild("dataClassLeft");

		SmartPtrCClassCardinalityDoc dataClassLeftVal;
		if (! dataClassLeftXml.IsNull()) {
			dataClassLeftVal = ClassCardinalityXml::parse(dataClassLeftXml);
		}

		const SmartPtrCXmlElement dataClassRightXml =
			thisXml->findRequiredChild("dataClassRight");

		SmartPtrCClassCardinalityDoc dataClassRightVal;
		if (! dataClassRightXml.IsNull()) {
			dataClassRightVal = ClassCardinalityXml::parse(dataClassRightXml);
		}

		const CXmlElement::SmartPtrCElementCollection joinChildrenXml =
			thisXml->findRequiredChildren("join");

		std::deque<SmartPtrCJoinTypeDoc> joinVal;
		if (! joinChildrenXml.IsNull() && ! joinChildrenXml->empty()) {
			for (TConstIterator<CXmlElement::CElementCollection> joinXmlIter(*joinChildrenXml);
				joinXmlIter; joinXmlIter++) {
				const SmartPtrCXmlElement joinXml = joinXmlIter->second;
				const SmartPtrCJoinTypeDoc joinDoc =
					JoinTypeXml::parse(joinXml);
				joinVal.push_back(joinDoc);
			}
		}

		const std::string descriptionStrVal =
			thisXml->findOptionalAttribute("description");
		const std::string descriptionVal = descriptionStrVal;

		logicalRelationshipDoc.CreateInstance();
		logicalRelationshipDoc->initialize(
			namespaceValVal,
			nameVal,
			versionVal,
			arityVal,
			dataClassLeftVal,
			dataClassRightVal,
			joinVal,
			descriptionVal);
	}
	CAF_CM_EXIT;

	return logicalRelationshipDoc;
}