summaryrefslogtreecommitdiffstats
path: root/models-provider/src/main/java
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-04-01 21:03:34 +0000
committerliamfallon <liam.fallon@est.tech>2019-04-01 21:03:34 +0000
commit0664ecd9f945ffa27126707db144e91156313ba1 (patch)
treed1503017e7aed6d4172f527cb78cf20745b382d4 /models-provider/src/main/java
parent0ac03692ecd0fbe69660b1246ca0c1fbac53e623 (diff)
Add extra methods to Provider interface
This review provides the full specification of the Provider interfce and stups the new implemented methods into the relevant delegated providers. Issue-ID: POLICY-1095 Change-Id: I5f297f8dbbe4131ce910fce95459425ac8b7c3f9 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-provider/src/main/java')
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java178
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java116
-rw-r--r--models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java103
3 files changed, 347 insertions, 50 deletions
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
index a8d8483e3..b0494ff60 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/PolicyModelsProvider.java
@@ -20,12 +20,19 @@
package org.onap.policy.models.provider;
+import java.util.List;
import java.util.Map;
import lombok.NonNull;
+import org.apache.commons.lang3.tuple.Pair;
import org.onap.policy.models.base.PfModelException;
+import org.onap.policy.models.pdp.concepts.PdpGroup;
import org.onap.policy.models.pdp.concepts.PdpGroups;
+import org.onap.policy.models.pdp.concepts.PdpStatistics;
+import org.onap.policy.models.pdp.concepts.PdpSubGroup;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
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;
@@ -48,13 +55,40 @@ public interface PolicyModelsProvider extends AutoCloseable {
/**
* Get policy types.
*
- * @param name the name of the policy type to get.
- * @param version the version of the policy type to get.
+ * @param name the name of the policy type to get, set to null to get all policy types
+ * @param version the version of the policy type to get, set to null to get all versions
* @return the policy types found
* @throws PfModelException on errors getting policy types
*/
- public ToscaServiceTemplate getPolicyTypes(@NonNull final String name, @NonNull final String version)
- throws PfModelException;
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException;
+
+ /**
+ * Get policy types.
+ *
+ * @param name the name of the policy type to get, set to null to get all policy types
+ * @param version the version of the policy type to get, set to null to get all versions
+ * @return the policy types found
+ * @throws PfModelException on errors getting policy types
+ */
+ public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) throws PfModelException;
+
+ /**
+ * Get latest policy types.
+ *
+ * @param name the name of the policy type to get, set to null to get all policy types
+ * @return the policy types found
+ * @throws PfModelException on errors getting policy types
+ */
+ public ToscaServiceTemplate getLatestPolicyTypes(final String name) throws PfModelException;
+
+ /**
+ * Get latest policy types.
+ *
+ * @param name the name of the policy type to get, set to null to get all policy types
+ * @return the policy types found
+ * @throws PfModelException on errors getting policy types
+ */
+ public List<ToscaPolicyType> getLatestPolicyTypeList(final String name) throws PfModelException;
/**
* Create policy types.
@@ -77,26 +111,62 @@ public interface PolicyModelsProvider extends AutoCloseable {
throws PfModelException;
/**
- * Delete policy types.
+ * Delete policy type.
*
* @param name the name of the policy type to delete.
* @param version the version of the policy type to delete.
- * @return the TOSCA service template containing the policy types that were deleted
+ * @return the TOSCA service template containing the policy type that was deleted
* @throws PfModelException on errors deleting policy types
*/
- public ToscaServiceTemplate deletePolicyTypes(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicyType(@NonNull final String name, @NonNull final String version)
throws PfModelException;
/**
* Get policies.
*
- * @param name the name of the policy to get.
- * @param version the version of the policy to get.
+ * @param name the name of the policy to get, null to get all policies
+ * @param version the version of the policy to get, null to get all versions of a policy
* @return the policies found
* @throws PfModelException on errors getting policies
*/
- public ToscaServiceTemplate getPolicies(@NonNull final String name, @NonNull final String version)
- throws PfModelException;
+ public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException;
+
+ /**
+ * Get policies.
+ *
+ * @param name the name of the policy to get, null to get all policies
+ * @param version the version of the policy to get, null to get all versions of a policy
+ * @return the policies found
+ * @throws PfModelException on errors getting policies
+ */
+ public List<ToscaPolicy> getPolicyList(final String name, final String version) throws PfModelException;
+
+ /**
+ * Get policies for a policy type name.
+ *
+ * @param policyTypeName the name of the policy type for which to get policies
+ * @return the policies found
+ * @throws PfModelException on errors getting policies
+ */
+ public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName) throws PfModelException;
+
+ /**
+ * Get latest policies.
+ *
+ * @param name the name of the policy to get, null to get all policies
+ * @return the policies found
+ * @throws PfModelException on errors getting policies
+ */
+ public ToscaServiceTemplate getLatestPolicies(final String name) throws PfModelException;
+
+ /**
+ * Get latest policies.
+ *
+ * @param name the name of the policy to get, null to get all policies
+ * @return the policies found
+ * @throws PfModelException on errors getting policies
+ */
+ public List<ToscaPolicy> getLatestPolicyList(final String name) throws PfModelException;
/**
* Create policies.
@@ -108,7 +178,6 @@ public interface PolicyModelsProvider extends AutoCloseable {
public ToscaServiceTemplate createPolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
throws PfModelException;
-
/**
* Update policies.
*
@@ -120,14 +189,14 @@ public interface PolicyModelsProvider extends AutoCloseable {
throws PfModelException;
/**
- * Delete policies.
+ * Delete policy.
*
* @param name the name of the policy to delete.
* @param version the version of the policy to delete.
- * @return the TOSCA service template containing the policy types that were deleted
- * @throws PfModelException on errors deleting policies
+ * @return the TOSCA service template containing the policy that was deleted
+ * @throws PfModelException on errors deleting a policy
*/
- public ToscaServiceTemplate deletePolicies(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicy(@NonNull final String name, @NonNull final String version)
throws PfModelException;
/**
@@ -210,11 +279,31 @@ public interface PolicyModelsProvider extends AutoCloseable {
/**
* Get PDP groups.
*
- * @param pdpGroupFilter a filter for the get
+ * @param name the name of the policy to get, null to get all PDP groups
+ * @param version the version of the policy to get, null to get all versions of a PDP group
* @return the PDP groups found
* @throws PfModelException on errors getting PDP groups
*/
- public PdpGroups getPdpGroups(@NonNull final String pdpGroupFilter) throws PfModelException;
+ public PdpGroups getPdpGroups(final String name, final String version) throws PfModelException;
+
+ /**
+ * Get latest PDP Groups.
+ *
+ * @param name the name of the PDP group to get, null to get all PDP groups
+ * @return the PDP groups found
+ * @throws PfModelException on errors getting policies
+ */
+ public PdpGroups getLatestPdpGroups(final String name) throws PfModelException;
+
+ /**
+ * Get a filtered list of PDP groups.
+ *
+ * @param pdpType The PDP type filter for the returned PDP groups
+ * @param supportedPolicyTypes a list of policy type name/version pairs that the PDP groups must support.
+ * @return the PDP groups found
+ */
+ public PdpGroups getFilteredPdpGroups(@NonNull final String pdpType,
+ @NonNull final List<Pair<String, String>> supportedPolicyTypes);
/**
* Creates PDP groups.
@@ -234,12 +323,57 @@ public interface PolicyModelsProvider extends AutoCloseable {
*/
public PdpGroups updatePdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException;
+
+ /**
+ * Update a PDP subgroup.
+ *
+ * @param pdpGroupName the name of the PDP group of the PDP subgroup
+ * @param pdpGroupVersion the version of the PDP group of the PDP subgroup
+ * @param pdpSubGroup the PDP subgroup to be updated
+ * @throws PfModelException on errors updating PDP subgroups
+ */
+ public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException;
+
/**
- * Delete PDP groups.
+ * Delete a PDP group.
*
- * @param pdpGroupFilter a filter for the get
- * @return the PDP groups deleted
+ * @param name the name of the policy to get, null to get all PDP groups
+ * @param version the version of the policy to get, null to get all versions of a PDP group
+ * @return the PDP group deleted
* @throws PfModelException on errors deleting PDP groups
*/
- public PdpGroups deletePdpGroups(@NonNull final String pdpGroupFilter) throws PfModelException;
+ public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException;
+
+ /**
+ * Get PDP statistics.
+ *
+ * @param name the name of the PDP group to get statistics for, null to get all PDP groups
+ * @param version the version of the PDP group to get statistics for, null to get all versions of a PDP group
+ * @return the statistics found
+ * @throws PfModelException on errors getting statistics
+ */
+ public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException;
+
+ /**
+ * Update PDP statistics for a PDP.
+ *
+ * @param pdpGroupName the name of the PDP group containing the PDP that the statistics are for
+ * @param pdpGroupVersion the version of the PDP group containing the PDP that the statistics are for
+ * @param pdpType the PDP type of the subgroup containing the PDP that the statistics are for
+ * @param pdpInstanceId the instance ID of the PDP to update statistics for
+ * @throws PfModelException on errors updating statistics
+ */
+ public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final String pdpType, @NonNull final String pdpInstanceId,
+ @NonNull final PdpStatistics pdppStatistics) throws PfModelException;
+
+ /**
+ * Get deployed policies.
+ *
+ * @param name the name of the policy to get, null to get all policies
+ * @return the policies deployed as a map of policy lists keyed by PDP group
+ * @throws PfModelException on errors getting policies
+ */
+ public Map<PdpGroup, List<ToscaPolicy>> getDeployedPolicyList(final String name) throws PfModelException;
}
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
index 9a32feb65..ee8ed7348 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DatabasePolicyModelsProviderImpl.java
@@ -23,22 +23,29 @@ package org.onap.policy.models.provider.impl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Base64;
+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.dao.DaoParameters;
import org.onap.policy.models.dao.PfDao;
import org.onap.policy.models.dao.PfDaoFactory;
import org.onap.policy.models.dao.impl.DefaultPfDao;
+import org.onap.policy.models.pdp.concepts.PdpGroup;
import org.onap.policy.models.pdp.concepts.PdpGroups;
+import org.onap.policy.models.pdp.concepts.PdpStatistics;
+import org.onap.policy.models.pdp.concepts.PdpSubGroup;
import org.onap.policy.models.pdp.persistence.provider.PdpProvider;
import org.onap.policy.models.provider.PolicyModelsProvider;
import org.onap.policy.models.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.authorative.provider.AuthorativeToscaProvider;
import org.onap.policy.models.tosca.legacy.concepts.LegacyGuardPolicyInput;
@@ -137,13 +144,30 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate getPolicyTypes(@NonNull final String name, @NonNull final String version)
- throws PfModelException {
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
assertInitilized();
return new AuthorativeToscaProvider().getPolicyTypes(pfDao, name, version);
}
@Override
+ public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getPolicyTypeList(pfDao, name, version);
+ }
+
+ @Override
+ public ToscaServiceTemplate getLatestPolicyTypes(final String name) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getLatestPolicyTypes(pfDao, name);
+ }
+
+ @Override
+ public List<ToscaPolicyType> getLatestPolicyTypeList(final String name) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getLatestPolicyTypeList(pfDao, name);
+ }
+
+ @Override
public ToscaServiceTemplate createPolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
throws PfModelException {
assertInitilized();
@@ -158,20 +182,43 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate deletePolicyTypes(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicyType(@NonNull final String name, @NonNull final String version)
throws PfModelException {
assertInitilized();
- return new AuthorativeToscaProvider().deletePolicyTypes(pfDao, name, version);
+ return new AuthorativeToscaProvider().deletePolicyType(pfDao, name, version);
}
@Override
- public ToscaServiceTemplate getPolicies(@NonNull final String name, @NonNull final String version)
- throws PfModelException {
+ public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
assertInitilized();
return new AuthorativeToscaProvider().getPolicies(pfDao, name, version);
}
@Override
+ public List<ToscaPolicy> getPolicyList(final String name, final String version) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getPolicyList(pfDao, name, version);
+ }
+
+ @Override
+ public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getPolicyList4PolicyType(pfDao, policyTypeName);
+ }
+
+ @Override
+ public ToscaServiceTemplate getLatestPolicies(final String name) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getLatestPolicies(pfDao, name);
+ }
+
+ @Override
+ public List<ToscaPolicy> getLatestPolicyList(final String name) throws PfModelException {
+ assertInitilized();
+ return new AuthorativeToscaProvider().getLatestPolicyList(pfDao, name);
+ }
+
+ @Override
public ToscaServiceTemplate createPolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
throws PfModelException {
assertInitilized();
@@ -186,10 +233,10 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate deletePolicies(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicy(@NonNull final String name, @NonNull final String version)
throws PfModelException {
assertInitilized();
- return new AuthorativeToscaProvider().deletePolicies(pfDao, name, version);
+ return new AuthorativeToscaProvider().deletePolicy(pfDao, name, version);
}
@Override
@@ -246,27 +293,68 @@ public class DatabasePolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+ public PdpGroups getPdpGroups(final String name, final String version) throws PfModelException {
+ assertInitilized();
+ return new PdpProvider().getPdpGroups(pfDao, name, version);
+ }
+
+ @Override
+ public PdpGroups getLatestPdpGroups(final String name) throws PfModelException {
assertInitilized();
- return new PdpProvider().getPdpGroups(pfDao, pdpGroupFilter);
+ return new PdpProvider().getLatestPdpGroups(pfDao, name);
}
@Override
- public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+ public PdpGroups getFilteredPdpGroups(@NonNull final String pdpType,
+ @NonNull final List<Pair<String, String>> supportedPolicyTypes) {
+ assertInitilized();
+ return new PdpProvider().getFilteredPdpGroups(pfDao, pdpType, supportedPolicyTypes);
+ }
+
+ @Override
+ public PdpGroups createPdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException {
assertInitilized();
return new PdpProvider().createPdpGroups(pfDao, pdpGroups);
}
@Override
- public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
+ public PdpGroups updatePdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException {
assertInitilized();
return new PdpProvider().updatePdpGroups(pfDao, pdpGroups);
}
@Override
- public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
+ public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException {
+ assertInitilized();
+ new PdpProvider().updatePdpSubGroup(pfDao, pdpGroupName, pdpGroupVersion, pdpSubGroup);
+ }
+
+ @Override
+ public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException {
+ assertInitilized();
+ return new PdpProvider().deletePdpGroup(pfDao, name, version);
+ }
+
+ @Override
+ public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException {
+ assertInitilized();
+ return new PdpProvider().getPdpStatistics(pfDao, name, version);
+ }
+
+ @Override
+ public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final String pdpType, @NonNull final String pdpInstanceId,
+ @NonNull final PdpStatistics pdppStatistics) throws PfModelException {
+ assertInitilized();
+ new PdpProvider().updatePdpStatistics(pfDao, pdpGroupName, pdpGroupVersion, pdpType, pdpInstanceId,
+ pdppStatistics);
+ }
+
+ @Override
+ public Map<PdpGroup, List<ToscaPolicy>> getDeployedPolicyList(final String name) throws PfModelException {
assertInitilized();
- return new PdpProvider().deletePdpGroups(pfDao, pdpGroupFilter);
+ return new PdpProvider().getDeployedPolicyList(pfDao, name);
}
/**
diff --git a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
index 8881ed08e..3db8e5e35 100644
--- a/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
+++ b/models-provider/src/main/java/org/onap/policy/models/provider/impl/DummyPolicyModelsProviderImpl.java
@@ -21,19 +21,27 @@
package org.onap.policy.models.provider.impl;
+import java.util.ArrayList;
import java.util.HashMap;
+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.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
+import org.onap.policy.models.pdp.concepts.PdpGroup;
import org.onap.policy.models.pdp.concepts.PdpGroups;
+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.provider.PolicyModelsProviderParameters;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyType;
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;
@@ -64,12 +72,26 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate getPolicyTypes(@NonNull final String name, @NonNull final String version)
- throws PfModelException {
+ public ToscaServiceTemplate getPolicyTypes(final String name, final String version) throws PfModelException {
return getDummyResponse("dummyimpl/DummyToscaPolicyTypeGetResponse.json");
}
@Override
+ public List<ToscaPolicyType> getPolicyTypeList(final String name, final String version) throws PfModelException {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public ToscaServiceTemplate getLatestPolicyTypes(final String name) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public List<ToscaPolicyType> getLatestPolicyTypeList(final String name) throws PfModelException {
+ return new ArrayList<>();
+ }
+
+ @Override
public ToscaServiceTemplate createPolicyTypes(@NonNull final ToscaServiceTemplate serviceTemplate)
throws PfModelException {
return serviceTemplate;
@@ -82,18 +104,37 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate deletePolicyTypes(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicyType(@NonNull final String name, @NonNull final String version)
throws PfModelException {
return getDummyResponse("dummyimpl/DummyToscaPolicyTypeDeleteResponse.json");
}
@Override
- public ToscaServiceTemplate getPolicies(@NonNull final String name, @NonNull final String version)
- throws PfModelException {
+ public ToscaServiceTemplate getPolicies(final String name, final String version) throws PfModelException {
return getDummyResponse("dummyimpl/DummyToscaPolicyGetResponse.json");
}
@Override
+ public List<ToscaPolicy> getPolicyList(final String name, final String version) throws PfModelException {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public List<ToscaPolicy> getPolicyList4PolicyType(@NonNull final String policyTypeName) throws PfModelException {
+ return new ArrayList<>();
+ }
+
+ @Override
+ public ToscaServiceTemplate getLatestPolicies(final String name) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public List<ToscaPolicy> getLatestPolicyList(final String name) throws PfModelException {
+ return new ArrayList<>();
+ }
+
+ @Override
public ToscaServiceTemplate createPolicies(@NonNull final ToscaServiceTemplate serviceTemplate)
throws PfModelException {
return serviceTemplate;
@@ -106,7 +147,7 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public ToscaServiceTemplate deletePolicies(@NonNull final String name, @NonNull final String version)
+ public ToscaServiceTemplate deletePolicy(@NonNull final String name, @NonNull final String version)
throws PfModelException {
return getDummyResponse("dummyimpl/DummyToscaPolicyDeleteResponse.json");
}
@@ -158,23 +199,57 @@ public class DummyPolicyModelsProviderImpl implements PolicyModelsProvider {
}
@Override
- public PdpGroups getPdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
- return new PdpGroups();
+ public PdpGroups getPdpGroups(final String name, final String version) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public PdpGroups getLatestPdpGroups(final String name) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public PdpGroups getFilteredPdpGroups(@NonNull final String pdpType,
+ @NonNull final List<Pair<String, String>> supportedPolicyTypes) {
+ return null;
+ }
+
+ @Override
+ public PdpGroups createPdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public PdpGroups updatePdpGroups(@NonNull final PdpGroups pdpGroups) throws PfModelException {
+ return null;
+ }
+
+ @Override
+ public void updatePdpSubGroup(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final PdpSubGroup pdpSubGroup) throws PfModelException {
+ // Not implemented
+ }
+
+ @Override
+ public PdpGroup deletePdpGroup(@NonNull final String name, @NonNull final String version) throws PfModelException {
+ return null;
}
@Override
- public PdpGroups createPdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
- return new PdpGroups();
+ public List<PdpStatistics> getPdpStatistics(final String name, final String version) throws PfModelException {
+ return new ArrayList<>();
}
@Override
- public PdpGroups updatePdpGroups(@NonNull PdpGroups pdpGroups) throws PfModelException {
- return new PdpGroups();
+ public void updatePdpStatistics(@NonNull final String pdpGroupName, @NonNull final String pdpGroupVersion,
+ @NonNull final String pdpType, @NonNull final String pdpInstanceId,
+ @NonNull final PdpStatistics pdppStatistics) throws PfModelException {
+ // Not implemented
}
@Override
- public PdpGroups deletePdpGroups(@NonNull String pdpGroupFilter) throws PfModelException {
- return new PdpGroups();
+ public Map<PdpGroup, List<ToscaPolicy>> getDeployedPolicyList(final String name) throws PfModelException {
+ return null;
}
/**