From f4a86b5bc37350c15c62544cea5e22ce7b6f931b Mon Sep 17 00:00:00 2001 From: liamfallon Date: Mon, 4 Jan 2021 13:47:42 +0000 Subject: 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: Id614bbed34ed8897e7e882b70147b98ffe90bf57 Signed-off-by: liamfallon --- .../onap/policy/tutorial/tutorial/TutorialApplication.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tutorials/tutorial-xacml-application') diff --git a/tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialApplication.java b/tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialApplication.java index 3c76494b..5d486c42 100644 --- a/tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialApplication.java +++ b/tutorials/tutorial-xacml-application/src/main/java/org/onap/policy/tutorial/tutorial/TutorialApplication.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 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. @@ -20,14 +21,14 @@ package org.onap.policy.tutorial.tutorial; import java.util.Arrays; import java.util.List; -import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier; +import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier; import org.onap.policy.pdp.xacml.application.common.ToscaPolicyTranslator; import org.onap.policy.pdp.xacml.application.common.std.StdXacmlApplicationServiceProvider; public class TutorialApplication extends StdXacmlApplicationServiceProvider { - private final ToscaPolicyTypeIdentifier supportedPolicyType = - new ToscaPolicyTypeIdentifier("onap.policies.Authorization", "1.0.0"); + private final ToscaConceptIdentifier supportedPolicyType = + new ToscaConceptIdentifier("onap.policies.Authorization", "1.0.0"); private final TutorialTranslator translator = new TutorialTranslator(); @Override @@ -41,12 +42,12 @@ public class TutorialApplication extends StdXacmlApplicationServiceProvider { } @Override - public synchronized List supportedPolicyTypes() { + public synchronized List supportedPolicyTypes() { return Arrays.asList(supportedPolicyType); } @Override - public boolean canSupportPolicyType(ToscaPolicyTypeIdentifier policyTypeId) { + public boolean canSupportPolicyType(ToscaConceptIdentifier policyTypeId) { return supportedPolicyType.equals(policyTypeId); } -- cgit 1.2.3-korg