aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db
diff options
context:
space:
mode:
Diffstat (limited to 'mso-catalog-db')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java175
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java138
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java80
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java138
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java81
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java91
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java143
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java138
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java82
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java186
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java16
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java137
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java81
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java236
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java137
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java82
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java19
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceWorkflowRepository.java34
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java30
-rw-r--r--mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java48
-rw-r--r--mso-catalog-db/src/test/resources/data.sql3
-rw-r--r--mso-catalog-db/src/test/resources/schema.sql34
22 files changed, 2108 insertions, 1 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java
new file mode 100644
index 0000000000..9fcb1824db
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java
@@ -0,0 +1,175 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "ACTIVITY_SPEC")
+public class ActivitySpec implements Serializable {
+
+ private static final long serialVersionUID = 6902290480087262973L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "DESCRIPTION")
+ private String description;
+
+ @BusinessKey
+ @Column(name = "VERSION")
+ private Double version;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec")
+ private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec")
+ private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec")
+ private List<ActivitySpecUserParameters> activitySpecUserParameters;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec")
+ private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+
+ public Double getVersion() {
+ return version;
+ }
+
+ public void setVersion(Double version) {
+ this.version = version;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @LinkedResource
+ public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() {
+ return workflowActivitySpecSequence;
+ }
+
+ public void setWorkflowActivitySpecSequence(
+ List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) {
+ this.workflowActivitySpecSequence = workflowActivitySpecSequence;
+ }
+
+ @LinkedResource
+ public List<ActivitySpecUserParameters> getActivitySpecUserParameters() {
+ return activitySpecUserParameters;
+ }
+
+ public void setActivitySpecUserParameters(
+ List<ActivitySpecUserParameters> activitySpecUserParameters) {
+ this.activitySpecUserParameters = activitySpecUserParameters;
+ }
+
+ @LinkedResource
+ public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() {
+ return activitySpecActivitySpecCategories;
+ }
+
+ public void setActivitySpecActivitySpecCategories(
+ List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) {
+ this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories;
+ }
+
+ @LinkedResource
+ public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() {
+ return activitySpecActivitySpecParameters;
+ }
+
+ public void setActivitySpecActivitySpecParameters(
+ List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) {
+ this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters;
+ }
+
+
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("name", name)
+ .append("description", description).append("version", version)
+ .append("created", created).append("workflowActivitySpecSequence", workflowActivitySpecSequence)
+ .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString();
+ }
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpec)) {
+ return false;
+ }
+ ActivitySpec castOther = (ActivitySpec) other;
+ return new EqualsBuilder().append(name, castOther.name).append(version, castOther.version).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).append(version).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java
new file mode 100644
index 0000000000..e18188dff8
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@IdClass(ActivitySpecActivitySpecCategoriesId.class)
+@Table(name = "activity_spec_to_activity_spec_categories")
+public class ActivitySpecActivitySpecCategories implements Serializable {
+
+ private static final long serialVersionUID = 6228647901909437418L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_ID")
+ private Integer activitySpecId;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_CATEGORIES_ID")
+ private Integer activitySpecCategoriesId;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
+ private ActivitySpec activitySpec;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_CATEGORIES_ID", updatable = false, insertable = false)
+ private ActivitySpecCategories activitySpecCategories;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("activitySpecId", activitySpecId)
+ .append("activitySpecCategoriesId", activitySpecCategoriesId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecActivitySpecCategories)) {
+ return false;
+ }
+ ActivitySpecActivitySpecCategories castOther = (ActivitySpecActivitySpecCategories) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ public Integer getActivitySpecCategoriesId() {
+ return activitySpecCategoriesId;
+ }
+
+ public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) {
+ this.activitySpecCategoriesId = activitySpecCategoriesId;
+ }
+
+ public ActivitySpec getActivitySpec() {
+ return activitySpec;
+ }
+
+ public void setActivitySpec(ActivitySpec activitySpec) {
+ this.activitySpec = activitySpec;
+ }
+
+ public ActivitySpecCategories getActivitySpecCategories() {
+ return activitySpecCategories;
+ }
+
+ public void setActivitySpecCategories(ActivitySpecCategories activitySpecCategories) {
+ this.activitySpecCategories = activitySpecCategories;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java
new file mode 100644
index 0000000000..e31c5fcece
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java
@@ -0,0 +1,80 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+public class ActivitySpecActivitySpecCategoriesId implements Serializable {
+
+ private static final long serialVersionUID = 1563771827209840959L;
+ private Integer ID;
+ @BusinessKey
+ private Integer activitySpecId;
+ @BusinessKey
+ private Integer activitySpecCategoriesId;
+
+ public Integer getID() {
+ return ID;
+ }
+ public void setID(Integer iD) {
+ ID = iD;
+ }
+ public Integer getActivitySpecCategoriesId() {
+ return activitySpecCategoriesId;
+ }
+ public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) {
+ this.activitySpecCategoriesId = activitySpecCategoriesId;
+ }
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("activitySpecId", activitySpecId)
+ .append("activitySpecCategoriesId", activitySpecCategoriesId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecActivitySpecCategoriesId)) {
+ return false;
+ }
+ ActivitySpecActivitySpecCategoriesId castOther = (ActivitySpecActivitySpecCategoriesId) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java
new file mode 100644
index 0000000000..181380244d
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@IdClass(ActivitySpecActivitySpecParametersId.class)
+@Table(name = "activity_spec_to_activity_spec_parameters")
+public class ActivitySpecActivitySpecParameters implements Serializable {
+
+ private static final long serialVersionUID = -2036788837696381115L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_ID")
+ private Integer activitySpecId;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_PARAMETERS_ID")
+ private Integer activitySpecParametersId;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
+ private ActivitySpec activitySpec;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_PARAMETERS_ID", updatable = false, insertable = false)
+ private ActivitySpecParameters activitySpecParameters;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("activitySpecId", activitySpecId)
+ .append("activitySpecCategoriesId", activitySpecParametersId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecActivitySpecParameters)) {
+ return false;
+ }
+ ActivitySpecActivitySpecParameters castOther = (ActivitySpecActivitySpecParameters) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ public Integer getActivitySpecParametersId() {
+ return activitySpecParametersId;
+ }
+
+ public void setActivitySpecParametersId(Integer activitySpecParametersId) {
+ this.activitySpecParametersId = activitySpecParametersId;
+ }
+
+ public ActivitySpec getActivitySpec() {
+ return activitySpec;
+ }
+
+ public void setActivitySpec(ActivitySpec activitySpec) {
+ this.activitySpec = activitySpec;
+ }
+
+ public ActivitySpecParameters getActivitySpecParameters() {
+ return activitySpecParameters;
+ }
+
+ public void setActivitySpecParameters(ActivitySpecParameters activitySpecParameters) {
+ this.activitySpecParameters = activitySpecParameters;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java
new file mode 100644
index 0000000000..36c3a07c3f
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+public class ActivitySpecActivitySpecParametersId implements Serializable {
+
+ private static final long serialVersionUID = 1563771827209840959L;
+
+ private Integer ID;
+ @BusinessKey
+ private Integer activitySpecId;
+ @BusinessKey
+ private Integer activitySpecParametersId;
+
+ public Integer getID() {
+ return ID;
+ }
+ public void setID(Integer iD) {
+ ID = iD;
+ }
+ public Integer getActivitySpecParametersId() {
+ return activitySpecParametersId;
+ }
+ public void setActivitySpecParametersId(Integer activitySpecParametersId) {
+ this.activitySpecParametersId = activitySpecParametersId;
+ }
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("activitySpecId", activitySpecId)
+ .append("activitySpecCategoriesId", activitySpecParametersId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecActivitySpecParametersId)) {
+ return false;
+ }
+ ActivitySpecActivitySpecParametersId castOther = (ActivitySpecActivitySpecParametersId) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java
new file mode 100644
index 0000000000..737b174a9b
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java
@@ -0,0 +1,91 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "ACTIVITY_SPEC_CATEGORIES")
+public class ActivitySpecCategories implements Serializable {
+
+ private static final long serialVersionUID = -6251150462067699643L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "NAME")
+ private String name;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecCategories")
+ private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories;
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @LinkedResource
+ public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() {
+ return activitySpecActivitySpecCategories;
+ }
+
+ public void setActivitySpecActivitySpecCategories(
+ List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) {
+ this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("name", name)
+ .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString();
+ }
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecCategories)) {
+ return false;
+ }
+ ActivitySpecCategories castOther = (ActivitySpecCategories) other;
+ return new EqualsBuilder().append(name, castOther.name).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java
new file mode 100644
index 0000000000..9e3e301456
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java
@@ -0,0 +1,143 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "ACTIVITY_SPEC_PARAMETERS")
+public class ActivitySpecParameters implements Serializable {
+
+ private static final long serialVersionUID = 3627711377147710046L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "TYPE")
+ private String type;
+
+ @BusinessKey
+ @Column(name = "DIRECTION")
+ private String direction;
+
+ @Column(name = "DESCRIPTION")
+ private String description;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecParameters")
+ private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ @LinkedResource
+ public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() {
+ return activitySpecActivitySpecParameters;
+ }
+
+ public void setActivitySpecActivitySpecParameters(
+ List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) {
+ this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("name", name).append("direction", direction)
+ .append("activitySpecActivitySpecParameters", activitySpecActivitySpecParameters).toString();
+ }
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecParameters)) {
+ return false;
+ }
+ ActivitySpecParameters castOther = (ActivitySpecParameters) other;
+ return new EqualsBuilder().append(ID, castOther.ID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(ID).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDirection() {
+ return direction;
+ }
+
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java
new file mode 100644
index 0000000000..8cf3351274
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@IdClass(ActivitySpecUserParametersId.class)
+@Table(name = "activity_spec_to_user_parameters")
+public class ActivitySpecUserParameters implements Serializable {
+
+ private static final long serialVersionUID = 5599242118780268449L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_ID")
+ private Integer activitySpecId;
+
+ @BusinessKey
+ @Id
+ @Column(name = "USER_PARAMETERS_ID")
+ private Integer userParametersId;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
+ private ActivitySpec activitySpec;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "USER_PARAMETERS_ID", updatable = false, insertable = false)
+ private UserParameters userParameters;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this)
+ .append("activitySpecId", activitySpecId)
+ .append("userParametersId", userParametersId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecUserParameters)) {
+ return false;
+ }
+ ActivitySpecUserParameters castOther = (ActivitySpecUserParameters) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(userParametersId, castOther.userParametersId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ public Integer getUserParametersId() {
+ return userParametersId;
+ }
+
+ public void setUserParametersId(Integer userParametersId) {
+ this.userParametersId = userParametersId;
+ }
+
+ public ActivitySpec getActivitySpec() {
+ return activitySpec;
+ }
+
+ public void setActivitySpec(ActivitySpec activitySpec) {
+ this.activitySpec = activitySpec;
+ }
+
+ public UserParameters getUserParameters() {
+ return userParameters;
+ }
+
+ public void setUserParameters(UserParameters userParameters) {
+ this.userParameters = userParameters;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java
new file mode 100644
index 0000000000..3e739ac013
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+public class ActivitySpecUserParametersId implements Serializable {
+
+ private static final long serialVersionUID = 1563771827209840959L;
+
+ private Integer ID;
+ @BusinessKey
+ private Integer activitySpecId;
+ @BusinessKey
+ private Integer userParametersId;
+
+ public Integer getID() {
+ return ID;
+ }
+ public void setID(Integer iD) {
+ ID = iD;
+ }
+ public Integer getUserParametersId() {
+ return userParametersId;
+ }
+ public void setUserParametersId(Integer userParametersId) {
+ this.userParametersId = userParametersId;
+ }
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("activitySpecId", activitySpecId)
+ .append("userParametersId", userParametersId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof ActivitySpecUserParametersId)) {
+ return false;
+ }
+ ActivitySpecUserParametersId castOther = (ActivitySpecUserParametersId) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(userParametersId, castOther.userParametersId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode();
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
new file mode 100644
index 0000000000..7d23717b2f
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java
@@ -0,0 +1,186 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "USER_PARAMETERS")
+public class UserParameters implements Serializable {
+
+ private static final long serialVersionUID = -5036895978102778877L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "PAYLOAD_LOCATION")
+ private String payloadLocation;
+
+ @Column(name = "LABEL")
+ private String label;
+
+ @Column(name = "TYPE")
+ private String type;
+
+ @Column(name = "DESCRIPTION")
+ private String description;
+
+ @Column(name = "IS_REQUIRED")
+ private Boolean isRequried;
+
+ @Column(name = "MAX_LENGTH")
+ private Integer maxLength;
+
+ @Column(name = "ALLOWABLE_CHARS")
+ private String allowableChars;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "userParameters")
+ private List<ActivitySpecUserParameters> activitySpecUserParameters;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @LinkedResource
+ public List<ActivitySpecUserParameters> getActivitySpecUserParameters() {
+ return activitySpecUserParameters;
+ }
+
+ public void setActivitySpecUserParameters(
+ List<ActivitySpecUserParameters> activitySpecUserParameters) {
+ this.activitySpecUserParameters = activitySpecUserParameters;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("name", name)
+ .append("ActivitySpecUserParameters", activitySpecUserParameters).toString();
+ }
+ public String getPayloadLocation() {
+ return payloadLocation;
+ }
+
+ public void setPayloadLocation(String payloadLocation) {
+ this.payloadLocation = payloadLocation;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Boolean getIsRequried() {
+ return isRequried;
+ }
+
+ public void setIsRequried(Boolean isRequried) {
+ this.isRequried = isRequried;
+ }
+
+ public Integer getMaxLength() {
+ return maxLength;
+ }
+
+ public void setMaxLength(Integer maxLength) {
+ this.maxLength = maxLength;
+ }
+
+ public String getAllowableChars() {
+ return allowableChars;
+ }
+
+ public void setAllowableChars(String allowableChars) {
+ this.allowableChars = allowableChars;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof UserParameters)) {
+ return false;
+ }
+ UserParameters castOther = (UserParameters) other;
+ return new EqualsBuilder().append(name, castOther.name).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(name).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
index 83fe051233..41269fb010 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java
@@ -99,6 +99,9 @@ public class VnfResource implements Serializable {
@OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources")
private List<VnfResourceCustomization> vnfResourceCustomizations;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource")
+ private List<VnfResourceWorkflow> vnfResourceWorkflow;
@PrePersist
protected void onCreate() {
@@ -113,6 +116,7 @@ public class VnfResource implements Serializable {
.append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin)
.append("aicVersionMax", aicVersionMax).append("created", created)
.append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations)
+ .append("vnfResourceWorkflow",vnfResourceWorkflow)
.toString();
}
@@ -259,4 +263,16 @@ public class VnfResource implements Serializable {
public void setModelVersion(String modelVersion) {
this.modelVersion = modelVersion;
}
+
+ @LinkedResource
+ public List<VnfResourceWorkflow> getVnfResourceWorkflow() {
+ if (vnfResourceWorkflow == null)
+ vnfResourceWorkflow = new ArrayList<>();
+ return vnfResourceWorkflow;
+ }
+
+ public void setVnfResourceWorkflow(List<VnfResourceWorkflow> vnfResourceWorkflow) {
+ this.vnfResourceWorkflow = vnfResourceWorkflow;
+ }
+
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java
new file mode 100644
index 0000000000..8790e738ef
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java
@@ -0,0 +1,137 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@IdClass(VnfResourceWorkflowId.class)
+@Table(name = "VNF_RESOURCE_TO_WORKFLOW")
+public class VnfResourceWorkflow implements Serializable {
+
+ private static final long serialVersionUID = -1326433350241927676L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "VNF_RESOURCE_MODEL_UUID")
+ private String vnfResourceModelUUID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "WORKFLOW_ID")
+ private Integer workflowId;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID", updatable = false, insertable = false)
+ private VnfResource vnfResource;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false)
+ private Workflow workflow;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID)
+ .append("workflowId", workflowId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof VnfResourceWorkflow)) {
+ return false;
+ }
+ VnfResourceWorkflow castOther = (VnfResourceWorkflow) other;
+ return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID)
+ .append(workflowId, castOther.workflowId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getVnfResourceModelUUID() {
+ return vnfResourceModelUUID;
+ }
+
+ public void setVnfResourceModelUUID(String vnfResourceModelUUID) {
+ this.vnfResourceModelUUID = vnfResourceModelUUID;
+ }
+
+ public Integer getWorkflowId() {
+ return workflowId;
+ }
+
+ public void setWorkflowId(Integer workflowId) {
+ this.workflowId = workflowId;
+ }
+
+ public VnfResource getVnfResource() {
+ return vnfResource;
+ }
+
+ public void setVnfResource(VnfResource vnfResource) {
+ this.vnfResource = vnfResource;
+ }
+
+ public Workflow getWorkflow() {
+ return workflow;
+ }
+
+ public void setWorkflow(Workflow workflow) {
+ this.workflow = workflow;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java
new file mode 100644
index 0000000000..ad8aa0587d
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java
@@ -0,0 +1,81 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+public class VnfResourceWorkflowId implements Serializable {
+
+ private static final long serialVersionUID = -594459957997483601L;
+
+ private Integer ID;
+
+ @BusinessKey
+ private String vnfResourceModelUUID;
+ @BusinessKey
+ private Integer workflowId;
+
+ public String getVnfResourceModelUUID() {
+ return vnfResourceModelUUID;
+ }
+ public void setVnfResourceModelUUID(String vnfResourceModelUUID) {
+ this.vnfResourceModelUUID = vnfResourceModelUUID;
+ }
+ public Integer getWorkflowId() {
+ return workflowId;
+ }
+ public void setWorkflowId(Integer workflowId) {
+ this.workflowId = workflowId;
+ }
+ public Integer getID() {
+ return ID;
+ }
+ public void setID(Integer ID) {
+ this.ID = ID;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID)
+ .append("workflowId", workflowId).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof VnfResourceWorkflowId)) {
+ return false;
+ }
+ VnfResourceWorkflowId castOther = (VnfResourceWorkflowId) other;
+ return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID)
+ .append(workflowId, castOther.workflowId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
new file mode 100644
index 0000000000..cdbf41747c
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java
@@ -0,0 +1,236 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import org.hibernate.annotations.NotFound;
+import org.hibernate.annotations.NotFoundAction;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "workflow")
+public class Workflow implements Serializable {
+
+ private static final long serialVersionUID = 1485794141983033264L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @Column(name = "ARTIFACT_UUID")
+ private String artifactUUID;
+
+ @Column(name = "ARTIFACT_NAME")
+ private String artifactName;
+
+ @Column(name = "NAME")
+ private String name;
+
+ @Column(name = "OPERATION_NAME")
+ private String operationName;
+
+ @Column(name = "VERSION")
+ private Double version;
+
+ @Column(name = "DESCRIPTION")
+ private String description;
+
+ @Lob
+ @Column(name = "BODY", columnDefinition = "LONGTEXT")
+ private String body = null;
+
+ @Column(name = "RESOURCE_TARGET")
+ private String resourceTarget;
+
+ @Column(name = "SOURCE")
+ private String source;
+
+ @Column(name = "TIMEOUT_MINUTES")
+ private Integer timeoutMinutes;
+
+ @Column(name = "ARTIFACT_CHECKSUM")
+ private String artifactChecksum;
+
+ @Column(name = "CREATION_TIMESTAMP", updatable = false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow")
+ private List<VnfResourceWorkflow> vnfResourceWorkflow;
+
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow")
+ private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence;
+
+ @PrePersist
+ protected void onCreate() {
+ this.created = new Date();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getArtifactUUID() {
+ return artifactUUID;
+ }
+
+ public void setArtifactUUID(String artifactUUID) {
+ this.artifactUUID = artifactUUID;
+ }
+
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getOperationName() {
+ return operationName;
+ }
+
+ public void setOperationName(String operationName) {
+ this.operationName = operationName;
+ }
+
+ public Double getVersion() {
+ return version;
+ }
+
+ public void setVersion(Double version) {
+ this.version = version;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ public String getResourceTarget() {
+ return resourceTarget;
+ }
+
+ public void setResourceTarget(String resourceTarget) {
+ this.resourceTarget = resourceTarget;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public void setSource(String source) {
+ this.source = source;
+ }
+
+ public Integer getTimeoutMinutes() {
+ return timeoutMinutes;
+ }
+
+ public void setTimeoutMinutes(Integer timeoutMinutes) {
+ this.timeoutMinutes = timeoutMinutes;
+ }
+
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @LinkedResource
+ public List<VnfResourceWorkflow> getVnfResourceWorkflow() {
+ return vnfResourceWorkflow;
+ }
+
+ public void setVnfResourceWorkflow(
+ List<VnfResourceWorkflow> vnfResourceWorkflow) {
+ this.vnfResourceWorkflow = vnfResourceWorkflow;
+ }
+
+ @LinkedResource
+ public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() {
+ return workflowActivitySpecSequence;
+ }
+
+ public void setWorkflowActivitySpecSequence(
+ List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) {
+ this.workflowActivitySpecSequence = workflowActivitySpecSequence;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("ID", ID).append("artifactUUID", artifactUUID)
+ .append("artifactName", artifactName).append("name", name)
+ .append("operationName", operationName).append("version", version).append("description", description)
+ .append("body",body).append("resourceTarget",resourceTarget).append("source", source)
+ .append("timeoutMinutes", timeoutMinutes).append("artifactChecksum", artifactChecksum)
+ .append("created", created).append("vnfResourceWorkflow", vnfResourceWorkflow)
+ .append("WorkflowActivitySpecSequence",workflowActivitySpecSequence).toString();
+ }
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof Workflow)) {
+ return false;
+ }
+ Workflow castOther = (Workflow) other;
+ return new EqualsBuilder().append(ID, castOther.ID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(ID).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java
new file mode 100644
index 0000000000..8a1881edf3
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java
@@ -0,0 +1,137 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@IdClass(WorkflowActivitySpecSequenceId.class)
+@Table(name = "workflow_activity_spec_sequence")
+public class WorkflowActivitySpecSequence implements Serializable {
+
+ private static final long serialVersionUID = -8788505759463286871L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Id
+ @Column(name = "ACTIVITY_SPEC_ID")
+ private Integer activitySpecId;
+
+ @BusinessKey
+ @Id
+ @Column(name = "WORKFLOW_ID")
+ private Integer workflowId;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false)
+ private ActivitySpec activitySpec;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false)
+ private Workflow workflow;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("workflowId", workflowId)
+ .append("activitySpecId", activitySpecId)
+ .toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof WorkflowActivitySpecSequence)) {
+ return false;
+ }
+ WorkflowActivitySpecSequence castOther = (WorkflowActivitySpecSequence) other;
+ return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId)
+ .append(workflowId, castOther.workflowId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(activitySpecId).append(workflowId).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ public Integer getWorkflowId() {
+ return workflowId;
+ }
+
+ public void setWorkflowId(Integer workflowId) {
+ this.workflowId = workflowId;
+ }
+
+ public ActivitySpec getActivitySpec() {
+ return activitySpec;
+ }
+
+ public void setActivitySpec(ActivitySpec activitySpec) {
+ this.activitySpec = activitySpec;
+ }
+
+ public Workflow getWorkflow() {
+ return workflow;
+ }
+
+ public void setWorkflow(Workflow workflow) {
+ this.workflow = workflow;
+ }
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java
new file mode 100644
index 0000000000..f0a5759c3a
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java
@@ -0,0 +1,82 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.beans;
+
+import java.io.Serializable;
+
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+import com.openpojo.business.annotation.BusinessKey;
+
+public class WorkflowActivitySpecSequenceId implements Serializable {
+
+ private static final long serialVersionUID = -8987314754011453123L;
+
+ private Integer ID;
+
+ @BusinessKey
+ private Integer workflowId;
+ @BusinessKey
+ private Integer activitySpecId;
+
+ public Integer getID() {
+ return ID;
+ }
+ public void setID(Integer ID) {
+ this.ID = ID;
+ }
+
+ public Integer getWorkflowId() {
+ return workflowId;
+ }
+ public void setWorkflowId(Integer workflowId) {
+ this.workflowId = workflowId;
+ }
+ public Integer getActivitySpecId() {
+ return activitySpecId;
+ }
+ public void setActivitySpecId(Integer activitySpecId) {
+ this.activitySpecId = activitySpecId;
+ }
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("workflowId", workflowId)
+ .append("activitySpecId", activitySpecId).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof WorkflowActivitySpecSequenceId)) {
+ return false;
+ }
+ WorkflowActivitySpecSequenceId castOther = (WorkflowActivitySpecSequenceId) other;
+ return new EqualsBuilder().append(workflowId, castOther.workflowId)
+ .append(activitySpecId, castOther.activitySpecId).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(workflowId).append(activitySpecId).toHashCode();
+ }
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
index d010288feb..2ce1263f69 100644
--- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java
@@ -59,6 +59,7 @@ import org.onap.so.db.catalog.beans.VnfRecipe;
import org.onap.so.db.catalog.beans.VnfResource;
import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization;
+import org.onap.so.db.catalog.beans.Workflow;
import org.onap.so.db.catalog.beans.macro.NorthBoundRequest;
import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
@@ -110,6 +111,7 @@ public class CatalogDbClient {
private static final String NETWORK_RECIPE = "/networkRecipe";
private static final String PNF_RESOURCE = "/pnfResource";
private static final String PNF_RESOURCE_CUSTOMIZATION = "/pnfResourceCustomization";
+ private static final String WORKFLOW = "/workflow";
private static final String SEARCH = "/search";
@@ -143,6 +145,7 @@ public class CatalogDbClient {
private static final String CLLI = "clli";
private static final String CLOUD_VERSION = "cloudVersion";
private static final String HOMING_INSTANCE = "/homingInstance";
+ private static final String ARTIFACT_UUID = "artifactUUID";
private static final String TARGET_ENTITY = "SO:CatalogDB";
private static final String ASTERISK = "*";
@@ -176,6 +179,7 @@ public class CatalogDbClient {
private String findByClliAndCloudVersion = "/findByClliAndCloudVersion";
private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId";
private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid";
+ private String findWorkflowByArtifactUUID = "/findByArtifactUUID";
private String serviceURI;
private String vfModuleURI;
@@ -192,6 +196,7 @@ public class CatalogDbClient {
private String cvnfcResourceCustomizationURI;
private String pnfResourceURI;
private String pnfResourceCustomizationURI;
+ private String workflowURI;
private final Client<Service> serviceClient;
@@ -248,6 +253,8 @@ public class CatalogDbClient {
private final Client<PnfResource> pnfResourceClient;
private final Client<PnfResourceCustomization> pnfResourceCustomizationClient;
+
+ private final Client<Workflow> workflowClient;
@Value("${mso.catalog.db.spring.endpoint:#{null}}")
private String endpoint;
@@ -290,6 +297,8 @@ public class CatalogDbClient {
findPnfResourceCustomizationByModelUuid =
endpoint + PNF_RESOURCE_CUSTOMIZATION + SEARCH + findPnfResourceCustomizationByModelUuid;
+
+ findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID;
serviceURI = endpoint + SERVICE + URI_SEPARATOR;
vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR;
@@ -306,6 +315,7 @@ public class CatalogDbClient {
homingInstanceURI = endpoint + HOMING_INSTANCE + URI_SEPARATOR;
pnfResourceURI = endpoint + PNF_RESOURCE + URI_SEPARATOR;
pnfResourceCustomizationURI = endpoint + PNF_RESOURCE_CUSTOMIZATION + URI_SEPARATOR;
+ workflowURI = endpoint + WORKFLOW + URI_SEPARATOR;
}
@@ -352,6 +362,7 @@ public class CatalogDbClient {
externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
pnfResourceClient = clientFactory.create(PnfResource.class);
pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class);
+ workflowClient = clientFactory.create(Workflow.class);
}
public CatalogDbClient(String baseUri, String auth) {
@@ -397,6 +408,7 @@ public class CatalogDbClient {
externalServiceToInternalServiceClient = clientFactory.create(ExternalServiceToInternalService.class);
pnfResourceClient = clientFactory.create(PnfResource.class);
pnfResourceCustomizationClient = clientFactory.create(PnfResourceCustomization.class);
+ workflowClient = clientFactory.create(Workflow.class);
}
public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID(String modelCustomizationUUID) {
@@ -801,5 +813,10 @@ public class CatalogDbClient {
}else
throw new EntityNotFoundException("Unable to find CvnfcConfigurationCustomization ModelCustomizationUUID:" + cvnfcCustomizationUuid);
}
-
+
+ public Workflow findWorkflowByArtifactUUID (String artifactUUID) {
+ return this.getSingleResource(workflowClient,getUri(UriBuilder
+ .fromUri(findWorkflowByArtifactUUID)
+ .queryParam(ARTIFACT_UUID, artifactUUID).build().toString()));
+ }
}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceWorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceWorkflowRepository.java
new file mode 100644
index 0000000000..d722ab2d6a
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceWorkflowRepository.java
@@ -0,0 +1,34 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.so.db.catalog.data.repository;
+
+import java.util.List;
+
+import org.onap.so.db.catalog.beans.VnfResource;
+import org.onap.so.db.catalog.beans.VnfResourceWorkflow;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+@RepositoryRestResource(collectionResourceRel = "vnfResourceWorkflow", path = "vnfResourceWorkflow")
+public interface VnfResourceWorkflowRepository
+ extends JpaRepository<VnfResourceWorkflow, String> {
+ List<VnfResourceWorkflow> findByVnfResourceModelUUID(String vnfResourceModelUUID);
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
new file mode 100644
index 0000000000..f33a5b6ff9
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * 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.so.db.catalog.data.repository;
+
+import org.onap.so.db.catalog.beans.Workflow;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.rest.core.annotation.RepositoryRestResource;
+
+@RepositoryRestResource(collectionResourceRel = "workflow", path = "workflow")
+public interface WorkflowRepository extends JpaRepository<Workflow, String> {
+ Workflow findByArtifactUUID(String artifactUUID);
+} \ No newline at end of file
diff --git a/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
new file mode 100644
index 0000000000..be5800608d
--- /dev/null
+++ b/mso-catalog-db/src/test/java/org/onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java
@@ -0,0 +1,48 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2019 Nordix Foundation.
+ * ================================================================================
+ * 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.so.db.catalog.data.repository;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.List;
+import org.junit.Test;
+import org.onap.so.db.catalog.BaseTest;
+import org.onap.so.db.catalog.beans.PnfResource;
+import org.onap.so.db.catalog.beans.PnfResourceCustomization;
+import org.onap.so.db.catalog.beans.Workflow;
+import org.onap.so.db.catalog.exceptions.NoEntityFoundException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class WorkflowRepositoryTest extends BaseTest {
+
+ @Autowired
+ private WorkflowRepository workflowRepository;
+
+ @Test
+ public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception {
+ Workflow workflow = workflowRepository
+ .findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1");
+
+ assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName());
+ }
+
+}
diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql
index 008f4ae737..ade183ee6a 100644
--- a/mso-catalog-db/src/test/resources/data.sql
+++ b/mso-catalog-db/src/test/resources/data.sql
@@ -738,3 +738,6 @@ insert into pnf_resource_customization(model_customization_uuid, model_instance_
insert into pnf_resource_customization_to_service(service_model_uuid, resource_model_customization_uuid) values
('5df8b6de-2083-11e7-93ae-92361f002676', '68dc9a92-214c-11e7-93ae-92361f002680');
+
+insert into workflow(artifact_uuid, artifact_name, name, operation_name, version, description, body, resource_target, source) values
+('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc');
diff --git a/mso-catalog-db/src/test/resources/schema.sql b/mso-catalog-db/src/test/resources/schema.sql
index 9002c92172..d5a73b0f07 100644
--- a/mso-catalog-db/src/test/resources/schema.sql
+++ b/mso-catalog-db/src/test/resources/schema.sql
@@ -1203,3 +1203,37 @@ CREATE TABLE IF NOT EXISTS `pnf_resource_customization_to_service` (
`RESOURCE_MODEL_CUSTOMIZATION_UUID` varchar(200) NOT NULL,
PRIMARY KEY (`SERVICE_MODEL_UUID`,`RESOURCE_MODEL_CUSTOMIZATION_UUID`)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `workflow` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `ARTIFACT_UUID` varchar(200) NOT NULL,
+ `ARTIFACT_NAME` varchar(200) NOT NULL,
+ `NAME` varchar(200) NOT NULL,
+ `OPERATION_NAME` varchar(200) DEFAULT NULL,
+ `VERSION` double NOT NULL,
+ `DESCRIPTION` varchar(1200) DEFAULT NULL,
+ `BODY` longtext DEFAULT NULL,
+ `RESOURCE_TARGET` varchar(200) NOT NULL,
+ `SOURCE` varchar(200) NOT NULL,
+ `TIMEOUT_MINUTES` int(11) DEFAULT NULL,
+ `ARTIFACT_CHECKSUM` varchar(200) DEFAULT 'MANUAL RECORD',
+ `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT current_timestamp(),
+ PRIMARY KEY (`ID`),
+ UNIQUE KEY `UK_workflow` (`ARTIFACT_UUID`,`NAME`,`VERSION`,`SOURCE`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+CREATE TABLE IF NOT EXISTS `vnf_resource_to_workflow` (
+ `ID` int(11) NOT NULL AUTO_INCREMENT,
+ `VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL,
+ `WORKFLOW_ID` int(11) NOT NULL,
+ PRIMARY KEY (`ID`),
+ UNIQUE KEY `UK_vnf_resource_to_workflow` (`VNF_RESOURCE_MODEL_UUID`,`WORKFLOW_ID`),
+ KEY `fk_vnf_resource_to_workflow__workflow1_idx` (`WORKFLOW_ID`),
+ KEY `fk_vnf_resource_to_workflow__vnf_res_mod_uuid_idx` (`VNF_RESOURCE_MODEL_UUID`),
+ CONSTRAINT `fk_vnf_resource_to_workflow__vnf_resource1` FOREIGN KEY (`VNF_RESOURCE_MODEL_UUID`) REFERENCES `vnf_resource` (`MODEL_UUID`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `fk_vnf_resource_to_workflow__workflow1` FOREIGN KEY (`WORKFLOW_ID`) REFERENCES `workflow` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+
+
+