Loading src/policy/src/main/java/org/etsi/tfs/policy/policy/PolicyServiceImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class PolicyServiceImpl implements PolicyService { @Override public Uni<PolicyRuleState> deletePolicy(String policyRuleId) { LOGGER.infof("Received %s", policyRuleId); LOGGER.infof("Received policy %s for deletion", policyRuleId); final var retrievedPolicyRule = contextService.getPolicyRule(policyRuleId); Loading @@ -250,6 +250,7 @@ public class PolicyServiceImpl implements PolicyService { private PolicyRuleState removePolicyFromContext(PolicyRule policyRule) { if (policyRule == null) { LOGGER.error("Retrieved NULL policy rule from Context"); return new PolicyRuleState(PolicyRuleStateEnum.POLICY_FAILED, String.format(INVALID_MESSAGE)); } Loading Loading @@ -287,6 +288,6 @@ public class PolicyServiceImpl implements PolicyService { contextService.removePolicyRule(policyRuleId).subscribe().with(x -> {}); return new PolicyRuleState( PolicyRuleStateEnum.POLICY_FAILED, policyRuleBasic.getExceptionMessage()); PolicyRuleStateEnum.POLICY_REMOVED, REMOVED_POLICYRULE_STATE.getPolicyRuleStateMessage()); } } src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRule.java +1 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ public class PolicyRule { @Override public String toString() { return String.format( "%s:{configActionEnum:\"%s\", %s}", getClass().getSimpleName(), policyRuleType); return String.format("%s:{configActionEnum: %s}", getClass().getSimpleName(), policyRuleType); } } src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBasic.java +2 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class PolicyRuleBasic { checkNotNull(policyRuleKPIs, "Policy rule KPIs cannot be NULL."); checkArgument(!policyRuleKPIs.isEmpty(), "Policy rule KPIs cannot be empty."); this.policyRuleKPIs = policyRuleKPIs; this.exceptionMessage = ""; this.isValid = true; } Loading Loading @@ -97,7 +98,7 @@ public class PolicyRuleBasic { @Override public String toString() { return String.format( "%s:{policyRuleId:\"%s\", %s, policyRulePriority:%d, [%s]}", "%s:{policyRuleId:\"%s\", %s, policyRulePriority:%d, [%s] [%s]}", getClass().getSimpleName(), policyRuleId, policyRuleState, Loading src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleService.java +0 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ public class PolicyRuleService extends PolicyRuleBase { !serviceId.getContextId().isBlank(), "Context ID of Service ID must not be empty."); checkArgument(!serviceId.getId().isBlank(), "Service ID must not be empty."); this.serviceId = serviceId; // TODO If device list not empty // checkArgument(!deviceIds.isEmpty(), "Device IDs must not be empty."); this.deviceIds = deviceIds; this.isValid = true; this.exceptionMessage = ""; Loading src/policy/src/main/java/org/etsi/tfs/policy/policy/service/PolicyRuleConditionValidator.java +0 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ import org.jboss.logging.Logger; public class PolicyRuleConditionValidator { private static final Logger LOGGER = Logger.getLogger(PolicyRuleConditionValidator.class); private static final String INVALID_MESSAGE = "%s is invalid."; private static final String VALID_MESSAGE = "%s is valid."; private final ContextService contextService; Loading Loading
src/policy/src/main/java/org/etsi/tfs/policy/policy/PolicyServiceImpl.java +3 −2 Original line number Diff line number Diff line Loading @@ -239,7 +239,7 @@ public class PolicyServiceImpl implements PolicyService { @Override public Uni<PolicyRuleState> deletePolicy(String policyRuleId) { LOGGER.infof("Received %s", policyRuleId); LOGGER.infof("Received policy %s for deletion", policyRuleId); final var retrievedPolicyRule = contextService.getPolicyRule(policyRuleId); Loading @@ -250,6 +250,7 @@ public class PolicyServiceImpl implements PolicyService { private PolicyRuleState removePolicyFromContext(PolicyRule policyRule) { if (policyRule == null) { LOGGER.error("Retrieved NULL policy rule from Context"); return new PolicyRuleState(PolicyRuleStateEnum.POLICY_FAILED, String.format(INVALID_MESSAGE)); } Loading Loading @@ -287,6 +288,6 @@ public class PolicyServiceImpl implements PolicyService { contextService.removePolicyRule(policyRuleId).subscribe().with(x -> {}); return new PolicyRuleState( PolicyRuleStateEnum.POLICY_FAILED, policyRuleBasic.getExceptionMessage()); PolicyRuleStateEnum.POLICY_REMOVED, REMOVED_POLICYRULE_STATE.getPolicyRuleStateMessage()); } }
src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRule.java +1 −2 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ public class PolicyRule { @Override public String toString() { return String.format( "%s:{configActionEnum:\"%s\", %s}", getClass().getSimpleName(), policyRuleType); return String.format("%s:{configActionEnum: %s}", getClass().getSimpleName(), policyRuleType); } }
src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleBasic.java +2 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ public class PolicyRuleBasic { checkNotNull(policyRuleKPIs, "Policy rule KPIs cannot be NULL."); checkArgument(!policyRuleKPIs.isEmpty(), "Policy rule KPIs cannot be empty."); this.policyRuleKPIs = policyRuleKPIs; this.exceptionMessage = ""; this.isValid = true; } Loading Loading @@ -97,7 +98,7 @@ public class PolicyRuleBasic { @Override public String toString() { return String.format( "%s:{policyRuleId:\"%s\", %s, policyRulePriority:%d, [%s]}", "%s:{policyRuleId:\"%s\", %s, policyRulePriority:%d, [%s] [%s]}", getClass().getSimpleName(), policyRuleId, policyRuleState, Loading
src/policy/src/main/java/org/etsi/tfs/policy/policy/model/PolicyRuleService.java +0 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ public class PolicyRuleService extends PolicyRuleBase { !serviceId.getContextId().isBlank(), "Context ID of Service ID must not be empty."); checkArgument(!serviceId.getId().isBlank(), "Service ID must not be empty."); this.serviceId = serviceId; // TODO If device list not empty // checkArgument(!deviceIds.isEmpty(), "Device IDs must not be empty."); this.deviceIds = deviceIds; this.isValid = true; this.exceptionMessage = ""; Loading
src/policy/src/main/java/org/etsi/tfs/policy/policy/service/PolicyRuleConditionValidator.java +0 −2 Original line number Diff line number Diff line Loading @@ -33,8 +33,6 @@ import org.jboss.logging.Logger; public class PolicyRuleConditionValidator { private static final Logger LOGGER = Logger.getLogger(PolicyRuleConditionValidator.class); private static final String INVALID_MESSAGE = "%s is invalid."; private static final String VALID_MESSAGE = "%s is valid."; private final ContextService contextService; Loading