From 41373a9619308bdbab6a31c02fe3d54e91ac6ee3 Mon Sep 17 00:00:00 2001 From: liboNet Date: Wed, 3 Apr 2019 02:26:05 +0800 Subject: 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 --- artifactbroker/model/pom.xml | 13 +++++ .../policy/distribution/model/CloudArtifact.java | 16 ++--- .../policy/distribution/model/VfModuelModel.java | 62 -------------------- .../policy/distribution/model/VfModuleModel.java | 68 ++++++++++++++++++++++ 4 files changed, 90 insertions(+), 69 deletions(-) delete mode 100644 artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuelModel.java create mode 100644 artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java (limited to 'artifactbroker/model') 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 @@ ${project.artifactId} [${project.parent.artifactId}] module provides the model for policy distribution + + + org.onap.sdc.sdc-distribution-client + sdc-distribution-client + 1.3.0 + + + org.slf4j + slf4j-log4j12 + + + + 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 vfModulePayload; - Map artifactTypeMap; + List vfModulePayload; + Map artifactMap; - public CloudArtifact(List vfModulePayload, Map artifactTypeMap) { + public CloudArtifact(List vfModulePayload, Map 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 getVfModulePayload() { + public List getVfModulePayload() { return vfModulePayload; } @@ -50,8 +52,8 @@ public class CloudArtifact implements PolicyInput { * * @return the path of the TOSCA file */ - Map getArtifactTypeMap() { - return artifactTypeMap; + public Map 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/VfModuelModel.java deleted file mode 100644 index e774b89..0000000 --- a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuelModel.java +++ /dev/null @@ -1,62 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2018 Ericsson. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.policy.distribution.model; - -import java.util.List; -import java.util.Map; - - -/** - * Represents a VfModuleModel that a {@link VfModuleModel} can be parsed. - */ - -public class VfModuelModel { - - private String vfModuleModelName; - private String vfModuleModelInvariantUUID; - private String vfModuleModelVersion; - private String vfModuleModelUUID; - private String vfModuleModelCustomizationUUID; - private String vfModuleModelDescription; - private Boolean isBase; - private List artifacts; - private Map properties; - - public String getVfModuleModelName() { - return vfModuleModelName; - } - - public String getVfModuleModelCustomizationUUID() { - return vfModuleModelCustomizationUUID; - } - - public String getVfModuleModelDescription() { - return vfModuleModelDescription; - } - - public List getArtifacts() { - return artifacts; - } - - public Map getProperties() { - return properties; - } -} diff --git a/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java new file mode 100644 index 0000000..220dc57 --- /dev/null +++ b/artifactbroker/model/src/main/java/org/onap/policy/distribution/model/VfModuleModel.java @@ -0,0 +1,68 @@ +/*- + * ============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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.distribution.model; + +import java.util.List; +import java.util.Map; + + +/** + * Represents a VfModuleModel that a {@link Policy} can be decoded from. + */ + +@SuppressWarnings("unchecked") +public class VfModuleModel { + + private String vfModuleModelName; + private String vfModuleModelInvariantUUID; + private String vfModuleModelVersion; + private String vfModuleModelUUID; + private String vfModuleModelCustomizationUUID; + private String vfModuleModelDescription; + private Boolean isBase; + private List artifacts; + private Map properties; + + public String getVfModuleModelName() { + return vfModuleModelName; + } + + public String getVfModuleModelVersion() { + return vfModuleModelVersion; + } + + public String getVfModuleModelCustomizationUUID() { + return vfModuleModelCustomizationUUID; + } + + public String getVfModuleModelDescription() { + return vfModuleModelDescription; + } + + public List getArtifacts() { + return artifacts; + } + + public Map getProperties() { + return properties; + } +} -- cgit 1.2.3-korg