aboutsummaryrefslogtreecommitdiffstats
path: root/core/core-engine
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2018-09-04 20:13:38 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-04 20:13:38 +0000
commitf7689b84472ab4698d9d96f1de08402208d99ca8 (patch)
treef003c5aef834f2158726ab678eb9a76e1ae37dac /core/core-engine
parent25ac320ced13ae5da0e55db5404f62237bdaa491 (diff)
parent87be30582d1db37bee7c6b456c0c5c3ca9584963 (diff)
Merge "Fix checkstyle issues in apex model basic"
Diffstat (limited to 'core/core-engine')
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java6
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java62
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java26
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java2
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java2
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java16
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java22
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java2
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java4
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java14
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java18
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java2
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java6
-rw-r--r--core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java4
14 files changed, 93 insertions, 93 deletions
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
index 2186ee31d..85e45f718 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/context/ApexInternalContext.java
@@ -148,10 +148,10 @@ public final class ApexInternalContext implements AxConceptGetter<ContextAlbum>
// The schema is different, throw an exception because the schema should not change if the key of the
// album has not changed
throw new ContextException("internal context update failed on context album \""
- + contextAlbumEntry.getKey().getID() + "\" in model \"" + key.getID() + "\", schema \""
- + currentContextAlbum.getItemSchema().getID()
+ + contextAlbumEntry.getKey().getId() + "\" in model \"" + key.getId() + "\", schema \""
+ + currentContextAlbum.getItemSchema().getId()
+ "\" on existing context model does not equal schema \""
- + newContextAlbum.getItemSchema().getID() + "\" on incoming model");
+ + newContextAlbum.getItemSchema().getId() + "\" on incoming model");
}
}
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
index 235140863..3349b609f 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/ApexEngineImpl.java
@@ -82,7 +82,7 @@ public class ApexEngineImpl implements ApexEngine {
protected ApexEngineImpl(final AxArtifactKey key) {
argumentNotNull(key, "AxArtifactKey may not be null");
- LOGGER.entry("ApexEngine()->" + key.getID() + "," + state);
+ LOGGER.entry("ApexEngine()->" + key.getId() + "," + state);
this.key = key;
@@ -90,7 +90,7 @@ public class ApexEngineImpl implements ApexEngine {
engineStats = new AxEngineStats();
engineStats.setKey(new AxReferenceKey(key, "_EngineStats"));
- LOGGER.exit("ApexEngine()<-" + key.getID() + "," + state);
+ LOGGER.exit("ApexEngine()<-" + key.getId() + "," + state);
}
/*
@@ -103,16 +103,16 @@ public class ApexEngineImpl implements ApexEngine {
@Override
public void updateModel(final AxPolicyModel apexModel) throws ApexException {
if (apexModel != null) {
- LOGGER.entry("updateModel()->" + key.getID() + ", apexPolicyModel=" + apexModel.getKey().getID());
+ LOGGER.entry("updateModel()->" + key.getId() + ", apexPolicyModel=" + apexModel.getKey().getId());
} else {
- LOGGER.warn("updateModel()<-" + key.getID() + ", Apex model not set");
+ LOGGER.warn("updateModel()<-" + key.getId() + ", Apex model not set");
throw new ApexException(
- "updateModel()<-" + key.getID() + ", Apex model is not defined, it has a null value");
+ "updateModel()<-" + key.getId() + ", Apex model is not defined, it has a null value");
}
// The engine must be stopped in order to do a model update
if (!state.equals(AxEngineState.STOPPED)) {
- throw new ApexException("updateModel()<-" + key.getID()
+ throw new ApexException("updateModel()<-" + key.getId()
+ ", cannot update model, engine should be stopped but is in state " + state);
}
@@ -127,10 +127,10 @@ public class ApexEngineImpl implements ApexEngine {
}
} catch (final ContextException e) {
LOGGER.warn(
- "updateModel()<-" + key.getID() + ", error setting the context for engine \"" + key.getID() + "\"",
+ "updateModel()<-" + key.getId() + ", error setting the context for engine \"" + key.getId() + "\"",
e);
throw new ApexException(
- "updateModel()<-" + key.getID() + ", error setting the context for engine \"" + key.getID() + "\"",
+ "updateModel()<-" + key.getId() + ", error setting the context for engine \"" + key.getId() + "\"",
e);
}
@@ -140,13 +140,13 @@ public class ApexEngineImpl implements ApexEngine {
// always set up as new
stateMachineHandler = new StateMachineHandler(internalContext);
} catch (final StateMachineException e) {
- LOGGER.warn("updateModel()<-" + key.getID() + ", error setting up the engine state machines \""
- + key.getID() + "\"", e);
- throw new ApexException("updateModel()<-" + key.getID() + ", error setting up the engine state machines \""
- + key.getID() + "\"", e);
+ LOGGER.warn("updateModel()<-" + key.getId() + ", error setting up the engine state machines \""
+ + key.getId() + "\"", e);
+ throw new ApexException("updateModel()<-" + key.getId() + ", error setting up the engine state machines \""
+ + key.getId() + "\"", e);
}
- LOGGER.exit("updateModel()<-" + key.getID());
+ LOGGER.exit("updateModel()<-" + key.getId());
}
/*
@@ -159,15 +159,15 @@ public class ApexEngineImpl implements ApexEngine {
LOGGER.entry("start()" + key);
if (state != AxEngineState.STOPPED) {
- LOGGER.warn("start()<-" + key.getID() + "," + state + ", cannot start engine, engine not in state STOPPED");
+ LOGGER.warn("start()<-" + key.getId() + "," + state + ", cannot start engine, engine not in state STOPPED");
throw new ApexException(
- "start()<-" + key.getID() + "," + state + ", cannot start engine, engine not in state STOPPED");
+ "start()<-" + key.getId() + "," + state + ", cannot start engine, engine not in state STOPPED");
}
if (stateMachineHandler == null || internalContext == null) {
- LOGGER.warn("start()<-" + key.getID() + "," + state
+ LOGGER.warn("start()<-" + key.getId() + "," + state
+ ", cannot start engine, engine has not been initialized, its model is not loaded");
- throw new ApexException("start()<-" + key.getID() + "," + state
+ throw new ApexException("start()<-" + key.getId() + "," + state
+ ", cannot start engine, engine has not been initialized, its model is not loaded");
}
@@ -177,10 +177,10 @@ public class ApexEngineImpl implements ApexEngine {
stateMachineHandler.start();
engineStats.engineStart();
} catch (final StateMachineException e) {
- LOGGER.warn("updateModel()<-" + key.getID() + ", error starting the engine state machines \"" + key.getID()
+ LOGGER.warn("updateModel()<-" + key.getId() + ", error starting the engine state machines \"" + key.getId()
+ "\"", e);
- throw new ApexException("updateModel()<-" + key.getID() + ", error starting the engine state machines \""
- + key.getID() + "\"", e);
+ throw new ApexException("updateModel()<-" + key.getId() + ", error starting the engine state machines \""
+ + key.getId() + "\"", e);
}
// OK, we are good to go
@@ -206,7 +206,7 @@ public class ApexEngineImpl implements ApexEngine {
// Already stopped
case STOPPED:
- throw new ApexException("stop()<-" + key.getID() + "," + state
+ throw new ApexException("stop()<-" + key.getId() + "," + state
+ ", cannot stop engine, engine is already stopped");
// The normal case, the engine wasn't doing anything or it was executing
case READY:
@@ -222,13 +222,13 @@ public class ApexEngineImpl implements ApexEngine {
state = AxEngineState.STOPPING;
break;
default:
- throw new ApexException("stop()<-" + key.getID() + "," + state
+ throw new ApexException("stop()<-" + key.getId() + "," + state
+ ", cannot stop engine, engine is in an undefined state");
}
}
}
- throw new ApexException("stop()<-" + key.getID() + "," + state + ", cannot stop engine, engine stop timed out");
+ throw new ApexException("stop()<-" + key.getId() + "," + state + ", cannot stop engine, engine stop timed out");
}
/*
@@ -241,7 +241,7 @@ public class ApexEngineImpl implements ApexEngine {
LOGGER.entry("clear()->" + key);
if (state != AxEngineState.STOPPED) {
throw new ApexException(
- "clear" + "()<-" + key.getID() + "," + state + ", cannot clear engine, engine is not stopped");
+ "clear" + "()<-" + key.getId() + "," + state + ", cannot clear engine, engine is not stopped");
}
// Clear everything
@@ -261,7 +261,7 @@ public class ApexEngineImpl implements ApexEngine {
public EnEvent createEvent(final AxArtifactKey eventKey) {
if (state != AxEngineState.READY && state != AxEngineState.EXECUTING) {
LOGGER.warn(
- "createEvent()<-" + key.getID() + "," + state + ", cannot create event, engine not in state READY");
+ "createEvent()<-" + key.getId() + "," + state + ", cannot create event, engine not in state READY");
return null;
}
@@ -269,7 +269,7 @@ public class ApexEngineImpl implements ApexEngine {
// Create an event using the internal context
return new EnEvent(eventKey);
} catch (final Exception e) {
- LOGGER.warn("createEvent()<-" + key.getID() + "," + state + ", error on event creation", e);
+ LOGGER.warn("createEvent()<-" + key.getId() + "," + state + ", error on event creation", e);
return null;
}
}
@@ -284,13 +284,13 @@ public class ApexEngineImpl implements ApexEngine {
public boolean handleEvent(final EnEvent incomingEvent) {
boolean ret = false;
if (incomingEvent == null) {
- LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", cannot run engine, incoming event is null");
+ LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", cannot run engine, incoming event is null");
return ret;
}
synchronized (state) {
if (state != AxEngineState.READY) {
- LOGGER.warn("handleEvent()<-" + key.getID() + "," + state
+ LOGGER.warn("handleEvent()<-" + key.getId() + "," + state
+ ", cannot run engine, engine not in state READY");
return ret;
}
@@ -308,7 +308,7 @@ public class ApexEngineImpl implements ApexEngine {
engineStats.executionExit();
ret = true;
} catch (final StateMachineException e) {
- LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", engine execution error: ", e);
+ LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", engine execution error: ", e);
// Create an exception return event
outgoingEvent = createExceptionEvent(incomingEvent, e);
@@ -318,7 +318,7 @@ public class ApexEngineImpl implements ApexEngine {
try {
synchronized (eventListeners) {
if (eventListeners.isEmpty()) {
- LOGGER.debug("handleEvent()<-" + key.getID() + "," + state
+ LOGGER.debug("handleEvent()<-" + key.getId() + "," + state
+ ", There is no listener registered to recieve outgoing event: " + outgoingEvent);
}
for (final EnEventListener axEventListener : eventListeners.values()) {
@@ -326,7 +326,7 @@ public class ApexEngineImpl implements ApexEngine {
}
}
} catch (final ApexException e) {
- LOGGER.warn("handleEvent()<-" + key.getID() + "," + state + ", outgoing event publishing error: ", e);
+ LOGGER.warn("handleEvent()<-" + key.getId() + "," + state + ", outgoing event publishing error: ", e);
ret = false;
}
synchronized (state) {
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
index f17d7f825..5ade06537 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/engine/impl/StateMachineHandler.java
@@ -71,7 +71,7 @@ public class StateMachineHandler {
* @throws StateMachineException On state machine initiation errors
*/
protected StateMachineHandler(final ApexInternalContext internalContext) throws StateMachineException {
- LOGGER.entry("StateMachineHandler()->" + internalContext.getKey().getID());
+ LOGGER.entry("StateMachineHandler()->" + internalContext.getKey().getId());
key = internalContext.getKey();
@@ -97,17 +97,17 @@ public class StateMachineHandler {
if (lastStateMachineExecutor != null
&& lastStateMachineExecutor.getSubject() != thisStateMachineExecutor.getSubject()) {
LOGGER.error("No more than one policy in a model can have the same trigger event. In model "
- + internalContext.getKey().getID() + " Policy ("
- + lastStateMachineExecutor.getSubject().getKey().getID() + ") and Policy ("
- + thisStateMachineExecutor.getSubject().getKey().getID() + ") have the same Trigger event ("
- + triggerEvent.getKey().getID() + ") ");
+ + internalContext.getKey().getId() + " Policy ("
+ + lastStateMachineExecutor.getSubject().getKey().getId() + ") and Policy ("
+ + thisStateMachineExecutor.getSubject().getKey().getId() + ") have the same Trigger event ("
+ + triggerEvent.getKey().getId() + ") ");
LOGGER.error(" Policy (" + lastStateMachineExecutor.getSubject().getKey() + ") has overwritten Policy ("
- + thisStateMachineExecutor.getSubject().getKey().getID()
+ + thisStateMachineExecutor.getSubject().getKey().getId()
+ " so this overwritten policy will never be triggered in this engine.");
}
}
- LOGGER.exit("StateMachineHandler()<-" + internalContext.getKey().getID());
+ LOGGER.exit("StateMachineHandler()<-" + internalContext.getKey().getId());
}
/**
@@ -117,21 +117,21 @@ public class StateMachineHandler {
* @throws StateMachineException On state machine initiation errors
*/
protected void start() throws StateMachineException {
- LOGGER.entry("start()->" + key.getID());
+ LOGGER.entry("start()->" + key.getId());
// Iterate over the state machines
for (final StateMachineExecutor smExecutor : stateMachineExecutorMap.values()) {
try {
smExecutor.prepare();
} catch (final StateMachineException e) {
- final String stateMachineID = smExecutor.getContext().getKey().getID();
- LOGGER.warn("start()<-" + key.getID() + ", start failed, state machine \"" + stateMachineID + "\"", e);
+ final String stateMachineID = smExecutor.getContext().getKey().getId();
+ LOGGER.warn("start()<-" + key.getId() + ", start failed, state machine \"" + stateMachineID + "\"", e);
throw new StateMachineException(
- "start()<-" + key.getID() + ", start failed, state machine \"" + stateMachineID + "\"", e);
+ "start()<-" + key.getId() + ", start failed, state machine \"" + stateMachineID + "\"", e);
}
}
- LOGGER.exit("start()<-" + key.getID());
+ LOGGER.exit("start()<-" + key.getId());
}
/**
@@ -180,7 +180,7 @@ public class StateMachineHandler {
try {
smExecutor.cleanUp();
} catch (final StateMachineException e) {
- final String smID = smExecutor.getContext().getKey().getID();
+ final String smID = smExecutor.getContext().getKey().getId();
LOGGER.warn("stop()<-clean up failed, state machine \"" + smID + "\" cleanup failed", e);
}
}
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
index 6fbf647b4..109240c0d 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnEvent.java
@@ -123,7 +123,7 @@ public class EnEvent extends HashMap<String, Object> {
* @return the event key
*/
public String getID() {
- return axEvent.getKey().getID();
+ return axEvent.getKey().getId();
}
/**
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
index 5f12e8764..a7ce251bd 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/event/EnField.java
@@ -65,7 +65,7 @@ public class EnField implements Serializable {
try {
schemaHelper = new SchemaHelperFactory().createSchemaHelper(axField.getKey(), axField.getSchema());
} catch (final ContextRuntimeException e) {
- final String message = "schema helper cannot be created for parameter with key \"" + axField.getID()
+ final String message = "schema helper cannot be created for parameter with key \"" + axField.getId()
+ "\" with schema \"" + axField.getSchema() + "\"";
LOGGER.warn(message, e);
throw new EnException(message, e);
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
index cad83d6bc..9cf7d90e3 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateExecutor.java
@@ -131,7 +131,7 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
if (finalizerLogic == null) {
// Finalizer logic for the task does not exist
throw new StateMachineRuntimeException("state finalizer logic on task reference \"" + taskReference
- + "\" on state \"" + axState.getID() + "\" does not exist");
+ + "\" on state \"" + axState.getId() + "\" does not exist");
}
// Create a state finalizer executor for the task
@@ -140,7 +140,7 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
} else {
// This should never happen but.....
throw new StateMachineRuntimeException("invalid state output type on task reference \"" + taskReference
- + "\" on state \"" + axState.getID() + "\"");
+ + "\" on state \"" + axState.getId() + "\"");
}
}
}
@@ -178,7 +178,7 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
// Check that the incoming event matches the trigger for this state
if (!incomingEvent.getAxEvent().getKey().equals(axState.getTrigger())) {
throw new StateMachineException("incoming event \"" + incomingEvent.getID() + "\" does not match trigger \""
- + axState.getTrigger().getID() + "\" of state \"" + axState.getID() + "\"");
+ + axState.getTrigger().getId() + "\" of state \"" + axState.getId() + "\"");
}
// The key of the task to execute
@@ -213,8 +213,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
// State finalizer logic should exist for the task
final StateFinalizerExecutor finalizerLogicExecutor = task2StateFinalizerMap.get(taskKey);
if (finalizerLogicExecutor == null) {
- throw new StateMachineException("state finalizer logic for task \"" + taskKey.getID()
- + "\" not found for state \"" + axState.getID() + "\"");
+ throw new StateMachineException("state finalizer logic for task \"" + taskKey.getId()
+ + "\" not found for state \"" + axState.getId() + "\"");
}
// Execute the state finalizer logic to select a state output and to adjust the
@@ -227,7 +227,7 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
final AxStateOutput stateOutputDefinition = axState.getStateOutputs().get(stateOutputName);
if (stateOutputDefinition == null) {
throw new StateMachineException("state output definition for state output \"" + stateOutputName
- + "\" not found for state \"" + axState.getID() + "\"");
+ + "\" not found for state \"" + axState.getId() + "\"");
}
// Create the state output and transfer all the fields across to its event
@@ -247,8 +247,8 @@ public class StateExecutor implements Executor<EnEvent, StateOutput, AxState, Ap
// That's it, the state execution is complete
return stateOutput;
} catch (final Exception e) {
- final String errorMessage = "State execution of state \"" + axState.getID() + "\" on task \""
- + (taskKey != null ? taskKey.getID() : "null") + "\" failed: " + e.getMessage();
+ final String errorMessage = "State execution of state \"" + axState.getId() + "\" on task \""
+ + (taskKey != null ? taskKey.getId() : "null") + "\" failed: " + e.getMessage();
LOGGER.warn(errorMessage);
throw new StateMachineException(errorMessage, e);
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
index 0d37b0bb7..3bbcc13dc 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateFinalizerExecutor.java
@@ -95,7 +95,7 @@ public abstract class StateFinalizerExecutor
*/
@Override
public void prepare() throws StateMachineException {
- LOGGER.debug("prepare:" + finalizerLogic.getID() + "," + finalizerLogic.getLogicFlavour() + ","
+ LOGGER.debug("prepare:" + finalizerLogic.getId() + "," + finalizerLogic.getLogicFlavour() + ","
+ finalizerLogic.getLogic());
argumentNotNull(finalizerLogic.getLogic(), StateMachineException.class, "task logic cannot be null.");
}
@@ -122,7 +122,7 @@ public abstract class StateFinalizerExecutor
@Override
public final void executePre(final long executionID, final Map<String, Object> newIncomingFields)
throws StateMachineException, ContextException {
- LOGGER.debug("execute-pre:" + finalizerLogic.getLogicFlavour() + "," + getSubject().getID() + ","
+ LOGGER.debug("execute-pre:" + finalizerLogic.getLogicFlavour() + "," + getSubject().getId() + ","
+ finalizerLogic.getLogic());
// Record the incoming fields
@@ -141,8 +141,8 @@ public abstract class StateFinalizerExecutor
@Override
public final void executePost(final boolean returnValue) throws StateMachineException, ContextException {
if (!returnValue) {
- String errorMessage = "execute-post: state finalizer logic execution failure on state \"" + axState.getID()
- + "\" on finalizer logic " + finalizerLogic.getID();
+ String errorMessage = "execute-post: state finalizer logic execution failure on state \"" + axState.getId()
+ + "\" on finalizer logic " + finalizerLogic.getId();
if (executionContext.getMessage() != null) {
errorMessage += ", user message: " + executionContext.getMessage();
}
@@ -152,22 +152,22 @@ public abstract class StateFinalizerExecutor
// Check a state output has been selected
if (getOutgoing() == null) {
- LOGGER.warn("execute-post: state finalizer logic \"" + finalizerLogic.getID()
+ LOGGER.warn("execute-post: state finalizer logic \"" + finalizerLogic.getId()
+ "\" did not select an output state");
- throw new StateMachineException("execute-post: state finalizer logic \"" + finalizerLogic.getID()
+ throw new StateMachineException("execute-post: state finalizer logic \"" + finalizerLogic.getId()
+ "\" did not select an output state");
}
if (!axState.getStateOutputs().keySet().contains(getOutgoing())) {
LOGGER.warn(
- "execute-post: state finalizer logic \"" + finalizerLogic.getID() + "\" selected output state \""
- + getOutgoing() + "\" that does not exsist on state \"" + axState.getID() + "\"");
+ "execute-post: state finalizer logic \"" + finalizerLogic.getId() + "\" selected output state \""
+ + getOutgoing() + "\" that does not exsist on state \"" + axState.getId() + "\"");
throw new StateMachineException(
- "execute-post: state finalizer logic \"" + finalizerLogic.getID() + "\" selected output state \""
- + getOutgoing() + "\" that does not exsist on state \"" + axState.getID() + "\"");
+ "execute-post: state finalizer logic \"" + finalizerLogic.getId() + "\" selected output state \""
+ + getOutgoing() + "\" that does not exsist on state \"" + axState.getId() + "\"");
}
- LOGGER.debug("execute-post:" + finalizerLogic.getID() + ", returning state output \"" + getOutgoing()
+ LOGGER.debug("execute-post:" + finalizerLogic.getId() + ", returning state output \"" + getOutgoing()
+ " and fields " + incomingFields);
}
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
index 7a9594bf8..07ef8d6d6 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateMachineExecutor.java
@@ -161,7 +161,7 @@ public class StateMachineExecutor implements Executor<EnEvent, EnEvent, AxPolicy
stateExecutor = stateExecutorMap.get(stateOutput.getNextState());
if (stateExecutor == null) {
throw new StateMachineException(
- "state execution failed, next state \"" + stateOutput.getNextState().getID() + "\" not found");
+ "state execution failed, next state \"" + stateOutput.getNextState().getId() + "\" not found");
}
}
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
index aaec71b47..65cb0d2b8 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/StateOutput.java
@@ -110,7 +110,7 @@ public class StateOutput {
if (!incomingFieldDefinitionMap.keySet().equals(eventFieldMap.keySet())) {
throw new StateMachineException(
- "field definitions and values do not match for event " + outputEventDef.getID() + '\n'
+ "field definitions and values do not match for event " + outputEventDef.getId() + '\n'
+ incomingFieldDefinitionMap.keySet() + '\n' + eventFieldMap.keySet());
}
for (final Entry<String, Object> incomingFieldEntry : eventFieldMap.entrySet()) {
@@ -120,7 +120,7 @@ public class StateOutput {
// Check if this field is a field in the event
if (!outputEventDef.getFields().contains(fieldDef)) {
throw new StateMachineException(
- "field \"" + fieldName + "\" does not exist on event \"" + outputEventDef.getID() + "\"");
+ "field \"" + fieldName + "\" does not exist on event \"" + outputEventDef.getId() + "\"");
}
// Set the value in the output event
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
index 9f6f92d4e..8dd2575b0 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskExecutor.java
@@ -99,7 +99,7 @@ public abstract class TaskExecutor
*/
@Override
public void prepare() throws StateMachineException {
- LOGGER.debug("prepare:" + axTask.getKey().getID() + "," + axTask.getTaskLogic().getLogicFlavour() + ","
+ LOGGER.debug("prepare:" + axTask.getKey().getId() + "," + axTask.getTaskLogic().getLogicFlavour() + ","
+ axTask.getTaskLogic().getLogic());
argumentNotNull(axTask.getTaskLogic().getLogic(), StateMachineException.class, "task logic cannot be null.");
}
@@ -127,7 +127,7 @@ public abstract class TaskExecutor
public final void executePre(final long executionID, final Map<String, Object> newIncomingFields)
throws StateMachineException, ContextException {
LOGGER.debug("execute-pre:" + getSubject().getTaskLogic().getLogicFlavour() + ","
- + getSubject().getKey().getID() + "," + getSubject().getTaskLogic().getLogic());
+ + getSubject().getKey().getId() + "," + getSubject().getTaskLogic().getLogic());
// Check that the incoming event has all the input fields for this state
final Set<String> missingTaskInputFields = new TreeSet<>(axTask.getInputFields().keySet());
@@ -143,7 +143,7 @@ public abstract class TaskExecutor
}
if (!missingTaskInputFields.isEmpty()) {
throw new StateMachineException("task input fields \"" + missingTaskInputFields
- + "\" are missing for task \"" + axTask.getKey().getID() + "\"");
+ + "\" are missing for task \"" + axTask.getKey().getId() + "\"");
}
// Record the incoming fields
@@ -169,7 +169,7 @@ public abstract class TaskExecutor
public final void executePost(final boolean returnValue) throws StateMachineException, ContextException {
if (!returnValue) {
String errorMessage = "execute-post: task logic execution failure on task \"" + axTask.getKey().getName()
- + "\" in model " + internalContext.getKey().getID();
+ + "\" in model " + internalContext.getKey().getId();
if (executionContext.getMessage() != null) {
errorMessage += ", user message: " + executionContext.getMessage();
}
@@ -215,7 +215,7 @@ public abstract class TaskExecutor
}
if (!missingTaskOutputFields.isEmpty()) {
throw new StateMachineException("task output fields \"" + missingTaskOutputFields
- + "\" are missing for task \"" + axTask.getKey().getID() + "\"");
+ + "\" are missing for task \"" + axTask.getKey().getId() + "\"");
}
// Finally, check that the outgoing field map don't have any extra fields, if present, raise
@@ -225,10 +225,10 @@ public abstract class TaskExecutor
extraTaskOutputFields.removeAll(axTask.getOutputFields().keySet());
if (!extraTaskOutputFields.isEmpty()) {
throw new StateMachineException("task output fields \"" + extraTaskOutputFields
- + "\" are unwanted for task \"" + axTask.getKey().getID() + "\"");
+ + "\" are unwanted for task \"" + axTask.getKey().getId() + "\"");
}
- LOGGER.debug("execute-post:" + axTask.getKey().getID() + ", returning fields " + outgoingFields.toString());
+ LOGGER.debug("execute-post:" + axTask.getKey().getId() + ", returning fields " + outgoingFields.toString());
}
/*
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
index f3ac1f6b0..cda0ac549 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/TaskSelectExecutor.java
@@ -92,7 +92,7 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact
*/
@Override
public void prepare() throws StateMachineException {
- LOGGER.debug("prepare:" + axState.getKey().getID() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+ LOGGER.debug("prepare:" + axState.getKey().getId() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+ "," + axState.getTaskSelectionLogic().getLogic());
argumentNotNull(axState.getTaskSelectionLogic().getLogic(), "task selection logic cannot be null.");
}
@@ -117,7 +117,7 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact
*/
@Override
public final void executePre(final long executionID, final EnEvent newIncomingEvent) throws StateMachineException {
- LOGGER.debug("execute-pre:" + axState.getKey().getID() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+ LOGGER.debug("execute-pre:" + axState.getKey().getId() + "," + axState.getTaskSelectionLogic().getLogicFlavour()
+ "," + axState.getTaskSelectionLogic().getLogic());
this.incomingEvent = newIncomingEvent;
@@ -139,7 +139,7 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact
public final void executePost(final boolean returnValue) throws StateMachineException {
if (!returnValue) {
String errorMessage =
- "execute-post: task selection logic failed on state \"" + axState.getKey().getID() + "\"";
+ "execute-post: task selection logic failed on state \"" + axState.getKey().getId() + "\"";
if (executionContext.getMessage() != null) {
errorMessage += ", user message: " + executionContext.getMessage();
}
@@ -149,18 +149,18 @@ public abstract class TaskSelectExecutor implements Executor<EnEvent, AxArtifact
if (outgoingTaskKey == null || AxArtifactKey.getNullKey().getName().equals(outgoingTaskKey.getName())) {
outgoingTaskKey = axState.getDefaultTask();
- LOGGER.debug("execute-post:" + axState.getKey().getID() + ", returning default task");
+ LOGGER.debug("execute-post:" + axState.getKey().getId() + ", returning default task");
return;
}
if (!axState.getTaskReferences().containsKey(outgoingTaskKey)) {
- LOGGER.error("execute-post: task \"" + outgoingTaskKey.getID()
- + "\" returned by task selection logic not defined on state \"" + axState.getKey().getID() + "\"");
- throw new StateMachineException("task \"" + outgoingTaskKey.getID()
- + "\" returned by task selection logic not defined on state \"" + axState.getKey().getID() + "\"");
+ LOGGER.error("execute-post: task \"" + outgoingTaskKey.getId()
+ + "\" returned by task selection logic not defined on state \"" + axState.getKey().getId() + "\"");
+ throw new StateMachineException("task \"" + outgoingTaskKey.getId()
+ + "\" returned by task selection logic not defined on state \"" + axState.getKey().getId() + "\"");
}
- LOGGER.debug("execute-post:" + axState.getKey().getID() + "," + ", returning task " + outgoingTaskKey.getID());
+ LOGGER.debug("execute-post:" + axState.getKey().getId() + "," + ", returning task " + outgoingTaskKey.getId());
}
/*
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
index e63bd3db8..bb8e36275 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxStateFacade.java
@@ -68,7 +68,7 @@ public class AxStateFacade {
* @return the ID
*/
public String getId() {
- return state.getKey().getID();
+ return state.getKey().getId();
}
/**
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
index a9e93a3b2..f7b53554d 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/executor/context/AxTaskFacade.java
@@ -74,7 +74,7 @@ public class AxTaskFacade {
* @return the task ID
*/
public String getId() {
- return task.getID();
+ return task.getId();
}
/**
@@ -112,7 +112,7 @@ public class AxTaskFacade {
// Find the field for the field name
if (field == null) {
final String message = "no " + directionString + " field with name \"" + fieldName + "\" defined on task \""
- + task.getID() + "\"";
+ + task.getId() + "\"";
LOGGER.warn(message);
throw new StateMachineRuntimeException(message);
}
@@ -122,7 +122,7 @@ public class AxTaskFacade {
return new SchemaHelperFactory().createSchemaHelper(field.getKey(), field.getSchema());
} catch (final ContextRuntimeException e) {
final String message = "schema helper cannot be created for task field \"" + fieldName + "\" with key \""
- + field.getID() + "\" with schema \"" + field.getSchema() + "\"";
+ + field.getId() + "\" with schema \"" + field.getSchema() + "\"";
LOGGER.warn(message, e);
throw new EnException(message, e);
}
diff --git a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
index 9710b106e..c1c9ce949 100644
--- a/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
+++ b/core/core-engine/src/main/java/org/onap/policy/apex/core/engine/monitoring/EventMonitor.java
@@ -95,9 +95,9 @@ public class EventMonitor {
builder.append(',');
}
if (stackKey instanceof AxArtifactKey) {
- builder.append(((AxArtifactKey) stackKey).getID());
+ builder.append(((AxArtifactKey) stackKey).getId());
} else if (stackKey instanceof AxReferenceKey) {
- builder.append(((AxReferenceKey) stackKey).getID());
+ builder.append(((AxReferenceKey) stackKey).getId());
} else {
builder.append(stackKey.toString());
}