summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-09-20 18:37:41 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-09-20 18:46:34 +0800
commit8413474a8e1cd5f1a4cc398403f68f7b8c5c147b (patch)
tree7b6519f588d1e35d1d7475d31a3c3e40f38b6e73 /vnfmarket-be
parentcdbc3248d61eec82b59fb81144d381cd4f855256 (diff)
use List in PackageManager
major: L67 L86 L90 Change-Id: I73e087730af7866af367c2bd486abe1bd5e85622 Signed-off-by: Harry Huang <huangxiangyu5@huawei.com> Issue-Id: VNFSDK-85
Diffstat (limited to 'vnfmarket-be')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/db/resource/PackageManager.java12
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapper.java2
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/wrapper/PackageWrapperUtil.java5
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 {
}
}
}
+