diff options
author | Murali Mohan Murthy Potham <murali.p@huawei.com> | 2017-09-20 11:59:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-20 11:59:09 +0000 |
commit | 84316557d6f59e0c31c330108dac091af7010596 (patch) | |
tree | 4a415866d11d31f647c326b008689a5452bd0994 /vnfmarket-be | |
parent | 3df60bfc465cf807406ca3e5e2a0827eb943ce10 (diff) | |
parent | 8413474a8e1cd5f1a4cc398403f68f7b8c5c147b (diff) |
Merge "use List in PackageManager"
Diffstat (limited to 'vnfmarket-be')
3 files changed, 11 insertions, 8 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/resource/PackageManager.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/resource/PackageManager.java index 63573715..84e07b3f 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/resource/PackageManager.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/resource/PackageManager.java @@ -17,6 +17,7 @@ package org.onap.vnfsdk.marketplace.db.resource; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.onap.vnfsdk.marketplace.db.common.Parameters; @@ -64,10 +65,10 @@ public class PackageManager { * @return package data list * @throws MarketplaceResourceException e */ - public ArrayList<PackageData> queryPackageByCsarId(String csarId) + public List<PackageData> queryPackageByCsarId(String csarId) throws MarketplaceResourceException { LOGGER.info("start query package info by csarid." + csarId); - ArrayList<PackageData> data = handler.queryByID(csarId); + List<PackageData> data = handler.queryByID(csarId); LOGGER.info("query package info end.size:" + data.size() + "detail:" + MarketplaceDbUtil.objectToString(data)); return data; @@ -83,11 +84,11 @@ public class PackageManager { * @return package data list * @throws MarketplaceResourceException e */ - public ArrayList<PackageData> queryPackage(String name, String provider, String version, + public List<PackageData> queryPackage(String name, String provider, String version, String deletionPending, String type) throws MarketplaceResourceException { LOGGER.info("start query package info.name:" + name + " provider:" + provider + " version:" + version + " type:" + type); - Map<String, String> queryParam = new HashMap<String, String>(); + Map<String, String> queryParam = new HashMap<>(); if (MarketplaceDbUtil.isNotEmpty(name)) { queryParam.put(Parameters.name.name(), name); } @@ -103,7 +104,7 @@ public class PackageManager { if (MarketplaceDbUtil.isNotEmpty(provider)) { queryParam.put(Parameters.provider.name(), provider); } - ArrayList<PackageData> data = handler.query(queryParam); + List<PackageData> data = handler.query(queryParam); LOGGER.info("query package info end.size:" + data.size() + "detail:" + MarketplaceDbUtil.objectToString(data)); return data; @@ -149,3 +150,4 @@ public class PackageManager { LOGGER.info("Download count updated to :" + idownloadcount); } } + diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java index 518d2060..97b96b88 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java @@ -135,7 +135,7 @@ public class PackageWrapper { */ public Response queryPackageListByCond(String name, String provider, String version, String deletionPending, String type) { - ArrayList<PackageData> dbresult = new ArrayList<>(); + List<PackageData> dbresult = new ArrayList<>(); List<PackageMeta> result = new ArrayList<>(); LOG.info("query package info.name:" + name + " provider:" + provider + " version" + version + " deletionPending" + deletionPending + " type:" + type); diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java index c55019d5..cddb4c4e 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java @@ -106,7 +106,7 @@ public class PackageWrapperUtil { */ public static PackageData getPackageInfoById(String csarId) { PackageData result = new PackageData(); - ArrayList<PackageData> packageDataList = new ArrayList<>(); + List<PackageData> packageDataList = new ArrayList<>(); try { packageDataList = PackageManager.getInstance().queryPackageByCsarId(csarId); if (packageDataList != null && ! packageDataList.isEmpty()) { @@ -165,7 +165,7 @@ public class PackageWrapperUtil { * @return download uri */ public static String getPackagePath(String csarId) { - ArrayList<PackageData> packageList = new ArrayList<>(); + List<PackageData> packageList = new ArrayList<>(); String downloadUri = null; try { packageList = PackageManager.getInstance().queryPackageByCsarId(csarId); @@ -354,3 +354,4 @@ public class PackageWrapperUtil { } } } + |