2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
25 constructor(loopJson) {
26 this.loopJsonCache=loopJson;
29 updateMsProperties(type, newMsProperties) {
30 if (newMsProperties["name"] == type) {
31 for (p in this.loopJsonCache["microServicePolicies"]) {
32 if (this.loopJsonCache["microServicePolicies"][p]["name"] == type) {
33 this.loopJsonCache["microServicePolicies"][p] = newMsProperties;
39 updateGlobalProperties(newGlobalProperties) {
40 this.loopJsonCache["globalPropertiesJson"] = newGlobalProperties;
43 updateOpPolicyProperties(newOpProperties) {
44 this.loopJsonCache["operationalPolicies"] = newOpProperties;
48 return this.loopJsonCache["name"];
51 getOperationalPolicyProperty() {
52 return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]["0"]["configurationsJson"]));
55 getOperationalPolicies() {
56 return JSON.parse(JSON.stringify(this.loopJsonCache["operationalPolicies"]));
60 return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]));
63 getDeploymentProperties() {
64 return JSON.parse(JSON.stringify(this.loopJsonCache["globalPropertiesJson"]["dcaeDeployParameters"]));
68 var msProperties = this.loopJsonCache["microServicePolicies"];
69 for (p in msProperties) {
70 if (msProperties[p]["name"] == type) {
71 return JSON.parse(JSON.stringify(msProperties[p]));
78 var msProperties = this.loopJsonCache["microServicePolicies"];
79 for (p in msProperties) {
80 if (msProperties[p]["name"] == type) {
81 if (msProperties[p]["properties"] !== null && msProperties[p]["properties"] !== undefined) {
82 return JSON.parse(JSON.stringify(msProperties[p]["properties"]));
90 var msProperties = this.loopJsonCache["microServicePolicies"];
91 for (p in msProperties) {
92 if (msProperties[p]["name"] == type) {
93 return JSON.parse(JSON.stringify(msProperties[p]["jsonRepresentation"]));
99 getResourceDetailsVfProperty() {
100 return this.loopJsonCache["modelPropertiesJson"]["resourceDetails"]["VF"];
103 getResourceDetailsVfModuleProperty() {
104 return this.loopJsonCache["modelPropertiesJson"]["resourceDetails"]["VFModule"];
108 return this.loopJsonCache.loopLogs;
111 getComponentStates() {
112 return this.loopJsonCache.components;
116 export default LoopCache;