From f59208f6e79f729a06e0349c04c19662c1977045 Mon Sep 17 00:00:00 2001 From: pasindu Date: Tue, 3 Sep 2024 09:44:11 +0530 Subject: [PATCH] Save OperationStartupHandler in data holder --- .../mgt/core/internal/DeviceManagementDataHolder.java | 9 +++++++++ .../core/internal/DeviceManagementServiceComponent.java | 2 ++ 2 files changed, 11 insertions(+) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java index f9ea261793..95d3d9b0a4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java @@ -100,6 +100,7 @@ public class DeviceManagementDataHolder { private DeviceStatusManagementService deviceStatusManagementService; private APIApplicationServices apiApplicationServices; private PublisherRESTAPIServices publisherRESTAPIServices; + private OperationStartupHandler operationStartupHandler; private final Map deviceStatusTaskPluginConfigs = Collections.synchronizedMap( new HashMap<>()); @@ -457,4 +458,12 @@ public class DeviceManagementDataHolder { public void setGroupAccessAuthorizationService(GroupAccessAuthorizationService groupAccessAuthorizationService) { this.groupAccessAuthorizationService = groupAccessAuthorizationService; } + + public OperationStartupHandler getOperationStartupHandler() { + return operationStartupHandler; + } + + public void setOperationStartupHandler(OperationStartupHandler operationStartupHandler) { + this.operationStartupHandler = operationStartupHandler; + } } diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java index b2c9b20ab3..125a2f0524 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -262,7 +262,9 @@ public class DeviceManagementServiceComponent { UserRoleCreateObserver userRoleCreateObserver = new UserRoleCreateObserver(); bundleContext.registerService(ServerStartupObserver.class.getName(), userRoleCreateObserver, null); + /* Registering Device Operation Management Startup Handler */ OperationStartupHandler operationStartupHandler = new OperationStartupHandler(); + DeviceManagementDataHolder.getInstance().setOperationStartupHandler(operationStartupHandler); bundleContext.registerService(ServerStartupObserver.class.getName(), operationStartupHandler, null); /* Registering Device Management Service */