Update operations status when serve startup #503
Merged
tcdlpds
merged 5 commits from pasindu/device-mgt-core:operationImprovement
into master
2 months ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'pasindu/device-mgt-core:operationImprovement'
Deleting a branch is permanent. It CANNOT be undone. Continue?
The fix is related for the -
Support ticket - https://support.entgra.net/issues/9668
Implementation -
API details
Api - /api/device-mgt-config/v1.0/operation-configuration
Scope key - admin:operation_config:manage
Request body format -
{
"deviceTypes" : ["switchgear_controlbox"],
"initialOperationStatus" : "IN_PROGRESS",
"requiredStatusChange" : "ERROR"
}
Note : deviceTypes is an array of strings.
5843ff88a2
toeeab5b2d40
2 months agoeeab5b2d40
to2538c83dc5
2 months ago2538c83dc5
to70a25549ae
2 months ago70a25549ae
to5a57dbac9b
2 months agoUserRoleCreateObserver userRoleCreateObserver = new UserRoleCreateObserver();
bundleContext.registerService(ServerStartupObserver.class.getName(), userRoleCreateObserver, null);
OperationStartupHandler operationStartupHandler = new OperationStartupHandler();
Shall we save the service in the DataHolder also?
Fixed with
f59208f6e7
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.core.ServerStartupObserver;
public class OperationStartupHandler implements ServerStartupObserver {
Why haven't we used already implemented class to have this functionality?
In device-mgt core component there were only Server startup observer use for the UserRoleCreateObserver service so I created a separate class for this operation startup service.
} catch (MetadataManagementException e) {
String msg = "Error occurred while retrieving operation configuration";
log.error(msg, e);
throw new OperationConfigException(e);
Throw message and the error, please check all the places and do the modification.
Fixed with
6d324c084a
sql += " AND STATUS=?";
}
stmt = connection.prepareStatement(sql);
Let's use try-with-resources, then we can remove the finally block also. Please check all the relevant places and do the modifications.
Fixed with
87b98a6cb5
14a589f42a
to87b98a6cb5
2 months agof071a68e3a
to0272bda2ce
2 months ago00686e75d1
into master 2 months agoReviewers
00686e75d1
.