aboutsummaryrefslogtreecommitdiffstats
path: root/services/services-engine/src
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-04 17:24:15 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-04 17:25:22 +0100
commit87be30582d1db37bee7c6b456c0c5c3ca9584963 (patch)
tree28806c5866fc5d07c89a06014d7c7d2705772b4f /services/services-engine/src
parentf32508381ce0b555fc14978cbaa458aa4e2d91c5 (diff)
Fix checkstyle issues in apex model basic
CHeckstyle issues in apex model basic and knock on changes in other apex modules. Issue-ID: POLICY-1034 Change-Id: I65823f5e2e344526abc74b0812877113acb056ec Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'services/services-engine/src')
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java42
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java4
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java76
-rw-r--r--services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java58
4 files changed, 90 insertions, 90 deletions
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
index 1bc88a409..3840e915d 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/engdep/EngDepMessageListener.java
@@ -203,90 +203,90 @@ public class EngDepMessageListener implements MessageListener<Message>, Runnable
switch (enDepAction) {
case GET_ENGINE_SERVICE_INFO:
final GetEngineServiceInfo engineServiceInformationMessage = (GetEngineServiceInfo) message;
- LOGGER.debug("getting engine service information for engine service " + apexService.getKey().getID()
+ LOGGER.debug("getting engine service information for engine service " + apexService.getKey().getId()
+ " . . .");
// Send a reply with the engine service information
sendServiceInfoReply(webSocket, engineServiceInformationMessage, apexService.getKey(),
apexService.getEngineKeys(), apexService.getApexModelKey());
LOGGER.debug(
- "returned engine service information for engine service " + apexService.getKey().getID());
+ "returned engine service information for engine service " + apexService.getKey().getId());
break;
case UPDATE_MODEL:
final UpdateModel updateModelMessage = (UpdateModel) message;
- LOGGER.debug("updating model in engine {} . . .", updateModelMessage.getTarget().getID());
+ LOGGER.debug("updating model in engine {} . . .", updateModelMessage.getTarget().getId());
// Update the model
apexService.updateModel(updateModelMessage.getTarget(), updateModelMessage.getMessageData(),
updateModelMessage.isForceInstall());
// Send a reply indicating the message action worked
sendReply(webSocket, updateModelMessage, true,
- "updated model in engine " + updateModelMessage.getTarget().getID());
- LOGGER.debug("updated model in engine service {}", updateModelMessage.getTarget().getID());
+ "updated model in engine " + updateModelMessage.getTarget().getId());
+ LOGGER.debug("updated model in engine service {}", updateModelMessage.getTarget().getId());
break;
case START_ENGINE:
final StartEngine startEngineMessage = (StartEngine) message;
- LOGGER.debug("starting engine {} . . .", startEngineMessage.getTarget().getID());
+ LOGGER.debug("starting engine {} . . .", startEngineMessage.getTarget().getId());
// Start the engine
apexService.start(startEngineMessage.getTarget());
// Send a reply indicating the message action worked
sendReply(webSocket, startEngineMessage, true,
- "started engine " + startEngineMessage.getTarget().getID());
- LOGGER.debug("started engine {}", startEngineMessage.getTarget().getID());
+ "started engine " + startEngineMessage.getTarget().getId());
+ LOGGER.debug("started engine {}", startEngineMessage.getTarget().getId());
break;
case STOP_ENGINE:
final StopEngine stopEngineMessage = (StopEngine) message;
- LOGGER.debug("stopping engine {} . . .", stopEngineMessage.getTarget().getID());
+ LOGGER.debug("stopping engine {} . . .", stopEngineMessage.getTarget().getId());
// Stop the engine
apexService.stop(stopEngineMessage.getTarget());
// Send a reply indicating the message action worked
sendReply(webSocket, stopEngineMessage, true,
- "stopped engine " + stopEngineMessage.getTarget().getID());
- LOGGER.debug("stopping engine {}", stopEngineMessage.getTarget().getID());
+ "stopped engine " + stopEngineMessage.getTarget().getId());
+ LOGGER.debug("stopping engine {}", stopEngineMessage.getTarget().getId());
break;
case START_PERIODIC_EVENTS:
final StartPeriodicEvents startPeriodicEventsMessage = (StartPeriodicEvents) message;
LOGGER.debug("starting periodic events on engine {} . . .",
- startPeriodicEventsMessage.getTarget().getID());
+ startPeriodicEventsMessage.getTarget().getId());
// Start periodic events with the period specified in the message
final Long period = Long.parseLong(startPeriodicEventsMessage.getMessageData());
apexService.startPeriodicEvents(period);
// Send a reply indicating the message action worked
sendReply(webSocket, startPeriodicEventsMessage, true, "started periodic events on engine "
- + startPeriodicEventsMessage.getTarget().getID() + " with period " + period);
- LOGGER.debug("started periodic events on engine " + startPeriodicEventsMessage.getTarget().getID()
+ + startPeriodicEventsMessage.getTarget().getId() + " with period " + period);
+ LOGGER.debug("started periodic events on engine " + startPeriodicEventsMessage.getTarget().getId()
+ " with period " + period);
break;
case STOP_PERIODIC_EVENTS:
final StopPeriodicEvents stopPeriodicEventsMessage = (StopPeriodicEvents) message;
LOGGER.debug("stopping periodic events on engine {} . . .",
- stopPeriodicEventsMessage.getTarget().getID());
+ stopPeriodicEventsMessage.getTarget().getId());
// Stop periodic events
apexService.stopPeriodicEvents();
// Send a reply indicating the message action worked
sendReply(webSocket, stopPeriodicEventsMessage, true,
- "stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getID());
- LOGGER.debug("stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getID());
+ "stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getId());
+ LOGGER.debug("stopped periodic events on engine " + stopPeriodicEventsMessage.getTarget().getId());
break;
case GET_ENGINE_STATUS:
final GetEngineStatus getEngineStatusMessage = (GetEngineStatus) message;
- LOGGER.debug("getting status for engine{} . . .", getEngineStatusMessage.getTarget().getID());
+ LOGGER.debug("getting status for engine{} . . .", getEngineStatusMessage.getTarget().getId());
// Send a reply with the engine status
sendReply(webSocket, getEngineStatusMessage, true,
apexService.getStatus(getEngineStatusMessage.getTarget()));
- LOGGER.debug("returned status for engine {}", getEngineStatusMessage.getTarget().getID());
+ LOGGER.debug("returned status for engine {}", getEngineStatusMessage.getTarget().getId());
break;
case GET_ENGINE_INFO:
final GetEngineInfo getEngineInfo = (GetEngineInfo) message;
- LOGGER.debug("getting runtime information for engine {} . . .", getEngineInfo.getTarget().getID());
+ LOGGER.debug("getting runtime information for engine {} . . .", getEngineInfo.getTarget().getId());
// Send a reply with the engine runtime information
sendReply(webSocket, getEngineInfo, true, apexService.getRuntimeInfo(getEngineInfo.getTarget()));
- LOGGER.debug("returned runtime information for engine {}", getEngineInfo.getTarget().getID());
+ LOGGER.debug("returned runtime information for engine {}", getEngineInfo.getTarget().getId());
break;
case RESPONSE:
throw new ApexException("RESPONSE action on received message not handled by engine");
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
index 21e4cd122..30e9db722 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/event/impl/jsonprotocolplugin/Apex2JSONEventConverter.java
@@ -176,7 +176,7 @@ public class Apex2JSONEventConverter implements ApexEventProtocolConverter {
if (!apexEvent.containsKey(fieldName)) {
if (!eventField.getOptional()) {
- final String errorMessage = "error parsing " + eventDefinition.getID() + " event to Json. "
+ final String errorMessage = "error parsing " + eventDefinition.getId() + " event to Json. "
+ "Field \"" + fieldName + "\" is missing, but is mandatory. Fields: " + apexEvent;
LOGGER.debug(errorMessage);
throw new ApexEventRuntimeException(errorMessage);
@@ -240,7 +240,7 @@ public class Apex2JSONEventConverter implements ApexEventProtocolConverter {
final String fieldName = eventField.getKey().getLocalName();
if (!hasJSONField(jsonObject, fieldName)) {
if (!eventField.getOptional()) {
- final String errorMessage = "error parsing " + eventDefinition.getID() + " event from Json. "
+ final String errorMessage = "error parsing " + eventDefinition.getId() + " event from Json. "
+ "Field \"" + fieldName + "\" is missing, but is mandatory.";
LOGGER.debug(errorMessage);
throw new ApexEventException(errorMessage);
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
index ee5f9ae72..d5cb05507 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineServiceImpl.java
@@ -113,7 +113,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
final AxArtifactKey engineWorkerKey =
new AxArtifactKey(engineServiceKey.getName() + '-' + engineCounter, engineServiceKey.getVersion());
engineWorkerMap.put(engineWorkerKey, new EngineWorker(engineWorkerKey, queue, atFactory));
- LOGGER.info("Created apex engine {} .", engineWorkerKey.getID());
+ LOGGER.info("Created apex engine {} .", engineWorkerKey.getId());
}
LOGGER.info("APEX service created.");
@@ -272,9 +272,9 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Check if the Apex model specified is sane
if (apexModelString == null || apexModelString.trim().length() == 0) {
LOGGER.warn(
- "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is empty");
+ "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is empty");
throw new ApexException(
- "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is empty");
+ "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is empty");
}
// Read the Apex model into memory using the Apex Model Reader
@@ -283,14 +283,14 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
apexPolicyModel = modelReader.read(new ByteArrayInputStream(apexModelString.getBytes()));
} catch (final ApexModelException e) {
- LOGGER.error("failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getID(), e);
+ LOGGER.error("failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getId(), e);
throw new ApexException(
- "failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getID(), e);
+ "failed to unmarshal the apex model on engine service " + incomingEngineServiceKey.getId(), e);
}
if (apexPolicyModel == null) {
- LOGGER.error("apex model null on engine service " + incomingEngineServiceKey.getID());
- throw new ApexException("apex model null on engine service " + incomingEngineServiceKey.getID());
+ LOGGER.error("apex model null on engine service " + incomingEngineServiceKey.getId());
+ throw new ApexException("apex model null on engine service " + incomingEngineServiceKey.getId());
}
// Update the model
@@ -315,17 +315,17 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Check if the Apex model specified is sane
if (apexModel == null) {
LOGGER.warn(
- "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is null");
+ "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is null");
throw new ApexException(
- "model for updating on engine service with key " + incomingEngineServiceKey.getID() + " is null");
+ "model for updating on engine service with key " + incomingEngineServiceKey.getId() + " is null");
}
// Check if the key on the update request is correct
if (!this.engineServiceKey.equals(incomingEngineServiceKey)) {
- LOGGER.warn("engine service key " + incomingEngineServiceKey.getID() + " does not match the key"
- + engineServiceKey.getID() + " of this engine service");
- throw new ApexException("engine service key " + incomingEngineServiceKey.getID() + " does not match the key"
- + engineServiceKey.getID() + " of this engine service");
+ LOGGER.warn("engine service key " + incomingEngineServiceKey.getId() + " does not match the key"
+ + engineServiceKey.getId() + " of this engine service");
+ throw new ApexException("engine service key " + incomingEngineServiceKey.getId() + " does not match the key"
+ + engineServiceKey.getId() + " of this engine service");
}
// Check model compatibility
@@ -334,14 +334,14 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
final AxPolicyModel currentModel = ModelService.getModel(AxPolicyModel.class);
if (!currentModel.getKey().isCompatible(apexModel.getKey())) {
if (forceFlag) {
- LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getID()
+ LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getId()
+ "\" is not a compatible model update from the existing engine model with key \""
- + currentModel.getKey().getID() + "\"");
+ + currentModel.getKey().getId() + "\"");
} else {
throw new ContextException(
- "apex model update failed, supplied model with key \"" + apexModel.getKey().getID()
+ "apex model update failed, supplied model with key \"" + apexModel.getKey().getId()
+ "\" is not a compatible model update from the existing engine model with key \""
- + currentModel.getKey().getID() + "\"");
+ + currentModel.getKey().getId() + "\"");
}
}
}
@@ -359,7 +359,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
final StringBuilder notStoppedEngineIDBuilder = new StringBuilder();
for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
if (engineWorkerEntry.getValue().getState() != AxEngineState.STOPPED) {
- notStoppedEngineIDBuilder.append(engineWorkerEntry.getKey().getID());
+ notStoppedEngineIDBuilder.append(engineWorkerEntry.getKey().getId());
notStoppedEngineIDBuilder.append('(');
notStoppedEngineIDBuilder.append(engineWorkerEntry.getValue().getState());
notStoppedEngineIDBuilder.append(") ");
@@ -367,7 +367,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
}
if (notStoppedEngineIDBuilder.length() > 0) {
final String errorString = "cannot update model on engine service with key "
- + incomingEngineServiceKey.getID() + ", engines not stopped after " + MAX_STOP_WAIT_TIME
+ + incomingEngineServiceKey.getId() + ", engines not stopped after " + MAX_STOP_WAIT_TIME
+ "ms are: " + notStoppedEngineIDBuilder.toString().trim();
LOGGER.warn(errorString);
throw new ApexException(errorString);
@@ -376,7 +376,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Update the engines
for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
- LOGGER.info("Registering apex model on engine {}", engineWorkerEntry.getKey().getID());
+ LOGGER.info("Registering apex model on engine {}", engineWorkerEntry.getKey().getId());
engineWorkerEntry.getValue().updateModel(engineWorkerEntry.getKey(), apexModel, forceFlag);
}
@@ -392,7 +392,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
for (final Entry<AxArtifactKey, EngineService> engineWorkerEntry : engineWorkerMap.entrySet()) {
if (engineWorkerEntry.getValue().getState() != AxEngineState.READY
&& engineWorkerEntry.getValue().getState() != AxEngineState.EXECUTING) {
- notRunningEngineIDBuilder.append(engineWorkerEntry.getKey().getID());
+ notRunningEngineIDBuilder.append(engineWorkerEntry.getKey().getId());
notRunningEngineIDBuilder.append('(');
notRunningEngineIDBuilder.append(engineWorkerEntry.getValue().getState());
notRunningEngineIDBuilder.append(") ");
@@ -400,7 +400,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
}
if (notRunningEngineIDBuilder.length() > 0) {
final String errorString = "engine start error on model update on engine service with key "
- + incomingEngineServiceKey.getID() + ", engines not running are: "
+ + incomingEngineServiceKey.getId() + ", engines not running are: "
+ notRunningEngineIDBuilder.toString().trim();
LOGGER.warn(errorString);
throw new ApexException(errorString);
@@ -457,8 +457,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
- throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+ throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
}
// Start the engine
@@ -499,8 +499,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
- throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+ throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
}
// Stop the engine
@@ -536,7 +536,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public boolean isStarted(final AxArtifactKey engineKey) {
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
}
return engineWorkerMap.get(engineKey).isStarted();
}
@@ -568,7 +568,7 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public boolean isStopped(final AxArtifactKey engineKey) {
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
}
return engineWorkerMap.get(engineKey).isStopped();
}
@@ -582,9 +582,9 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public void startPeriodicEvents(final long period) throws ApexException {
// Check if periodic events are already started
if (periodicEventGenerator != null) {
- LOGGER.warn("Peiodic event geneation already running on engine " + engineServiceKey.getID() + ", "
+ LOGGER.warn("Peiodic event geneation already running on engine " + engineServiceKey.getId() + ", "
+ periodicEventGenerator.toString());
- throw new ApexException("Peiodic event geneation already running on engine " + engineServiceKey.getID()
+ throw new ApexException("Peiodic event geneation already running on engine " + engineServiceKey.getId()
+ ", " + periodicEventGenerator.toString());
}
@@ -605,8 +605,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public void stopPeriodicEvents() throws ApexException {
// Check if periodic events are already started
if (periodicEventGenerator == null) {
- LOGGER.warn("Peiodic event geneation not running on engine " + engineServiceKey.getID());
- throw new ApexException("Peiodic event geneation not running on engine " + engineServiceKey.getID());
+ LOGGER.warn("Peiodic event geneation not running on engine " + engineServiceKey.getId());
+ throw new ApexException("Peiodic event geneation not running on engine " + engineServiceKey.getId());
}
// Stop periodic events
@@ -625,8 +625,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public String getStatus(final AxArtifactKey engineKey) throws ApexException {
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
- throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+ throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
}
// Return the information for this worker
@@ -644,8 +644,8 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
public String getRuntimeInfo(final AxArtifactKey engineKey) throws ApexException {
// Check if we have this key on our map
if (!engineWorkerMap.containsKey(engineKey)) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not found in engine service");
- throw new ApexException("engine with key " + engineKey.getID() + " not found in engine service");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not found in engine service");
+ throw new ApexException("engine with key " + engineKey.getId() + " not found in engine service");
}
// Return the information for this worker
@@ -664,12 +664,12 @@ public final class EngineServiceImpl implements EngineService, EngineServiceEven
// Check if we have this key on our map
if (getState() == AxEngineState.STOPPED) {
LOGGER.warn("event " + event.getName() + " not processed, no engines on engine service "
- + engineServiceKey.getID() + " are running");
+ + engineServiceKey.getId() + " are running");
return;
}
if (event == null) {
- LOGGER.warn("Null events cannot be processed, in engine service " + engineServiceKey.getID());
+ LOGGER.warn("Null events cannot be processed, in engine service " + engineServiceKey.getId());
return;
}
diff --git a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
index f82aae69b..be294aae7 100644
--- a/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
+++ b/services/services-engine/src/main/java/org/onap/policy/apex/service/engine/runtime/impl/EngineWorker.java
@@ -131,7 +131,7 @@ final class EngineWorker implements EngineService {
public void registerActionListener(final String listenerName, final ApexEventListener apexEventListener) {
// Sanity checks on the Apex model
if (engine == null) {
- LOGGER.warn("listener registration on engine with key " + engineWorkerKey.getID()
+ LOGGER.warn("listener registration on engine with key " + engineWorkerKey.getId()
+ ", failed, listener is null");
return;
}
@@ -150,7 +150,7 @@ final class EngineWorker implements EngineService {
public void deregisterActionListener(final String listenerName) {
// Sanity checks on the Apex model
if (engine == null) {
- LOGGER.warn("listener deregistration on engine with key " + engineWorkerKey.getID()
+ LOGGER.warn("listener deregistration on engine with key " + engineWorkerKey.getId()
+ ", failed, listener is null");
return;
}
@@ -222,13 +222,13 @@ final class EngineWorker implements EngineService {
final ApexModelReader<AxPolicyModel> modelReader = new ApexModelReader<>(AxPolicyModel.class);
apexPolicyModel = modelReader.read(new ByteArrayInputStream(engineModel.getBytes()));
} catch (final ApexModelException e) {
- LOGGER.error("failed to unmarshal the apex model on engine " + engineKey.getID(), e);
- throw new ApexException("failed to unmarshal the apex model on engine " + engineKey.getID(), e);
+ LOGGER.error("failed to unmarshal the apex model on engine " + engineKey.getId(), e);
+ throw new ApexException("failed to unmarshal the apex model on engine " + engineKey.getId(), e);
}
if (apexPolicyModel == null) {
- LOGGER.error("apex model null on engine " + engineKey.getID());
- throw new ApexException("apex model null on engine " + engineKey.getID());
+ LOGGER.error("apex model null on engine " + engineKey.getId());
+ throw new ApexException("apex model null on engine " + engineKey.getId());
}
// Update the Apex model in the Apex engine
@@ -252,16 +252,16 @@ final class EngineWorker implements EngineService {
// Check if the key on the update request is correct
if (!engineWorkerKey.equals(engineKey)) {
- LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+ LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
+ " of this engine");
- throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
- + engineWorkerKey.getID() + " of this engine");
+ throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+ + engineWorkerKey.getId() + " of this engine");
}
// Sanity checks on the Apex model
if (engine == null) {
- LOGGER.warn("engine with key " + engineKey.getID() + " not initialized");
- throw new ApexException("engine with key " + engineKey.getID() + " not initialized");
+ LOGGER.warn("engine with key " + engineKey.getId() + " not initialized");
+ throw new ApexException("engine with key " + engineKey.getId() + " not initialized");
}
// Check model compatibility
@@ -270,14 +270,14 @@ final class EngineWorker implements EngineService {
final AxPolicyModel currentModel = ModelService.getModel(AxPolicyModel.class);
if (!currentModel.getKey().isCompatible(apexModel.getKey())) {
if (forceFlag) {
- LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getID()
+ LOGGER.warn("apex model update forced, supplied model with key \"" + apexModel.getKey().getId()
+ "\" is not a compatible model update from the existing engine model with key \""
- + currentModel.getKey().getID() + "\"");
+ + currentModel.getKey().getId() + "\"");
} else {
throw new ContextException(
- "apex model update failed, supplied model with key \"" + apexModel.getKey().getID()
+ "apex model update failed, supplied model with key \"" + apexModel.getKey().getId()
+ "\" is not a compatible model update from the existing engine model with key \""
- + currentModel.getKey().getID() + "\"");
+ + currentModel.getKey().getId() + "\"");
}
}
}
@@ -285,7 +285,7 @@ final class EngineWorker implements EngineService {
// Update the Apex model in the Apex engine
engine.updateModel(apexModel);
- LOGGER.debug("engine model {} added to the engine-{}", apexModel.getKey().getID(), engineWorkerKey);
+ LOGGER.debug("engine model {} added to the engine-{}", apexModel.getKey().getId(), engineWorkerKey);
LOGGER.exit();
}
@@ -322,22 +322,22 @@ final class EngineWorker implements EngineService {
// Check if the key on the start request is correct
if (!engineWorkerKey.equals(engineKey)) {
- LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+ LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
+ " of this engine");
- throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
- + engineWorkerKey.getID() + " of this engine");
+ throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+ + engineWorkerKey.getId() + " of this engine");
}
if (engine == null) {
- LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " null");
- throw new ApexException("apex engine for engine key" + engineWorkerKey.getID() + " null");
+ LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " null");
+ throw new ApexException("apex engine for engine key" + engineWorkerKey.getId() + " null");
}
// Starts the event processing thread that handles incoming events
if (processorThread != null && processorThread.isAlive()) {
- LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " is already running with state "
+ LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " is already running with state "
+ getState());
- throw new ApexException("apex engine for engine key" + engineWorkerKey.getID()
+ throw new ApexException("apex engine for engine key" + engineWorkerKey.getId()
+ " is already running with state " + getState());
}
@@ -372,22 +372,22 @@ final class EngineWorker implements EngineService {
public void stop(final AxArtifactKey engineKey) throws ApexException {
// Check if the key on the start request is correct
if (!engineWorkerKey.equals(engineKey)) {
- LOGGER.warn("engine key " + engineKey.getID() + " does not match the key" + engineWorkerKey.getID()
+ LOGGER.warn("engine key " + engineKey.getId() + " does not match the key" + engineWorkerKey.getId()
+ " of this engine");
- throw new ApexException("engine key " + engineKey.getID() + " does not match the key"
- + engineWorkerKey.getID() + " of this engine");
+ throw new ApexException("engine key " + engineKey.getId() + " does not match the key"
+ + engineWorkerKey.getId() + " of this engine");
}
if (engine == null) {
- LOGGER.error("apex engine for engine key" + engineWorkerKey.getID() + " null");
- throw new ApexException("apex engine for engine key" + engineWorkerKey.getID() + " null");
+ LOGGER.error("apex engine for engine key" + engineWorkerKey.getId() + " null");
+ throw new ApexException("apex engine for engine key" + engineWorkerKey.getId() + " null");
}
// Interrupt the worker to stop its thread
if (processorThread == null || !processorThread.isAlive()) {
processorThread = null;
- LOGGER.warn("apex engine for engine key" + engineWorkerKey.getID() + " is already stopped with state "
+ LOGGER.warn("apex engine for engine key" + engineWorkerKey.getId() + " is already stopped with state "
+ getState());
return;
}