0d7f7f0fd6e6da59b00c257915849faa8fbbcca5
[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, 2022 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.util.Collection;
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29 import javax.ws.rs.core.Response;
30 import lombok.NonNull;
31 import org.onap.policy.models.base.PfConceptKey;
32 import org.onap.policy.models.base.PfModelException;
33 import org.onap.policy.models.base.PfModelRuntimeException;
34 import org.onap.policy.models.pdp.concepts.Pdp;
35 import org.onap.policy.models.pdp.concepts.PdpGroup;
36 import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
37 import org.onap.policy.models.pdp.concepts.PdpPolicyStatus;
38 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
39 import org.onap.policy.models.provider.PolicyModelsProvider;
40 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
41 import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityFilter;
42 import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityKey;
43 import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
44 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
45 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
46 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
47 import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
48
49 /**
50  * Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
51  *
52  * @author Liam Fallon (liam.fallon@est.tech)
53  */
54 public class DummyBadProviderImpl implements PolicyModelsProvider {
55     public DummyBadProviderImpl() {
56         throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Bad Request");
57     }
58
59     @Override
60     public void close() throws PfModelException {
61         // do nothing
62     }
63
64     @Override
65     public void init() throws PfModelException {
66         // do nothing
67     }
68
69     @Override
70     public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
71             @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
72         return null;
73     }
74
75     @Override
76     public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
77             throws PfModelException {
78         return null;
79     }
80
81     @Override
82     public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
83             throws PfModelException {
84         return null;
85     }
86
87     @Override
88     public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
89             throws PfModelException {
90         return null;
91     }
92
93     @Override
94     public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
95         return null;
96     }
97
98     @Override
99     public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
100             throws PfModelException {
101         return null;
102     }
103
104     @Override
105     public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
106             throws PfModelException {
107         return null;
108     }
109
110     @Override
111     public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
112         return null;
113     }
114
115     @Override
116     public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
117         return null;
118     }
119
120     @Override
121     public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
122         return null;
123     }
124
125     @Override
126     public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
127         return null;
128     }
129
130     @Override
131     public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
132         return null;
133     }
134
135     @Override
136     public ToscaServiceTemplate createToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
137         throws PfModelException {
138         return null;
139     }
140
141     @Override
142     public ToscaServiceTemplate updateToscaNodeTemplates(@NonNull ToscaServiceTemplate serviceTemplate)
143         throws PfModelRuntimeException, PfModelException {
144         return null;
145     }
146
147     @Override
148     public ToscaServiceTemplate deleteToscaNodeTemplate(@NonNull String name, @NonNull String version)
149         throws PfModelException {
150         return null;
151     }
152
153     @Override
154     public List<Map<ToscaEntityKey, Map<String, Object>>> getNodeTemplateMetadataSets(@NonNull String name,
155                                                                                       @NonNull String version)
156         throws PfModelException {
157         return null;
158     }
159
160     @Override
161     public List<ToscaNodeTemplate> getToscaNodeTemplate(final String name, final String version)
162         throws PfModelException {
163         return null;
164     }
165
166     @Override
167     public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
168         return Collections.emptyList();
169     }
170
171     @Override
172     public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
173         return Collections.emptyList();
174     }
175
176     @Override
177     public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
178         return Collections.emptyList();
179     }
180
181     @Override
182     public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
183             throws PfModelException {
184         // do nothing
185     }
186
187     @Override
188     public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
189         return null;
190     }
191
192     @Override
193     public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
194         return Collections.emptyList();
195     }
196
197     @Override
198     public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
199             throws PfModelException {
200         return null;
201     }
202
203     @Override
204     public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
205             throws PfModelException {
206         return Collections.emptyList();
207     }
208
209     @Override
210     public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
211         return Collections.emptyList();
212     }
213
214     @Override
215     public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
216             throws PfModelException {
217         return null;
218     }
219
220     @Override
221     public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
222             throws PfModelException {
223         return Collections.emptyList();
224     }
225
226     @Override
227     public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
228         return Collections.emptyList();
229     }
230
231     @Override
232     public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
233             throws PfModelException {
234         // do nothing
235     }
236
237     @Override
238     public List<PdpPolicyStatus> getAllPolicyStatus() throws PfModelException {
239         // Not implemented
240         return null;
241     }
242
243     @Override
244     public List<PdpPolicyStatus> getAllPolicyStatus(@NonNull ToscaConceptIdentifierOptVersion policy)
245             throws PfModelException {
246         // Not implemented
247         return null;
248     }
249
250     @Override
251     public List<PdpPolicyStatus> getGroupPolicyStatus(@NonNull String groupName) throws PfModelException {
252         // Not implemented
253         return null;
254     }
255
256     @Override
257     public void cudPolicyStatus(Collection<PdpPolicyStatus> createObjs, Collection<PdpPolicyStatus> updateObjs,
258             Collection<PdpPolicyStatus> deleteObjs) {
259         // Not implemented
260     }
261
262     @Override
263     public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
264         // Not implemented
265         return null;
266     }
267 }