From d064d9be33bc3a210397adc147967ce77eb63c4f Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Sat, 27 Apr 2019 07:43:35 -0400 Subject: Correct Catalog DB beans Correct Catalog DB beans Change-Id: Ie9bb4aef606da8c87e5960c95b564fb2fc299869 Issue-ID: SO-1828 Signed-off-by: Kuleshov, Elena --- .../org/onap/so/db/catalog/beans/ActivitySpec.java | 8 +-- .../beans/ActivitySpecActivitySpecCategories.java | 7 +- .../ActivitySpecActivitySpecCategoriesId.java | 82 --------------------- .../beans/ActivitySpecActivitySpecParameters.java | 12 +--- .../ActivitySpecActivitySpecParametersId.java | 83 --------------------- .../db/catalog/beans/ActivitySpecCategories.java | 16 +---- .../db/catalog/beans/ActivitySpecParameters.java | 27 +------ .../catalog/beans/ActivitySpecUserParameters.java | 10 +-- .../beans/ActivitySpecUserParametersId.java | 84 ---------------------- .../onap/so/db/catalog/beans/UserParameters.java | 26 +------ .../org/onap/so/db/catalog/beans/Workflow.java | 6 -- .../beans/WorkflowActivitySpecSequence.java | 11 +-- .../beans/WorkflowActivitySpecSequenceId.java | 84 ---------------------- .../data/repository/ActivitySpecRepository.java | 2 +- .../ActivitySpecUserParametersRepository.java | 30 ++++++++ .../WorkflowActivitySpecSequenceRepository.java | 30 ++++++++ .../data/repository/WorkflowRepository.java | 3 +- .../data/repository/WorkflowRepositoryTest.java | 2 - 18 files changed, 75 insertions(+), 448 deletions(-) delete mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java delete mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java delete mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java delete mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java create mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecUserParametersRepository.java create mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowActivitySpecSequenceRepository.java (limited to 'mso-catalog-db') 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 index 00eff8f0c9..20c10748b6 100644 --- 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 @@ -1,7 +1,6 @@ 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; @@ -10,9 +9,6 @@ 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; @@ -22,12 +18,10 @@ 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") +@Table(name = "activity_spec") public class ActivitySpec implements Serializable { private static final long serialVersionUID = 6902290480087262973L; 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 index 3518805b0d..64c77d27db 100644 --- 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 @@ -21,7 +21,6 @@ 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; @@ -29,13 +28,9 @@ 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; @@ -43,7 +38,6 @@ 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 { @@ -121,6 +115,7 @@ public class ActivitySpecActivitySpecCategories implements Serializable { this.activitySpec = activitySpec; } + @LinkedResource public ActivitySpecCategories getActivitySpecCategories() { return 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 deleted file mode 100644 index e3dcd359ec..0000000000 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java +++ /dev/null @@ -1,82 +0,0 @@ -/*- - * ============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 index f0c9bd99ce..f3e6a09b7f 100644 --- 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 @@ -21,7 +21,6 @@ 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; @@ -29,13 +28,9 @@ 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; @@ -43,7 +38,6 @@ 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 { @@ -55,12 +49,10 @@ public class ActivitySpecActivitySpecParameters implements Serializable { private Integer ID; @BusinessKey - @Id @Column(name = "ACTIVITY_SPEC_ID") private Integer activitySpecId; @BusinessKey - @Id @Column(name = "ACTIVITY_SPEC_PARAMETERS_ID") private Integer activitySpecParametersId; @@ -75,7 +67,7 @@ public class ActivitySpecActivitySpecParameters implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("activitySpecId", activitySpecId) - .append("activitySpecCategoriesId", activitySpecParametersId).toString(); + .append("activitySpecParametersId", activitySpecParametersId).toString(); } @Override @@ -113,6 +105,7 @@ public class ActivitySpecActivitySpecParameters implements Serializable { this.activitySpecParametersId = activitySpecParametersId; } + @LinkedResource public ActivitySpec getActivitySpec() { return activitySpec; } @@ -121,6 +114,7 @@ public class ActivitySpecActivitySpecParameters implements Serializable { this.activitySpec = activitySpec; } + @LinkedResource public ActivitySpecParameters getActivitySpecParameters() { return 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 deleted file mode 100644 index 8f4cc6d966..0000000000 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ============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 index a42a73aac9..e7ace2cda5 100644 --- 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 @@ -41,9 +41,6 @@ public class ActivitySpecCategories implements Serializable { @Column(name = "NAME") private String name; - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecCategories") - private List activitySpecActivitySpecCategories; - public Integer getID() { return ID; } @@ -56,20 +53,9 @@ public class ActivitySpecCategories implements Serializable { this.name = name; } - @LinkedResource - public List getActivitySpecActivitySpecCategories() { - return activitySpecActivitySpecCategories; - } - - public void setActivitySpecActivitySpecCategories( - List activitySpecActivitySpecCategories) { - this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; - } - @Override public String toString() { - return new ToStringBuilder(this).append("name", name) - .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); + return new ToStringBuilder(this).append("name", name).toString(); } @Override 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 index 49e0f3fa79..5173f27a15 100644 --- 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 @@ -1,20 +1,12 @@ 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; @@ -23,9 +15,6 @@ 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") @@ -56,28 +45,14 @@ public class ActivitySpecParameters implements Serializable { @Temporal(TemporalType.TIMESTAMP) private Date created; - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecParameters") - private List activitySpecActivitySpecParameters; - @PrePersist protected void onCreate() { this.created = new Date(); } - @LinkedResource - public List getActivitySpecActivitySpecParameters() { - return activitySpecActivitySpecParameters; - } - - public void setActivitySpecActivitySpecParameters( - List activitySpecActivitySpecParameters) { - this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters; - } - @Override public String toString() { - return new ToStringBuilder(this).append("name", name).append("direction", direction) - .append("activitySpecActivitySpecParameters", activitySpecActivitySpecParameters).toString(); + return new ToStringBuilder(this).append("name", name).append("direction", direction).toString(); } @Override 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 index be32da379e..d23c782a1a 100644 --- 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 @@ -21,7 +21,6 @@ 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; @@ -29,13 +28,9 @@ 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; @@ -43,7 +38,6 @@ 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 { @@ -55,12 +49,10 @@ public class ActivitySpecUserParameters implements Serializable { private Integer ID; @BusinessKey - @Id @Column(name = "ACTIVITY_SPEC_ID") private Integer activitySpecId; @BusinessKey - @Id @Column(name = "USER_PARAMETERS_ID") private Integer userParametersId; @@ -113,6 +105,7 @@ public class ActivitySpecUserParameters implements Serializable { this.userParametersId = userParametersId; } + @LinkedResource public ActivitySpec getActivitySpec() { return activitySpec; } @@ -121,6 +114,7 @@ public class ActivitySpecUserParameters implements Serializable { this.activitySpec = activitySpec; } + @LinkedResource public UserParameters getUserParameters() { return 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 deleted file mode 100644 index fd55d6e961..0000000000 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ============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 index a20647d5c1..c2cf2d7cf6 100644 --- 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 @@ -1,19 +1,12 @@ 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; @@ -22,9 +15,6 @@ 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") @@ -66,10 +56,6 @@ public class UserParameters implements Serializable { @Temporal(TemporalType.TIMESTAMP) private Date created; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "userParameters") - private List activitySpecUserParameters; - @PrePersist protected void onCreate() { this.created = new Date(); @@ -87,19 +73,9 @@ public class UserParameters implements Serializable { this.name = name; } - @LinkedResource - public List getActivitySpecUserParameters() { - return activitySpecUserParameters; - } - - public void setActivitySpecUserParameters(List activitySpecUserParameters) { - this.activitySpecUserParameters = activitySpecUserParameters; - } - @Override public String toString() { - return new ToStringBuilder(this).append("name", name) - .append("ActivitySpecUserParameters", activitySpecUserParameters).toString(); + return new ToStringBuilder(this).append("name", name).toString(); } public String getPayloadLocation() { 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 index 1f46bc01f7..d1e60a0f76 100644 --- 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 @@ -1,7 +1,6 @@ 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; @@ -10,9 +9,7 @@ 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; @@ -21,9 +18,6 @@ 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 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 index 4b497cc7da..f25be45bb2 100644 --- 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 @@ -21,7 +21,6 @@ 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; @@ -29,21 +28,17 @@ 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 { @@ -55,12 +50,10 @@ public class WorkflowActivitySpecSequence implements Serializable { private Integer ID; @BusinessKey - @Id @Column(name = "ACTIVITY_SPEC_ID") private Integer activitySpecId; @BusinessKey - @Id @Column(name = "WORKFLOW_ID") private Integer workflowId; @@ -113,6 +106,7 @@ public class WorkflowActivitySpecSequence implements Serializable { this.workflowId = workflowId; } + @LinkedResource public ActivitySpec getActivitySpec() { return activitySpec; } @@ -121,6 +115,7 @@ public class WorkflowActivitySpecSequence implements Serializable { this.activitySpec = activitySpec; } + @LinkedResource public Workflow getWorkflow() { return 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 deleted file mode 100644 index 41af2ed3a5..0000000000 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java +++ /dev/null @@ -1,84 +0,0 @@ -/*- - * ============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/data/repository/ActivitySpecRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepository.java index aa474238fd..f86ae14f93 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecRepository.java @@ -25,7 +25,7 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "activitySpec", path = "activitySpec") -public interface ActivitySpecRepository extends JpaRepository { +public interface ActivitySpecRepository extends JpaRepository { ActivitySpec findByName(String name); diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecUserParametersRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecUserParametersRepository.java new file mode 100644 index 0000000000..5e4340e392 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ActivitySpecUserParametersRepository.java @@ -0,0 +1,30 @@ +/*- + * ============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 org.onap.so.db.catalog.beans.ActivitySpecUserParameters; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "activitySpecUserParameters", path = "activitySpecUserParameters") +public interface ActivitySpecUserParametersRepository extends JpaRepository { + +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowActivitySpecSequenceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowActivitySpecSequenceRepository.java new file mode 100644 index 0000000000..0dfbbb9ead --- /dev/null +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowActivitySpecSequenceRepository.java @@ -0,0 +1,30 @@ +/*- + * ============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 org.onap.so.db.catalog.beans.WorkflowActivitySpecSequence; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "workflowActivitySpecSequence", path = "workflowActivitySpecSequence") +public interface WorkflowActivitySpecSequenceRepository extends JpaRepository { + +} 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 index fb5f202cbc..89df52182c 100644 --- 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 @@ -24,11 +24,10 @@ import java.util.List; import org.onap.so.db.catalog.beans.Workflow; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "workflow", path = "workflow") -public interface WorkflowRepository extends JpaRepository { +public interface WorkflowRepository extends JpaRepository { Workflow findByArtifactUUID(String artifactUUID); 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 index 4f31e4b38c..547b8e50a4 100644 --- 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 @@ -15,8 +15,6 @@ 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.Assert; import org.junit.Test; -- cgit 1.2.3-korg From eee110cb38b47745cadc65ca7cbb5c64a1965418 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Sun, 5 May 2019 07:51:49 -0400 Subject: Fix deployment of workflows on start Fix deployment of workflows on start Change-Id: Iaa5cb96020da20c96bedb81e0829f73c7461b67f Issue-ID: SO-1837 Signed-off-by: Kuleshov, Elena --- .../so/db/catalog/client/CatalogDbClientTest.java | 15 ++++++ .../MSOInfrastructureApplication.java | 58 ++++++++++++---------- .../onap/so/db/catalog/client/CatalogDbClient.java | 8 +++ .../data/repository/WorkflowRepository.java | 2 + .../data/repository/WorkflowRepositoryTest.java | 10 ++++ 5 files changed, 67 insertions(+), 26 deletions(-) (limited to 'mso-catalog-db') diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 51b44b0d3a..9265e5aa54 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -673,4 +673,19 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { Assert.assertNull(workflow); } + @Test + public void getWorkflowBySource_validSource_expectedOutput() { + List workflows = client.findWorkflowBySource("sdc"); + assertTrue(workflows != null); + assertTrue(workflows.size() != 0); + + assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + } + + @Test + public void getWorkflowBySource_invalidSource_nullOutput() { + List workflow = client.findWorkflowBySource("abc"); + Assert.assertNull(workflow); + } + } diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java index c61808ebb1..8168d2a4b8 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java @@ -24,14 +24,14 @@ package org.onap.so.bpmn.infrastructure; import java.util.List; import java.util.concurrent.Executor; -import org.camunda.bpm.application.PostDeploy; +import javax.annotation.PostConstruct; import org.camunda.bpm.application.PreUndeploy; import org.camunda.bpm.application.ProcessApplicationInfo; import org.camunda.bpm.engine.ProcessEngine; import org.camunda.bpm.engine.repository.DeploymentBuilder; import org.onap.so.bpmn.common.DefaultToShortClassNameBeanNameGenerator; import org.onap.so.db.catalog.beans.Workflow; -import org.onap.so.db.catalog.data.repository.WorkflowRepository; +import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.logging.jaxrs.filter.MDCTaskDecorator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -39,13 +39,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.FilterType; import org.springframework.context.annotation.Primary; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -56,17 +54,17 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @SpringBootApplication @EnableAsync -@EnableJpaRepositories("org.onap.so.db.catalog.data.repository") -@EntityScan({"org.onap.so.db.catalog.beans"}) @ComponentScan(basePackages = {"org.onap"}, nameGenerator = DefaultToShortClassNameBeanNameGenerator.class, excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)}) public class MSOInfrastructureApplication { private static final Logger logger = LoggerFactory.getLogger(MSOInfrastructureApplication.class); + @Autowired + private ProcessEngine processEngine; @Autowired - private WorkflowRepository workflowRepository; + private CatalogDbClient catalogDbClient; @Value("${mso.async.core-pool-size}") private int corePoolSize; @@ -79,6 +77,7 @@ public class MSOInfrastructureApplication { private static final String LOGS_DIR = "logs_dir"; private static final String BPMN_SUFFIX = ".bpmn"; + private static final String SDC_SOURCE = "sdc"; private static void setLogsDir() { @@ -93,10 +92,14 @@ public class MSOInfrastructureApplication { setLogsDir(); } - @PostDeploy - public void postDeploy(ProcessEngine processEngineInstance) { - DeploymentBuilder deploymentBuilder = processEngineInstance.getRepositoryService().createDeployment(); - deployCustomWorkflows(deploymentBuilder); + @PostConstruct + public void postConstruct() { + try { + DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment(); + deployCustomWorkflows(deploymentBuilder); + } catch (Exception e) { + logger.warn("Unable to invoke deploymentBuilder: " + e.getMessage()); + } } @PreUndeploy @@ -117,23 +120,26 @@ public class MSOInfrastructureApplication { } public void deployCustomWorkflows(DeploymentBuilder deploymentBuilder) { - if (workflowRepository == null) { - return; - } - List workflows = workflowRepository.findAll(); - if (workflows != null && workflows.size() != 0) { - for (Workflow workflow : workflows) { - String workflowName = workflow.getName(); - String workflowBody = workflow.getBody(); - if (!workflowName.endsWith(BPMN_SUFFIX)) { - workflowName += BPMN_SUFFIX; - } - if (workflowBody != null) { - logger.info("{} {}", "Deploying custom workflow", workflowName); - deploymentBuilder.addString(workflowName, workflowBody); + logger.debug("Attempting to deploy custom workflows"); + try { + List workflows = catalogDbClient.findWorkflowBySource(SDC_SOURCE); + if (workflows != null && workflows.size() != 0) { + for (Workflow workflow : workflows) { + String workflowName = workflow.getName(); + String workflowBody = workflow.getBody(); + if (!workflowName.endsWith(BPMN_SUFFIX)) { + workflowName += BPMN_SUFFIX; + } + if (workflowBody != null) { + logger.info("{} {}", "Deploying custom workflow", workflowName); + deploymentBuilder.addString(workflowName, workflowBody); + } } + deploymentBuilder.enableDuplicateFiltering(true); + deploymentBuilder.deploy(); } - deploymentBuilder.deploy(); + } catch (Exception e) { + logger.warn("Unable to deploy custom workflows, " + e.getMessage()); } } } 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 19200468ae..ab5fdb939c 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 @@ -145,6 +145,7 @@ public class CatalogDbClient { 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 SOURCE = "source"; private static final String TARGET_ENTITY = "SO:CatalogDB"; private static final String ASTERISK = "*"; @@ -191,6 +192,7 @@ public class CatalogDbClient { private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; private String findWorkflowByArtifactUUID = "/findByArtifactUUID"; private String findWorkflowByModelUUID = "/findWorkflowByModelUUID"; + private String findWorkflowBySource = "/findBySource"; private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid"; private String serviceURI; @@ -333,6 +335,7 @@ public class CatalogDbClient { findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID; findWorkflowByModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByModelUUID; + findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource; findVnfResourceCustomizationByModelUuid = endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findVnfResourceCustomizationByModelUuid; @@ -889,4 +892,9 @@ public class CatalogDbClient { return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByModelUUID) .queryParam(VNF_RESOURCE_MODEL_UUID, vnfResourceModelUUID).build().toString())); } + + public List findWorkflowBySource(String source) { + return this.getMultipleResources(workflowClient, + getUri(UriBuilder.fromUri(findWorkflowBySource).queryParam(SOURCE, source).build().toString())); + } } 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 index 89df52182c..8bcc60c8be 100644 --- 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 @@ -31,6 +31,8 @@ public interface WorkflowRepository extends JpaRepository { Workflow findByArtifactUUID(String artifactUUID); + List findBySource(String source); + /** * Used to fetch the @{link Workflow} by the Model UUID. * 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 index 547b8e50a4..171d4b29f5 100644 --- 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 @@ -44,4 +44,14 @@ public class WorkflowRepositoryTest extends BaseTest { Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); } + @Test + public void findBySourceTest() throws Exception { + List workflows = workflowRepository.findBySource("sdc"); + + Assert.assertTrue(workflows != null); + Assert.assertTrue(workflows.size() != 0); + + Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); + } + } -- cgit 1.2.3-korg From a385c0cc6a0ed25cc63fab1368fc686d79f06bca Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 9 May 2019 12:27:30 -0400 Subject: Use workflow's name for invocation Use workflow's name for invocation Change-Id: Ie527788f029bdccc91f7f406df0a478e55375c01 Issue-ID: SO-1876 Signed-off-by: Kuleshov, Elena --- .../java/org/onap/so/db/catalog/client/CatalogDbClientTest.java | 6 +++--- .../src/test/resources/db/migration/afterMigrate.sql | 2 +- asdc-controller/src/test/resources/data.sql | 2 +- .../main/java/org/onap/so/apihandlerinfra/InstanceManagement.java | 2 +- .../src/test/resources/__files/catalogdb/workflow_Response.json | 3 ++- .../onap/so/db/catalog/data/repository/WorkflowRepositoryTest.java | 6 +++--- mso-catalog-db/src/test/resources/data.sql | 2 +- 7 files changed, 12 insertions(+), 11 deletions(-) (limited to 'mso-catalog-db') diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java index 9265e5aa54..d8d9ee191a 100644 --- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java @@ -649,7 +649,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { @Test public void getWorkflowByArtifactUUID_validUuid_expectedOutput() { Workflow workflow = client.findWorkflowByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1"); - assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName()); + assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName()); } @Test @@ -664,7 +664,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertTrue(workflows != null); assertTrue(workflows.size() != 0); - assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName()); } @Test @@ -679,7 +679,7 @@ public class CatalogDbClientTest extends CatalogDbAdapterBaseTest { assertTrue(workflows != null); assertTrue(workflows.size() != 0); - assertEquals("testingWorkflow", workflows.get(0).getArtifactName()); + assertEquals("testingWorkflow.bpmn", workflows.get(0).getArtifactName()); } @Test diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 0229dd0d85..1ba1597c73 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -225,7 +225,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m ('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'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); diff --git a/asdc-controller/src/test/resources/data.sql b/asdc-controller/src/test/resources/data.sql index 47e6c4c982..c9179fe65f 100644 --- a/asdc-controller/src/test/resources/data.sql +++ b/asdc-controller/src/test/resources/data.sql @@ -26,7 +26,7 @@ insert into vnf_resource(orchestration_mode, description, creation_timestamp, mo ('HEAT', '1607 vSAMP10a - inherent network', '2017-04-14 21:46:28', 'ff2ae348-214a-11e7-93ae-92361f002671', '', '', '2fff5b20-214b-11e7-93ae-92361f002671', '1.0', 'vSAMP10a', 'VF', null); 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'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java index c491444f39..dd6050bf60 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/InstanceManagement.java @@ -255,7 +255,7 @@ public class InstanceManagement { if (workflow == null) { return null; } else { - String workflowName = workflow.getArtifactName(); + String workflowName = workflow.getName(); recipeUri = "/mso/async/services/" + workflowName; } return new RecipeLookupResult(recipeUri, 180); diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json index 6e358f7e17..d6ed585537 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/workflow_Response.json @@ -1,4 +1,5 @@ { "artifactUUID": "71526781-e55c-4cb7-adb3-97e09d9c76be", - "artifactName": "testingWorkflow" + "artifactName": "testingWorkflow.bpmn", + "name": "testingWorkflow" } \ 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 index 171d4b29f5..7d1b8d0d96 100644 --- 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 @@ -31,7 +31,7 @@ public class WorkflowRepositoryTest extends BaseTest { public void findByArtifactUuid_ValidUuid_ExpectedOutput() throws Exception { Workflow workflow = workflowRepository.findByArtifactUUID("5b0c4322-643d-4c9f-b184-4516049e99b1"); - assertEquals("artifactName", "testingWorkflow", workflow.getArtifactName()); + assertEquals("artifactName", "testingWorkflow.bpmn", workflow.getArtifactName()); } @Test @@ -41,7 +41,7 @@ public class WorkflowRepositoryTest extends BaseTest { Assert.assertTrue(workflows != null); Assert.assertTrue(workflows.size() != 0); - Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); + Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName())); } @Test @@ -51,7 +51,7 @@ public class WorkflowRepositoryTest extends BaseTest { Assert.assertTrue(workflows != null); Assert.assertTrue(workflows.size() != 0); - Assert.assertTrue("testingWorkflow".equals(workflows.get(0).getArtifactName())); + Assert.assertTrue("testingWorkflow.bpmn".equals(workflows.get(0).getArtifactName())); } } diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql index f6d04263c0..31f59203ca 100644 --- a/mso-catalog-db/src/test/resources/data.sql +++ b/mso-catalog-db/src/test/resources/data.sql @@ -742,7 +742,7 @@ insert into pnf_resource_customization_to_service(service_model_uuid, resource_m ('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'); +('5b0c4322-643d-4c9f-b184-4516049e99b1', 'testingWorkflow.bpmn', 'testingWorkflow', 'create', 1, 'Test Workflow', null, 'vnf', 'sdc'); insert into vnf_resource_to_workflow(vnf_resource_model_uuid, workflow_id) values ('ff2ae348-214a-11e7-93ae-92361f002671', '1'); -- cgit 1.2.3-korg From 6a02c565b2cd3f4083617166fa36dea842838601 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 9 May 2019 20:29:01 -0400 Subject: Add missing UserParametersRepository Add missing UserParametersRepository Change-Id: Iba30896cab00687fcfb6cd5ba703d3579efcac30 Issue-ID: SO-1888 Signed-off-by: Kuleshov, Elena --- .../data/repository/UserParametersRepository.java | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/UserParametersRepository.java (limited to 'mso-catalog-db') diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/UserParametersRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/UserParametersRepository.java new file mode 100644 index 0000000000..984f8fac99 --- /dev/null +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/UserParametersRepository.java @@ -0,0 +1,30 @@ +/*- + * ============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 org.onap.so.db.catalog.beans.UserParameters; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource(collectionResourceRel = "userParameters", path = "userParameters") +public interface UserParametersRepository extends JpaRepository { + +} -- cgit 1.2.3-korg From 8e40406c6dd82de42d592ca8abb6203697b0aa8b Mon Sep 17 00:00:00 2001 From: "Bonkur, Venkat (vb8416)" Date: Mon, 20 May 2019 17:40:21 -0400 Subject: Add SO WFD activity BBs to building_block_detail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added dublin-WFD activity BBs to building_block_detaili tbl Also updated the resource_type to NO_VALIDATE where target_action is CUSTOM During the execute of the Activity building blocks for the Workflow Designer running into orchestrationStatusValidation exception as it could not find the activity's name in building_block_detail table. Updated the test/resources/data.sql to reflect the above changes Issue-ID: SO-1901 Signed-off-by: Bonkur, Venkat (vb8416) Change-Id: I9a5c60fc818ec4abc18005e3ef9b8c7b3313f55d --- .../main/resources/db/migration/R__MacroData.sql | 66 +++++++++++++++------ mso-catalog-db/src/test/resources/data.sql | 67 +++++++++++++++------- 2 files changed, 93 insertions(+), 40 deletions(-) (limited to 'mso-catalog-db') diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index 824d1df3d6..0054bcff53 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -597,27 +597,27 @@ WHERE TARGET_ACTION = 'CHANGEMODEL'; INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) VALUES ('UnassignVfModuleBB', 'VF_MODULE', 'UNASSIGN'), -('SniroHoming', 'CUSTOM', 'CUSTOM'), -('DeactivateAndUnassignVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), -('DeactivateNetworkCollectionBB', 'CUSTOM', 'CUSTOM'), -('AAICheckVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('AAISetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('AAIUnsetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('SDNOVnfHealthCheckBB', 'CUSTOM', 'CUSTOM'), -('VNF-Macro-Replace', 'CUSTOM', 'CUSTOM'), -('HomingBB', 'CUSTOM', 'CUSTOM'); +('SniroHoming', 'NO_VALIDATE', 'CUSTOM'), +('DeactivateAndUnassignVpnBondingLinksBB', 'NO_VALIDATE', 'CUSTOM'), +('DeactivateNetworkCollectionBB', 'NO_VALIDATE', 'CUSTOM'), +('AAICheckVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('AAISetVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('AAIUnsetVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('SDNOVnfHealthCheckBB', 'NO_VALIDATE', 'CUSTOM'), +('VNF-Macro-Replace', 'NO_VALIDATE', 'CUSTOM'), +('HomingBB', 'NO_VALIDATE', 'CUSTOM'); INSERT INTO orchestration_status_state_transition_directive(RESOURCE_TYPE, ORCHESTRATION_STATUS, TARGET_ACTION, FLOW_DIRECTIVE) VALUES -('CUSTOM', 'ACTIVE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'CREATED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE'); +('NO_VALIDATE', 'ACTIVE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'CREATED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PRECREATED', 'CUSTOM', 'CONTINUE'); INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, IS_TOPLEVELFLOW, CLOUD_OWNER) VALUES ('VFModule-DeactivateAndCloudDelete', 'deactivateAndCloudDelete', 'VfModule', true, '7','7', true, 'CloudOwner'); @@ -776,4 +776,32 @@ UPDATE rainy_day_handler_macro SET Secondary_Policy = 'Rollback' WHERE FLOW_NAME INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY) VALUES ('GenericVnfHealthCheckBB', '*', '*', '*', "*" , 'Retry'), -('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry'); \ No newline at end of file +('ConfigurationScaleOutBB', '*', '*', '*', "*" , 'Retry'); + +INSERT INTO building_block_detail(BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) +VALUES +('VNFSetInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckPserversLockedFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFSetClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnsetClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFLockActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnlockActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFStopActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFStartActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFSnapShotActivity', 'NO_VALIDATE', 'CUSTOM'), +('FlowCompleteActivity', 'NO_VALIDATE', 'CUSTOM'), +('PauseForManualTaskActivity', 'NO_VALIDATE', 'CUSTOM'), +('DistributeTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('DistributeTrafficCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFHealthCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFQuiesceTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFResumeTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnsetInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradeBackupActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradePostCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradePreCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradeSoftwareActivity', 'NO_VALIDATE', 'CUSTOM'), +('VnfInPlaceSoftwareUpdate', 'NO_VALIDATE', 'CUSTOM'); + diff --git a/mso-catalog-db/src/test/resources/data.sql b/mso-catalog-db/src/test/resources/data.sql index 31f59203ca..13ab018a27 100644 --- a/mso-catalog-db/src/test/resources/data.sql +++ b/mso-catalog-db/src/test/resources/data.sql @@ -266,18 +266,43 @@ VALUES ('DeleteVfModuleBB', 'VF_MODULE', 'DELETE'), ('DeleteNetworkBB', 'NETWORK', 'DELETE'), ('DeleteNetworkCollectionBB', 'NETWORK', 'DELETE'), -('AssignAndActivateVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), -('AvpnAssignServiceInstanceBB', 'CUSTOM', 'CUSTOM'), -('CreateCustomerVpnBindingBB', 'CUSTOM', 'CUSTOM'), -('SniroHoming', 'CUSTOM', 'CUSTOM'), -('DeactivateAndUnassignVpnBondingLinksBB', 'CUSTOM', 'CUSTOM'), -('DeactivateNetworkCollectionBB', 'CUSTOM', 'CUSTOM'), -('AAICheckVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('AAISetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('AAIUnsetVnfInMaintBB', 'CUSTOM', 'CUSTOM'), -('SDNOVnfHealthCheckBB', 'CUSTOM', 'CUSTOM'), -('VNF-Macro-Replace', 'CUSTOM', 'CUSTOM'), -('HomingBB', 'CUSTOM', 'CUSTOM'); +('AssignAndActivateVpnBondingLinksBB', 'NO_VALIDATE', 'CUSTOM'), +('AvpnAssignServiceInstanceBB', 'NO_VALIDATE', 'CUSTOM'), +('CreateCustomerVpnBindingBB', 'NO_VALIDATE', 'CUSTOM'), +('SniroHoming', 'NO_VALIDATE', 'CUSTOM'), +('DeactivateAndUnassignVpnBondingLinksBB', 'NO_VALIDATE', 'CUSTOM'), +('DeactivateNetworkCollectionBB', 'NO_VALIDATE', 'CUSTOM'), +('AAICheckVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('AAISetVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('AAIUnsetVnfInMaintBB', 'NO_VALIDATE', 'CUSTOM'), +('SDNOVnfHealthCheckBB', 'NO_VALIDATE', 'CUSTOM'), +('VNF-Macro-Replace', 'NO_VALIDATE', 'CUSTOM'), +('HomingBB', 'NO_VALIDATE', 'CUSTOM'), +('VNFSetInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckPserversLockedFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFCheckClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFSetClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnsetClosedLoopDisabledFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFLockActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnlockActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFStopActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFStartActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFSnapShotActivity', 'NO_VALIDATE', 'CUSTOM'), +('FlowCompleteActivity', 'NO_VALIDATE', 'CUSTOM'), +('PauseForManualTaskActivity', 'NO_VALIDATE', 'CUSTOM'), +('DistributeTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('DistributeTrafficCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFHealthCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFQuiesceTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFResumeTrafficActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUnsetInMaintFlagActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradeBackupActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradePostCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradePreCheckActivity', 'NO_VALIDATE', 'CUSTOM'), +('VNFUpgradeSoftwareActivity', 'NO_VALIDATE', 'CUSTOM'), +('VnfInPlaceSoftwareUpdate', 'NO_VALIDATE', 'CUSTOM'); + INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES ('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create')), @@ -644,15 +669,15 @@ VALUES ('VOLUME_GROUP', 'PENDING', 'DELETE', 'SILENT_SUCCESS'), ('VF_MODULE', 'PENDING', 'DELETE', 'FAIL'), ('NETWORK', 'PENDING', 'DELETE', 'FAIL'), -('CUSTOM', 'ACTIVE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'CREATED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), -('CUSTOM', 'PRECREATED', 'CUSTOM', 'CONTINUE'); +('NO_VALIDATE', 'ACTIVE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'ASSIGNED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'CREATED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'INVENTORIED', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_ACTIVATION', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_CREATE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PENDING_DELETE', 'CUSTOM', 'CONTINUE'), +('NO_VALIDATE', 'PRECREATED', 'CUSTOM', 'CONTINUE'); INSERT INTO `cloudify_managers` (`ID`, `CLOUDIFY_URL`, `USERNAME`, `PASSWORD`, `VERSION`, `LAST_UPDATED_BY`, `CREATION_TIMESTAMP`, `UPDATE_TIMESTAMP`) VALUES ('mtn13', 'http://localhost:28090/v2.0', 'm93945', '93937EA01B94A10A49279D4572B48369', NULL, 'MSO_USER', '2018-07-17 14:05:08', '2018-07-17 14:05:08'); -- cgit 1.2.3-korg From 3aa69ccef204f8df3ea310d5014384390a59890b Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Sat, 25 May 2019 08:30:00 -0400 Subject: Use lowercase for table names in beans Uppercase table names cause issues on db queries Issue-ID: SO-1969 Signed-off-by: Kuleshov, Elena Change-Id: I468cfc6635c68771caf04a1f75d336559877d288 --- .../main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java | 2 +- .../main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java | 2 +- .../src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'mso-catalog-db') 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 index e7ace2cda5..b5da55c7d6 100644 --- 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 @@ -27,7 +27,7 @@ import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity -@Table(name = "ACTIVITY_SPEC_CATEGORIES") +@Table(name = "activity_spec_categories") public class ActivitySpecCategories implements Serializable { private static final long serialVersionUID = -6251150462067699643L; 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 index 5173f27a15..ed056400b2 100644 --- 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 @@ -17,7 +17,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import com.openpojo.business.annotation.BusinessKey; @Entity -@Table(name = "ACTIVITY_SPEC_PARAMETERS") +@Table(name = "activity_spec_parameters") public class ActivitySpecParameters implements Serializable { private static final long serialVersionUID = 3627711377147710046L; 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 index f49ae26305..92cc5d18f0 100644 --- 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 @@ -44,7 +44,7 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @IdClass(VnfResourceWorkflowId.class) -@Table(name = "VNF_RESOURCE_TO_WORKFLOW") +@Table(name = "vnf_resource_to_workflow") public class VnfResourceWorkflow implements Serializable { private static final long serialVersionUID = -1326433350241927676L; -- cgit 1.2.3-korg