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.IPAddressStatus;
22 import org.onap.policy.apex.examples.aadm.concepts.IMSIStatus;
24 logger.debug(subject.id + ":" + subject.taskName + " execution logic");
25 logger.debug(inFields);
27 ipAddress = inFields["UE_IP_ADDRESS"];
28 if (ipAddress == null ) {
29 ipAddress = inFields["IMSI_IP"];
31 if (ipAddress == null ) {
32 logger.debug("Incoming event must specify parameter UE_IP_ADDRESS or parameter IMSI_IP");
37 imsi = inFields["IMSI"];
39 logger.debug("Incoming event must specify parameter IMSI");
43 eNodeBID = inFields["ENODEB_ID"];
44 if (eNodeBID == null ) {
45 logger.debug("Incoming event must specify parameter ENODEB_ID");
49 IPAddressStatus ipAddressStatus = getContextAlbum("IPAddressStatusAlbum").get(ipAddress);
50 if (ipAddressStatus == null) {
51 ipAddressStatus = new IPAddressStatus(ipAddress);
52 ipAddressStatus.setIMSI(imsi);
53 getContextAlbum("IPAddressStatusAlbum").put(ipAddressStatus.getIPAddress(), ipAddressStatus);
54 logger.debug("added new IP address " + getContextAlbum("IPAddressStatusAlbum").get(ipAddress));
57 logger.debug("found IP address " + ipAddressStatus);
60 IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)imsi);
61 if (imsiStatus == null) {
62 imsiStatus = new IMSIStatus(imsi);
63 imsiStatus.setENodeBID(eNodeBID);
64 getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus);
65 logger.debug("added new IMSI " + imsi + " to IMSI status map")
68 ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get((String)eNodeBID);
69 if (eNodeBStatus == null) {
70 eNodeBStatus = new ENodeBStatus(eNodeBID);
71 getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
72 logger.debug("added new ENodeB " + eNodeBID + " to ENodeB status map")