2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * SPDX-License-Identifier: Apache-2.0
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.api.main.rest.provider;
25 import org.onap.policy.model.tosca.ToscaPolicyType;
26 import org.onap.policy.model.tosca.ToscaPolicyTypeList;
29 * Class to provide all kinds of policy type operations.
31 public class PolicyTypeProvider {
33 private static final String POST_OK = "Successfully created";
34 private static final String DELETE_OK = "Successfully deleted";
37 * Retrieves a list of policy types matching specified policy type ID and version.
39 * @param policyTypeId the ID of policy type
40 * @param policyTypeVersion the version of policy type
42 * @return the ToscaPolicyTypeList object containing a list of policy types matching specified fields
44 public ToscaPolicyTypeList fetchPolicyTypes(String policyTypeId, String policyTypeVersion) {
46 return new ToscaPolicyTypeList();
50 * Creates a new policy type.
52 * @param body the entity body of policy type
54 * @return a string message indicating the operation results
56 public String createPolicyType(ToscaPolicyType body) {
62 * Delete the policy types matching specified policy type ID and version.
64 * @param policyTypeId the ID of policy type
65 * @param policyTypeVersion the version of policy type
67 * @return a string message indicating the operation results
69 public String deletePolicyTypes(String policyTypeId, String policyTypeVersion) {