Add API endpoints for legacy policies
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / provider / LegacyGuardPolicyProvider.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP Policy API
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  * SPDX-License-Identifier: Apache-2.0
20  * ============LICENSE_END=========================================================
21  */
22
23 package org.onap.policy.api.main.rest.provider;
24
25 import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicy;
26 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
27
28 /**
29  * Class to provide all kinds of legacy guard policy operations.
30  *
31  * @author Chenfei Gao (cgao@research.att.com)
32  */
33 public class LegacyGuardPolicyProvider {
34
35     private static final String DELETE_OK = "Successfully deleted";
36
37     /**
38      * Retrieves a list of guard policies matching specified ID and version.
39      *
40      * @param policyId the ID of policy
41      * @param policyVersion the version of policy
42      *
43      * @return the ToscaServiceTemplate object
44      */
45     public ToscaServiceTemplate fetchGuardPolicies(String policyId, String policyVersion) {
46         // placeholder
47         return new ToscaServiceTemplate();
48     }
49
50     /**
51      * Creates a new guard policy.
52      *
53      * @param body the entity body of policy
54      *
55      * @return the ToscaServiceTemplate object
56      */
57     public ToscaServiceTemplate createGuardPolicy(LegacyGuardPolicy body) {
58         // placeholder
59         return new ToscaServiceTemplate();
60     }
61
62     /**
63      * Deletes the guard policies matching specified ID and version.
64      *
65      * @param policyId the ID of policy
66      * @param policyVersion the version of policy
67      *
68      * @return a string message indicating the operation results
69      */
70     public String deleteGuardPolicies(String policyId, String policyVersion) {
71         // placeholder
72         return DELETE_OK;
73     }
74 }