diff options
Diffstat (limited to 'examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel')
-rw-r--r-- | examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel new file mode 100644 index 000000000..115ac5477 --- /dev/null +++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel @@ -0,0 +1,40 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +import org.onap.policy.apex.examples.aadm.concepts.IMSIStatus; + +logger.debug(subject.id + ":" + subject.taskName + " execution logic"); +logger.debug(inFields); + +for (IMSIStatus imsiStatus : getContextAlbum("IMSIStatusAlbum").values()) { + if ((System.currentTimeMillis() - imsiStatus.getBlacklistedTime()) > 180000) { + imsiStatus.setBlacklistedTime(0); + getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus); + } +} + +outFields["IMSI"] = 0; +outFields["PROFILE"] = "ServiceA"; +outFields["BLACKLIST_ON"] = false; +outFields["PROBE_ON"] = false; +outFields["TCP_ON"] = false; +outFields["NW_IP"] = "0.0.0.0"; +outFields["IMSI_IP"] = "0.0.0.0"; + +return true; |