summaryrefslogtreecommitdiffstats
path: root/artifactbroker/model
diff options
context:
space:
mode:
authorliboNet <libo.zhu@intel.com>2019-04-03 02:26:05 +0800
committerliboNet <libo.zhu@intel.com>2019-04-03 02:26:05 +0800
commit41373a9619308bdbab6a31c02fe3d54e91ac6ee3 (patch)
tree4e79dc6d6573e9fab2415294e5e926589b0f9827 /artifactbroker/model
parentb852967aa9ebbf7a37e562e562c21b9df76f04d7 (diff)
add subplugin field support and new Cloud Artifact class
. add subplugin field to integrate with Distribution framework . add new Cloud Artifact which is to be used by subplugin like k8s . update test .json file to include reception and forward fields . add dummy test class to ensure the flow works as expected . fix typos Change-Id: I9d69d88e448a18247e19b3b7a6062b20814b5f8c Issue-ID: MULTICLOUD-512 Signed-off-by: liboNet <libo.zhu@intel.com>
Diffstat (limited to 'artifactbroker/model')
-rw-r--r--artifactbroker/model/pom.xml13
-rw-r--r--artifactbroker/model/src/main/java/org/onap/policy/distribution/model/CloudArtifact.java16
-rw-r--r--artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java (renamed from artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuelModel.java)12
3 files changed, 31 insertions, 10 deletions
diff --git a/artifactbroker/model/pom.xml b/artifactbroker/model/pom.xml
index 21f0ba4..f2c2850 100644
--- a/artifactbroker/model/pom.xml
+++ b/artifactbroker/model/pom.xml
@@ -29,4 +29,17 @@
<name>${project.artifactId}</name>
<description>[${project.parent.artifactId}] module provides the model for policy distribution</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.sdc.sdc-distribution-client</groupId>
+ <artifactId>sdc-distribution-client</artifactId>
+ <version>1.3.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
</project>
diff --git a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/CloudArtifact.java b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/CloudArtifact.java
index 2447c68..834bbcf 100644
--- a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/CloudArtifact.java
+++ b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/CloudArtifact.java
@@ -23,17 +23,19 @@ package org.onap.policy.distribution.model;
import java.util.List;
import java.util.Map;
+import org.onap.sdc.api.notification.IArtifactInfo;
+
/**
* Represents a CloudArtifact that a {@link Policy} can be decoded from.
*/
public class CloudArtifact implements PolicyInput {
- List<VfModuelModel> vfModulePayload;
- Map<String, String> artifactTypeMap;
+ List<VfModuleModel> vfModulePayload;
+ Map<String, IArtifactInfo> artifactMap;
- public CloudArtifact(List<VfModuelModel> vfModulePayload, Map<String, String> artifactTypeMap) {
+ public CloudArtifact(List<VfModuleModel> vfModulePayload, Map<String, IArtifactInfo> artifactMap) {
this.vfModulePayload = vfModulePayload;
- this.artifactTypeMap = artifactTypeMap;
+ this.artifactMap = artifactMap;
}
/**
@@ -41,7 +43,7 @@ public class CloudArtifact implements PolicyInput {
*
* @return the path of the TOSCA file
*/
- List<VfModuelModel> getVfModulePayload() {
+ public List<VfModuleModel> getVfModulePayload() {
return vfModulePayload;
}
@@ -50,8 +52,8 @@ public class CloudArtifact implements PolicyInput {
*
* @return the path of the TOSCA file
*/
- Map<String, String> getArtifactTypeMap() {
- return artifactTypeMap;
+ public Map<String, IArtifactInfo> getArtifactTypeMap() {
+ return artifactMap;
}
}
diff --git a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuelModel.java b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java
index e774b89..220dc57 100644
--- a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuelModel.java
+++ b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2018 Ericsson. All rights reserved.
+ * Copyright (C) 2019 Intel. 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.
@@ -25,10 +26,11 @@ import java.util.Map;
/**
- * Represents a VfModuleModel that a {@link VfModuleModel} can be parsed.
+ * Represents a VfModuleModel that a {@link Policy} can be decoded from.
*/
-public class VfModuelModel {
+@SuppressWarnings("unchecked")
+public class VfModuleModel {
private String vfModuleModelName;
private String vfModuleModelInvariantUUID;
@@ -44,6 +46,10 @@ public class VfModuelModel {
return vfModuleModelName;
}
+ public String getVfModuleModelVersion() {
+ return vfModuleModelVersion;
+ }
+
public String getVfModuleModelCustomizationUUID() {
return vfModuleModelCustomizationUUID;
}
@@ -55,7 +61,7 @@ public class VfModuelModel {
public List<String> getArtifacts() {
return artifacts;
}
-
+
public Map<String, Object> getProperties() {
return properties;
}