aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/model
diff options
context:
space:
mode:
authorSonsino, Ofir (os0695) <os0695@intl.att.com>2018-07-10 14:20:54 +0300
committerSonsino, Ofir (os0695) <os0695@intl.att.com>2018-07-10 14:20:54 +0300
commitc72d565bb58226b20625b2bce5f0019046bee649 (patch)
tree8658e49595705b02e47ddc14afa20d6bb7123547 /vid-app-common/src/main/java/org/onap/vid/model
parentef8a6b47847012fd59ea20da21d8d3d7c4a301ed (diff)
Merge 1806 code of vid-common
Change-Id: I75d52abed4a24dfe3827d79edc4a2938726aa87a Issue-ID: VID-208 Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/model')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/CR.java80
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java51
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/Group.java212
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/GroupProperties.java40
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java159
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/JobBulk.java20
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/JobModel.java47
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NameCounter.java42
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NetworkCollection.java59
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NetworkCollectionProperties.java22
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewService.java20
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java11
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/Node.java83
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/PombaRequest.java7
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/ServiceInstance.java21
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/Service.java17
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java395
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java79
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VNF.java14
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VfModule.java246
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroup.java55
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroupProperties.java44
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VidBaseEntity.java64
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java55
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java141
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/probes/ErrorMetadata.java7
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/probes/ExternalComponentStatus.java26
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/probes/HttpRequestMetadata.java34
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/probes/StatusMetadata.java19
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java174
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java75
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java120
34 files changed, 1873 insertions, 576 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CR.java b/vid-app-common/src/main/java/org/onap/vid/model/CR.java
new file mode 100644
index 000000000..f8c046e7f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CR.java
@@ -0,0 +1,80 @@
+package org.onap.vid.model;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class CR extends Node{
+
+ private String category;
+
+ private String subcategory;
+
+ private String resourceVendor;
+
+ private String resourceVendorRelease;
+
+ private String resourceVendorModelNumber;
+
+ private String customizationUUID;
+
+ private Map<String, NetworkCollection> networksCollection = new HashMap<String, NetworkCollection>();
+
+
+
+ public Map<String, NetworkCollection> getNetworksCollection() {
+ return networksCollection;
+ }
+
+ public void setNetworksCollection(Map<String, NetworkCollection> networksCollection) {
+ this.networksCollection = networksCollection;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ public String getSubcategory() {
+ return subcategory;
+ }
+
+ public void setSubcategory(String subcategory) {
+ this.subcategory = subcategory;
+ }
+
+ public String getResourceVendor() {
+ return resourceVendor;
+ }
+
+ public void setResourceVendor(String resourceVendor) {
+ this.resourceVendor = resourceVendor;
+ }
+
+ public String getResourceVendorRelease() {
+ return resourceVendorRelease;
+ }
+
+ public void setResourceVendorRelease(String resourceVendorRelease) {
+ this.resourceVendorRelease = resourceVendorRelease;
+ }
+
+ public String getResourceVendorModelNumber() {
+ return resourceVendorModelNumber;
+ }
+
+ public void setResourceVendorModelNumber(String resourceVendorModelNumber) {
+ this.resourceVendorModelNumber = resourceVendorModelNumber;
+ }
+
+ public String getCustomizationUUID() {
+ return customizationUUID;
+ }
+
+ public void setCustomizationUUID(String customizationUUID) {
+ this.customizationUUID = customizationUUID;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
index a98a71bc1..99824e72b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
@@ -1,19 +1,16 @@
package org.onap.vid.model;
//import org.hibernate.annotations.Table;
-import org.onap.portalsdk.core.domain.support.DomainVo;
-import org.onap.vid.controllers.MaintenanceController;
-//import javax.persistence.*;
import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
import java.util.HashSet;
import java.util.Set;
+//import javax.persistence.*;
+
@Entity
@Table(name = "vid_category_parameter", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
-public class CategoryParameter extends DomainVo {
+public class CategoryParameter extends VidBaseEntity {
public enum Family {
PARAMETER_STANDARDIZATION,
@@ -45,30 +42,6 @@ public class CategoryParameter extends DomainVo {
return super.getId();
}
- @Override
- @Column(name = "CREATED_DATE")
- public Date getCreated() {
- return super.getCreated();
- }
-
- @Override
- @Column(name = "MODIFIED_DATE")
- public Date getModified() {
- return super.getModified();
- }
-
- @Override
- @Transient
- public Long getCreatedId() {
- return super.getCreatedId();
- }
-
- @Override
- @Transient
- public Long getModifiedId() {
- return super.getModifiedId();
- }
-
@Column(name = "NAME", unique = true, nullable = false, length=50)
public String getName() {
return name;
@@ -78,24 +51,6 @@ public class CategoryParameter extends DomainVo {
this.name = name;
}
- @Override
- @Transient
- public Serializable getAuditUserId() {
- return super.getAuditUserId();
- }
-
- @Override
- @Transient
- public Long getRowNum() {
- return super.getRowNum();
- }
-
- @Override
- @Transient
- public Set getAuditTrail() {
- return super.getAuditTrail();
- }
-
@OneToMany(fetch = FetchType.EAGER, mappedBy = "categoryParameter")
public Set<CategoryParameterOption> getOptions() {
return options;
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
index 141d2c149..5cccc835c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
@@ -11,7 +11,6 @@ import java.util.Set;
@Table(name = "vid_category_parameter_option")
public class CategoryParameterOption extends DomainVo {
- private Long id;
private String appId;
private String name;
@@ -33,10 +32,6 @@ public class CategoryParameterOption extends DomainVo {
return id;
}
- public void setId(Long id) {
- this.id = id;
- }
-
@Column(name = "CATEGORY_OPT_APP_ID")
public String getAppId() {
return appId;
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Group.java b/vid-app-common/src/main/java/org/onap/vid/model/Group.java
new file mode 100644
index 000000000..5f98341df
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Group.java
@@ -0,0 +1,212 @@
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+
+import java.util.Map;
+
+public class Group {
+
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant uuid. */
+ private String invariantUuid;
+
+ /** The customization uuid. */
+ private String customizationUuid;
+
+ /** The description. */
+ private String description;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The model customization name. */
+ private String modelCustomizationName;
+
+ /** The group properties. */
+ private GroupProperties properties;
+
+ private Map<String, Input> inputs;
+
+
+ /**
+ * Gets the model customization name.
+ *
+ * @return the model customization name
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+ /**
+ * Gets the customization uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getCustomizationUuid() {
+ return customizationUuid;
+ }
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public GroupProperties getProperties() {
+ return properties;
+ }
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant uuid.
+ *
+ * @param invariantUuid the new invariant uuid
+ */
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+ /**
+ * Sets the customization uuid.
+ *
+ * @param customizationUuid the new customization uuid
+ */
+ public void setCustomizationUuid(String customizationUuid) {
+ this.customizationUuid = customizationUuid;
+ }
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public Map<String, Input> getInputs() {
+ return inputs;
+ }
+
+ public void setInputs(Map<String, Input> inputs) {
+ this.inputs = inputs;
+ }
+
+ /**
+ * Sets the model customization name.
+ *
+ * @param modelCustomizationName the new model customization name
+ */
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+ /**
+ * Sets the group properties.
+ *
+ * @param properties the new model customization name
+ */
+ public void setProperties(GroupProperties properties) {
+ this.properties = properties;
+ }
+
+
+
+ protected static GroupProperties extractPropertiesForGroup(org.onap.vid.asdc.beans.tosca.Group group){
+ String [] propertyKeys = {ToscaParserImpl2.Constants.MIN_VF_MODULE_INSTANCES, ToscaParserImpl2.Constants.MAX_VF_MODULE_INSTANCES, ToscaParserImpl2.Constants.INITIAL_COUNT};
+ GroupProperties groupProperties = new GroupProperties();
+
+ for(String propertyKey : propertyKeys){
+ Object val = group.getProperties().get(propertyKey);
+ if (val != null && val instanceof Integer) {
+ setInGroupProperties(groupProperties, propertyKey, (Integer) val);
+ }
+ }
+ return groupProperties;
+ }
+
+ private static void setInGroupProperties(GroupProperties groupProperties, String propertyKey, Integer propertyValue){
+ switch (propertyKey) {
+ case ToscaParserImpl2.Constants.MIN_VF_MODULE_INSTANCES:
+ groupProperties.setMinCountInstances(propertyValue);
+ break;
+ case ToscaParserImpl2.Constants.MAX_VF_MODULE_INSTANCES:
+ groupProperties.setMaxCountInstances(propertyValue);
+ break;
+ case ToscaParserImpl2.Constants.INITIAL_COUNT:
+ groupProperties.setInitialCount(propertyValue);
+ break;
+ default:
+ // do noting
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/GroupProperties.java b/vid-app-common/src/main/java/org/onap/vid/model/GroupProperties.java
new file mode 100644
index 000000000..c7ca60069
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/GroupProperties.java
@@ -0,0 +1,40 @@
+package org.onap.vid.model;
+
+public class GroupProperties {
+ private Integer minCountInstances;
+ private Integer maxCountInstances;
+ private Integer initialCount;
+ private String vfModuleLabel;
+
+ public String getVfModuleLabel() {
+ return vfModuleLabel;
+ }
+
+ public void setVfModuleLabel(String vfModuleLabel) {
+ this.vfModuleLabel = vfModuleLabel;
+ }
+
+ public Integer getMinCountInstances() {
+ return minCountInstances;
+ }
+
+ public void setMinCountInstances(Integer minCountInstances) {
+ this.minCountInstances = minCountInstances;
+ }
+
+ public Integer getMaxCountInstances() {
+ return maxCountInstances;
+ }
+
+ public void setMaxCountInstances(Integer maxCountInstances) {
+ this.maxCountInstances = maxCountInstances;
+ }
+
+ public Integer getInitialCount() {
+ return initialCount;
+ }
+
+ public void setInitialCount(Integer initialCount) {
+ this.initialCount = initialCount;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java b/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java
new file mode 100644
index 000000000..614267990
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/JobAuditStatus.java
@@ -0,0 +1,159 @@
+package org.onap.vid.model;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.hibernate.annotations.Type;
+import org.onap.vid.job.Job.JobStatus;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import javax.persistence.*;
+import java.util.Date;
+import java.util.UUID;
+
+@Entity
+@Table(name = "vid_job_audit_status")
+public class JobAuditStatus extends VidBaseEntity {
+
+ static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(JobAuditStatus.class);
+
+ public JobAuditStatus(){}
+
+ public JobAuditStatus(UUID jobId, String jobStatus, SourceStatus source){
+ this.jobId = jobId;
+ this.jobStatus = jobStatus;
+ this.source = source;
+ }
+
+ public JobAuditStatus(UUID jobId, String jobStatus, SourceStatus source, Date date){
+ this(jobId, jobStatus, source);
+ this.created = date;
+ }
+
+ public JobAuditStatus(UUID jobId, String jobStatus, SourceStatus source, UUID requestId, String additionalInfo) {
+ this(jobId, jobStatus, source);
+ this.requestId = requestId;
+ this.additionalInfo = additionalInfo;
+ }
+
+ public JobAuditStatus(UUID jobId, String jobStatus, SourceStatus source, UUID requestId, String additionalInfo, Date date){
+ this(jobId, jobStatus, source, requestId, additionalInfo);
+ this.created = date;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+
+ if (o == null || getClass() != o.getClass()) return false;
+
+ JobAuditStatus that = (JobAuditStatus) o;
+
+ return new EqualsBuilder()
+ .append(jobId, that.jobId)
+ .append(jobStatus, that.jobStatus)
+ .append(source, that.source)
+ .append(requestId, that.requestId)
+ .append(additionalInfo, that.additionalInfo)
+ .isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(17, 37)
+ .append(jobId)
+ .append(jobStatus)
+ .append(source)
+ .append(requestId)
+ .append(additionalInfo)
+ .toHashCode();
+ }
+
+ public enum SourceStatus {
+ MSO,
+ VID
+ }
+
+ private UUID jobId;
+ private String jobStatus;
+ private SourceStatus source;
+ private UUID requestId;
+ private String additionalInfo;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Override
+ @Column(name = "ID", columnDefinition = "INT(11)")
+ public Long getId() {
+ return this.id;
+ }
+
+ @Column(name = "JOB_ID", columnDefinition = "CHAR(36)")
+ @Type(type="org.hibernate.type.UUIDCharType")
+ public UUID getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(UUID jobId) {
+ this.jobId = jobId;
+ }
+
+
+ @Column(name = "JOB_STATUS")
+ public String getJobStatus() {
+ return jobStatus;
+ }
+
+ public void setJobStatus(String jobStatus) {
+ this.jobStatus = jobStatus;
+ }
+
+
+ @Enumerated(EnumType.STRING)
+ @Column(name = "SOURCE")
+ public SourceStatus getSource() {
+ return source;
+ }
+
+ public void setSource(SourceStatus source) {
+ this.source = source;
+ }
+
+ @Column(name = "REQUEST_ID", columnDefinition = "CHAR(36)")
+ @Type(type="org.hibernate.type.UUIDCharType")
+ public UUID getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(UUID requestId) {
+ this.requestId = requestId;
+ }
+
+ @Column(name = "ADDITIONAL_INFO")
+ public String getAdditionalInfo() {
+ return additionalInfo;
+ }
+
+ public void setAdditionalInfo(String additionalInfo) {
+ this.additionalInfo = additionalInfo;
+ }
+
+ @Transient
+ public Boolean isFinal(){
+ try {
+ if (getSource() == SourceStatus.VID) {
+ return JobStatus.valueOf(getJobStatus()).isFinal();
+ }
+ }
+ catch (IllegalArgumentException e){
+ logger.error("JobStatus: " + getJobStatus() + " from vid isn't a value of JobStatus enum" + e.getMessage());
+ return false;
+ }
+ return false;
+ }
+
+ @Transient
+ public Date getCreatedDate() {
+ return getCreated();
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/JobBulk.java b/vid-app-common/src/main/java/org/onap/vid/model/JobBulk.java
new file mode 100644
index 000000000..400502772
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/JobBulk.java
@@ -0,0 +1,20 @@
+package org.onap.vid.model;
+
+import java.util.List;
+
+public class JobBulk {
+
+ private List<JobModel> jobs;
+
+ public JobBulk(List<JobModel> jobs) {
+ this.jobs = jobs;
+ }
+
+ public List<JobModel> getJobs() {
+ return jobs;
+ }
+
+ public void setJobs(List<JobModel> jobs) {
+ this.jobs = jobs;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/JobModel.java b/vid-app-common/src/main/java/org/onap/vid/model/JobModel.java
new file mode 100644
index 000000000..bd2b46c6f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/JobModel.java
@@ -0,0 +1,47 @@
+package org.onap.vid.model;
+
+import org.onap.vid.job.Job;
+import org.onap.vid.job.JobType;
+
+import java.util.UUID;
+
+public class JobModel {
+
+ private UUID uuid;
+ private Job.JobStatus status;
+ private UUID templateId;
+ private JobType type;
+
+ public UUID getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(UUID uuid) {
+ this.uuid = uuid;
+ }
+
+ public Job.JobStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(Job.JobStatus status) {
+ this.status = status;
+ }
+
+ public UUID getTemplateId() {
+ return templateId;
+ }
+
+ public void setTemplateId(UUID templateId) {
+ this.templateId = templateId;
+ }
+
+ public JobType getType() {
+ return type;
+ }
+
+ public void setType(JobType type) {
+ this.type = type;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NameCounter.java b/vid-app-common/src/main/java/org/onap/vid/model/NameCounter.java
new file mode 100644
index 000000000..aae39e440
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NameCounter.java
@@ -0,0 +1,42 @@
+package org.onap.vid.model;
+
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "vid_name_counter")
+public class NameCounter {
+
+ private String name;
+ private Integer counter;
+
+ public NameCounter() {
+ }
+
+ public NameCounter(String name) {
+ this.name = name;
+ this.counter = 1;
+ }
+
+ @Id
+ @Column(name = "name", columnDefinition = "VARCHAR(100)")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name = "counter", columnDefinition = "INT")
+ public Integer getCounter() {
+ return counter;
+ }
+
+ public void setCounter(Integer counter) {
+ this.counter = counter;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollection.java b/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollection.java
new file mode 100644
index 000000000..69ff286de
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollection.java
@@ -0,0 +1,59 @@
+package org.onap.vid.model;
+
+public class NetworkCollection {
+
+ private String uuid;
+
+ private String invariantUuid;
+
+ private String name;
+
+ private String version;
+
+ private NetworkCollectionProperties networkCollectionProperties;
+
+ public NetworkCollection(){
+ this.networkCollectionProperties = new NetworkCollectionProperties();
+ }
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public NetworkCollectionProperties getNetworkCollectionProperties() {
+ return networkCollectionProperties;
+ }
+
+ public void setNetworkCollectionProperties(NetworkCollectionProperties networkCollectionProperties) {
+ this.networkCollectionProperties = networkCollectionProperties;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollectionProperties.java b/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollectionProperties.java
new file mode 100644
index 000000000..16edff7a5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NetworkCollectionProperties.java
@@ -0,0 +1,22 @@
+package org.onap.vid.model;
+
+public class NetworkCollectionProperties {
+ private String networkCollectionFunction;
+ private String networkCollectionDescription;
+
+ public String getNetworkCollectionFunction() {
+ return networkCollectionFunction;
+ }
+
+ public void setNetworkCollectionFunction(String networkCollectionFunction) {
+ this.networkCollectionFunction = networkCollectionFunction;
+ }
+
+ public String getNetworkCollectionDescription() {
+ return networkCollectionDescription;
+ }
+
+ public void setNetworkCollectionDescription(String networkCollectionDescription) {
+ this.networkCollectionDescription = networkCollectionDescription;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewService.java b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
index 1346c0d95..6d5255067 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
@@ -20,11 +20,11 @@
package org.onap.vid.model;
+import org.onap.vid.asdc.beans.tosca.Input;
+
import java.util.Map;
import java.util.UUID;
-import org.onap.vid.asdc.beans.tosca.Input;
-
/**
* The Class Service.
*/
@@ -220,9 +220,7 @@ public class NewService {
*/
@Override
public int hashCode() {
- final UUID uuid = UUID.fromString(getUuid());
-
- return uuid.hashCode();
+ return UUID.fromString(getUuid()).hashCode();
}
/* (non-Javadoc)
@@ -237,16 +235,4 @@ public class NewService {
return (service.getUuid().equals(getUuid()));
}
- /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
-
- //Look for vnfCustomizationName..vfModuleCustomizationName
- String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
- for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
- VfModule xMod = vfModuleComponent.getValue();
- if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
- vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
- return;
- }
- }
- }*/
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
index 9ac0836a5..e55ba4a4e 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
@@ -67,6 +67,9 @@ public class NewServiceModel {
private Map<String, Node> pnfs;
+ private Map<String, CR> collectionResource;
+
+
/**
* Instantiates a new service model.
*/
@@ -178,6 +181,14 @@ public class NewServiceModel {
this.pnfs = pnfs;
}
+ public Map<String, CR> getCollectionResource() {
+ return collectionResource;
+ }
+
+ public void setCollectionResource(Map<String, CR> collectionResource) {
+ this.collectionResource = collectionResource;
+ }
+
/**
* Extract service.
*
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Node.java b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
index 474dfb55a..3b7abd39b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/Node.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
@@ -60,7 +60,7 @@ public class Node {
private String customizationUuid;
/** The inputs. */
- private Map<String, Input> inputs;
+ private Map<String, Input> inputs = new HashMap<>();
/** The get_input or other constructs from node template properties. */
private Map<String, CommandProperty> commands;
@@ -271,45 +271,10 @@ public class Node {
try {
// nodeTemplate.getProperties() map of String->Object
- for (Entry<String, Object> e : nodeTemplate.getProperties().entrySet()) {
-
- String k = e.getKey();
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + k );
-
- if ( e.getValue() != null ) {
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
- k + "=" + e.getValue());
- //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
- // e.getValue().getClass().getName());
- Class<?> c = e.getValue().getClass();
- if ( c.getName().equalsIgnoreCase(java.lang.String.class.getName())) {
- getProperties().put (k, (String)e.getValue());
- }
- else {
- Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-
- for(Class<?> ifc: interfaces ) {
- //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
- // ifc.getName());
- if ( ifc.getName().equalsIgnoreCase(java.util.Map.class.getName()) ) {
- // only extract get_input for now
- @SuppressWarnings("unchecked")
- HashMap<String,String> v = (HashMap<String,String>)e.getValue();
- for (Entry<String, String> entry : v.entrySet()) {
- // only include get_input for now
- if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
- CommandProperty cp = new CommandProperty();
- cp.setCommand(entry.getKey());
- cp.setInputName(entry.getValue());
- cp.setDisplayName(k);
- getCommands().put(k,cp);
- }
- }
- }
- }
-
- }
+ for (Entry<String, Object> entrySet : nodeTemplate.getProperties().entrySet()) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + entrySet.getKey());
+ if ( entrySet.getValue() != null ) {
+ readStringAndCommandsProperties(entrySet);
}
}
}
@@ -319,4 +284,42 @@ public class Node {
}
}
+ private void readStringAndCommandsProperties(Entry<String, Object> entrySet) {
+ String key = entrySet.getKey();
+ String methodName = "readStringAndCommandsProperties";
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
+ key + "=" + entrySet.getValue());
+ Class<?> c = entrySet.getValue().getClass();
+ if ( c.getName().equalsIgnoreCase(String.class.getName())) {
+ getProperties().put (key, (String) entrySet.getValue());
+ }
+ else {
+ Class<?>[] interfaces = entrySet.getValue().getClass().getInterfaces();
+
+ for(Class<?> ifc: interfaces ) {
+ if ( ifc.getName().equalsIgnoreCase(Map.class.getName()) ) {
+ readGetInputAsCommands(entrySet, key);
+
+ }
+ }
+
+ }
+ }
+
+ private void readGetInputAsCommands(Entry<String, Object> entrySet, String key) {
+ // only extract get_input for now
+ @SuppressWarnings("unchecked")
+ HashMap<String,String> v = (HashMap<String,String>) entrySet.getValue();
+ for (Entry<String, String> entry : v.entrySet()) {
+ // only include get_input for now
+ if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
+ CommandProperty cp = new CommandProperty();
+ cp.setCommand(entry.getKey());
+ cp.setInputName(entry.getValue());
+ cp.setDisplayName(key);
+ getCommands().put(key,cp);
+ }
+ }
+ }
+
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/PombaRequest.java b/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/PombaRequest.java
new file mode 100644
index 000000000..f7327acf1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/PombaRequest.java
@@ -0,0 +1,7 @@
+package org.onap.vid.model.PombaInstance;
+
+import java.util.List;
+
+public class PombaRequest {
+ public List<ServiceInstance> serviceInstanceList;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/ServiceInstance.java
new file mode 100644
index 000000000..08b224a3b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/PombaInstance/ServiceInstance.java
@@ -0,0 +1,21 @@
+package org.onap.vid.model.PombaInstance;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class ServiceInstance {
+
+ @JsonProperty
+ public String serviceInstanceId;
+
+ @JsonProperty
+ public String modelVersionId;
+
+ @JsonProperty
+ public String modelInvariantId;
+
+ @JsonProperty
+ public String customerId;
+
+ @JsonProperty
+ public String serviceType;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/Service.java b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
index b0597c649..d00f58f04 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
@@ -234,9 +234,7 @@ public class Service {
*/
@Override
public int hashCode() {
- final UUID uuid = UUID.fromString(getUuid());
-
- return uuid.hashCode();
+ return UUID.fromString(getUuid()).hashCode();
}
/* (non-Javadoc)
@@ -267,17 +265,4 @@ public class Service {
public void setServiceRole(String serviceRole) {
this.serviceRole = serviceRole;
}
-
- /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
-
- //Look for vnfCustomizationName..vfModuleCustomizationName
- String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
- for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
- VfModule xMod = vfModuleComponent.getValue();
- if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
- vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
- return;
- }
- }
- }*/
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java
new file mode 100644
index 000000000..4f04adf51
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInfo.java
@@ -0,0 +1,395 @@
+ package org.onap.vid.model;
+
+
+ import org.hibernate.annotations.Type;
+ import org.onap.vid.job.Job;
+ import org.onap.portalsdk.core.domain.support.DomainVo;
+
+ import javax.persistence.*;
+ import java.io.Serializable;
+ import java.util.Date;
+ import java.util.Objects;
+ import java.util.Set;
+ import java.util.UUID;
+
+@Entity
+@Table(name = "vid_service_info")
+public class ServiceInfo extends DomainVo {
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+
+ private UUID jobId;
+ private UUID templateId;
+ private String userId;
+ private Job.JobStatus jobStatus;
+ private Date statusModifiedDate;
+ private boolean hidden;
+ private boolean pause;
+ private Date deletedAt;
+ private String owningEntityId;
+ private String owningEntityName;
+ private String project;
+ private String aicZoneId;
+ private String aicZoneName;
+ private String tenantId;
+ private String tenantName;
+ private String regionId;
+ private String regionName;
+ private String serviceType;
+ private String subscriberName;
+ private String serviceInstanceId;
+ private String serviceInstanceName;
+ private String serviceModelId;
+ private String serviceModelName;
+ private String serviceModelVersion;
+ private Date createdBulkDate;
+
+ public ServiceInfo(){
+
+ }
+
+ public ServiceInfo(String userId, Job.JobStatus jobStatus, boolean pause, UUID jobId, UUID templateId, String owningEntityId, String owningEntityName, String project, String aicZoneId, String aicZoneName, String tenantId, String tenantName, String regionId, String regionName, String serviceType, String subscriberName, String serviceInstanceId, String serviceInstanceName, String serviceModelId, String serviceModelName, String serviceModelVersion, Date createdBulkDate) {
+ this.userId = userId;
+ this.jobStatus = jobStatus;
+ this.jobId = jobId;
+ this.templateId = templateId;
+ this.pause = pause;
+ this.owningEntityId = owningEntityId;
+ this.owningEntityName = owningEntityName;
+ this.project = project;
+ this.aicZoneId = aicZoneId;
+ this.aicZoneName = aicZoneName;
+ this.tenantId = tenantId;
+ this.tenantName = tenantName;
+ this.regionId = regionId;
+ this.regionName = regionName;
+ this.serviceType = serviceType;
+ this.subscriberName = subscriberName;
+ this.serviceInstanceId = serviceInstanceId;
+ this.serviceInstanceName = serviceInstanceName;
+ this.serviceModelId = serviceModelId;
+ this.serviceModelName = serviceModelName;
+ this.serviceModelVersion = serviceModelVersion;
+ this.createdBulkDate = createdBulkDate;
+ }
+
+ @Column(name = "JOB_ID", columnDefinition = "CHAR(36)")
+ @Type(type="org.hibernate.type.UUIDCharType")
+ public UUID getJobId() {
+ return jobId;
+ }
+
+ @Column(name = "TEMPLATE_ID", columnDefinition = "CHAR(36)")
+ @Type(type="org.hibernate.type.UUIDCharType")
+ public UUID getTemplateId() {
+ return templateId;
+ }
+
+ @Column(name="USER_ID")
+ public String getUserId() {
+ return userId;
+ }
+
+ @Column(name="JOB_STATUS")
+ @Enumerated(EnumType.STRING)
+ public Job.JobStatus getJobStatus() {
+ return jobStatus;
+ }
+
+ @Column(name="STATUS_MODIFIED_DATE")
+ public Date getStatusModifiedDate() {
+ return statusModifiedDate;
+ }
+
+ @Column(name="IS_HIDDEN")
+ public boolean isHidden() {
+ return hidden;
+ }
+
+ @Column(name="IS_PAUSE")
+ public boolean isPause() {
+ return pause;
+ }
+
+ @Column(name="OWNING_ENTITY_ID")
+ public String getOwningEntityId() {
+ return owningEntityId;
+ }
+
+ @Column(name="OWNING_ENTITY_NAME")
+ public String getOwningEntityName() {
+ return owningEntityName;
+ }
+
+ @Column(name="PROJECT")
+ public String getProject() {
+ return project;
+ }
+
+ @Column(name="AIC_ZONE_ID")
+ public String getAicZoneId() {
+ return aicZoneId;
+ }
+
+ @Column(name="AIC_ZONE_NAME")
+ public String getAicZoneName() {
+ return aicZoneName;
+ }
+
+ @Column(name="TENANT_ID")
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ @Column(name="TENANT_NAME")
+ public String getTenantName() {
+ return tenantName;
+ }
+
+ @Column(name="REGION_ID")
+ public String getRegionId() {
+ return regionId;
+ }
+
+ @Column(name="REGION_NAME")
+ public String getRegionName() {
+ return regionName;
+ }
+
+ @Column(name="SERVICE_TYPE")
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ @Column(name="SUBSCRIBER_NAME")
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ @Column(name="SERVICE_INSTANCE_ID")
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ @Column(name="SERVICE_INSTANCE_NAME")
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ @Column(name="SERVICE_MODEL_ID")
+ public String getServiceModelId() {
+ return serviceModelId;
+ }
+
+ @Column(name="SERVICE_MODEL_NAME")
+ public String getServiceModelName() {
+ return serviceModelName;
+ }
+
+ @Column(name="SERVICE_MODEL_VERSION")
+ public String getServiceModelVersion() {
+ return serviceModelVersion;
+ }
+
+ @Column(name="CREATED_BULK_DATE")
+ public Date getCreatedBulkDate() {
+ return createdBulkDate;
+ }
+
+ @Column(name="DELETED_AT")
+ public Date getDeletedAt() {
+ return deletedAt;
+ }
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Override
+ @Column(name = "ID", columnDefinition = "INT(11)")
+ public Long getId() {
+ return this.id;
+ }
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Override
+ @Transient
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+
+ public void setJobId(UUID jobId) {
+ this.jobId = jobId;
+ }
+
+ public void setTemplateId(UUID templateId) {
+ this.templateId = templateId;
+ }
+
+ public void setJobStatus(Job.JobStatus jobStatus) {
+ this.jobStatus = jobStatus;
+ }
+
+ public void setStatusModifiedDate(Date statusModifiedDate) {
+ this.statusModifiedDate = statusModifiedDate;
+ }
+
+ public void setHidden(boolean isHidden) {
+ hidden = isHidden;
+ }
+
+ public void setPause(boolean pause) {
+ this.pause = pause;
+ }
+
+ public void setOwningEntityId(String owningEntityId) {
+ this.owningEntityId = owningEntityId;
+ }
+
+ public void setOwningEntityName(String owningEntityName) {
+ this.owningEntityName = owningEntityName;
+ }
+
+ public void setProject(String project) {
+ this.project = project;
+ }
+
+ public void setAicZoneId(String aicZoneId) {
+ this.aicZoneId = aicZoneId;
+ }
+
+ public void setAicZoneName(String aicZoneName) {
+ this.aicZoneName = aicZoneName;
+ }
+
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ public void setTenantName(String tenantName) {
+ this.tenantName = tenantName;
+ }
+
+ public void setRegionId(String regionId) {
+ this.regionId = regionId;
+ }
+
+ public void setRegionName(String regionName) {
+ this.regionName = regionName;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public void setSubscriberName(String subscriberName) {
+ this.subscriberName = subscriberName;
+ }
+
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public void setServiceModelId(String serviceModelId) {
+ this.serviceModelId = serviceModelId;
+ }
+
+ public void setServiceModelName(String serviceModelName) {
+ this.serviceModelName = serviceModelName;
+ }
+
+ public void setServiceModelVersion(String serviceModelVersion) {
+ this.serviceModelVersion = serviceModelVersion;
+ }
+
+ public void setCreatedBulkDate(Date createdBulkDate) {
+ this.createdBulkDate = createdBulkDate;
+ }
+
+ public void setDeletedAt(Date deletedAt) {
+ this.deletedAt = deletedAt;
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (!(o instanceof ServiceInfo)) return false;
+ ServiceInfo that = (ServiceInfo) o;
+ return isHidden() == that.isHidden() &&
+ isPause() == that.isPause() &&
+ Objects.equals(getDeletedAt(), that.getDeletedAt()) &&
+ Objects.equals(getJobId(), that.getJobId()) &&
+ Objects.equals(getTemplateId(), that.getTemplateId()) &&
+ Objects.equals(getUserId(), that.getUserId()) &&
+ getJobStatus() == that.getJobStatus() &&
+ Objects.equals(getStatusModifiedDate(), that.getStatusModifiedDate()) &&
+ Objects.equals(getOwningEntityId(), that.getOwningEntityId()) &&
+ Objects.equals(getOwningEntityName(), that.getOwningEntityName()) &&
+ Objects.equals(getProject(), that.getProject()) &&
+ Objects.equals(getAicZoneId(), that.getAicZoneId()) &&
+ Objects.equals(getAicZoneName(), that.getAicZoneName()) &&
+ Objects.equals(getTenantId(), that.getTenantId()) &&
+ Objects.equals(getTenantName(), that.getTenantName()) &&
+ Objects.equals(getRegionId(), that.getRegionId()) &&
+ Objects.equals(getRegionName(), that.getRegionName()) &&
+ Objects.equals(getServiceType(), that.getServiceType()) &&
+ Objects.equals(getSubscriberName(), that.getSubscriberName()) &&
+ Objects.equals(getServiceInstanceId(), that.getServiceInstanceId()) &&
+ Objects.equals(getServiceInstanceName(), that.getServiceInstanceName()) &&
+ Objects.equals(getServiceModelId(), that.getServiceModelId()) &&
+ Objects.equals(getServiceModelName(), that.getServiceModelName()) &&
+ Objects.equals(getServiceModelVersion(), that.getServiceModelVersion()) &&
+ Objects.equals(getCreatedBulkDate(), that.getCreatedBulkDate());
+ }
+
+ @Override
+ public int hashCode() {
+
+ return Objects.hash(getJobId(), getTemplateId(), getUserId(), getJobStatus(), getStatusModifiedDate(),
+ isHidden(), isPause(), getDeletedAt(), getOwningEntityId(), getOwningEntityName(), getProject(),
+ getAicZoneId(), getAicZoneName(), getTenantId(), getTenantName(), getRegionId(),
+ getRegionName(), getServiceType(), getSubscriberName(), getServiceInstanceId(),
+ getServiceInstanceName(), getServiceModelId(), getServiceModelName(),
+ getServiceModelVersion(), getCreatedBulkDate());
+ }
+ }
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
index 7a1da8045..53eb18c64 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
@@ -20,18 +20,18 @@
package org.onap.vid.model;
+import org.apache.commons.collections.MapUtils;
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.properties.VidProperties;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-
-import org.onap.vid.asdc.beans.tosca.Group;
-import org.onap.vid.asdc.beans.tosca.NodeTemplate;
-import org.onap.vid.asdc.beans.tosca.ToscaModel;
-import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.onap.vid.properties.VidProperties;
/**
* The Class ServiceModel.
*/
@@ -42,7 +42,7 @@ public class ServiceModel {
private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceModel.class);
/** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ static final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
/** The service. */
private Service service;
@@ -52,6 +52,9 @@ public class ServiceModel {
/** The networks. */
private Map<String, Network> networks;
+ private Map<String, CR> collectionResource;
+
+
/** Port Mirroring Configuration node templates */
private Map<String, PortMirroringConfig> configurations;
@@ -218,6 +221,14 @@ public class ServiceModel {
*/
public void setPnfs(Map<String,Node> pnfs) {this.pnfs = pnfs;}
+ public Map<String, CR> getCollectionResource() {
+ return collectionResource;
+ }
+
+ public void setCollectionResource(Map<String, CR> collectionResource) {
+ this.collectionResource = collectionResource;
+ }
+
/**
* Extract service.
*
@@ -247,8 +258,8 @@ public class ServiceModel {
// Get the groups. The groups may duplicate the groups that are in the VNF model and have
// additional data like the VF module customization String>
- final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
- final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
+ final Map<String, VfModule> vfModules = new HashMap<> ();
+ final Map<String, VolumeGroup> volumeGroups = new HashMap<> ();
String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
@@ -283,41 +294,25 @@ public class ServiceModel {
String vnfCustomizationName = null;
String normalizedVnfCustomizationName = null;
String vfModuleCustomizationName = null;
- VNF tmpVnf = null;
-
- if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
+
+ if (!MapUtils.isEmpty(getVnfs())) {
for (Entry<String, VNF> vnfComponent : getVnfs().entrySet()) {
vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
-
+
LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
" VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
// now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
-
- if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
+
+ if (!MapUtils.isEmpty(getVolumeGroups())) {
for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
" VF Module customizationName=" + vfModuleCustomizationName );
if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
-
- // this vf module belongs to the VNF
- tmpVnf = vnfComponent.getValue();
- (tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
- " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
-
- // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
- if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
- if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
- if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
- (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
- }
- }
- }
+ handleCustomizationName(methodName, vnfCustomizationName, vfModuleCustomizationName, vnfComponent, vfModuleComponent);
}
}
}
@@ -327,4 +322,26 @@ public class ServiceModel {
}
+
+ private void handleCustomizationName(String methodName, String vnfCustomizationName, String vfModuleCustomizationName, Entry<String, VNF> vnfComponent, Entry<String, VfModule> vfModuleComponent) {
+ VNF tmpVnf;// this vf module belongs to the VNF
+ tmpVnf = vnfComponent.getValue();
+ (tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+ " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
+
+ // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
+ if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
+ if (isVolumeGroupsContainsVfModuleCustomName(vfModuleCustomizationName)) {
+ (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
+ }
+ }
+ }
+
+ private boolean isVolumeGroupsContainsVfModuleCustomName(String vfModuleCustomizationName) {
+ return (!MapUtils.isEmpty(getVolumeGroups())) && (getVolumeGroups().containsKey((vfModuleCustomizationName)));
+ }
+
+
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
index 6e3d3e79e..a08b585b5 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
@@ -8,6 +8,11 @@ import java.util.List;
* Created by Oren on 7/4/17.
*/
public class SubscriberList {
+ public SubscriberList(List<Subscriber> customer) {
+ this.customer = customer;
+ }
+
+ public SubscriberList(){}
public List<Subscriber> customer;
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VNF.java b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
index 54e54947e..9da88870c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
@@ -56,7 +56,10 @@ public class VNF extends Node {
/** The volume groups. */
private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
-
+
+ private Map<String, VfcInstanceGroup> vfcInstanceGroups = new HashMap<>();
+
+
/**
* Instantiates a new vnf.
*/
@@ -109,6 +112,15 @@ public class VNF extends Node {
this.volumeGroups = volumeGroups;
}
+
+ public Map<String, VfcInstanceGroup> getVfcInstanceGroups() {
+ return vfcInstanceGroups;
+ }
+
+ public void setVfcInstanceGroups(Map<String, VfcInstanceGroup> vfcInstanceGroups) {
+ this.vfcInstanceGroups = vfcInstanceGroups;
+ }
+
/**
* Extract vnf.
*
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
index f7b4d88f1..ea30571a0 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
@@ -20,130 +20,27 @@
package org.onap.vid.model;
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.onap.vid.asdc.beans.tosca.Group;
-
-import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.onap.sdc.toscaparser.api.Property;
/**
* The Class VfModule.
*/
-public class VfModule {
+public class VfModule extends org.onap.vid.model.Group {
/** The Constant LOG. */
private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VfModule.class);
/** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The customization uuid. */
- private String customizationUuid;
-
- /** The description. */
- private String description;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
+ static final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ public static final String VOLUME_GROUP = "volume_group";
+
/** The volume group allowed. */
private boolean volumeGroupAllowed;
-
- /** The get_input or other constructs for VF Module. */
- private Map<String, CommandProperty> commands;
-
- /** The model customization name. */
- private String modelCustomizationName;
-
- /** The model properties. */
- private Map<String, Property> properties;
-
- /**
- * Instantiates a new vf module.
- */
- public VfModule() {
- commands = new HashMap<String, CommandProperty>();
- }
- /**
- * Gets the model customization name.
- *
- * @return the model customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
- /**
- * Gets the customization uuid.
- *
- * @return the invariant uuid
- */
- public String getCustomizationUuid() {
- return customizationUuid;
- }
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * Gets the commands.
- *
- * @return the commands
- */
- public Map<String, CommandProperty> getCommands() {
- return commands;
- }
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
/**
* Checks if is volume group allowed.
@@ -153,58 +50,7 @@ public class VfModule {
public boolean isVolumeGroupAllowed() {
return volumeGroupAllowed;
}
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
- /**
- * Sets the customization uuid.
- *
- * @param customizationUuid the new customization uuid
- */
- public void setCustomizationUuid(String customizationUuid) {
- this.customizationUuid = customizationUuid;
- }
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
/**
* Sets the volume group allowed.
@@ -214,22 +60,8 @@ public class VfModule {
public void setVolumeGroupAllowed(boolean volumeGroupAllowed) {
this.volumeGroupAllowed = volumeGroupAllowed;
}
- /**
- * Sets the commands.
- *
- * @param m the commands
- */
- public void setCommands( Map<String, CommandProperty>m ) {
- commands = m;
- }
- /**
- * Sets the model customization name.
- *
- * @param modelCustomizationName the new model customization name
- */
- public void setModelCustomizationName(String modelCustomizationName) {
- this.modelCustomizationName = modelCustomizationName;
- }
+
+
/**
* Extract vf module.
*
@@ -250,17 +82,17 @@ public class VfModule {
vfModule.setVersion(group.getMetadata().getVfModuleModelVersion());
vfModule.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
vfModule.setModelCustomizationName (modelCustomizationName);
- //?vfModule.setProperties(group.getProperties());
-
- if (group.getProperties().containsKey("volume_group")) {
- if (group.getProperties().get("volume_group") != null) {
+ vfModule.setProperties(VfModule.extractPropertiesForGroup(group));
+
+ if (group.getProperties().containsKey(VOLUME_GROUP)) {
+ if (group.getProperties().get(VOLUME_GROUP) != null) {
- Class<?> c = group.getProperties().get("volume_group").getClass();
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" +
+ Class<?> c = group.getProperties().get(VOLUME_GROUP).getClass();
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" +
c.getName());
if ( c.getName().equalsIgnoreCase(Boolean.class.getName()) ) {
- Boolean b = (Boolean)group.getProperties().get("volume_group");
+ Boolean b = (Boolean)group.getProperties().get(VOLUME_GROUP);
vfModule.setVolumeGroupAllowed( b.booleanValue() );
}
}
@@ -272,48 +104,8 @@ public class VfModule {
LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module from group: e=" +
e.toString());
}
- /* Not extracting other types of properties for 1702
- try {
-
- for (Entry<String, Object> e : group.getProperties().entrySet()) {
-
- String k = e.getKey();
- if ( e.getValue() != null ) {
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
- k + "=" + e.getValue());
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
- e.getValue().getClass().getName());
- Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-
- for(Class<?> ifc: interfaces ){
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
- ifc.getName());
- }
-
- // only extract get_input for now
- for (Entry<String, String> entry : v.entrySet()) {
- // only include get_input for now
- if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
- CommandProperty cp = new CommandProperty();
- cp.setDisplayName(entry.getValue());
- cp.setCommand(entry.getKey());
- cp.setInputName(k);
- (vfModule.getCommands()).put(k,cp);
- }
- }
- }
- }
- }
- catch ( Exception e ) {
- LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module properties: e=" +
- e.toString());
- }*/
- return vfModule;
+ return vfModule;
}
- public Map<String, Property> getProperties() {
- return properties;
- }
- public void setProperties(Map<String, Property> properties) {
- this.properties = properties;
- }
+
+
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroup.java
new file mode 100644
index 000000000..1a7ca4316
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroup.java
@@ -0,0 +1,55 @@
+package org.onap.vid.model;
+
+public class VfcInstanceGroup {
+
+ private String uuid;
+ private String invariantUuid;
+ private String name;
+ private String version;
+ private VfcInstanceGroupProperties vfcInstanceGroupProperties;
+
+ public String getUuid() {
+ return uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public VfcInstanceGroupProperties getVfcInstanceGroupProperties() {
+ return vfcInstanceGroupProperties;
+ }
+
+ public void setVfcInstanceGroupProperties(VfcInstanceGroupProperties vfcInstanceGroupProperties) {
+ this.vfcInstanceGroupProperties = vfcInstanceGroupProperties;
+ }
+
+
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroupProperties.java b/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroupProperties.java
new file mode 100644
index 000000000..d6c04618d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfcInstanceGroupProperties.java
@@ -0,0 +1,44 @@
+package org.onap.vid.model;
+
+public class VfcInstanceGroupProperties {
+
+ private String vfcParentPortRole;
+ private String networkCollectionFunction;
+ private String vfcInstanceGroupFunction;
+ private String subinterfaceRole;
+
+ public String getVfcParentPortRole() {
+ return vfcParentPortRole;
+ }
+
+ public void setVfcParentPortRole(String vfcParentPortRole) {
+ this.vfcParentPortRole = vfcParentPortRole;
+ }
+
+ public String getNetworkCollectionFunction() {
+ return networkCollectionFunction;
+ }
+
+ public void setNetworkCollectionFunction(String networkCollectionFunction) {
+ this.networkCollectionFunction = networkCollectionFunction;
+ }
+
+ public String getVfcInstanceGroupFunction() {
+ return vfcInstanceGroupFunction;
+ }
+
+ public void setVfcInstanceGroupFunction(String vfcInstanceGroupFunction) {
+ this.vfcInstanceGroupFunction = vfcInstanceGroupFunction;
+ }
+
+ public String getSubinterfaceRole() {
+ return subinterfaceRole;
+ }
+
+ public void setSubinterfaceRole(String subinterfaceRole) {
+ this.subinterfaceRole = subinterfaceRole;
+ }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VidBaseEntity.java b/vid-app-common/src/main/java/org/onap/vid/model/VidBaseEntity.java
new file mode 100644
index 000000000..28c80b68d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VidBaseEntity.java
@@ -0,0 +1,64 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.onap.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.Transient;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@MappedSuperclass
+public class VidBaseEntity extends DomainVo {
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ @JsonIgnore
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ @JsonIgnore
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
index 5b9eeeba6..9054898e1 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
@@ -2,16 +2,12 @@ package org.onap.vid.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import org.onap.portalsdk.core.domain.support.DomainVo;
import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Set;
@Entity
@Table(name = "vid_workflow")
-public class VidWorkflow extends DomainVo {
+public class VidWorkflow extends VidBaseEntity {
private String wokflowName;
@@ -23,55 +19,6 @@ public class VidWorkflow extends DomainVo {
return id;
}
- @Override
- @Column(name = "CREATED_DATE")
- @JsonIgnore
- public Date getCreated() {
- return super.getCreated();
- }
-
- @Override
- @Column(name = "MODIFIED_DATE")
- @JsonIgnore
- public Date getModified() {
- return super.getModified();
- }
-
- @Override
- @Transient
- @JsonIgnore
- public Long getCreatedId() {
- return super.getCreatedId();
- }
-
- @Override
- @Transient
- @JsonIgnore
- public Long getModifiedId() {
- return super.getModifiedId();
- }
-
- @Override
- @Transient
- @JsonIgnore
- public Serializable getAuditUserId() {
- return super.getAuditUserId();
- }
-
- @Override
- @Transient
- @JsonIgnore
- public Long getRowNum() {
- return super.getRowNum();
- }
-
- @Override
- @Transient
- @JsonIgnore
- public Set getAuditTrail() {
- return super.getAuditTrail();
- }
-
@Column(name = "WORKFLOW_APP_NAME")
public String getWokflowName() {
return wokflowName;
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
index 969c287ce..888c5f5cf 100644
--- a/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
@@ -25,28 +25,10 @@ import org.onap.vid.asdc.beans.tosca.Group;
/**
* The Class VolumeGroup.
*/
-public class VolumeGroup {
+public class VolumeGroup extends org.onap.vid.model.Group {
+
+
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The description. */
- private String description;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The customization uuid. */
- private String customizationUuid;
-
- /** The customization uuid. */
- private String modelCustomizationName;
/**
* Instantiates a new volume group.
*/
@@ -57,124 +39,8 @@ public class VolumeGroup {
*
* @return the uuid
*/
- public String getUuid() {
- return uuid;
- }
- /**
- * Gets the customization uuid.
- *
- * @return the customization uuid
- */
- public String getCustomizationUuid() {
- return customizationUuid;
- }
- /**
- * Gets the customization name.
- *
- * @return the customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
/**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
- /**
- * Sets the customization uuid.
- *
- * @param u the new customization uuid
- */
- public void setCustomizationUuid(String u) {
- this.customizationUuid = u;
-
- }
- /**
- * Sets the customization name.
- *
- * @param u the new customization name
- */
- public void setModelCustomizationName(String u) {
- this.modelCustomizationName = u;
-
- }
- /**
* Extract volume group.
*
* @param group the group
@@ -190,6 +56,7 @@ public class VolumeGroup {
volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());
volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
volumeGroup.setModelCustomizationName(modelCustomizationName);
+ volumeGroup.setProperties(VolumeGroup.extractPropertiesForGroup(group));
return volumeGroup;
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/probes/ErrorMetadata.java b/vid-app-common/src/main/java/org/onap/vid/model/probes/ErrorMetadata.java
new file mode 100644
index 000000000..1f3fdfd7e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/probes/ErrorMetadata.java
@@ -0,0 +1,7 @@
+package org.onap.vid.model.probes;
+
+public class ErrorMetadata extends StatusMetadata {
+ public ErrorMetadata(String description, long duration) {
+ super(description, duration);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/probes/ExternalComponentStatus.java b/vid-app-common/src/main/java/org/onap/vid/model/probes/ExternalComponentStatus.java
new file mode 100644
index 000000000..da8c912e3
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/probes/ExternalComponentStatus.java
@@ -0,0 +1,26 @@
+package org.onap.vid.model.probes;
+
+public class ExternalComponentStatus {
+ public enum Component {AAI, MSO}
+ private final Component component;
+ private final boolean available;
+ private final StatusMetadata metadata;
+
+ public ExternalComponentStatus(Component component, boolean isAvailable, StatusMetadata metadata) {
+ this.component = component;
+ this.available = isAvailable;
+ this.metadata = metadata;
+ }
+
+ public Component getComponent() {
+ return component;
+ }
+
+ public boolean isAvailable() {
+ return available;
+ }
+
+ public StatusMetadata getMetadata() {
+ return metadata;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/probes/HttpRequestMetadata.java b/vid-app-common/src/main/java/org/onap/vid/model/probes/HttpRequestMetadata.java
new file mode 100644
index 000000000..e80d563bf
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/probes/HttpRequestMetadata.java
@@ -0,0 +1,34 @@
+package org.onap.vid.model.probes;
+
+import org.springframework.http.HttpMethod;
+
+public class HttpRequestMetadata extends StatusMetadata {
+ private final HttpMethod httpMethod;
+ private final int httpCode;
+ private final String url;
+ private final String rawData;
+
+ public HttpRequestMetadata(HttpMethod httpMethod, int httpCode, String url, String rawData, String description, long duration) {
+ super(description, duration);
+ this.httpMethod = httpMethod;
+ this.url = url;
+ this.httpCode = httpCode;
+ this.rawData = rawData;
+ }
+
+ public HttpMethod getHttpMethod() {
+ return httpMethod;
+ }
+
+ public int getHttpCode() {
+ return httpCode;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getRawData() {
+ return rawData;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/probes/StatusMetadata.java b/vid-app-common/src/main/java/org/onap/vid/model/probes/StatusMetadata.java
new file mode 100644
index 000000000..c1e7202cd
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/probes/StatusMetadata.java
@@ -0,0 +1,19 @@
+package org.onap.vid.model.probes;
+
+public abstract class StatusMetadata {
+ protected final long duration;
+ protected final String description;
+
+ public StatusMetadata(String description, long duration) {
+ this.description = description;
+ this.duration = duration;
+ }
+
+ public long getDuration() {
+ return duration;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java
new file mode 100644
index 000000000..1d2e69d54
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/ServiceInstantiation.java
@@ -0,0 +1,174 @@
+package org.onap.vid.model.serviceInstantiation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.onap.vid.domain.mso.ModelInfo;
+import org.onap.vid.job.JobAdapter;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public class ServiceInstantiation implements JobAdapter.AsyncJobRequest {
+
+ private final ModelInfo modelInfo;
+
+ private final String owningEntityId;
+
+ private final String owningEntityName;
+
+ private final String projectName;
+
+ private final String subscriberName;
+
+ private final String globalSubscriberId;
+
+ private final String productFamilyId;
+
+ private final String instanceName;
+
+ private final Boolean isUserProvidedNaming;
+
+ private final String subscriptionServiceType;
+
+ private final String lcpCloudRegionId;
+
+ private final String tenantId;
+
+ private final String tenantName;
+
+ private final String aicZoneId;
+
+ private final String aicZoneName;
+
+ private final Map<String, Vnf> vnfs;
+
+ private final List<Map<String,String>> instanceParams;
+
+ private final boolean isPause;
+
+ private final int bulkSize;
+
+ private final boolean rollbackOnFailure;
+
+ public ServiceInstantiation(@JsonProperty("modelInfo") ModelInfo modelInfo,
+ @JsonProperty("owningEntityId") String owningEntityId,
+ @JsonProperty("owningEntityName") String owningEntityName,
+ @JsonProperty("projectName") String projectName,
+ @JsonProperty("globalSubscriberId") String globalSubscriberId,
+ @JsonProperty("subscriberName") String subscriberName,
+ @JsonProperty("productFamilyId") String productFamilyId,
+ @JsonProperty("instanceName") String instanceName,
+ @JsonProperty("isUserProvidedNaming") Boolean isUserProvidedNaming,
+ @JsonProperty("subscriptionServiceType") String subscriptionServiceType,
+ @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
+ @JsonProperty("tenantId") String tenantId,
+ @JsonProperty("tenantName") String tenantName,
+ @JsonProperty("aicZoneId") String aicZoneId,
+ @JsonProperty("aicZoneName") String aicZoneName,
+ @JsonProperty("vnfs") Map<String, Vnf> vnfs,
+ @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
+ @JsonProperty("pause") boolean isPause,
+ @JsonProperty("bulkSize") int bulkSize,
+ @JsonProperty("rollbackOnFailure") boolean rollbackOnFailure
+ ) {
+
+ this.modelInfo = modelInfo;
+ this.modelInfo.setModelType("service");
+ this.owningEntityId = owningEntityId;
+ this.owningEntityName = owningEntityName;
+ this.projectName = projectName;
+ this.globalSubscriberId = globalSubscriberId;
+ this.subscriberName = subscriberName;
+ this.productFamilyId = productFamilyId;
+ this.instanceName = instanceName;
+ this.isUserProvidedNaming = isUserProvidedNaming;
+ this.subscriptionServiceType = subscriptionServiceType;
+ this.lcpCloudRegionId = lcpCloudRegionId;
+ this.tenantId = tenantId;
+ this.tenantName = tenantName;
+ this.aicZoneId = aicZoneId;
+ this.aicZoneName = aicZoneName;
+ this.vnfs = vnfs;
+ this.instanceParams = instanceParams;
+ this.isPause = isPause;
+ this.bulkSize = bulkSize;
+ this.rollbackOnFailure = rollbackOnFailure;
+ }
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public String getOwningEntityId() {
+ return owningEntityId;
+ }
+
+ public String getOwningEntityName() {
+ return owningEntityName;
+ }
+
+ public String getProjectName() {
+ return projectName;
+ }
+
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ public String getProductFamilyId() {
+ return productFamilyId;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ @JsonProperty("isUserProvidedNaming")
+ public Boolean isUserProvidedNaming() { return isUserProvidedNaming; }
+
+ public String getSubscriptionServiceType() {
+ return subscriptionServiceType;
+ }
+
+ public String getLcpCloudRegionId() {
+ return lcpCloudRegionId;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public String getTenantName() {
+ return tenantName;
+ }
+
+ public String getAicZoneId() {
+ return aicZoneId;
+ }
+
+ public String getAicZoneName() {
+ return aicZoneName;
+ }
+
+ public Map<String, Vnf> getVnfs() {
+ return vnfs;
+ }
+
+ public List<Map<String, String>> getInstanceParams() {
+ return instanceParams == null ? Collections.emptyList() : instanceParams;
+ }
+
+ public boolean isPause() {
+ return isPause;
+ }
+
+ public int getBulkSize() { return bulkSize; }
+
+ public boolean isRollbackOnFailure() {
+ return rollbackOnFailure;
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java
new file mode 100644
index 000000000..f63fb3365
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/VfModule.java
@@ -0,0 +1,75 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model.serviceInstantiation;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.vid.domain.mso.ModelInfo;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
+
+/**
+ * The Class VfModule.
+ */
+public class VfModule {
+
+
+
+ private final ModelInfo modelInfo;
+
+ @JsonInclude(NON_NULL) private final String instanceName;
+
+ private final List<Map<String, String>> instanceParams;
+ @JsonInclude(NON_NULL) private final String volumeGroupInstanceName;
+
+ public VfModule(@JsonProperty("modelInfo") ModelInfo modelInfo,
+ @JsonProperty("instanceName") String instanceName,
+ @JsonProperty(value = "volumeGroupName") String volumeGroupInstanceName,
+ @JsonProperty("instanceParams") List<Map<String, String>> instanceParams) {
+ this.modelInfo = modelInfo;
+ this.modelInfo.setModelType("vfModule");
+ this.instanceName = instanceName;
+ this.instanceParams = instanceParams;
+ this.volumeGroupInstanceName = volumeGroupInstanceName;
+ }
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public String getVolumeGroupInstanceName() {
+ return volumeGroupInstanceName;
+ }
+
+ public List<Map<String, String>> getInstanceParams() {
+ return instanceParams == null ? Collections.emptyList() : instanceParams;
+ }
+
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java
new file mode 100644
index 000000000..621754d17
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/serviceInstantiation/Vnf.java
@@ -0,0 +1,120 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. 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.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model.serviceInstantiation;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.commons.lang3.StringUtils;
+import org.onap.vid.domain.mso.ModelInfo;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The Class VNF.
+ */
+public class Vnf {
+ private final ModelInfo modelInfo;
+
+ private final String productFamilyId;
+
+ private final String instanceName;
+
+ private final String platformName;
+
+ private final String lcpCloudRegionId;
+
+ private final String tenantId;
+
+ private final Boolean isUserProvidedNaming;
+
+ private final List<Map<String, String>> instanceParams;
+
+ private final String lineOfBusiness;
+
+
+ private final Map<String, Map<String, VfModule>> vfModules;
+
+ public Vnf(@JsonProperty("modelInfo") ModelInfo modelInfo,
+ @JsonProperty("productFamilyId") String productFamilyId,
+ @JsonProperty("instanceName") String instanceName,
+ @JsonProperty("isUserProvidedNaming") Boolean isUserProvidedNaming,
+ @JsonProperty("platformName") String platformName,
+ @JsonProperty("lcpCloudRegionId") String lcpCloudRegionId,
+ @JsonProperty("tenantId") String tenantId,
+ @JsonProperty("instanceParams") List<Map<String, String>> instanceParams,
+ @JsonProperty("lineOfBusinessName") String lineOfBusiness,
+ @JsonProperty("vfModules") Map<String, Map<String, VfModule>> vfModules) {
+ this.modelInfo = modelInfo;
+ this.modelInfo.setModelType("vnf");
+ this.productFamilyId = productFamilyId;
+ this.instanceName = instanceName;
+ this.isUserProvidedNaming = isUserProvidedNaming;
+ this.platformName = platformName;
+ this.lcpCloudRegionId = lcpCloudRegionId;
+ this.tenantId = tenantId;
+ this.instanceParams = instanceParams;
+ this.vfModules = vfModules;
+ this.lineOfBusiness = lineOfBusiness;
+ }
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public String getProductFamilyId() {
+ return productFamilyId;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ @JsonProperty("isUserProvidedNaming")
+ public Boolean isUserProvidedNaming() {
+ return isUserProvidedNaming;
+ }
+
+ public String getPlatformName() {
+ return platformName;
+ }
+
+ public String getLcpCloudRegionId() {
+ return lcpCloudRegionId;
+ }
+
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ public List<Map<String, String>> getInstanceParams() {
+ return instanceParams == null ? Collections.emptyList() : instanceParams;
+ }
+
+ public Map<String, Map<String, VfModule>> getVfModules() {
+ return vfModules;
+ }
+
+ public String getLineOfBusiness() {
+ return lineOfBusiness;
+ }
+}