Skip to content
Snippets Groups Projects
Commit b449507d authored by Vasilis Katopodis's avatar Vasilis Katopodis
Browse files

Add subcriber callback instead of thread

parent 74fd3aa7
No related branches found
No related tags found
1 merge request!3feat(policy): policy rule add/update/delete RPCs
......@@ -146,13 +146,10 @@ public class PolicyServiceImpl implements PolicyService {
final var policyRuleBasic = policyRuleService.getPolicyRuleBasic();
policyRuleBasic.setPolicyRuleState(INSERTED_POLICYRULE_STATE);
new Thread(
() -> {
validateService(policyRuleService);
})
.start();
contextService.setPolicyRule(policyRuleBasic);
contextService
.setPolicyRule(policyRuleBasic)
.subscribe()
.with(id -> validateService(policyRuleService));
return Uni.createFrom().item(policyRuleBasic.getPolicyRuleState());
}
......@@ -164,13 +161,10 @@ public class PolicyServiceImpl implements PolicyService {
final var policyRuleBasic = policyRuleService.getPolicyRuleBasic();
policyRuleBasic.setPolicyRuleState(UPDATED_POLICYRULE_STATE);
new Thread(
() -> {
validateUpdatedPolicyService(policyRuleService);
})
.start();
contextService.setPolicyRule(policyRuleBasic);
contextService
.setPolicyRule(policyRuleBasic)
.subscribe()
.with(id -> validateUpdatedPolicyService(policyRuleService));
return Uni.createFrom().item(policyRuleBasic.getPolicyRuleState());
}
......@@ -182,13 +176,10 @@ public class PolicyServiceImpl implements PolicyService {
final var policyRuleBasic = policyRuleDevice.getPolicyRuleBasic();
policyRuleBasic.setPolicyRuleState(INSERTED_POLICYRULE_STATE);
new Thread(
() -> {
validateDevice(policyRuleDevice);
})
.start();
contextService.setPolicyRule(policyRuleBasic);
contextService
.setPolicyRule(policyRuleBasic)
.subscribe()
.with(id -> validateDevice(policyRuleDevice));
return Uni.createFrom().item(policyRuleBasic.getPolicyRuleState());
}
......@@ -199,13 +190,10 @@ public class PolicyServiceImpl implements PolicyService {
final var policyRuleBasic = policyRuleDevice.getPolicyRuleBasic();
policyRuleBasic.setPolicyRuleState(UPDATED_POLICYRULE_STATE);
new Thread(
() -> {
validateUpdatedPolicyDevice(policyRuleDevice);
})
.start();
contextService.setPolicyRule(policyRuleBasic);
contextService
.setPolicyRule(policyRuleBasic)
.subscribe()
.with(id -> validateUpdatedPolicyDevice(policyRuleDevice));
return Uni.createFrom().item(policyRuleBasic.getPolicyRuleState());
}
......
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