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.models.tosca.legacy.concepts.LegacyGuardPolicy;
26 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
29 * Class to provide all kinds of legacy guard policy operations.
31 * @author Chenfei Gao (cgao@research.att.com)
33 public class LegacyGuardPolicyProvider {
35 private static final String DELETE_OK = "Successfully deleted";
38 * Retrieves a list of guard policies matching specified ID and version.
40 * @param policyId the ID of policy
41 * @param policyVersion the version of policy
43 * @return the ToscaServiceTemplate object
45 public ToscaServiceTemplate fetchGuardPolicies(String policyId, String policyVersion) {
47 return new ToscaServiceTemplate();
51 * Creates a new guard policy.
53 * @param body the entity body of policy
55 * @return the ToscaServiceTemplate object
57 public ToscaServiceTemplate createGuardPolicy(LegacyGuardPolicy body) {
59 return new ToscaServiceTemplate();
63 * Deletes the guard policies matching specified ID and version.
65 * @param policyId the ID of policy
66 * @param policyVersion the version of policy
68 * @return a string message indicating the operation results
70 public String deleteGuardPolicies(String policyId, String policyVersion) {