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