From 8413474a8e1cd5f1a4cc398403f68f7b8c5c147b Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Wed, 20 Sep 2017 18:37:41 +0800 Subject: use List in PackageManager major: L67 L86 L90 Change-Id: I73e087730af7866af367c2bd486abe1bd5e85622 Signed-off-by: Harry Huang Issue-Id: VNFSDK-85 --- .../onap/vnfsdk/marketplace/db/resource/PackageManager.java | 12 +++++++----- .../org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java | 2 +- .../onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java/org') 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 queryPackageByCsarId(String csarId) + public List queryPackageByCsarId(String csarId) throws MarketplaceResourceException { LOGGER.info("start query package info by csarid." + csarId); - ArrayList data = handler.queryByID(csarId); + List 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 queryPackage(String name, String provider, String version, + public List 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 queryParam = new HashMap(); + Map 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 data = handler.query(queryParam); + List 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 dbresult = new ArrayList<>(); + List dbresult = new ArrayList<>(); List 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 packageDataList = new ArrayList<>(); + List 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 packageList = new ArrayList<>(); + List packageList = new ArrayList<>(); String downloadUri = null; try { packageList = PackageManager.getInstance().queryPackageByCsarId(csarId); @@ -354,3 +354,4 @@ public class PackageWrapperUtil { } } } + -- cgit 1.2.3-korg