aboutsummaryrefslogtreecommitdiffstats
path: root/examples/examples-aadm/src/main/resources/org
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-aadm/src/main/resources/org')
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSProvenActTask_TaskLogic.mvel80
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSSuggestionActTask_TaskLogic.mvel106
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMMatchTask_TaskLogic.mvel75
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMNoActTask_TaskLogic.mvel55
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMPolicy_Act_TaskSelectionLogic.mvel67
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskLogic.mvel23
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskSelectionLogic.mvel23
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/PeriodicActTask_TaskLogic.mvel40
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCActTask_TaskLogic.mvel79
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCMatchTask_TaskLogic.mvel52
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEActTask_TaskLogic.mvel44
-rw-r--r--examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEMatchTask_TaskLogic.mvel47
12 files changed, 691 insertions, 0 deletions
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSProvenActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSProvenActTask_TaskLogic.mvel
new file mode 100644
index 000000000..078841792
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSProvenActTask_TaskLogic.mvel
@@ -0,0 +1,80 @@
+/*
+ * ============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.ENodeBStatus;
+import org.onap.policy.apex.examples.aadm.concepts.IMSIStatus;
+
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+outFields["ACTTASK"] = "act";
+outFields["TRIGGER_SPEC"] = "XSTREAM_AADM_ACT_EVENT";
+outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
+outFields["PROBE_ON"] = true;
+outFields["TCP_ON"] = false;
+outFields["IMSI"] = inFields["IMSI"];
+
+if (inFields["IMSI_IP"] != null) {
+ outFields["IMSI_IP"] = inFields["IMSI_IP"];
+}
+else{
+ outFields["IMSI_IP"] = inFields["UE_IP_ADDRESS"];
+}
+
+if (inFields["NW_IP"] != null) {
+ outFields["NW_IP"] = inFields["NW_IP"];
+}
+else{
+ outFields["NW_IP"] = inFields["SGW_IP_ADDRESS"];
+}
+
+IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
+logger.debug(imsiStatus);
+
+ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBID());
+eNodeBStatus.setBeingProbed(false);
+
+leaveProbingOn = false;
+for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
+ if (enbStatus.getBeingProbed()) {
+ leaveProbingOn = true;
+ }
+}
+
+if (!leaveProbingOn) {
+ outFields["PROBE_ON"] = false;
+ outFields["TCP_ON"] = false;
+}
+
+eNodeBStatus.decrementDOSCount();
+logger.debug(eNodeBStatus.getENodeB() + ": dosCount is " + eNodeBStatus.getDOSCount());
+
+imsiStatus.setAnomalous(false);
+
+logger.debug("imsi: " + imsiStatus.getIMSI() + " anamalous " + imsiStatus.getAnomalous());
+
+getContextAlbum("IMSIStatusAlbum") .put(imsiStatus.getIMSI(), imsiStatus);
+getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
+
+outFields["THRESHOLD"] = 0;
+outFields["PROFILE"] = "";
+outFields["VERSION"] = "0.0.1";
+outFields["BLACKLIST_ON"] = false;
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSSuggestionActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSSuggestionActTask_TaskLogic.mvel
new file mode 100644
index 000000000..d04f9425e
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMDoSSuggestionActTask_TaskLogic.mvel
@@ -0,0 +1,106 @@
+/*
+ * ============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.ENodeBStatus;
+import org.onap.policy.apex.examples.aadm.concepts.IMSIStatus;
+
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+outFields["ACTTASK"] = "probe";
+outFields["TRIGGER_SPEC"] = "XSTREAM_AADM_ACT_EVENT";
+outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
+outFields["IMSI"] = inFields["IMSI"];
+
+if (inFields["IMSI_IP"] != null) {
+ outFields["IMSI_IP"] = inFields["IMSI_IP"];
+}
+else {
+ outFields["IMSI_IP"] = inFields["UE_IP_ADDRESS"];
+}
+
+if (inFields["NW_IP"] != null) {
+ outFields["NW_IP"] = inFields["NW_IP"];
+}
+else {
+ outFields["NW_IP"] = inFields["SGW_IP_ADDRESS"];
+}
+
+IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
+logger.debug(imsiStatus);
+
+ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBID());
+logger.debug(eNodeBStatus);
+
+if (imsiStatus.getENodeBID() != null && !imsiStatus.getENodeBID().equals(inFields["ENODEB_ID"]) || inFields["AVG_SUBSCRIBER_SERVICE_REQUEST"] == null) {
+ // if user moved enodeB remove him from previous one
+ if (imsiStatus.getENodeBID() != null) {
+ eNodeBStatus.decrementDOSCount();
+ }
+
+ // if user became non anomalous return action
+ if (inFields["AVG_SUBSCRIBER_SERVICE_REQUEST"] == null) {
+ imsiStatus.setAnomalous(false);
+ outFields["ACTTASK"] = "remove_from_probe";
+
+ for (ENodeBStatus enbStatus : getContextAlbum("ENodeBStatusAlbum").values) {
+ if (enbStatus.getBeingProbed()) {
+ outFields["PROBE_ON"] = true;
+ outFields["TCP_ON"] = true;
+ return true;
+ }
+ }
+
+ outFields["PROBE_ON"] = false;
+ outFields["TCP_ON"] = false;
+
+ getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus);
+ getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
+
+ return true;
+ }
+}
+
+imsiStatus.setAnomalous(true);
+imsiStatus.setAnomolousTime(System.currentTimeMillis());
+imsiStatus.setENodeBID(inFields["ENODEB_ID"]);
+getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus);
+logger.debug(imsiStatus.getENodeBID() + ": enodeb added to imsi ip added " + outFields["IMSI_IP"]);
+
+ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBID());
+if (eNodeBStatus == null) {
+ eNodeBStatus = new ENodeBStatus(imsiStatus.getENodeBID());
+ getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
+ logger.debug("new eNodeB added " + getContextAlbum("ENodeBStatusAlbum").get(imsiStatus.getENodeBID()));
+}
+
+eNodeBStatus.incrementDOSCount();
+getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
+logger.debug(eNodeBStatus.getENodeB() + ": dosCount incremented to " + eNodeBStatus.getDOSCount());
+
+outFields["PROBE_ON"] = true;
+outFields["TCP_ON"] = true;
+outFields["THRESHOLD"] = 0;
+outFields["PROFILE"] = "";
+outFields["VERSION"] = "0.0.1";
+outFields["BLACKLIST_ON"] = false;
+
+logger.debug("out here5");
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMMatchTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMMatchTask_TaskLogic.mvel
new file mode 100644
index 000000000..bb38034af
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMMatchTask_TaskLogic.mvel
@@ -0,0 +1,75 @@
+/*
+ * ============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.ENodeBStatus;
+import org.onap.policy.apex.examples.aadm.concepts.IPAddressStatus;
+import org.onap.policy.apex.examples.aadm.concepts.IMSIStatus;
+
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+ipAddress = inFields["UE_IP_ADDRESS"];
+if (ipAddress == null ) {
+ ipAddress = inFields["IMSI_IP"];
+
+ if (ipAddress == null ) {
+ logger.debug("Incoming event must specify parameter UE_IP_ADDRESS or parameter IMSI_IP");
+ return false;
+ }
+}
+
+imsi = inFields["IMSI"];
+if (imsi == null ) {
+ logger.debug("Incoming event must specify parameter IMSI");
+ return false;
+}
+
+eNodeBID = inFields["ENODEB_ID"];
+if (eNodeBID == null ) {
+ logger.debug("Incoming event must specify parameter ENODEB_ID");
+ return false;
+}
+
+IPAddressStatus ipAddressStatus = getContextAlbum("IPAddressStatusAlbum").get(ipAddress);
+if (ipAddressStatus == null) {
+ ipAddressStatus = new IPAddressStatus(ipAddress);
+ ipAddressStatus.setIMSI(imsi);
+ getContextAlbum("IPAddressStatusAlbum").put(ipAddressStatus.getIPAddress(), ipAddressStatus);
+ logger.debug("added new IP address " + getContextAlbum("IPAddressStatusAlbum").get(ipAddress));
+}
+else {
+ logger.debug("found IP address " + ipAddressStatus);
+}
+
+IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)imsi);
+if (imsiStatus == null) {
+ imsiStatus = new IMSIStatus(imsi);
+ imsiStatus.setENodeBID(eNodeBID);
+ getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus);
+ logger.debug("added new IMSI " + imsi + " to IMSI status map")
+}
+
+ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get((String)eNodeBID);
+if (eNodeBStatus == null) {
+ eNodeBStatus = new ENodeBStatus(eNodeBID);
+ getContextAlbum("ENodeBStatusAlbum").put(eNodeBStatus.getENodeB(), eNodeBStatus);
+ logger.debug("added new ENodeB " + eNodeBID + " to ENodeB status map")
+}
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMNoActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMNoActTask_TaskLogic.mvel
new file mode 100644
index 000000000..7107b940b
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMNoActTask_TaskLogic.mvel
@@ -0,0 +1,55 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+
+outFields["ACTTASK"] = "no";
+outFields["TRIGGER_SPEC"] = "XSTREAM_AADM_ACT_EVENT";
+outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
+
+if (inFields["PROBE_ON"] != null) {
+ outFields["PROBE_ON"] = inFields["PROBE_ON"];
+}
+else{
+ outFields["PROBE_ON"] = false;
+}
+
+if (inFields["TCP_ON"] != null) {
+ outFields["TCP_ON"] = inFields["TCP_ON"];
+}
+else {
+ outFields["TCP_ON"] = false;
+}
+
+outFields["IMSI"] = inFields["IMSI"];
+if (inFields["IMSI_IP"] != null) {
+ outFields["IMSI_IP"] = inFields["IMSI_IP"];
+}
+else {
+ outFields["IMSI_IP"] = inFields["UE_IP_ADDRESS"];
+}
+
+if (inFields["NW_IP"] != null) {
+ outFields["NW_IP"] = inFields["NW_IP"];
+}
+else{
+ outFields["NW_IP"] = inFields["SGW_IP_ADDRESS"];
+}
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMPolicy_Act_TaskSelectionLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMPolicy_Act_TaskSelectionLogic.mvel
new file mode 100644
index 000000000..2d0d45bdf
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/AADMPolicy_Act_TaskSelectionLogic.mvel
@@ -0,0 +1,67 @@
+/*
+ * ============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;
+import org.onap.policy.apex.examples.aadm.concepts.ENodeBStatus;
+
+logger.debug(subject.id + ":" + subject.stateName + " execution logic");
+logger.debug(inFields);
+
+logger.debug("inFields[SERVICE_REQUEST_COUNT]=" + inFields["SERVICE_REQUEST_COUNT"]);
+
+IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
+
+if (imsiStatus.getBlockingCount() > 1) {
+ subject.getTaskKey("AADMNoActTask").copyTo(selectedTask);
+ logger.debug("user blacklisted permanently");
+ return false;
+}
+
+logger.debug("imsi: " + imsiStatus.getIMSI() + " anamalous " + imsiStatus.getAnomalous());
+
+// check if this is second iteration
+if (inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] != null && inFields["TCP_UE_SIDE_AVG_THROUGHPUT"] > 100 && imsiStatus.getAnomalous()) {
+ subject.getTaskKey("AADMDoSProvenActTask").copyTo(selectedTask);
+ logger.debug("inside TCP_UE_SIDE_AVG_THROUGHPUT");
+ return true;
+}
+
+// Get the status of the ENodeB
+ENodeBStatus eNodeBStatus = getContextAlbum("ENodeBStatusAlbum").get((String)inFields["ENODEB_ID"]);
+
+// check if this is first iteration and DoS
+if (inFields["SERVICE_REQUEST_COUNT"] != null &&
+ inFields["AVG_SUBSCRIBER_SERVICE_REQUEST"] != null &&
+ inFields["SERVICE_REQUEST_COUNT"] > inFields["AVG_SUBSCRIBER_SERVICE_REQUEST"] &&
+ eNodeBStatus != null && eNodeBStatus.getDOSCount() > 100 &&
+ inFields["NUM_SUBSCRIBERS"] != null && inFields["NUM_SUBSCRIBERS"] > 100) {
+ logger.debug("inside NUM_SUBSCRIBERS");
+ subject.getTaskKey("AADMDoSProvenActTask").copyTo(selectedTask);
+ return true;
+}
+
+// check if this is first iteration and request probe
+if (inFields["UE_IP_ADDRESS"] != null) {
+ logger.debug("inside UE_IP_ADDRESS");
+ subject.getTaskKey("AADMDoSSuggestionActTask").copyTo(selectedTask);
+ return true;
+}
+
+subject.defaultTaskKey.copyTo(selectedTask);
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskLogic.mvel
new file mode 100644
index 000000000..69146d19c
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskLogic.mvel
@@ -0,0 +1,23 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+logger.debug(outFields);
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskSelectionLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskSelectionLogic.mvel
new file mode 100644
index 000000000..20fe626cd
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/Default_TaskSelectionLogic.mvel
@@ -0,0 +1,23 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.stateName);
+subject.defaultTaskKey.copyTo(selectedTask)
+logger.debug(subject.id + ":" + subject.stateName) + ", using default task";
+return true;
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;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCActTask_TaskLogic.mvel
new file mode 100644
index 000000000..7ceaa2abe
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCActTask_TaskLogic.mvel
@@ -0,0 +1,79 @@
+/*
+ * ============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);
+
+if (inFields["IMSI"] == null) {
+ outFields["IMSI"] = 0;
+}
+else {
+ outFields["IMSI"] = inFields["IMSI"];
+}
+
+if (outFields["IMSI"] == 0 && inFields["IMSI_IP"] != null && inFields["IMSI_IP"].equals("0")) {
+ // no action arrived
+ outFields["IMSI"] = 0;
+ outFields["PROFILE"] = "none";
+ outFields["BLACKLIST_ON"] = false;
+ outFields["PROBE_ON"] = false;
+ return true;
+}
+
+IMSIStatus imsiStatus = getContextAlbum("IMSIStatusAlbum").get((String)inFields["IMSI"]);
+logger.debug(imsiStatus);
+
+if (imsiStatus.getBlockingCount() > 1) {
+ outFields["IMSI"] = 0;
+ outFields["PROFILE"] = "none";
+ outFields["BLACKLIST_ON"] = false;
+ outFields["PROBE_ON"] = false;
+
+ return true;
+}
+
+if (imsiStatus.getBlockingCount() > 0 && imsiStatus.getBlacklistedTime() != 0) {
+ outFields["IMSI"] = 0;
+ outFields["PROFILE"] = "none";
+ outFields["BLACKLIST_ON"] = false;
+ outFields["PROBE_ON"] = false;
+
+ return true;
+}
+
+imsiStatus.incrementBlockingCount();
+imsiStatus.setBlacklistedTime(System.currentTimeMillis());
+
+logger.debug("Bocking count for IMSI: " + imsiStatus.getIMSI() + " is: " + imsiStatus.getBlockingCount());
+getContextAlbum("IMSIStatusAlbum").put(imsiStatus.getIMSI(), imsiStatus);
+
+outFields["PROFILE"] = "ServiceA";
+outFields["BLACKLIST_ON"] = true;
+outFields["PROBE_ON"] = false;
+
+if (imsiStatus.getBlockingCount() > 1) {
+ logger.debug("POLICY SAPCPolicy - blacklisting imsi: " + outFields["IMSI"] + " permanently");
+}
+else {
+ logger.debug("POLICY SAPCPolicy - blacklisting imsi: " + outFields["IMSI"] + " temporary for 120000 ms");
+}
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCMatchTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCMatchTask_TaskLogic.mvel
new file mode 100644
index 000000000..1de8b190c
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/SAPCMatchTask_TaskLogic.mvel
@@ -0,0 +1,52 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+if (inFields["ACTTASK"] != null && inFields["ACTTASK"].equals("no")) {
+ outFields["IMSI"] = 0;
+ outFields["IMSI_IP"] = "0";
+ return true;
+}
+
+if (inFields["PROBE_ON"] != null) {
+ outFields["PROBE_ON"] = inFields["PROBE_ON"];
+}
+else{
+ outFields["PROBE_ON"] = false;
+}
+
+if (inFields["TCP_ON"] != null) {
+ outFields["TCP_ON"] = inFields["TCP_ON"];
+}
+else{
+ outFields["TCP_ON"] = false;
+}
+
+outFields["IMSI"] = inFields["IMSI"];
+if (inFields["IMSI_IP"] != null) {
+ outFields["IMSI_IP"] = inFields["IMSI_IP"];
+}
+
+if (inFields["NW_IP"] != null) {
+ outFields["NW_IP"] = inFields["NW_IP"];
+}
+
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEActTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEActTask_TaskLogic.mvel
new file mode 100644
index 000000000..db1abdfe9
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEActTask_TaskLogic.mvel
@@ -0,0 +1,44 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+outFields["TRIGGER_SPEC"] = "vMMEThresholdEvent";
+outFields["MAJ_MIN_MAINT_VERSION"] = "0.0.1";
+
+if (outFields["IMSI"] == null) {
+ outFields["IMSI"] = 0;
+}
+
+if (outFields["ENODEB_ID"] == null) {
+ outFields["ENODEB_ID"] = 0;
+}
+
+if (outFields["IMSI_IP"] == null) {
+ outFields["IMSI_IP"] = "";
+}
+
+if (outFields["NW_IP"] == null) {
+ outFields["NW_IP"] = "";
+}
+
+outFields["PROFILE"] = "ServiceA";
+outFields["THRESHOLD"] = 20;
+return true;
diff --git a/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEMatchTask_TaskLogic.mvel b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEMatchTask_TaskLogic.mvel
new file mode 100644
index 000000000..33dbd4cd0
--- /dev/null
+++ b/examples/examples-aadm/src/main/resources/org/onap/policy/apex/examples/aadm/model/mvel/VMMEMatchTask_TaskLogic.mvel
@@ -0,0 +1,47 @@
+/*
+ * ============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=========================================================
+ */
+logger.debug(subject.id + ":" + subject.taskName + " execution logic");
+logger.debug(inFields);
+
+if (inFields["PROBE_ON"] != null) {
+ outFields["PROBE_ON"] = inFields["PROBE_ON"];
+}
+else{
+ outFields["PROBE_ON"] = false;
+}
+
+if (inFields["TCP_ON"] != null) {
+ outFields["TCP_ON"] = inFields["TCP_ON"];
+}
+else{
+ outFields["TCP_ON"] = false;
+}
+
+outFields["IMSI"] = inFields["IMSI"];
+if (inFields["IMSI_IP"] != null) {
+ outFields["IMSI_IP"] = inFields["IMSI_IP"];
+}
+
+if (inFields["NW_IP"] != null) {
+ outFields["NW_IP"] = inFields["NW_IP"];
+}
+outFields["VERSION"] = inFields.getkey().getVersion();
+
+return true;