2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
20 import org.onap.policy.apex.examples.aadm.concepts.ENodeBStatus;
21 import org.onap.policy.apex.examples.aadm.concepts.ImsiStatus;
23 logger.debug(subject.id + ":" + subject.taskName + " execution logic");
24 logger.debug(inFields);
26 outFields["ACTTASK"] = "act";
27 outFields["TRIGGER_SPEC"] = "XSTREAM_AADM_ACT_EVENT";
28 outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
29 outFields["PROBE_ON"] = true;
30 outFields["TCP_ON"] = false;
31 outFields["IMSI"] = inFields["IMSI"];
33 if (inFields["IMSI_IP"] != null) {
34 outFields["IMSI_IP"] = inFields["IMSI_IP"];
37 outFields["IMSI_IP"] = inFields["UE_IP_ADDRESS"];
40 if (inFields["NW_IP"] != null) {
41 outFields["NW_IP"] = inFields["NW_IP"];
44 outFields["NW_IP"] = inFields["SGW_IP_ADDRESS"];
47 ImsiStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
48 logger.debug(imsiStatus);
50 ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBId());
51 eNodeBStatus.setBeingProbed(false);
53 leaveProbingOn = false;
54 for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
55 if (enbStatus.getBeingProbed()) {
56 leaveProbingOn = true;
60 if (!leaveProbingOn) {
61 outFields["PROBE_ON"] = false;
62 outFields["TCP_ON"] = false;
65 eNodeBStatus.decrementDosCount();
66 logger.debug(eNodeBStatus.getENodeB() + ": dosCount is " + eNodeBStatus.getDosCount());
68 imsiStatus.setAnomalous(false);
70 logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.getAnomalous());
72 getContextAlbum("IMSIStatusAlbum") .put(imsiStatus.getImsi(), imsiStatus);
73 getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
75 outFields["THRESHOLD"] = 0;
76 outFields["PROFILE"] = "";
77 outFields["VERSION"] = "0.0.1";
78 outFields["BLACKLIST_ON"] = false;