diff options
10 files changed, 47 insertions, 48 deletions
diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh index ad7cc7cb4..444f65491 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexApps.sh @@ -1,10 +1,10 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2016-2018 Ericsson. All rights reserved. # Modifications Copyright (C) 2019-2020 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,16 +23,12 @@ #------------------------------------------------------------------------------- ## ## Script to run APEX Applications, call with '-h' for help -## - requires BASH with associative arrays, bash of at least version 4 -## - for BASH examples with arrays see for instance: http://www.artificialworlds.net/blog/2012/10/17/bash-associative-array-examples/ ## - adding a new app means to add a command to APEX_APP_MAP and a description to APEX_APP_DESCR_MAP using same/unique key ## ## @package org.onap.policy.apex ## @author Sven van der Meer <sven.van.der.meer@ericsson.com> ## @version v2.0.0 ## -## convert to ash shell script 12/1/2020 -## ##set -x ## ## DO NOT CHANGE CODE BELOW, unless you know what you are doing @@ -71,13 +67,13 @@ _jmxconfig="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9 ## Maven/APEX version _version=$(cat $APEX_HOME/etc/app-version.txt) -## system to get CygWin paths -## NOTE: CygWin can not be tested with ash, due to lack of env setup +## system to get CygWin paths +## NOTE: CygWin can not be tested with sh, due to lack of env setup system=$(uname -s | cut -c1-6) cpsep=":" if [ "$system" = "CYGWIN" ] ; then APEX_HOME=`cygpath -m ${APEX_HOME}` - cpsep=";" + cpsep=";" fi ## CP for CP apps CLASSPATH="$APEX_HOME/etc${cpsep}$APEX_HOME/etc/hazelcast${cpsep}$APEX_HOME/etc/infinispan${cpsep}$APEX_HOME/lib/*" diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh index ef14d903c..60608f922 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexAsh.sh @@ -1,27 +1,27 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2016-2018 Ericsson. All rights reserved. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # 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========================================================= #------------------------------------------------------------------------------- -# Run from the Apex home directory +# Run from the Apex home directory if [ ! -d /home/apexuser ]; then echo Apex user home directory "/home/apexuser" not found exit diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIEditor.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIEditor.sh index fb520e7fc..08cd118f0 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIEditor.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIEditor.sh @@ -1,22 +1,22 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2016-2018 Ericsson. All rights reserved. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # 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========================================================= #------------------------------------------------------------------------------- diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh index cdf4eb3a7..fb4018655 100644 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexCLIToscaEditor.sh @@ -1,9 +1,9 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2019 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexEngine.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexEngine.sh index ca68a9871..44f4ca070 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexEngine.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexEngine.sh @@ -1,22 +1,22 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2016-2018 Ericsson. All rights reserved. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # 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========================================================= #------------------------------------------------------------------------------- diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/apexOnapPf.sh b/packages/apex-pdp-package-full/src/main/package/scripts/apexOnapPf.sh index 2c95cd331..ff2bcccdf 100644 --- a/packages/apex-pdp-package-full/src/main/package/scripts/apexOnapPf.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/apexOnapPf.sh @@ -1,8 +1,8 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh # # ============LICENSE_START======================================================= # Copyright (C) 2019-2020 Nordix Foundation. -# Modifications Copyright (C) 2020 AT&T Intellectual Property +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh b/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh index d9ccaf81b..9985d7ac4 100644 --- a/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/runBenchmark.sh @@ -1,22 +1,22 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2018 Ericsson. All rights reserved. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # 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========================================================= #------------------------------------------------------------------------------- diff --git a/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh b/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh index 1afb5347b..f38975970 100755 --- a/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh +++ b/packages/apex-pdp-package-full/src/main/package/scripts/runOneBenchmark.sh @@ -1,22 +1,22 @@ -#!/usr/bin/env ash +#!/usr/bin/env sh #------------------------------------------------------------------------------- # ============LICENSE_START======================================================= # Copyright (C) 2018 Ericsson. All rights reserved. -# Modifications Copyright (C) 2020 AT&T Intellectual Property. +# Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # ================================================================================ # 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========================================================= #------------------------------------------------------------------------------- @@ -43,24 +43,24 @@ if [ "$1" != "Javascript" ] && [ "$1" != "Jython" ] && [ "$1" != "JRuby" ] && [ echo "executor-type must be a member of the set [Javascript|Jython|JRuby|Mvel|Java]" exit 1 fi - + if [ "$2" != "01" ] && [ "$2" != "02" ] && [ "$2" != "04" ] && [ "$2" != "08" ] && [ "$2" != "16" ] && [ "$2" != "32" ] && [ "$2" != "64" ]; then echo "thread-count must be a member of the set [01|02|04|08|16|32|64]" exit 1 fi - + # Remove the old benchmark test result file if it exists rm -fr examples/benchmark/Bm$1$2.json # Start the event generator -/bin/ash bin/apexApps.sh event-gen -c examples/benchmark/EventGeneratorConfig.json -o examples/benchmark/Bm$1$2.json > examples/benchmark/Bm$1$2_gen.log 2>&1 & +/bin/sh bin/apexApps.sh event-gen -c examples/benchmark/EventGeneratorConfig.json -o examples/benchmark/Bm$1$2.json > examples/benchmark/Bm$1$2_gen.log 2>&1 & # Start Apex sleep 2 -/bin/ash bin/apexApps.sh engine -c examples/benchmark/$1$2.json > examples/benchmark/Bm$1$2_apex.log 2>&1 & +/bin/sh bin/apexApps.sh engine -c examples/benchmark/$1$2.json > examples/benchmark/Bm$1$2_apex.log 2>&1 & apex_pid=`ps -A -o pid,cmd | grep ApexMain | grep -v grep | head -n 1 | awk '{print $1}'` -echo "running benchmark test for executor $1 with $2 threads" +echo "running benchmark test for executor $1 with $2 threads" # Loop until result file exists while [ ! -f examples/benchmark/Bm$1$2.json ] diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java index 9fe3c94ce..65c4b0373 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/ApexEngineHandler.java @@ -160,9 +160,10 @@ public class ApexEngineHandler { policyMapToRetain.putAll(policyModel.getPolicies().getPolicyMap()); }); for (ApexMain main : undeployedPoliciesMainMap.values()) { - handleParametersRemoval(inputParamKeysToRetain, outputParamKeysToRetain, taskParametersToRetain, - executorParamKeysToRetain, schemaParamKeysToRetain, main); - + if (null != main.getApexParameters()) { + handleParametersRemoval(inputParamKeysToRetain, outputParamKeysToRetain, taskParametersToRetain, + executorParamKeysToRetain, schemaParamKeysToRetain, main); + } if (null != main.getActivator() && null != main.getActivator().getPolicyModel()) { handleAxConceptsRemoval(keyInfoMapToRetain, schemaMapToRetain, eventMapToRetain, albumMapToRetain, taskMapToRetain, policyMapToRetain, main); diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java index bf72b0999..8dc49eefb 100644 --- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java +++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/handler/PdpUpdateMessageHandler.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 Bell Canada. 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. @@ -97,7 +98,8 @@ public class PdpUpdateMessageHandler { if (pdpStatusContext.getState().equals(PdpState.ACTIVE)) { pdpResponseDetails = startOrStopApexEngineBasedOnPolicies(pdpUpdateMsg, pdpMessageHandler); - ApexEngineHandler apexEngineHandler = Registry.get(ApexStarterConstants.REG_APEX_ENGINE_HANDLER); + ApexEngineHandler apexEngineHandler = + Registry.getOrDefault(ApexStarterConstants.REG_APEX_ENGINE_HANDLER, ApexEngineHandler.class, null); // in hearbeat while in active state, only the policies which are running should be there. // if some policy fails, that shouldn't go in the heartbeat. // If no policies are running, then the policy list in the heartbeat can be empty |