Skip to content
Snippets Groups Projects
Commit 0b5a19f9 authored by Fotis Soldatos's avatar Fotis Soldatos
Browse files

refactor(automation): extract warn message to it's own method

parent 91b8c2c6
No related branches found
No related tags found
1 merge request!54Release 2.0.0
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
package eu.teraflow.automation; package eu.teraflow.automation;
import eu.teraflow.automation.context.ContextService; import eu.teraflow.automation.context.ContextService;
import eu.teraflow.automation.context.model.Event;
import eu.teraflow.automation.context.model.EventTypeEnum;
import io.quarkus.runtime.StartupEvent; import io.quarkus.runtime.StartupEvent;
import java.time.Duration; import java.time.Duration;
import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.ApplicationScoped;
...@@ -75,11 +77,7 @@ public class ContextSubscriber { ...@@ -75,11 +77,7 @@ public class ContextSubscriber {
case UPDATE: case UPDATE:
case REMOVE: case REMOVE:
case UNDEFINED: case UNDEFINED:
{ logWarningMessage(event, deviceId, eventType);
LOGGER.warnf(
"Received %s for device [%s]. [%s] event handling is not yet implemented, ignoring...",
event, deviceId, eventType);
}
break; break;
} }
}); });
...@@ -94,4 +92,10 @@ public class ContextSubscriber { ...@@ -94,4 +92,10 @@ public class ContextSubscriber {
LOGGER.info("Not subscribing to Context service for device events..."); LOGGER.info("Not subscribing to Context service for device events...");
} }
} }
private void logWarningMessage(Event event, String deviceId, EventTypeEnum eventType) {
LOGGER.warnf(
"Received %s for device [%s]. [%s] event handling is not yet implemented, ignoring...",
event, deviceId, eventType);
}
} }
...@@ -3,8 +3,8 @@ apiVersion: v1 ...@@ -3,8 +3,8 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 70662d960465062d0c21ccce778af4ddb5619bec app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479
app.quarkus.io/build-timestamp: 2022-08-01 - 11:18:43 +0000 app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000
labels: labels:
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
app: automationservice app: automationservice
...@@ -25,8 +25,8 @@ apiVersion: apps/v1 ...@@ -25,8 +25,8 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 70662d960465062d0c21ccce778af4ddb5619bec app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479
app.quarkus.io/build-timestamp: 2022-08-01 - 11:18:43 +0000 app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000
labels: labels:
app: automationservice app: automationservice
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
...@@ -39,8 +39,8 @@ spec: ...@@ -39,8 +39,8 @@ spec:
template: template:
metadata: metadata:
annotations: annotations:
app.quarkus.io/commit-id: 70662d960465062d0c21ccce778af4ddb5619bec app.quarkus.io/commit-id: ac09ca6e8827edf1379450dc3e68dcdc35957479
app.quarkus.io/build-timestamp: 2022-08-01 - 11:18:43 +0000 app.quarkus.io/build-timestamp: 2022-08-02 - 07:36:43 +0000
labels: labels:
app: automationservice app: automationservice
app.kubernetes.io/name: automationservice app.kubernetes.io/name: automationservice
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment