Merge "Add code to follow ONAP API CVS guidelines"
[policy/api.git] / main / src / main / java / org / onap / policy / api / main / rest / provider / PolicyProvider.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.ToscaPolicy;
26 import org.onap.policy.models.tosca.ToscaPolicyList;
27
28 /**
29  * Class to provide all kinds of policy operations.
30  */
31 public class PolicyProvider {
32
33     private static final String POST_OK = "Successfully created";
34     private static final String DELETE_OK = "Successfully deleted";
35
36     /**
37      * Retrieves a list of policies matching specified ID and version of both policy type and policy.
38      *
39      * @param policyTypeId the ID of policy type
40      * @param policyTypeVersion the version of policy type
41      * @param policyId the ID of policy
42      * @param policyVersion the version of policy
43      *
44      * @return the ToscaPolicyList object containing a list of policies matching specified fields
45      */
46     public ToscaPolicyList fetchPolicies(String policyTypeId, String policyTypeVersion,
47                                          String policyId, String policyVersion) {
48         // placeholder
49         return new ToscaPolicyList();
50     }
51
52     /**
53      * Creates a new policy for a policy type ID and version.
54      *
55      * @param policyTypeId the ID of policy type
56      * @param policyTypeVersion the version of policy type
57      * @param body the entity body of policy
58      *
59      * @return a string message indicating the operation results
60      */
61     public String createPolicy(String policyTypeId, String policyTypeVersion, ToscaPolicy body) {
62         // placeholder
63         return POST_OK;
64     }
65
66     /**
67      * Deletes the policies matching specified ID and version of both policy type and policy.
68      *
69      * @param policyTypeId the ID of policy type
70      * @param policyTypeVersion the version of policy type
71      * @param policyId the ID of policy
72      * @param policyVersion the version of policy
73      *
74      * @return a string message indicating the operation results
75      */
76     public String deletePolicies(String policyTypeId, String policyTypeVersion,
77                                  String policyId, String policyVersion) {
78         // placeholder
79         return DELETE_OK;
80     }
81 }