diff options
author | liamfallon <liam.fallon@est.tech> | 2021-01-04 15:58:25 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@est.tech> | 2021-01-04 16:22:19 +0000 |
commit | ca2f61793ab1d971414c25c68f9007c7c9abfaac (patch) | |
tree | f3551785175224a2007dc9eff4b1fea078f22538 /policy-management/src/main/java/org | |
parent | 223519c0c263ea2f9b2b9a94efe52d40ab2cf6f7 (diff) |
Changed identifiers to concept identifiers
The policy models tosca classes ToscaPolicyIdentifier and
ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA
concept, not just TOSCA policies so they are renamed to
ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion
respectively.
The class ToscaPolicyTypeIdentifier is redundant and is replaced by
ToscaConceptIdentifier.
Issue-ID: POLICY-2900
Change-Id: I677cc1f8730001b300ab2041f2d57c2485cbc4ed
Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'policy-management/src/main/java/org')
2 files changed, 12 insertions, 10 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java index 82cd015e..7501aed5 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java @@ -3,6 +3,7 @@ * policy-management * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +30,7 @@ import org.onap.policy.common.endpoints.event.comm.TopicSink; import org.onap.policy.common.endpoints.event.comm.TopicSource; import org.onap.policy.drools.controller.DroolsController; import org.onap.policy.drools.protocol.configuration.DroolsConfiguration; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; /** * A Policy Controller is the higher level unit of control. It corresponds to the ncomp equivalent @@ -63,7 +64,7 @@ public interface PolicyController extends Startable, Lockable { /** * Get Policy Types supported by this controller. */ - List<ToscaPolicyTypeIdentifier> getPolicyTypes(); + List<ToscaConceptIdentifier> getPolicyTypes(); /** * Update maven configuration. diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/internal/AggregatedPolicyController.java b/policy-management/src/main/java/org/onap/policy/drools/system/internal/AggregatedPolicyController.java index 3f744024..e14b1620 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/internal/AggregatedPolicyController.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/internal/AggregatedPolicyController.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2021 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +47,7 @@ import org.onap.policy.drools.properties.DroolsPropertyConstants; import org.onap.policy.drools.protocol.configuration.DroolsConfiguration; import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.utils.PropertyUtil; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,7 +111,7 @@ public class AggregatedPolicyController implements PolicyController, TopicListen /** * Policy Types. */ - private List<ToscaPolicyTypeIdentifier> policyTypes; + private List<ToscaConceptIdentifier> policyTypes; /** * Constructor version mainly used for bootstrapping at initialization time a policy engine @@ -147,7 +148,7 @@ public class AggregatedPolicyController implements PolicyController, TopicListen } @Override - public List<ToscaPolicyTypeIdentifier> getPolicyTypes() { + public List<ToscaConceptIdentifier> getPolicyTypes() { if (!policyTypes.isEmpty()) { return policyTypes; } @@ -156,13 +157,13 @@ public class AggregatedPolicyController implements PolicyController, TopicListen .get() .getBaseDomainNames() .stream() - .map(d -> new ToscaPolicyTypeIdentifier(d, + .map(d -> new ToscaConceptIdentifier(d, DroolsPropertyConstants.DEFAULT_CONTROLLER_POLICY_TYPE_VERSION)) .collect(Collectors.toList()); } - protected List<ToscaPolicyTypeIdentifier> getPolicyTypesFromProperties() { - List<ToscaPolicyTypeIdentifier> policyTypeIds = new ArrayList<>(); + protected List<ToscaConceptIdentifier> getPolicyTypesFromProperties() { + List<ToscaConceptIdentifier> policyTypeIds = new ArrayList<>(); String ptiPropValue = properties.getProperty(DroolsPropertyConstants.PROPERTY_CONTROLLER_POLICY_TYPES); if (ptiPropValue == null) { @@ -173,10 +174,10 @@ public class AggregatedPolicyController implements PolicyController, TopicListen for (String pti : ptiPropList) { String[] ptv = pti.split(":"); if (ptv.length == 1) { - policyTypeIds.add(new ToscaPolicyTypeIdentifier(ptv[0], + policyTypeIds.add(new ToscaConceptIdentifier(ptv[0], DroolsPropertyConstants.DEFAULT_CONTROLLER_POLICY_TYPE_VERSION)); } else if (ptv.length == 2) { - policyTypeIds.add(new ToscaPolicyTypeIdentifier(ptv[0], ptv[1])); + policyTypeIds.add(new ToscaConceptIdentifier(ptv[0], ptv[1])); } } |