@sap/dwf-generator
Version:
SAP HANA Data Warehousing Foundation - Generator
44 lines (37 loc) • 977 B
JavaScript
'use strict';
function GlobalNodes(ioDlmProfile) {
this.dlmProfile = ioDlmProfile;
this.nodes = ioDlmProfile.get('global.node');
this.dataStores = [];
this.rules = [];
this.sparkExists = false;
this.sortNodes();
}
GlobalNodes.prototype.sortNodes = function () {
for (let i in this.nodes) {
switch (this.nodes[i].type) {
case 'dataStore':
this.dataStores.push(this.nodes[i]);
if (this.nodes[i].dataStore.type == 'spark') {
this.sparkExists = true;
}
break;
case 'rule':
this.rules.push(this.nodes[i]);
break;
default:
console.error(`${this.nodes[i]} is not valid node`);
process.exit(1);
}
}
};
GlobalNodes.prototype.getDataStoreNodes = function () {
return this.dataStores;
};
GlobalNodes.prototype.getRuleNodes = function () {
return this.rules;
};
GlobalNodes.prototype.getNodes = function () {
return this.nodes;
};
module.exports = GlobalNodes;