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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * SPDX-License-Identifier: Apache-2.0
20 * ============LICENSE_END=========================================================
23 package org.onap.policy.models.provider.impl;
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;
47 * Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
49 * @author Liam Fallon (liam.fallon@est.tech)
51 public class DummyBadProviderImpl implements PolicyModelsProvider {
52 public DummyBadProviderImpl() {
53 throw new PfModelRuntimeException(Response.Status.BAD_REQUEST, "Bad Request");
57 public void close() throws PfModelException {
62 public void init() throws PfModelException {
67 public List<ToscaServiceTemplate> getFilteredServiceTemplateList(@NonNull ToscaServiceTemplateFilter filter)
68 throws PfModelException {
73 public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
74 throws PfModelException {
79 public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
80 throws PfModelException {
85 public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
86 throws PfModelException {
91 public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
96 public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
97 throws PfModelException {
102 public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
103 throws PfModelException {
108 public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
113 public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
118 public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
123 public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
128 public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
133 public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
134 return Collections.emptyList();
138 public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
139 return Collections.emptyList();
143 public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
144 return Collections.emptyList();
148 public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
149 throws PfModelException {
154 public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
159 public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
160 return Collections.emptyList();
164 public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaPolicyTypeFilter filter) throws PfModelException {
169 public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaPolicyTypeFilter filter)
170 throws PfModelException {
171 return Collections.emptyList();
175 public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
176 return Collections.emptyList();
180 public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaPolicyFilter filter) throws PfModelException {
185 public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaPolicyFilter filter) throws PfModelException {
186 return Collections.emptyList();
190 public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
191 return Collections.emptyList();
195 public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
196 throws PfModelException {
201 public List<PdpStatistics> getPdpStatistics(final String name, final Date timestamp) throws PfModelException {
202 return new ArrayList<>();
206 public List<PdpStatistics> getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup,
207 Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) {
209 return new ArrayList<>();
213 public List<PdpStatistics> createPdpStatistics(final List<PdpStatistics> pdpStatisticsList)
214 throws PfModelException {
216 return new ArrayList<>();
220 public List<PdpStatistics> updatePdpStatistics(final List<PdpStatistics> pdpStatisticsList)
221 throws PfModelException {
223 return new ArrayList<>();
227 public List<PdpStatistics> deletePdpStatistics(final String name, final Date timestamp) {
233 public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
234 // TODO Auto-generated method stub