Add policy metadataSet handling as node templates
[policy/models.git] / models-provider / src / test / java / org / onap / policy / models / provider / impl / DummyBadProviderImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019-2022 Nordix Foundation.
4  *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
5  *  Modifications Copyright (C) 2020 Bell Canada. 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.models.provider.impl;
24
25 import java.time.Instant;
26 import java.util.ArrayList;
27 import java.util.Collection;
28 import java.util.Collections;
29 import java.util.List;
30 import java.util.Map;
31 import javax.ws.rs.core.Response;
32 import lombok.NonNull;
33 import org.onap.policy.models.base.PfConceptKey;
34 import org.onap.policy.models.base.PfModelException;
35 import org.onap.policy.models.base.PfModelRuntimeException;
36 import org.onap.policy.models.pap.concepts.PolicyAudit;
37 import org.onap.policy.models.pap.persistence.provider.PolicyAuditProvider.AuditFilter;
38 import org.onap.policy.models.pdp.concepts.Pdp;
39 import org.onap.policy.models.pdp.concepts.PdpGroup;
40 import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
41 import org.onap.policy.models.pdp.concepts.PdpPolicyStatus;
42 import org.onap.policy.models.pdp.concepts.PdpStatistics;
43 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
44 import org.onap.policy.models.pdp.persistence.provider.PdpFilterParameters;
45 import org.onap.policy.models.provider.PolicyModelsProvider;
46 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
47 import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityFilter;
48 import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityKey;
49 import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
50 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
51 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
52 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
53 import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
54
55 /**
56  * Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
57  *
58  * @author Liam Fallon (liam.fallon@est.tech)
59  */
60 public class DummyBadProviderImpl implements PolicyModelsProvider {
61     public DummyBadProviderImpl() {
62         throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Bad Request");
63     }
64
65     @Override
66     public void close() throws PfModelException {
67         // do nothing
68     }
69
70     @Override
71     public void init() throws PfModelException {
72         // do nothing
73     }
74
75     @Override
76     public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
77             @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
78         return null;
79     }
80
81     @Override
82     public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
83             throws PfModelException {
84         return null;
85     }
86
87     @Override
88     public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
89             throws PfModelException {
90         return null;
91     }
92
93     @Override
94     public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
95             throws PfModelException {
96         return null;
97     }
98
99     @Override
100     public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
101         return null;
102     }
103
104     @Override
105     public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
106             throws PfModelException {
107         return null;
108     }
109
110     @Override
111     public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
112             throws PfModelException {
113         return null;
114     }
115
116     @Override
117     public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
118         return null;
119     }
120
121     @Override
122     public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
123         return null;
124     }
125
126     @Override
127     public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
128         return null;
129     }
130
131     @Override
132     public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
133         return null;
134     }
135
136     @Override
137     public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
138         return null;
139     }
140
141     @Override
142     public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
143         throws PfModelException {
144         return null;
145     }
146
147     @Override
148     public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
149         throws PfModelRuntimeException, PfModelException {
150         return null;
151     }
152
153     @Override
154     public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
155         throws PfModelException {
156         return null;
157     }
158
159     @Override
160     public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
161                                                                                       @NonNull String version)
162         throws PfModelException {
163         return null;
164     }
165
166     @Override
167     public List<Map<PfConceptKey, ToscaNodeTemplate>> getToscaNodeTemplate(final String name,
168                                                                            final String version)
169         throws PfModelException {
170         return null;
171     }
172
173     @Override
174     public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
175         return Collections.emptyList();
176     }
177
178     @Override
179     public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
180         return Collections.emptyList();
181     }
182
183     @Override
184     public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
185         return Collections.emptyList();
186     }
187
188     @Override
189     public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
190             throws PfModelException {
191         // do nothing
192     }
193
194     @Override
195     public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
196         return null;
197     }
198
199     @Override
200     public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
201         return Collections.emptyList();
202     }
203
204     @Override
205     public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
206             throws PfModelException {
207         return null;
208     }
209
210     @Override
211     public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
212             throws PfModelException {
213         return Collections.emptyList();
214     }
215
216     @Override
217     public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
218         return Collections.emptyList();
219     }
220
221     @Override
222     public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
223             throws PfModelException {
224         return null;
225     }
226
227     @Override
228     public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
229             throws PfModelException {
230         return Collections.emptyList();
231     }
232
233     @Override
234     public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
235         return Collections.emptyList();
236     }
237
238     @Override
239     public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
240             throws PfModelException {
241         // do nothing
242     }
243
244     @Override
245     public List<PdpStatistics> getFilteredPdpStatistics(PdpFilterParameters filterParams) throws PfModelException {
246         // Not implemented
247         return null;
248     }
249
250     @Override
251     public List<PdpStatistics> createPdpStatistics(final List<PdpStatistics> pdpStatisticsList)
252             throws PfModelException {
253         // Not implemented
254         return new ArrayList<>();
255     }
256
257     @Override
258     public List<PdpStatistics> updatePdpStatistics(final List<PdpStatistics> pdpStatisticsList)
259             throws PfModelException {
260         // Not implemented
261         return new ArrayList<>();
262     }
263
264     @Override
265     public List<PdpStatistics> deletePdpStatistics(final String name, final Instant timestamp) {
266         // Not implemented
267         return null;
268     }
269
270     @Override
271     public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
272         // Not implemented
273         return null;
274     }
275
276     @Override
277     public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
278             throws PfModelException {
279         // Not implemented
280         return null;
281     }
282
283     @Override
284     public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) throws PfModelException {
285         // Not implemented
286         return null;
287     }
288
289     @Override
290     public void cudPolicyStatus(Collection<PdpPolicyStatus> createObjs, Collection<PdpPolicyStatus> updateObjs,
291             Collection<PdpPolicyStatus> deleteObjs) {
292         // Not implemented
293     }
294
295     @Override
296     public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
297         // Not implemented
298         return null;
299     }
300
301     @Override
302     public void createAuditRecords(List<PolicyAudit> auditRecords) {
303         // Not implemented
304     }
305
306     @Override
307     public List<PolicyAudit> getAuditRecords(AuditFilter auditFilter) {
308         // Not implemented
309         return null;
310     }
311 }