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 type operations.
\r
30 * @author Chenfei Gao (cgao@research.att.com)
\r
32 public class PolicyTypeProvider {
\r
34 private static final String DELETE_OK = "Successfully deleted";
\r
37 * Retrieves a list of policy types matching specified policy type ID and version.
\r
39 * @param policyTypeId the ID of policy type
\r
40 * @param policyTypeVersion the version of policy type
\r
42 * @return the ToscaServiceTemplate object
\r
44 public ToscaServiceTemplate fetchPolicyTypes(String policyTypeId, String policyTypeVersion) {
\r
46 return new ToscaServiceTemplate();
\r
50 * Creates a new policy type.
\r
52 * @param body the entity body of policy type
\r
54 * @return the ToscaServiceTemplate objects
\r
56 public ToscaServiceTemplate createPolicyType(ToscaServiceTemplate body) {
\r
58 return new ToscaServiceTemplate();
\r
62 * Delete the policy types matching specified policy type ID and version.
\r
64 * @param policyTypeId the ID of policy type
\r
65 * @param policyTypeVersion the version of policy type
\r
67 * @return a string message indicating the operation results
\r
69 public String deletePolicyTypes(String policyTypeId, String policyTypeVersion) {
\r