Implement Database provider
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / simple / provider / SimpleToscaProvider.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix Foundation.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.models.tosca.simple.provider;
22
23 import lombok.NonNull;
24
25 import org.onap.policy.models.base.PfConceptKey;
26 import org.onap.policy.models.base.PfModelException;
27 import org.onap.policy.models.dao.PfDao;
28 import org.onap.policy.models.tosca.simple.concepts.ToscaServiceTemplate;
29
30 /**
31  * This class provides the provision of information on TOSCA concepts in the database to callers.
32  *
33  * @author Liam Fallon (liam.fallon@est.tech)
34  */
35 public class SimpleToscaProvider {
36     /**
37      * Get policy types.
38      *
39      * @param dao the DAO to use to access the database
40      * @param policyTypeKey the policy type key for the policy types to be retrieved. A null key name returns all policy
41      *        types. A null key version returns all versions of the policy type name specified in the key.
42      * @return the policy types found
43      * @throws PfModelException on errors getting policy types
44      */
45     public ToscaServiceTemplate getPolicyTypes(@NonNull final PfDao dao, @NonNull final PfConceptKey policyTypeKey)
46             throws PfModelException {
47         return null;
48     }
49
50     /**
51      * Create policy types.
52      *
53      * @param dao the DAO to use to access the database
54      * @param serviceTemplate the service template containing the definition of the policy types to be created
55      * @return the TOSCA service template containing the created policy types
56      * @throws PfModelException on errors creating policy types
57      */
58     public ToscaServiceTemplate createPolicyTypes(@NonNull final PfDao dao,
59             @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
60         return null;
61     }
62
63     /**
64      * Create policy types.
65      *
66      * @param dao the DAO to use to access the database
67      * @param serviceTemplate the service template containing the definition of the policy types to be modified
68      * @return the TOSCA service template containing the modified policy types
69      * @throws PfModelException on errors updating policy types
70      */
71     public ToscaServiceTemplate updatePolicyTypes(@NonNull final PfDao dao,
72             @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
73         return null;
74     }
75
76     /**
77      * Delete policy types.
78      *
79      * @param dao the DAO to use to access the database
80      * @param policyTypeKey the policy type key for the policy types to be deleted, if the version of the key is null,
81      *        all versions of the policy type are deleted.
82      * @return the TOSCA service template containing the policy types that were deleted
83      * @throws PfModelException on errors deleting policy types
84      */
85     public ToscaServiceTemplate deletePolicyTypes(@NonNull final PfDao dao, @NonNull final PfConceptKey policyTypeKey)
86             throws PfModelException {
87         return null;
88     }
89
90     /**
91      * Get policies.
92      *
93      * @param dao the DAO to use to access the database
94      * @param policyKey the policy key for the policies to be retrieved. The parent name and version must be specified.
95      *        A null local name returns all policies for a parent policy type.
96      * @return the policies found
97      * @throws PfModelException on errors getting policies
98      */
99     public ToscaServiceTemplate getPolicies(@NonNull final PfDao dao, @NonNull final PfConceptKey policyKey)
100             throws PfModelException {
101         return null;
102     }
103
104     /**
105      * Create policies.
106      *
107      * @param dao the DAO to use to access the database
108      * @param serviceTemplate the service template containing the definitions of the new policies to be created.
109      * @return the TOSCA service template containing the policy types that were created
110      * @throws PfModelException on errors creating policies
111      */
112     public ToscaServiceTemplate createPolicies(@NonNull final PfDao dao,
113             @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
114         return null;
115     }
116
117     /**
118      * Update policies.
119      *
120      * @param dao the DAO to use to access the database
121      * @param serviceTemplate the service template containing the definitions of the policies to be updated.
122      * @return the TOSCA service template containing the policies that were updated
123      * @throws PfModelException on errors updating policies
124      */
125     public ToscaServiceTemplate updatePolicies(@NonNull final PfDao dao,
126             @NonNull final ToscaServiceTemplate serviceTemplate) throws PfModelException {
127         return null;
128     }
129
130     /**
131      * Delete policies.
132      *
133      * @param dao the DAO to use to access the database
134      * @param policyKey the policy key
135      * @return the TOSCA service template containing the policy types that were deleted
136      * @throws PfModelException on errors deleting policies
137      */
138     public ToscaServiceTemplate deletePolicies(@NonNull final PfDao dao, @NonNull final PfConceptKey policyKey)
139             throws PfModelException {
140         return null;
141     }
142 }