/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.models.provider.impl;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
import java.util.List;
-import java.util.Map;
-
import javax.ws.rs.core.Response;
-
import lombok.NonNull;
-
-import org.apache.commons.lang3.tuple.Pair;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
import org.onap.policy.models.pdp.concepts.Pdp;
import org.onap.policy.models.pdp.concepts.PdpGroup;
+import org.onap.policy.models.pdp.concepts.PdpGroupFilter;
import org.onap.policy.models.pdp.concepts.PdpStatistics;
import org.onap.policy.models.pdp.concepts.PdpSubGroup;
import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyFilter;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeFilter;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyOutput;
-import org.onap.policy.models.tosca.legacy.concepts.LegacyOperationalPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplateFilter;
/**
* Dummy implementation of {@link PolicyModelsProvider} with bad constructor.
}
@Override
- public void close() throws PfModelException {}
-
- @Override
- public void init() throws PfModelException {}
-
- @Override
- public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
- return null;
+ public void close() throws PfModelException {
+ // do nothing
}
@Override
- public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
- throws PfModelException {
- return null;
+ public void init() throws PfModelException {
+ // do nothing
}
@Override
- public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
+ public List<ToscaServiceTemplate> getFilteredServiceTemplateList(@NonNull ToscaServiceTemplateFilter filter)
throws PfModelException {
return null;
}
@Override
- public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
- return null;
- }
-
- @Override
- public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
- return null;
- }
-
- @Override
- public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate createServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
+ throws PfModelException {
return null;
}
@Override
- public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
+ public ToscaServiceTemplate updateServiceTemplate(@NonNull ToscaServiceTemplate serviceTemplate)
+ throws PfModelException {
return null;
}
@Override
- public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
+ public ToscaServiceTemplate deleteServiceTemplate(@NonNull String name, @NonNull String version)
+ throws PfModelException {
return null;
}
@Override
- public LegacyOperationalPolicy getOperationalPolicy(@NonNull String policyId) throws PfModelException {
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
return null;
}
@Override
- public LegacyOperationalPolicy createOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+ public ToscaServiceTemplate createPolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
throws PfModelException {
return null;
}
@Override
- public LegacyOperationalPolicy updateOperationalPolicy(@NonNull LegacyOperationalPolicy legacyOperationalPolicy)
+ public ToscaServiceTemplate updatePolicyTypes(@NonNull ToscaServiceTemplate serviceTemplate)
throws PfModelException {
return null;
}
@Override
- public LegacyOperationalPolicy deleteOperationalPolicy(@NonNull String policyId) throws PfModelException {
+ public ToscaServiceTemplate deletePolicyType(final String name, final String version) throws PfModelException {
return null;
}
@Override
- public Map<String, LegacyGuardPolicyOutput> getGuardPolicy(@NonNull String policyId) throws PfModelException {
+ public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
return null;
}
@Override
- public Map<String, LegacyGuardPolicyOutput> createGuardPolicy(@NonNull LegacyGuardPolicyInput legacyGuardPolicy)
- throws PfModelException {
+ public ToscaServiceTemplate createPolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
return null;
}
@Override
- public Map<String, LegacyGuardPolicyOutput> updateGuardPolicy(@NonNull LegacyGuardPolicyInput legacyGuardPolicy)
- throws PfModelException {
+ public ToscaServiceTemplate updatePolicies(@NonNull ToscaServiceTemplate serviceTemplate) throws PfModelException {
return null;
}
@Override
- public Map<String, LegacyGuardPolicyOutput> deleteGuardPolicy(@NonNull String policyId) throws PfModelException {
+ public ToscaServiceTemplate deletePolicy(final String name, final String version) throws PfModelException {
return null;
}
@Override
- public List<PdpGroup> getPdpGroups(String name, String version) throws PfModelException {
- return null;
+ public List<PdpGroup> getPdpGroups(String name) throws PfModelException {
+ return Collections.emptyList();
}
@Override
public List<PdpGroup> createPdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
- return null;
+ return Collections.emptyList();
}
@Override
public List<PdpGroup> updatePdpGroups(@NonNull List<PdpGroup> pdpGroups) throws PfModelException {
- return null;
+ return Collections.emptyList();
}
@Override
- public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
- @NonNull String pdpSubGroup, @NonNull Pdp pdp) throws PfModelException {
+ public void updatePdp(@NonNull String pdpGroupName, @NonNull String pdpSubGroup, @NonNull Pdp pdp)
+ throws PfModelException {
+ // do nothing
}
@Override
- public PdpGroup deletePdpGroup(@NonNull String name, @NonNull String verison) throws PfModelException {
+ public PdpGroup deletePdpGroup(@NonNull String name) throws PfModelException {
return null;
}
@Override
public List<ToscaPolicyType> getPolicyTypeList(String name, String version) throws PfModelException {
- return null;
+ return Collections.emptyList();
}
@Override
- public ToscaServiceTemplate getLatestPolicyTypes(String name) throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicyTypes(@NonNull ToscaPolicyTypeFilter filter) throws PfModelException {
return null;
}
@Override
- public List<ToscaPolicyType> getLatestPolicyTypeList(String name) throws PfModelException {
- return null;
+ public List<ToscaPolicyType> getFilteredPolicyTypeList(@NonNull ToscaPolicyTypeFilter filter)
+ throws PfModelException {
+ return Collections.emptyList();
}
@Override
public List<ToscaPolicy> getPolicyList(String name, String version) throws PfModelException {
- return null;
+ return Collections.emptyList();
}
@Override
- public ToscaServiceTemplate getPolicies4PolicyType(@NonNull String policyTypeName, String policyTypeVersion)
- throws PfModelException {
+ public ToscaServiceTemplate getFilteredPolicies(@NonNull ToscaPolicyFilter filter) throws PfModelException {
return null;
}
@Override
- public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull String policyTypeName, final String policyTypeVersion)
- throws PfModelException {
- return null;
+ public List<ToscaPolicy> getFilteredPolicyList(@NonNull ToscaPolicyFilter filter) throws PfModelException {
+ return Collections.emptyList();
}
@Override
- public ToscaServiceTemplate getLatestPolicies(String name) throws PfModelException {
- return null;
+ public List<PdpGroup> getFilteredPdpGroups(@NonNull PdpGroupFilter filter) throws PfModelException {
+ return Collections.emptyList();
}
@Override
- public List<ToscaPolicy> getLatestPolicyList(String name) throws PfModelException {
- return null;
+ public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull PdpSubGroup pdpSubGroup)
+ throws PfModelException {
+ // do nothing
}
@Override
- public List<PdpGroup> getLatestPdpGroups(String name) throws PfModelException {
- return null;
+ public List<PdpStatistics> getPdpStatistics(final String name, final Date timestamp) throws PfModelException {
+ return new ArrayList<>();
}
@Override
- public List<PdpGroup> getFilteredPdpGroups(@NonNull String pdpType,
- @NonNull List<Pair<String, String>> supportedPolicyTypes) {
- return null;
+ public List<PdpStatistics> getFilteredPdpStatistics(String name, String pdpGroupName, String pdpSubGroup,
+ Date startTimeStamp, Date endTimeStamp, String sortOrder, int getRecordNum) {
+ // Not implemented
+ return new ArrayList<>();
}
@Override
- public void updatePdpSubGroup(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
- @NonNull PdpSubGroup pdpSubGroup) throws PfModelException {}
+ public List<PdpStatistics> createPdpStatistics(final List<PdpStatistics> pdpStatisticsList)
+ throws PfModelException {
+ // Not implemented
+ return new ArrayList<>();
+ }
@Override
- public List<PdpStatistics> getPdpStatistics(String name, String version) throws PfModelException {
- return null;
+ public List<PdpStatistics> updatePdpStatistics(final List<PdpStatistics> pdpStatisticsList)
+ throws PfModelException {
+ // Not implemented
+ return new ArrayList<>();
}
@Override
- public void updatePdpStatistics(@NonNull String pdpGroupName, @NonNull String pdpGroupVersion,
- @NonNull String pdpType, @NonNull String pdpInstanceId, @NonNull PdpStatistics pdppStatistics) {}
+ public List<PdpStatistics> deletePdpStatistics(final String name, final Date timestamp) {
+ // Not implemented
+ return null;
+ }
@Override
- public Map<Pair<String, String>, List<ToscaPolicy>> getDeployedPolicyList(String name) throws PfModelException {
+ public List<ToscaServiceTemplate> getServiceTemplateList(String name, String version) throws PfModelException {
+ // TODO Auto-generated method stub
return null;
}
}