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

Refactor validateUpdatedPolicyService and validateUpdatedPolicyDevice

parent 5bdee66a
No related branches found
No related tags found
1 merge request!3feat(policy): policy rule add/update/delete RPCs
......@@ -507,10 +507,7 @@ public class PolicyServiceImpl implements PolicyService {
.subscribe()
.with(
policyRuleBoolean -> {
if (Boolean.TRUE.equals(isUpdatedPolicyRuleValid)) {
validateService(policyRuleService);
return;
} else {
if (Boolean.FALSE.equals(isUpdatedPolicyRuleValid)) {
var policyRuleState =
createFailedPolicyRuleState(
"The requested PolicyRuleService to update: "
......@@ -521,6 +518,8 @@ public class PolicyServiceImpl implements PolicyService {
contextService.setPolicyRule(policyRuleBasic);
return;
}
validateService(policyRuleService);
});
}
......@@ -534,10 +533,7 @@ public class PolicyServiceImpl implements PolicyService {
.subscribe()
.with(
policyRuleBoolean -> {
if (Boolean.TRUE.equals(isUpdatedPolicyRuleValid)) {
validateDevice(policyRuleDevice);
return;
} else {
if (Boolean.FALSE.equals(isUpdatedPolicyRuleValid)) {
var policyRuleState =
createFailedPolicyRuleState(
"The requested PolicyRuleDevice to update: "
......@@ -548,6 +544,7 @@ public class PolicyServiceImpl implements PolicyService {
contextService.setPolicyRule(policyRuleBasic);
return;
}
validateDevice(policyRuleDevice);
});
}
......
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