2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2016-2018 Ericsson. All rights reserved.
4 * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5 * ================================================================================
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * SPDX-License-Identifier: Apache-2.0
19 * ============LICENSE_END=========================================================
21 import org.onap.policy.apex.examples.aadm.concepts.ENodeBStatus;
22 import org.onap.policy.apex.examples.aadm.concepts.ImsiStatus;
24 logger.debug(subject.id + ":" + subject.taskName + " execution logic");
25 logger.debug(inFields);
27 outFields["ACTTASK"] = "act";
28 outFields["TRIGGER_SPEC"] = "XSTREAM_AADM_ACT_EVENT";
29 outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
30 outFields["PROBE_ON"] = true;
31 outFields["TCP_ON"] = false;
32 outFields["IMSI"] = inFields["IMSI"];
34 if (inFields["IMSI_IP"] != null) {
35 outFields["IMSI_IP"] = inFields["IMSI_IP"];
38 outFields["IMSI_IP"] = inFields["UE_IP_ADDRESS"];
41 if (inFields["NW_IP"] != null) {
42 outFields["NW_IP"] = inFields["NW_IP"];
45 outFields["NW_IP"] = inFields["SGW_IP_ADDRESS"];
48 ImsiStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
49 logger.debug(imsiStatus);
51 ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBId());
52 eNodeBStatus.setBeingProbed(false);
54 leaveProbingOn = false;
55 for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
56 if (enbStatus.isBeingProbed()) {
57 leaveProbingOn = true;
61 if (!leaveProbingOn) {
62 outFields["PROBE_ON"] = false;
63 outFields["TCP_ON"] = false;
66 eNodeBStatus.decrementDosCount();
67 logger.debug(eNodeBStatus.getENodeB() + ": dosCount is " + eNodeBStatus.getDosCount());
69 imsiStatus.setAnomalous(false);
71 logger.debug("imsi: " + imsiStatus.getImsi() + " anamalous " + imsiStatus.isAnomalous());
73 getContextAlbum("IMSIStatusAlbum") .put(imsiStatus.getImsi(), imsiStatus);
74 getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
76 outFields["THRESHOLD"] = 0;
77 outFields["PROFILE"] = "";
78 outFields["VERSION"] = "0.0.1";
79 outFields["BLACKLIST_ON"] = false;