Make filters on TOSCA entities generic
[policy/models.git] / models-provider / src / test / java / org / onap / policy / models / provider / impl / DummyBadProviderImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019-2021 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.util.ArrayList;
26 import java.util.Collection;
27 import java.util.Collections;
28 import java.util.Date;
29 import java.util.List;
30 import javax.ws.rs.core.Response;
31 import lombok.NonNull;
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.PdpStatistics;
39 import org.onap.policy.models.pdp.concepts.PdpSubGroup;
40 import org.onap.policy.models.provider.PolicyModelsProvider;
41 import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifierOptVersion;
42 import org.onap.policy.models.tosca.authorative.concepts.ToscaEntityFilter;
43 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
44 import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
45 import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
46 import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
47
48 /**
49  * Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
50  *
51  * @author Liam Fallon (liam.fallon@est.tech)
52  */
53 public class DummyBadProviderImpl implements PolicyModelsProvider {
54     public DummyBadProviderImpl() {
55         throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Bad Request");
56     }
57
58     @Override
59     public void close() throws PfModelException {
60         // do nothing
61     }
62
63     @Override
64     public void init() throws PfModelException {
65         // do nothing
66     }
67
68     @Override
69     public List<ToscaServiceTemplate> getFilteredServiceTemplateList(
70             @NonNull ToscaEntityFilter<ToscaServiceTemplate> filter) throws PfModelException {
71         return null;
72     }
73
74     @Override
75     public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
76             throws PfModelException {
77         return null;
78     }
79
80     @Override
81     public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
82             throws PfModelException {
83         return null;
84     }
85
86     @Override
87     public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
88             throws PfModelException {
89         return null;
90     }
91
92     @Override
93     public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
94         return null;
95     }
96
97     @Override
98     public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
99             throws PfModelException {
100         return null;
101     }
102
103     @Override
104     public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
105             throws PfModelException {
106         return null;
107     }
108
109     @Override
110     public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
111         return null;
112     }
113
114     @Override
115     public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
116         return null;
117     }
118
119     @Override
120     public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
121         return null;
122     }
123
124     @Override
125     public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
126         return null;
127     }
128
129     @Override
130     public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
131         return null;
132     }
133
134     @Override
135     public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
136         return Collections.emptyList();
137     }
138
139     @Override
140     public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
141         return Collections.emptyList();
142     }
143
144     @Override
145     public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
146         return Collections.emptyList();
147     }
148
149     @Override
150     public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
151             throws PfModelException {
152         // do nothing
153     }
154
155     @Override
156     public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
157         return null;
158     }
159
160     @Override
161     public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
162         return Collections.emptyList();
163     }
164
165     @Override
166     public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
167             throws PfModelException {
168         return null;
169     }
170
171     @Override
172     public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaEntityFilter<ToscaPolicyType> filter)
173             throws PfModelException {
174         return Collections.emptyList();
175     }
176
177     @Override
178     public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
179         return Collections.emptyList();
180     }
181
182     @Override
183     public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
184             throws PfModelException {
185         return null;
186     }
187
188     @Override
189     public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaTypedEntityFilter<ToscaPolicy> filter)
190             throws PfModelException {
191         return Collections.emptyList();
192     }
193
194     @Override
195     public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
196         return Collections.emptyList();
197     }
198
199     @Override
200     public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
201             throws PfModelException {
202         // do nothing
203     }
204
205     @Override
206     public List<PdpStatistics> getPdpStatistics(final String name, final Date timestamp) throws PfModelException {
207         return new ArrayList<>();
208     }
209
210     @Override
211     public List<PdpStatistics> getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup,
212             Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) {
213         // Not implemented
214         return new ArrayList<>();
215     }
216
217     @Override
218     public List<PdpStatistics> createPdpStatistics(final List<PdpStatistics> pdpStatisticsList)
219             throws PfModelException {
220         // Not implemented
221         return new ArrayList<>();
222     }
223
224     @Override
225     public List<PdpStatistics> updatePdpStatistics(final List<PdpStatistics> pdpStatisticsList)
226             throws PfModelException {
227         // Not implemented
228         return new ArrayList<>();
229     }
230
231     @Override
232     public List<PdpStatistics> deletePdpStatistics(final String name, final Date timestamp) {
233         // Not implemented
234         return null;
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 }