Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/controllers/BasicServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const onfAttributes = require('onf-core-model-ap/applicationPattern/onfModel/con
const LogicalTerminationPoint = require('onf-core-model-ap/applicationPattern/onfModel/models/LogicalTerminationPoint');
const metadataTableUpdateStartModule = require('../service/individualServices/CyclicProcessService/metaDataTableCyclicProcess.js')
const tcpClientInterface = require('onf-core-model-ap/applicationPattern/onfModel/models/layerProtocols/TcpClientInterface');
let kafkaConnection = require('../service/individualServices/KafkaHandler');
const forwardingDomain = require('onf-core-model-ap/applicationPattern/onfModel/models/ForwardingDomain');


const NEW_RELEASE_FORWARDING_NAME = undefined;
const OLD_RELEASE_FORWARDING_NAME = 'PromptForEmbeddingCausesRequestForBequeathingData';
Expand Down Expand Up @@ -96,7 +97,6 @@ module.exports.embedYourself = async function embedYourself(req, res, next, body
// start cyclic process for metadata List update
metadataTableUpdateStartModule.MetaDataTableCyclicProcess();
// starts further notification process
kafkaConnection.connectToKafka();
individualServices.PromptForEmbeddingCausesSubscribingForNotifications (user, originator, xCorrelator, traceIndicator, customerJourney);
responseBodyToDocument = responseBody;
let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.url);
Expand Down
8 changes: 4 additions & 4 deletions server/controllers/IndividualServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,7 @@ module.exports.regardDeviceAlarm = function regardDeviceAlarm(req, res, next, bo
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseBodyToDocument = {};
IndividualServices.regardDeviceAlarm(body)
IndividualServices.regardDeviceAlarm(req.url, body, user, originator, xCorrelator, traceIndicator, customerJourney)
.then(async function (responseBody) {
responseBodyToDocument = responseBody;
let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.openapi.openApiRoute);
Expand All @@ -2853,7 +2853,7 @@ module.exports.regardDeviceAttributeValueChange = function regardDeviceAttribute
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseBodyToDocument = {};
IndividualServices.regardDeviceAttributeValueChange(body)
IndividualServices.regardDeviceAttributeValueChange(req.url, body, user, originator, xCorrelator, traceIndicator, customerJourney)
.then(async function (responseBody) {
responseBodyToDocument = responseBody;
let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.openapi.openApiRoute);
Expand All @@ -2873,7 +2873,7 @@ module.exports.regardDeviceObjectCreation = function regardDeviceObjectCreation(
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseBodyToDocument = {};
IndividualServices.regardDeviceObjectCreation(body)
IndividualServices.regardDeviceObjectCreation(req.url, body, user, originator, xCorrelator, traceIndicator, customerJourney)
.then(async function (responseBody) {
responseBodyToDocument = responseBody;
let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.openapi.openApiRoute);
Expand All @@ -2893,7 +2893,7 @@ module.exports.regardDeviceObjectDeletion = function regardDeviceObjectDeletion(
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.NO_CONTENT;
let responseBodyToDocument = {};
IndividualServices.regardDeviceObjectDeletion(body)
IndividualServices.regardDeviceObjectDeletion(req.url, body, user, originator, xCorrelator, traceIndicator, customerJourney)
.then(async function (responseBody) {
responseBodyToDocument = responseBody;
let responseHeader = await restResponseHeader.createResponseHeader(xCorrelator, startTime, req.openapi.openApiRoute);
Expand Down
8,919 changes: 4,071 additions & 4,848 deletions server/database/load.json

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ const notificationManagement = require('./service/individualServices/Notificatio
appCommons.openApiValidatorOptions.validateSecurity.handlers.apiKeyAuth = apiKeyAuth.validateOperationKey;

const prepareElasticsearch = require('./service/individualServices/ElasticsearchPreparation');
<<<<<<< HEAD
const {performQualityMeasurement} = require('./service/individualServices/CyclicProcessService/CacheQualityMeasurement/measurementProcess')
const { Console } = require('console');
let kafkaConnection = require('./service/individualServices/KafkaHandler');

=======
const logger = require('./service/LoggingService.js').getLogger();
>>>>>>> origin/develop

// uncomment if you do not want to validate security e.g. operation-key, basic auth, etc
// appCommons.openApiValidatorOptions.validateSecurity = false;
Expand Down Expand Up @@ -72,12 +65,8 @@ prepareElasticsearch(false).catch(err => {
logger.info('Swagger-ui is available on http://localhost:%d/docs', serverPort);
});
appCommons.performApplicationRegistration();
//performQualityMeasurement();

kafkaConnection.connectToKafka();
}
);

//setInterval(performQualityMeasurement, 300);

global.applicationDataPath = './application-data/';
37 changes: 9 additions & 28 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 5 additions & 10 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
"start": "node index.js",
"test": "jest"
},
"babel": {
"presets": [
"@babel/preset-env"
],
"plugins": [
"babel-plugin-rewire"
]
"babel": {
"presets": ["@babel/preset-env"],
"plugins": ["babel-plugin-rewire"]
},
"jest": {
"transform": {
Expand All @@ -29,12 +25,11 @@
"dependencies": {
"connect": "^3.7.0",
"console-stamp": "3.1.2",
"deep-diff": "^1.0.2",
"eventsource": "^2.0.2",
"http-errors": "2.0.0",
"js-yaml": "^4.1.0",
"onf-core-model-ap": "2.1.2-b",
"onf-core-model-ap-bs": "2.1.2-b",
"onf-core-model-ap": "2.1.2",
"onf-core-model-ap-bs": "2.1.2",
"openbackhaul-oas3-tools": "2.3.1-alpha.3",
"qs": "^6.11.2",
"request": "^2.88.2",
Expand Down
36 changes: 25 additions & 11 deletions server/service/IndividualServicesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -10917,9 +10917,14 @@ exports.regardControllerAttributeValueChange = function (url, body, user, origin
* Receives notifications about alarms at devices
*
* body V1_regarddevicealarm_body
* user String User identifier from the system starting the service call
* originator String 'Identification for the system consuming the API, as defined in [/core-model-1-4:control-construct/logical-termination-point={uuid}/layer-protocol=0/http-client-interface-1-0:http-client-interface-pac/http-client-interface-configuration/application-name]'
* xCorrelator String UUID for the service execution flow that allows to correlate requests and responses
* traceIndicator String Sequence of request numbers along the flow
* customerJourney String Holds information supporting customer’s journey to which the execution applies
* no response value expected for this operation
**/
exports.regardDeviceAlarm = function (body) {
exports.regardDeviceAlarm = function (url, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
return new Promise(async function (resolve, reject) {
try {
let objectKey = Object.keys(body)[0];
Expand Down Expand Up @@ -10967,9 +10972,14 @@ exports.regardDeviceAlarm = function (body) {
* Receives notifications about changes of values of attributes inside the devices
*
* body V1_regarddeviceattributevaluechange_body
* user String User identifier from the system starting the service call
* originator String 'Identification for the system consuming the API, as defined in [/core-model-1-4:control-construct/logical-termination-point={uuid}/layer-protocol=0/http-client-interface-1-0:http-client-interface-pac/http-client-interface-configuration/application-name]'
* xCorrelator String UUID for the service execution flow that allows to correlate requests and responses
* traceIndicator String Sequence of request numbers along the flow
* customerJourney String Holds information supporting customer’s journey to which the execution applies
* no response value expected for this operation
**/
exports.regardDeviceAttributeValueChange = function (body) {
exports.regardDeviceAttributeValueChange = function (url, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
return new Promise(async function (resolve, reject) {
try {
let objectKey = Object.keys(body)[0];
Expand All @@ -10988,12 +10998,6 @@ exports.regardDeviceAttributeValueChange = function (body) {
// Construct the base URL
const baseUrl = `${parsedUrl.protocol}//${parsedUrl.host}`;
const finalUrl = baseUrl + resource;
let originator = "MicroWaveDeviceInventory";
let requestHeader = new RequestHeader(undefined,originator)
let user = requestHeader.user;
let xCorrelator = requestHeader.xCorrelator;
let customerJourney = requestHeader.customerJourney;
let traceIndicator = requestHeader.traceIndicator;
let resRequestor = await sentDataToRequestor(body, user, originator, xCorrelator, traceIndicator, customerJourney, finalUrl, notify[0].key);
//const res = await RestClient.dispatchEvent(finalUrl, 'GET', '', appNameAndUuidFromForwarding[0].key)
if (resRequestor == null) {
Expand Down Expand Up @@ -11038,10 +11042,15 @@ exports.regardDeviceAttributeValueChange = function (body) {
/**
* Receives notifications about objects that have been created inside the devices
*
* body V1_regarddeviceobjectcreation_body
* body V1_regarddeviceobjectcreation_body
* user String User identifier from the system starting the service call
* originator String 'Identification for the system consuming the API, as defined in [/core-model-1-4:control-construct/logical-termination-point={uuid}/layer-protocol=0/http-client-interface-1-0:http-client-interface-pac/http-client-interface-configuration/application-name]'
* xCorrelator String UUID for the service execution flow that allows to correlate requests and responses
* traceIndicator String Sequence of request numbers along the flow
* customerJourney String Holds information supporting customer’s journey to which the execution applies
* no response value expected for this operation
**/
exports.regardDeviceObjectCreation = function (body) {
exports.regardDeviceObjectCreation = function (url, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
return new Promise(async function (resolve, reject) {
try {
let objectKey = Object.keys(body)[0];
Expand Down Expand Up @@ -11108,9 +11117,14 @@ exports.regardDeviceObjectCreation = function (body) {
* Receives notifications about objects that have been deleted inside the devices
*
* body V1_regarddeviceobjectdeletion_body
* user String User identifier from the system starting the service call
* originator String 'Identification for the system consuming the API, as defined in [/core-model-1-4:control-construct/logical-termination-point={uuid}/layer-protocol=0/http-client-interface-1-0:http-client-interface-pac/http-client-interface-configuration/application-name]'
* xCorrelator String UUID for the service execution flow that allows to correlate requests and responses
* traceIndicator String Sequence of request numbers along the flow
* customerJourney String Holds information supporting customer’s journey to which the execution applies
* no response value expected for this operation
**/
exports.regardDeviceObjectDeletion = function (body) {
exports.regardDeviceObjectDeletion = function (url, body, user, originator, xCorrelator, traceIndicator, customerJourney) {
return new Promise(async function (resolve, reject) {
try {
let objectKey = Object.keys(body)[0];
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading