2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
19 * SPDX-License-Identifier: Apache-2.0
\r
20 * ============LICENSE_END=========================================================
\r
23 package org.onap.policy.api.main.rest.provider;
\r
25 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
\r
28 * Class to provide all kinds of policy operations.
\r
30 * @author Chenfei Gao (cgao@research.att.com)
\r
32 public class PolicyProvider {
\r
34 private static final String DELETE_OK = "Successfully deleted";
\r
37 * Retrieves a list of policies matching specified ID and version of both policy type and policy.
\r
39 * @param policyTypeId the ID of policy type
\r
40 * @param policyTypeVersion the version of policy type
\r
41 * @param policyId the ID of policy
\r
42 * @param policyVersion the version of policy
\r
44 * @return the ToscaServiceTemplate object
\r
46 public ToscaServiceTemplate fetchPolicies(String policyTypeId, String policyTypeVersion,
\r
47 String policyId, String policyVersion) {
\r
49 return new ToscaServiceTemplate();
\r
53 * Creates a new policy for a policy type ID and version.
\r
55 * @param policyTypeId the ID of policy type
\r
56 * @param policyTypeVersion the version of policy type
\r
57 * @param body the entity body of policy
\r
59 * @return the ToscaServiceTemplate object
\r
61 public ToscaServiceTemplate createPolicy(String policyTypeId, String policyTypeVersion,
\r
62 ToscaServiceTemplate body) {
\r
64 return new ToscaServiceTemplate();
\r
68 * Deletes the policies matching specified ID and version of both policy type and policy.
\r
70 * @param policyTypeId the ID of policy type
\r
71 * @param policyTypeVersion the version of policy type
\r
72 * @param policyId the ID of policy
\r
73 * @param policyVersion the version of policy
\r
75 * @return a string message indicating the operation results
\r
77 public String deletePolicies(String policyTypeId, String policyTypeVersion,
\r
78 String policyId, String policyVersion) {
\r