diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-04-08 14:14:34 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-04-08 14:24:59 -0400 |
commit | f47919f1fe367b612fa9c96d34c59f01a541e882 (patch) | |
tree | 5b6aa2fc36747d868897e68ccbec0c6db0aee81c /mso-catalog-db/src/main/java/org | |
parent | 54452b80a1cf4d22ef750bc1377f8c1b05431d57 (diff) |
Replaced all tabs with spaces in java and pom.xml
Added in maven plugins to enforce coding style rules
Added in eclipse java formatting xml
Change-Id: I3727bbf4ce8dc66abfd8ad21b6cfd0890c5d3ff0
Issue-ID: SO-1765
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org')
131 files changed, 8271 insertions, 8366 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 index 9fcb1824db..00eff8f0c9 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 @@ -4,7 +4,6 @@ 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; @@ -19,13 +18,10 @@ 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; @@ -34,142 +30,141 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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(); - } + 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 index e18188dff8..3518805b0d 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 @@ -22,7 +22,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; @@ -37,13 +36,10 @@ 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 @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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; - } + 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 index e31c5fcece..e3dcd359ec 100644 --- 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 @@ -21,60 +21,62 @@ 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(); - } + 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 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(); - } + @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 181380244d..f0c9bd99ce 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 @@ -22,7 +22,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; @@ -37,13 +36,10 @@ 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 @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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; - } + 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 index 36c3a07c3f..8f4cc6d966 100644 --- 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 @@ -21,61 +21,63 @@ 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(); - } + 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 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(); - } + @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 737b174a9b..a42a73aac9 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 @@ -4,7 +4,6 @@ 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; @@ -19,13 +18,10 @@ 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; @@ -34,58 +30,59 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "ACTIVITY_SPEC_CATEGORIES") public class ActivitySpecCategories implements Serializable { - private static final long serialVersionUID = -6251150462067699643L; + 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; + } - @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; - } + @LinkedResource + public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { + return activitySpecActivitySpecCategories; + } - public void setName(String name) { - this.name = name; - } + public void setActivitySpecActivitySpecCategories( + List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) { + this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; + } - @LinkedResource - public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { - return activitySpecActivitySpecCategories; - } + @Override + public String toString() { + return new ToStringBuilder(this).append("name", name) + .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); + } - 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 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(); - } + @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 index 9e3e301456..49e0f3fa79 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 @@ -4,7 +4,6 @@ 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; @@ -20,13 +19,10 @@ 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; @@ -34,110 +30,111 @@ 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; - } + + 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 index 8cf3351274..be32da379e 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 @@ -22,7 +22,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; @@ -37,13 +36,10 @@ 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 @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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; - } + 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 index 3e739ac013..fd55d6e961 100644 --- 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 @@ -21,62 +21,64 @@ 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; - } + 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 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 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(); - } + @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/AllottedResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java index 1d3ee7c36e..c3a662d883 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,148 +33,145 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; 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 @Table(name = "allotted_resource") public class AllottedResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "SUBCATEGORY") - private String subcategory; - - @Column(name = "DESCRIPTION") - private String description; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "allottedResource") - private Set<AllottedResourceCustomization> allotedResourceCustomization; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelVersion", modelVersion).append("modelName", modelName) - .append("toscaNodeType", toscaNodeType).append("subcategory", subcategory) - .append("description", description).append("created", created) - .append("allotedResourceCustomization", allotedResourceCustomization).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof AllottedResource)) { - return false; - } - AllottedResource castOther = (AllottedResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @LinkedResource - public Set<AllottedResourceCustomization> getAllotedResourceCustomization() { - if (allotedResourceCustomization == null) - allotedResourceCustomization = new HashSet<>(); - return allotedResourceCustomization; - } - - public void setAllotedResourceCustomization(Set<AllottedResourceCustomization> allotedResourceCustomization) { - this.allotedResourceCustomization = allotedResourceCustomization; - } - - public String getModelUUID() { - return this.modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return this.modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return this.modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return this.modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return this.toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getSubcategory() { - return this.subcategory; - } - - public void setSubcategory(String subcategory) { - this.subcategory = subcategory; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } + private static final long serialVersionUID = 768026109321305392L; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "SUBCATEGORY") + private String subcategory; + + @Column(name = "DESCRIPTION") + private String description; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "allottedResource") + private Set<AllottedResourceCustomization> allotedResourceCustomization; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelVersion", modelVersion).append("modelName", modelName) + .append("toscaNodeType", toscaNodeType).append("subcategory", subcategory) + .append("description", description).append("created", created) + .append("allotedResourceCustomization", allotedResourceCustomization).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof AllottedResource)) { + return false; + } + AllottedResource castOther = (AllottedResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @LinkedResource + public Set<AllottedResourceCustomization> getAllotedResourceCustomization() { + if (allotedResourceCustomization == null) + allotedResourceCustomization = new HashSet<>(); + return allotedResourceCustomization; + } + + public void setAllotedResourceCustomization(Set<AllottedResourceCustomization> allotedResourceCustomization) { + this.allotedResourceCustomization = allotedResourceCustomization; + } + + public String getModelUUID() { + return this.modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return this.modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return this.modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return this.modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return this.toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getSubcategory() { + return this.subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java index 04b93c3886..b3734caccc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java @@ -22,7 +22,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; @@ -34,222 +33,219 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; 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 @Table(name = "allotted_resource_customization") public class AllottedResourceCustomization implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID") - private String providingServiceModelInvariantUUID; + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID") + private String providingServiceModelInvariantUUID; - @Column(name = "PROVIDING_SERVICE_MODEL_UUID") - private String providingServiceModelUUID; + @Column(name = "PROVIDING_SERVICE_MODEL_UUID") + private String providingServiceModelUUID; - @Column(name = "PROVIDING_SERVICE_MODEL_NAME") - private String providingServiceModelName; + @Column(name = "PROVIDING_SERVICE_MODEL_NAME") + private String providingServiceModelName; - @Column(name = "TARGET_NETWORK_ROLE") - private String targetNetworkRole; - - @Column(name = "NF_FUNCTION") - private String nfFunction; + @Column(name = "TARGET_NETWORK_ROLE") + private String targetNetworkRole; + + @Column(name = "NF_FUNCTION") + private String nfFunction; - @Column(name = "NF_TYPE") - private String nfType; + @Column(name = "NF_TYPE") + private String nfType; - @Column(name = "NF_ROLE") - private String nfRole; - - @Column(name = "NF_NAMING_CODE") - private String nfNamingCode; - - @Column(name = "MIN_INSTANCES") - private Integer minInstances; + @Column(name = "NF_ROLE") + private String nfRole; + + @Column(name = "NF_NAMING_CODE") + private String nfNamingCode; + + @Column(name = "MIN_INSTANCES") + private Integer minInstances; - @Column(name = "MAX_INSTANCES") - private Integer maxInstances; + @Column(name = "MAX_INSTANCES") + private Integer maxInstances; - @Column(name = "RESOURCE_INPUT") - private String resourceInput; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "AR_MODEL_UUID") - private AllottedResource allottedResource; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("created", created).append("modelInstanceName", modelInstanceName) - .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID) - .append("providingServiceModelUUID", providingServiceModelUUID) - .append("providingServiceModelName", providingServiceModelName) - .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) - .append("minInstances", minInstances).append("maxInstances", maxInstances) - .append("allottedResource", allottedResource).toString(); - } + @Column(name = "RESOURCE_INPUT") + private String resourceInput; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "AR_MODEL_UUID") + private AllottedResource allottedResource; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("created", created).append("modelInstanceName", modelInstanceName) + .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID) + .append("providingServiceModelUUID", providingServiceModelUUID) + .append("providingServiceModelName", providingServiceModelName) + .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction) + .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) + .append("minInstances", minInstances).append("maxInstances", maxInstances) + .append("allottedResource", allottedResource).toString(); + } - @PrePersist - protected void onCreate() { - this.created = new Date(); - } + @PrePersist + protected void onCreate() { + this.created = new Date(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof AllottedResourceCustomization)) { - return false; - } - AllottedResourceCustomization castOther = (AllottedResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public String getProvidingServiceModelUUID() { - return providingServiceModelUUID; - } - - public void setProvidingServiceModelUUID(String providingServiceModelUUID) { - this.providingServiceModelUUID = providingServiceModelUUID; - } - - public String getProvidingServiceModelName() { - return providingServiceModelName; - } - - public void setProvidingServiceModelName(String providingServiceModelName) { - this.providingServiceModelName = providingServiceModelName; - } - - public AllottedResourceCustomization() { - super(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public Date getCreated() { - return this.created; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public AllottedResource getAllottedResource() { - return this.allottedResource; - } - - public void setAllottedResource(AllottedResource allottedResource) { - this.allottedResource = allottedResource; - } - - public String getProvidingServiceModelInvariantUUID() { - return this.providingServiceModelInvariantUUID; - } - - public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) { - this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID; - } - - public String getTargetNetworkRole() { - return this.targetNetworkRole; - } - - public void setTargetNetworkRole(String targetNetworkRole) { - this.targetNetworkRole = targetNetworkRole; - } - - public String getNfFunction() { - return this.nfFunction; - } - - public void setNfFunction(String nfFunction) { - this.nfFunction = nfFunction; - } - - public String getNfType() { - return this.nfType; - } - - public void setNfType(String nfType) { - this.nfType = nfType; - } - - public String getNfRole() { - return this.nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public String getNfNamingCode() { - return this.nfNamingCode; - } - - public void setNfNamingCode(String nfNamingCode) { - this.nfNamingCode = nfNamingCode; - } - - public Integer getMinInstances() { - return this.minInstances; - } - - public void setMinInstances(Integer minInstances) { - this.minInstances = minInstances; - } - - public Integer getMaxInstances() { - return this.maxInstances; - } - - public void setMaxInstances(Integer maxInstances) { - this.maxInstances = maxInstances; - } - - public String getResourceInput() { - return resourceInput; - } - - public void setResourceInput(String resourceInput) { - this.resourceInput = resourceInput; - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof AllottedResourceCustomization)) { + return false; + } + AllottedResourceCustomization castOther = (AllottedResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public String getProvidingServiceModelUUID() { + return providingServiceModelUUID; + } + + public void setProvidingServiceModelUUID(String providingServiceModelUUID) { + this.providingServiceModelUUID = providingServiceModelUUID; + } + + public String getProvidingServiceModelName() { + return providingServiceModelName; + } + + public void setProvidingServiceModelName(String providingServiceModelName) { + this.providingServiceModelName = providingServiceModelName; + } + + public AllottedResourceCustomization() { + super(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public Date getCreated() { + return this.created; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public AllottedResource getAllottedResource() { + return this.allottedResource; + } + + public void setAllottedResource(AllottedResource allottedResource) { + this.allottedResource = allottedResource; + } + + public String getProvidingServiceModelInvariantUUID() { + return this.providingServiceModelInvariantUUID; + } + + public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) { + this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID; + } + + public String getTargetNetworkRole() { + return this.targetNetworkRole; + } + + public void setTargetNetworkRole(String targetNetworkRole) { + this.targetNetworkRole = targetNetworkRole; + } + + public String getNfFunction() { + return this.nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfType() { + return this.nfType; + } + + public void setNfType(String nfType) { + this.nfType = nfType; + } + + public String getNfRole() { + return this.nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public String getNfNamingCode() { + return this.nfNamingCode; + } + + public void setNfNamingCode(String nfNamingCode) { + this.nfNamingCode = nfNamingCode; + } + + public Integer getMinInstances() { + return this.minInstances; + } + + public void setMinInstances(Integer minInstances) { + this.minInstances = minInstances; + } + + public Integer getMaxInstances() { + return this.maxInstances; + } + + public void setMaxInstances(Integer maxInstances) { + this.maxInstances = maxInstances; + } + + public String getResourceInput() { + return resourceInput; + } + + public void setResourceInput(String resourceInput) { + this.resourceInput = resourceInput; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java index 86ff743475..176c02c8cd 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java @@ -22,163 +22,160 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; 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; @Entity @Table(name = "ar_recipe") public class ArRecipe implements Recipe, Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false) - private Integer id; - @BusinessKey - @Column(name = "MODEL_NAME", nullable = false) - private String modelName; - @BusinessKey - @Column(name = "ACTION", nullable = false) - private String action; - - @Column(name = "VERSION_STR", nullable = false) - private String version; - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @Column(name = "DESCRIPTION") - private String description; - @BusinessKey - @Column(name = "ORCHESTRATION_URI", nullable = false) - private String orchestrationUri; - - @Column(name = "AR_PARAM_XSD") - private String paramXsd; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelName", getModelName()).append("action", getAction()) - .append("version", getVersion()).append("serviceType", getServiceType()) - .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) - .append("paramXSD", getParamXsd()).append("recipeTimeout", getRecipeTimeout()) - .append("created", getCreated()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (this == other) { - return true; - } - if (!(other instanceof ArRecipe)) { - return false; - } - ArRecipe castOther = (ArRecipe) other; - return new EqualsBuilder().append(getId(), castOther.getId()).append(getModelName(), castOther.getModelName()) - .append(getAction(), castOther.getAction()).append(getServiceType(), castOther.getServiceType()) - .append(getOrchestrationUri(), castOther.getOrchestrationUri()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getId()).append(getModelName()).append(getAction()).append(getServiceType()) - .append(getOrchestrationUri()).toHashCode(); - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false) + private Integer id; + @BusinessKey + @Column(name = "MODEL_NAME", nullable = false) + private String modelName; + @BusinessKey + @Column(name = "ACTION", nullable = false) + private String action; + + @Column(name = "VERSION_STR", nullable = false) + private String version; + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @Column(name = "DESCRIPTION") + private String description; + @BusinessKey + @Column(name = "ORCHESTRATION_URI", nullable = false) + private String orchestrationUri; + + @Column(name = "AR_PARAM_XSD") + private String paramXsd; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelName", getModelName()).append("action", getAction()) + .append("version", getVersion()).append("serviceType", getServiceType()) + .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) + .append("paramXSD", getParamXsd()).append("recipeTimeout", getRecipeTimeout()) + .append("created", getCreated()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (this == other) { + return true; + } + if (!(other instanceof ArRecipe)) { + return false; + } + ArRecipe castOther = (ArRecipe) other; + return new EqualsBuilder().append(getId(), castOther.getId()).append(getModelName(), castOther.getModelName()) + .append(getAction(), castOther.getAction()).append(getServiceType(), castOther.getServiceType()) + .append(getOrchestrationUri(), castOther.getOrchestrationUri()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getId()).append(getModelName()).append(getAction()).append(getServiceType()) + .append(getOrchestrationUri()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java index b1cb07447d..c0f60325ea 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum AuthenticationType { - USERNAME_PASSWORD, RACKSPACE_APIKEY; + USERNAME_PASSWORD, RACKSPACE_APIKEY; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java index cc2abacce2..54e2144c81 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,85 +33,83 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; - import com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "building_block_detail") public class BuildingBlockDetail implements Serializable { - private static final long serialVersionUID = -2375223199178059155L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "BUILDING_BLOCK_NAME") - private String buildingBlockName; - - @Enumerated(EnumType.STRING) - @Column(name = "RESOURCE_TYPE") - private ResourceType resourceType; - - @Enumerated(EnumType.STRING) - @Column(name = "TARGET_ACTION") - private OrchestrationAction targetAction; - - @Override - public String toString() { - return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName) - .append("resourceType", resourceType).append("targetAction", targetAction).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof BuildingBlockDetail)) { - return false; - } - BuildingBlockDetail castOther = (BuildingBlockDetail) other; - return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(buildingBlockName).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getBuildingBlockName() { - return buildingBlockName; - } - - public void setBuildingBlockName(String buildingBlockName) { - this.buildingBlockName = buildingBlockName; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - - public OrchestrationAction getTargetAction() { - return targetAction; - } - - public void setTargetAction(OrchestrationAction targetAction) { - this.targetAction = targetAction; - } + private static final long serialVersionUID = -2375223199178059155L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "BUILDING_BLOCK_NAME") + private String buildingBlockName; + + @Enumerated(EnumType.STRING) + @Column(name = "RESOURCE_TYPE") + private ResourceType resourceType; + + @Enumerated(EnumType.STRING) + @Column(name = "TARGET_ACTION") + private OrchestrationAction targetAction; + + @Override + public String toString() { + return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName) + .append("resourceType", resourceType).append("targetAction", targetAction).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof BuildingBlockDetail)) { + return false; + } + BuildingBlockDetail castOther = (BuildingBlockDetail) other; + return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(buildingBlockName).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getBuildingBlockName() { + return buildingBlockName; + } + + public void setBuildingBlockName(String buildingBlockName) { + this.buildingBlockName = buildingBlockName; + } + + public ResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public OrchestrationAction getTargetAction() { + return targetAction; + } + + public void setTargetAction(OrchestrationAction targetAction) { + this.targetAction = targetAction; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java index bb01f6f804..7dd163bafa 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java @@ -23,13 +23,10 @@ package org.onap.so.db.catalog.beans; import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.HashCodeBuilder; - import java.util.Date; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -41,9 +38,8 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; /** - * EntityBean class for a CloudIdentity. This bean represents a cloud identity - * service instance (i.e. a DCP node) in the NVP/AIC cloud. It will be loaded via - * CloudConfig object, of which it is a component. + * EntityBean class for a CloudIdentity. This bean represents a cloud identity service instance (i.e. a DCP node) in the + * NVP/AIC cloud. It will be loaded via CloudConfig object, of which it is a component. * */ @Entity @@ -55,53 +51,53 @@ public class CloudIdentity { @Id @Column(name = "ID") private String id; - + @JsonProperty("identity_url") @BusinessKey @Column(name = "IDENTITY_URL") private String identityUrl; - + @JsonProperty("mso_id") @BusinessKey @Column(name = "MSO_ID") private String msoId; - + @JsonProperty("mso_pass") @BusinessKey @Column(name = "MSO_PASS") private String msoPass; - + @JsonProperty("project_domain_name") @BusinessKey @Column(name = "PROJECT_DOMAIN_NAME") private String projectDomainName; - + @JsonProperty("user_domain_name") @BusinessKey @Column(name = "USER_DOMAIN_NAME") private String userDomainName; - + @JsonProperty("admin_tenant") @BusinessKey @Column(name = "ADMIN_TENANT") private String adminTenant; - + @JsonProperty("member_role") @BusinessKey @Column(name = "MEMBER_ROLE") private String memberRole; - + @JsonProperty("tenant_metadata") @BusinessKey @Column(name = "TENANT_METADATA") private Boolean tenantMetadata; - + @JsonProperty("identity_server_type") @BusinessKey @Enumerated(EnumType.STRING) @Column(name = "IDENTITY_SERVER_TYPE") private ServerType identityServerType; - + @JsonProperty("identity_authentication_type") @BusinessKey @Enumerated(EnumType.STRING) @@ -111,7 +107,7 @@ public class CloudIdentity { @JsonProperty("last_updated_by") @BusinessKey @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; + private String lastUpdatedBy; @JsonProperty("creation_timestamp") @BusinessKey @@ -124,7 +120,7 @@ public class CloudIdentity { @Column(name = "UPDATE_TIMESTAMP") @Temporal(TemporalType.TIMESTAMP) private Date updated; - + public CloudIdentity() {} @PrePersist @@ -133,38 +129,39 @@ public class CloudIdentity { this.updated = new Date(); } - public String getId () { + public String getId() { return id; } - public void setId (String id) { + public void setId(String id) { this.id = id; } public String getIdentityUrl() { - return this.identityUrl; + return this.identityUrl; } + public void setIdentityUrl(String url) { - this.identityUrl = url; + this.identityUrl = url; } - public String getMsoId () { + public String getMsoId() { return msoId; } - public void setMsoId (String id) { + public void setMsoId(String id) { this.msoId = id; } - public String getMsoPass () { + public String getMsoPass() { return msoPass; } - public void setMsoPass (String pwd) { + public void setMsoPass(String pwd) { this.msoPass = pwd; } - public String getAdminTenant () { + public String getAdminTenant() { return adminTenant; } @@ -192,15 +189,15 @@ public class CloudIdentity { this.updated = updated; } - public void setAdminTenant (String tenant) { + public void setAdminTenant(String tenant) { this.adminTenant = tenant; } - public String getMemberRole () { + public String getMemberRole() { return memberRole; } - public void setMemberRole (String role) { + public void setMemberRole(String role) { this.memberRole = role; } @@ -208,100 +205,106 @@ public class CloudIdentity { return tenantMetadata; } - public void setTenantMetadata (Boolean meta) { + public void setTenantMetadata(Boolean meta) { this.tenantMetadata = meta; } - + public ServerType getIdentityServerType() { - return this.identityServerType; + return this.identityServerType; } + public void setIdentityServerType(ServerType ist) { - this.identityServerType = ist; + this.identityServerType = ist; } + public String getIdentityServerTypeAsString() { - return this.identityServerType.toString(); + return this.identityServerType.toString(); } + /** - * @return the identityAuthenticationType - */ - public AuthenticationType getIdentityAuthenticationType() { - return identityAuthenticationType; - } - - /** - * @param identityAuthenticationType the identityAuthenticationType to set - */ - public void setIdentityAuthenticationType(AuthenticationType identityAuthenticationType) { - this.identityAuthenticationType = identityAuthenticationType; - } - - public String getProjectDomainName() { - return projectDomainName; - } - - public void setProjectDomainName(String projectDomainName) { - this.projectDomainName = projectDomainName; - } - - public String getUserDomainName() { - return userDomainName; - } - - public void setUserDomainName(String userDomainName) { - this.userDomainName = userDomainName; - } - @Override - public CloudIdentity clone() { - CloudIdentity cloudIdentityCopy = new CloudIdentity(); - - cloudIdentityCopy.id = this.id; - cloudIdentityCopy.identityUrl = this.identityUrl; - cloudIdentityCopy.msoId = this.msoId; - cloudIdentityCopy.msoPass = this.msoPass; - cloudIdentityCopy.adminTenant = this.adminTenant; - cloudIdentityCopy.memberRole = this.memberRole; - cloudIdentityCopy.tenantMetadata = this.tenantMetadata; - cloudIdentityCopy.identityServerType = this.identityServerType; - cloudIdentityCopy.identityAuthenticationType = this.identityAuthenticationType; - cloudIdentityCopy.projectDomainName = this.projectDomainName; - cloudIdentityCopy.userDomainName = this.userDomainName; - - return cloudIdentityCopy; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) - .append("identityUrl", getIdentityUrl()).append("msoId", getMsoId()) - .append("projectDomain", getProjectDomainName()).append("userDomain", getUserDomainName()) - .append("adminTenant", getAdminTenant()).append("memberRole", getMemberRole()) - .append("tenantMetadata", getTenantMetadata()).append("identityServerType", getIdentityServerType()) - .append("identityAuthenticationType", getIdentityAuthenticationType()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (other == null) { - return false; - } - if (!getClass().equals(other.getClass())) { - return false; - } - CloudIdentity castOther = (CloudIdentity) other; - return new EqualsBuilder().append(getId(), castOther.getId()) - .append(getIdentityUrl(), castOther.getIdentityUrl()).append(getMsoId(), castOther.getMsoId()) - .append(getMsoPass(), castOther.getMsoPass()).append(getAdminTenant(), castOther.getAdminTenant()) - .append(getProjectDomainName(), castOther.getProjectDomainName()).append(getUserDomainName(), castOther.getUserDomainName()) - .append(getMemberRole(), castOther.getMemberRole()) - .append(getTenantMetadata(), castOther.getTenantMetadata()) - .append(getIdentityServerType(), castOther.getIdentityServerType()) - .append(getIdentityAuthenticationType(), castOther.getIdentityAuthenticationType()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder(1, 31).append(getId()).append(getIdentityUrl()).append(getMsoId()) - .append(getMsoPass()).append(getProjectDomainName()).append(getUserDomainName()).append(getAdminTenant()).append(getMemberRole()).append(getTenantMetadata()) - .append(getIdentityServerType()).append(getIdentityAuthenticationType()).toHashCode(); - } -}
\ No newline at end of file + * @return the identityAuthenticationType + */ + public AuthenticationType getIdentityAuthenticationType() { + return identityAuthenticationType; + } + + /** + * @param identityAuthenticationType the identityAuthenticationType to set + */ + public void setIdentityAuthenticationType(AuthenticationType identityAuthenticationType) { + this.identityAuthenticationType = identityAuthenticationType; + } + + public String getProjectDomainName() { + return projectDomainName; + } + + public void setProjectDomainName(String projectDomainName) { + this.projectDomainName = projectDomainName; + } + + public String getUserDomainName() { + return userDomainName; + } + + public void setUserDomainName(String userDomainName) { + this.userDomainName = userDomainName; + } + + @Override + public CloudIdentity clone() { + CloudIdentity cloudIdentityCopy = new CloudIdentity(); + + cloudIdentityCopy.id = this.id; + cloudIdentityCopy.identityUrl = this.identityUrl; + cloudIdentityCopy.msoId = this.msoId; + cloudIdentityCopy.msoPass = this.msoPass; + cloudIdentityCopy.adminTenant = this.adminTenant; + cloudIdentityCopy.memberRole = this.memberRole; + cloudIdentityCopy.tenantMetadata = this.tenantMetadata; + cloudIdentityCopy.identityServerType = this.identityServerType; + cloudIdentityCopy.identityAuthenticationType = this.identityAuthenticationType; + cloudIdentityCopy.projectDomainName = this.projectDomainName; + cloudIdentityCopy.userDomainName = this.userDomainName; + + return cloudIdentityCopy; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) + .append("identityUrl", getIdentityUrl()).append("msoId", getMsoId()) + .append("projectDomain", getProjectDomainName()).append("userDomain", getUserDomainName()) + .append("adminTenant", getAdminTenant()).append("memberRole", getMemberRole()) + .append("tenantMetadata", getTenantMetadata()).append("identityServerType", getIdentityServerType()) + .append("identityAuthenticationType", getIdentityAuthenticationType()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (other == null) { + return false; + } + if (!getClass().equals(other.getClass())) { + return false; + } + CloudIdentity castOther = (CloudIdentity) other; + return new EqualsBuilder().append(getId(), castOther.getId()) + .append(getIdentityUrl(), castOther.getIdentityUrl()).append(getMsoId(), castOther.getMsoId()) + .append(getMsoPass(), castOther.getMsoPass()).append(getAdminTenant(), castOther.getAdminTenant()) + .append(getProjectDomainName(), castOther.getProjectDomainName()) + .append(getUserDomainName(), castOther.getUserDomainName()) + .append(getMemberRole(), castOther.getMemberRole()) + .append(getTenantMetadata(), castOther.getTenantMetadata()) + .append(getIdentityServerType(), castOther.getIdentityServerType()) + .append(getIdentityAuthenticationType(), castOther.getIdentityAuthenticationType()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(1, 31).append(getId()).append(getIdentityUrl()).append(getMsoId()) + .append(getMsoPass()).append(getProjectDomainName()).append(getUserDomainName()) + .append(getAdminTenant()).append(getMemberRole()).append(getTenantMetadata()) + .append(getIdentityServerType()).append(getIdentityAuthenticationType()).toHashCode(); + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java index 433ae986ab..053bf745e1 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.net.URI; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -36,24 +35,20 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; - import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.RemoteResource; import uk.co.blackpepper.bowman.annotation.ResourceId; /** - * EntityBean class for a CloudSite. This bean represents a cloud location - * (i.e. and LCP node) in the NVP/AIC cloud. It will be loaded via CloudConfig - * object, of which it is a component + * EntityBean class for a CloudSite. This bean represents a cloud location (i.e. and LCP node) in the NVP/AIC cloud. It + * will be loaded via CloudConfig object, of which it is a component * */ @RemoteResource("/cloudSite") @@ -111,7 +106,7 @@ public class CloudSite { @JsonProperty("last_updated_by") @BusinessKey @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; + private String lastUpdatedBy; @JsonProperty("creation_timestamp") @BusinessKey @@ -159,10 +154,12 @@ public class CloudSite { } @ResourceId - public URI getUri() {return this.uri;} + public URI getUri() { + return this.uri; + } public void setUri(URI uri) { - this.uri = uri; + this.uri = uri; } public String getRegionId() { @@ -174,7 +171,8 @@ public class CloudSite { } public String getIdentityServiceId() { - return identityServiceId == null ? (identityService== null? null:identityService.getId()):identityServiceId; + return identityServiceId == null ? (identityService == null ? null : identityService.getId()) + : identityServiceId; } public String getCloudVersion() { @@ -241,13 +239,14 @@ public class CloudSite { this.orchestrator = orchestrator; } - public CloudIdentity getIdentityService () { + public CloudIdentity getIdentityService() { return identityService; } - public void setIdentityService (CloudIdentity identity) { + public void setIdentityService(CloudIdentity identity) { this.identityService = identity; } + @Deprecated public void setIdentityServiceId(String identityServiceId) { this.identityServiceId = identityServiceId; @@ -272,7 +271,8 @@ public class CloudSite { CloudSite castOther = (CloudSite) other; return new EqualsBuilder().append(getRegionId(), castOther.getRegionId()) .append(getIdentityServiceId(), castOther.getIdentityServiceId()) - .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()).isEquals(); + .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()) + .isEquals(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java index 30ebca8699..a3df245ae6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java @@ -21,15 +21,12 @@ package org.onap.so.db.catalog.beans; import java.util.Date; - import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; - import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.EqualsBuilder; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -39,11 +36,9 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; /** - * EntityBean class for a Cloudify Manager. This bean represents a Cloudify - * node through which TOSCA-based VNFs may be deployed. Each CloudSite in the - * CloudConfig may have a Cloudify Manager for deployments using TOSCA blueprints. - * Cloudify Managers may support multiple Cloud Sites, but each site will have - * at most one Cloudify Manager. + * EntityBean class for a Cloudify Manager. This bean represents a Cloudify node through which TOSCA-based VNFs may be + * deployed. Each CloudSite in the CloudConfig may have a Cloudify Manager for deployments using TOSCA blueprints. + * Cloudify Managers may support multiple Cloud Sites, but each site will have at most one Cloudify Manager. * * This does not replace the ability to use the CloudSite directly via Openstack. * @@ -52,156 +47,157 @@ import javax.persistence.TemporalType; @Entity @Table(name = "cloudify_managers") public class CloudifyManager { - - @JsonProperty - @BusinessKey - @Id - @Column(name = "ID") - private String id; - - @BusinessKey - @JsonProperty ("cloudify_url") - @Column(name = "CLOUDIFY_URL") - private String cloudifyUrl; - - @BusinessKey - @JsonProperty("username") - @Column(name = "USERNAME") - private String username; - - @BusinessKey - @JsonProperty("password") - @Column(name = "PASSWORD") - private String password; - - @BusinessKey - @JsonProperty("version") - @Column(name = "VERSION") - private String version; - - @JsonProperty("last_updated_by") - @BusinessKey - @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; - - @JsonProperty("creation_timestamp") - @BusinessKey - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @JsonProperty("update_timestamp") - @BusinessKey - @Column(name = "UPDATE_TIMESTAMP") - @Temporal(TemporalType.TIMESTAMP) - private Date updated; - - public CloudifyManager() {} - - @PrePersist - protected void onCreate() { - this.created = new Date(); - this.updated = new Date(); - } - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getCloudifyUrl() { - return cloudifyUrl; - } - - public void setCloudifyUrl(String cloudifyUrl) { - this.cloudifyUrl = cloudifyUrl; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { + + @JsonProperty + @BusinessKey + @Id + @Column(name = "ID") + private String id; + + @BusinessKey + @JsonProperty("cloudify_url") + @Column(name = "CLOUDIFY_URL") + private String cloudifyUrl; + + @BusinessKey + @JsonProperty("username") + @Column(name = "USERNAME") + private String username; + + @BusinessKey + @JsonProperty("password") + @Column(name = "PASSWORD") + private String password; + + @BusinessKey + @JsonProperty("version") + @Column(name = "VERSION") + private String version; + + @JsonProperty("last_updated_by") + @BusinessKey + @Column(name = "LAST_UPDATED_BY") + private String lastUpdatedBy; + + @JsonProperty("creation_timestamp") + @BusinessKey + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @JsonProperty("update_timestamp") + @BusinessKey + @Column(name = "UPDATE_TIMESTAMP") + @Temporal(TemporalType.TIMESTAMP) + private Date updated; + + public CloudifyManager() {} + + @PrePersist + protected void onCreate() { + this.created = new Date(); + this.updated = new Date(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCloudifyUrl() { + return cloudifyUrl; + } + + public void setCloudifyUrl(String cloudifyUrl) { + this.cloudifyUrl = cloudifyUrl; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getLastUpdatedBy() { - return lastUpdatedBy; - } - - public Date getCreated() { - return created; - } - - public Date getUpdated() { - return updated; - } - - public void setLastUpdatedBy(String lastUpdatedBy) { - this.lastUpdatedBy = lastUpdatedBy; - } - - public void setCreated(Date created) { - this.created = created; - } - - public void setUpdated(Date updated) { - this.updated = updated; - } - - @Override - public CloudifyManager clone() { - CloudifyManager cloudifyManagerCopy = new CloudifyManager(); - cloudifyManagerCopy.id = this.id; - cloudifyManagerCopy.cloudifyUrl = this.cloudifyUrl; - cloudifyManagerCopy.username = this.username; - cloudifyManagerCopy.password = this.password; - cloudifyManagerCopy.version = this.version; - return cloudifyManagerCopy; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) - .append("cloudifyUrl", getCloudifyUrl()).append("username", getUsername()) - .append("password", getPassword()).append("version", getVersion()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (other == null) { - return false; - } - if (!getClass().equals(other.getClass())) { - return false; - } - CloudifyManager castOther = (CloudifyManager) other; - return new EqualsBuilder().append(getId(), castOther.getId()) - .append(getCloudifyUrl(), castOther.getCloudifyUrl()).append(getUsername(), castOther.getUsername()) - .append(getPassword(), castOther.getPassword()).append(getVersion(), castOther.getVersion()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder(1, 31).append(getId()).append(getCloudifyUrl()).append(getUsername()) - .append(getPassword()).append(getVersion()).toHashCode(); - } + } + + public void setPassword(String password) { + this.password = password; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public Date getCreated() { + return created; + } + + public Date getUpdated() { + return updated; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public void setCreated(Date created) { + this.created = created; + } + + public void setUpdated(Date updated) { + this.updated = updated; + } + + @Override + public CloudifyManager clone() { + CloudifyManager cloudifyManagerCopy = new CloudifyManager(); + cloudifyManagerCopy.id = this.id; + cloudifyManagerCopy.cloudifyUrl = this.cloudifyUrl; + cloudifyManagerCopy.username = this.username; + cloudifyManagerCopy.password = this.password; + cloudifyManagerCopy.version = this.version; + return cloudifyManagerCopy; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) + .append("cloudifyUrl", getCloudifyUrl()).append("username", getUsername()) + .append("password", getPassword()).append("version", getVersion()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (other == null) { + return false; + } + if (!getClass().equals(other.getClass())) { + return false; + } + CloudifyManager castOther = (CloudifyManager) other; + return new EqualsBuilder().append(getId(), castOther.getId()) + .append(getCloudifyUrl(), castOther.getCloudifyUrl()).append(getUsername(), castOther.getUsername()) + .append(getPassword(), castOther.getPassword()).append(getVersion(), castOther.getVersion()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(1, 31).append(getId()).append(getCloudifyUrl()).append(getUsername()) + .append(getPassword()).append(getVersion()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java index d4de5cbcdf..566268ba57 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java @@ -22,7 +22,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; @@ -34,175 +33,172 @@ 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 @Table(name = "collection_network_resource_customization") public class CollectionNetworkResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 11115611315801079L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID = null; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "NETWORK_TECHNOLOGY") - private String networkTechnology; - - @BusinessKey - @Column(name = "NETWORK_TYPE") - private String networkType = null; - - @BusinessKey - @Column(name = "NETWORK_SCOPE") - private String networkScope; - - @BusinessKey - @Column(name = "NETWORK_ROLE") - private String networkRole; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") - private NetworkResource networkResource = null; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") - private InstanceGroup instanceGroup = null; - - @BusinessKey - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID") - private NetworkCollectionResourceCustomization networkResourceCustomization = null; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionNetworkResourceCustomization)) { - return false; - } - CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType) - .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole) - .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType) - .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("networkTechnology", networkTechnology).append("networkType", networkType) - .append("networkScope", networkScope).append("networkRole", networkRole) - .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization) - .toString(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - @LinkedResource - public NetworkCollectionResourceCustomization getNetworkResourceCustomization() { - return networkResourceCustomization; - } - - public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public NetworkResource getNetworkResource() { - return this.networkResource; - } - - public void setNetworkResource(NetworkResource networkResource) { - this.networkResource = networkResource; - } - - public String getNetworkType() { - return this.networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public Date getCreated() { - return this.created; - } - - public String getNetworkTechnology() { - return this.networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public String getNetworkScope() { - return this.networkScope; - } - - public void setNetworkScope(String networkScope) { - this.networkScope = networkScope; - } - - public void setNetworkRole(String networkRole) { - this.networkRole = networkRole; - } - - public String getNetworkRole() { - return this.networkRole; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } - + /** + * + */ + private static final long serialVersionUID = 11115611315801079L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID = null; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "NETWORK_TECHNOLOGY") + private String networkTechnology; + + @BusinessKey + @Column(name = "NETWORK_TYPE") + private String networkType = null; + + @BusinessKey + @Column(name = "NETWORK_SCOPE") + private String networkScope; + + @BusinessKey + @Column(name = "NETWORK_ROLE") + private String networkRole; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") + private NetworkResource networkResource = null; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") + private InstanceGroup instanceGroup = null; + + @BusinessKey + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID") + private NetworkCollectionResourceCustomization networkResourceCustomization = null; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionNetworkResourceCustomization)) { + return false; + } + CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType) + .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole) + .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType) + .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("networkTechnology", networkTechnology).append("networkType", networkType) + .append("networkScope", networkScope).append("networkRole", networkRole) + .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization) + .toString(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + @LinkedResource + public NetworkCollectionResourceCustomization getNetworkResourceCustomization() { + return networkResourceCustomization; + } + + public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public NetworkResource getNetworkResource() { + return this.networkResource; + } + + public void setNetworkResource(NetworkResource networkResource) { + this.networkResource = networkResource; + } + + public String getNetworkType() { + return this.networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public Date getCreated() { + return this.created; + } + + public String getNetworkTechnology() { + return this.networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public String getNetworkScope() { + return this.networkScope; + } + + public void setNetworkScope(String networkScope) { + this.networkScope = networkScope; + } + + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } + + public String getNetworkRole() { + return this.networkRole; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java index f8148aa781..9a92d0a64f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,148 +33,145 @@ 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 @Table(name = "collection_resource") public class CollectionResource implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8612818857960992110L; + /** + * + */ + private static final long serialVersionUID = -8612818857960992110L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; - @Column(name = "MODEL_NAME") - private String modelName; + @Column(name = "MODEL_NAME") + private String modelName; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "DESCRIPTION") - private String description; + @Column(name = "DESCRIPTION") + private String description; - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResource") - private Set<CollectionResourceCustomization> collectionResourceCustomization; - - @OneToOne(cascade = CascadeType.ALL, mappedBy = "collectionResource") - private InstanceGroup instanceGroup; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResource)) { - return false; - } - CollectionResource castOther = (CollectionResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - public Set<CollectionResourceCustomization> getCollectionResourceCustomization() { - return collectionResourceCustomization; - } - - public void setCollectionResourceCustomization( - Set<CollectionResourceCustomization> collectionResourceCustomization) { - this.collectionResourceCustomization = collectionResourceCustomization; - } - - public String getModelUUID() { - return modelUUID; - } - - public Date getCreated() { - return this.created; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) - .toString(); - } -}
\ No newline at end of file + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResource") + private Set<CollectionResourceCustomization> collectionResourceCustomization; + + @OneToOne(cascade = CascadeType.ALL, mappedBy = "collectionResource") + private InstanceGroup instanceGroup; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResource)) { + return false; + } + CollectionResource castOther = (CollectionResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + public Set<CollectionResourceCustomization> getCollectionResourceCustomization() { + return collectionResourceCustomization; + } + + public void setCollectionResourceCustomization( + Set<CollectionResourceCustomization> collectionResourceCustomization) { + this.collectionResourceCustomization = collectionResourceCustomization; + } + + public String getModelUUID() { + return modelUUID; + } + + public Date getCreated() { + return this.created; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) + .toString(); + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java index 34389de22f..8214c0a074 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; @@ -39,13 +38,10 @@ 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 @@ -54,127 +50,127 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "collection_resource_customization") public class CollectionResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8328823396870652841L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "COLLECTION_RESOURCE_TYPE") - private String type; - - @Column(name = "ROLE") - private String role; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CR_MODEL_UUID") - private CollectionResource collectionResource; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResourceCust") - private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("type", type).append("role", role) - .append("function", function).append("created", created) - .append("collectionResource", collectionResource) - .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceCustomization)) { - return false; - } - CollectionResourceCustomization castOther = (CollectionResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public Date getCreated() { - return this.created; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - @LinkedResource - public CollectionResource getCollectionResource() { - return collectionResource; - } - - public void setCollectionResource(CollectionResource collectionResource) { - this.collectionResource = collectionResource; - } - - @LinkedResource - public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { - return collectionInstanceGroupCustomizations; - } - - public void setCollectionInstanceGroupCustomizations( - List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { - this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; - } -}
\ No newline at end of file + /** + * + */ + private static final long serialVersionUID = -8328823396870652841L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "COLLECTION_RESOURCE_TYPE") + private String type; + + @Column(name = "ROLE") + private String role; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CR_MODEL_UUID") + private CollectionResource collectionResource; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResourceCust") + private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("type", type).append("role", role) + .append("function", function).append("created", created) + .append("collectionResource", collectionResource) + .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceCustomization)) { + return false; + } + CollectionResourceCustomization castOther = (CollectionResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public Date getCreated() { + return this.created; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + @LinkedResource + public CollectionResource getCollectionResource() { + return collectionResource; + } + + public void setCollectionResource(CollectionResource collectionResource) { + this.collectionResource = collectionResource; + } + + @LinkedResource + public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { + return collectionInstanceGroupCustomizations; + } + + public void setCollectionInstanceGroupCustomizations( + List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { + this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java index 7379225a34..4a72f9a3c2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java @@ -22,7 +22,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; @@ -35,13 +34,10 @@ 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 @@ -49,132 +45,132 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "collection_resource_instance_group_customization") public class CollectionResourceInstanceGroupCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 5169990063225044265L; - - @BusinessKey - @Id - @Column(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID") - private String modelCustomizationUUID; - - @BusinessKey - @Id - @Column(name = "INSTANCE_GROUP_MODEL_UUID") - private String modelUUID; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID", updatable = false, insertable = false) - private CollectionResourceCustomization collectionResourceCust; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID", updatable = false, insertable = false) - private InstanceGroup instanceGroup; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "SUBINTERFACE_NETWORK_QUANTITY") - private Integer subInterfaceNetworkQuantity; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelUUID", modelUUID).append("collectionResourceCust", collectionResourceCust) - .append("instanceGroup", instanceGroup).append("function", function).append("description", description) - .append("created", created).append("subInterfaceNetworkQuantity", subInterfaceNetworkQuantity) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceInstanceGroupCustomization)) { - return false; - } - CollectionResourceInstanceGroupCustomization castOther = (CollectionResourceInstanceGroupCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(modelUUID, castOther.modelUUID).append(collectionResourceCust, castOther.collectionResourceCust) - .append(instanceGroup, castOther.instanceGroup).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).append(collectionResourceCust) - .append(instanceGroup).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public Integer getSubInterfaceNetworkQuantity() { - return subInterfaceNetworkQuantity; - } - - public void setSubInterfaceNetworkQuantity(Integer subInterfaceNetworkQuantity) { - this.subInterfaceNetworkQuantity = subInterfaceNetworkQuantity; - } - - @LinkedResource - public CollectionResourceCustomization getCollectionResourceCust() { - return collectionResourceCust; - } - - public void setCollectionResourceCust(CollectionResourceCustomization collectionResourceCust) { - this.collectionResourceCust = collectionResourceCust; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } + /** + * + */ + private static final long serialVersionUID = 5169990063225044265L; + + @BusinessKey + @Id + @Column(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID") + private String modelCustomizationUUID; + + @BusinessKey + @Id + @Column(name = "INSTANCE_GROUP_MODEL_UUID") + private String modelUUID; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID", updatable = false, insertable = false) + private CollectionResourceCustomization collectionResourceCust; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID", updatable = false, insertable = false) + private InstanceGroup instanceGroup; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "SUBINTERFACE_NETWORK_QUANTITY") + private Integer subInterfaceNetworkQuantity; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelUUID", modelUUID).append("collectionResourceCust", collectionResourceCust) + .append("instanceGroup", instanceGroup).append("function", function).append("description", description) + .append("created", created).append("subInterfaceNetworkQuantity", subInterfaceNetworkQuantity) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceInstanceGroupCustomization)) { + return false; + } + CollectionResourceInstanceGroupCustomization castOther = (CollectionResourceInstanceGroupCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(modelUUID, castOther.modelUUID).append(collectionResourceCust, castOther.collectionResourceCust) + .append(instanceGroup, castOther.instanceGroup).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).append(collectionResourceCust) + .append(instanceGroup).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public Integer getSubInterfaceNetworkQuantity() { + return subInterfaceNetworkQuantity; + } + + public void setSubInterfaceNetworkQuantity(Integer subInterfaceNetworkQuantity) { + this.subInterfaceNetworkQuantity = subInterfaceNetworkQuantity; + } + + @LinkedResource + public CollectionResourceCustomization getCollectionResourceCust() { + return collectionResourceCust; + } + + public void setCollectionResourceCust(CollectionResourceCustomization collectionResourceCust) { + this.collectionResourceCust = collectionResourceCust; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java index ff35bdb390..6d5c4109ee 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java @@ -21,58 +21,57 @@ 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 CollectionResourceInstanceGroupCustomizationId implements Serializable { - /** - * - */ - private static final long serialVersionUID = 7118300524797895317L; + /** + * + */ + private static final long serialVersionUID = 7118300524797895317L; - @BusinessKey - private String modelCustomizationUUID; - @BusinessKey - private String modelUUID; + @BusinessKey + private String modelCustomizationUUID; + @BusinessKey + private String modelUUID; - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelUUID", modelUUID).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelUUID", modelUUID).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceInstanceGroupCustomizationId)) { - return false; - } - CollectionResourceInstanceGroupCustomizationId castOther = (CollectionResourceInstanceGroupCustomizationId) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(modelUUID, castOther.modelUUID).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceInstanceGroupCustomizationId)) { + return false; + } + CollectionResourceInstanceGroupCustomizationId castOther = + (CollectionResourceInstanceGroupCustomizationId) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(modelUUID, castOther.modelUUID).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).toHashCode(); + } - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } - public String getModelUUID() { - return this.modelUUID; - } + public String getModelUUID() { + return this.modelUUID; + } - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java index ccfa71306b..9c2e1de244 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,151 +32,149 @@ 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.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; -@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" }) +@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) @Entity @Table(name = "configuration") public class ConfigurationResource implements Serializable { - /** - * - */ - private static final long serialVersionUID = 6675926401792679171L; + /** + * + */ + private static final long serialVersionUID = 6675926401792679171L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @Column(name = "MODEL_VERSION") + private String modelVersion; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") - private Set<ConfigurationResourceCustomization> configurationResourceCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") - private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public Set<ConfigurationResourceCustomization> getConfigurationResourceCustomization() { - return configurationResourceCustomization; - } - - public void setConfigurationResourceCustomization( - Set<ConfigurationResourceCustomization> configurationResourceCustomization) { - this.configurationResourceCustomization = configurationResourceCustomization; - } - - @LinkedResource - public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { - return cvnfcConfigurationCustomization; - } - - public void setCvnfcConfigurationCustomization(Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { - this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelVersion", modelVersion).append("modelName", modelName) - .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) - .append("configurationResourceCustomization", configurationResourceCustomization).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ConfigurationResource)) { - return false; - } - ConfigurationResource castOther = (ConfigurationResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") + private Set<ConfigurationResourceCustomization> configurationResourceCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") + private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public Set<ConfigurationResourceCustomization> getConfigurationResourceCustomization() { + return configurationResourceCustomization; + } + + public void setConfigurationResourceCustomization( + Set<ConfigurationResourceCustomization> configurationResourceCustomization) { + this.configurationResourceCustomization = configurationResourceCustomization; + } + + @LinkedResource + public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { + return cvnfcConfigurationCustomization; + } + + public void setCvnfcConfigurationCustomization( + Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { + this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelVersion", modelVersion).append("modelName", modelName) + .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) + .append("configurationResourceCustomization", configurationResourceCustomization).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ConfigurationResource)) { + return false; + } + ConfigurationResource castOther = (ConfigurationResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java index 0b02c11701..059935fff3 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,153 +37,150 @@ 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 @Table(name = "configuration_customization") public class ConfigurationResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1230671937560638856L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CONFIGURATION_FUNCTION") - private String nfFunction; - - @Column(name = "CONFIGURATION_TYPE") - private String nfType; - - @Column(name = "CONFIGURATION_ROLE") - private String nfRole; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") - private String serviceProxyResourceCustomizationUUID; - - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") - private ConfigurationResourceCustomization configResourceCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_MODEL_UUID") - private ConfigurationResource configurationResource; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getNfFunction() { - return nfFunction; - } - - public void setNfFunction(String nfFunction) { - this.nfFunction = nfFunction; - } - - public String getNfType() { - return nfType; - } - - public void setNfType(String nfType) { - this.nfType = nfType; - } - - public String getNfRole() { - return nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public Date getCreated() { - return created; - } - - public String getServiceProxyResourceCustomizationUUID() { - return serviceProxyResourceCustomizationUUID; - } - - public void setServiceProxyResourceCustomizationUUID(String serviceProxyResourceCustomizationUUID) { - this.serviceProxyResourceCustomizationUUID = serviceProxyResourceCustomizationUUID; - } - - @LinkedResource - public ConfigurationResourceCustomization getConfigResourceCustomization() { - return configResourceCustomization; - } - - public void setConfigResourceCustomization(ConfigurationResourceCustomization configResourceCustomization) { - this.configResourceCustomization = configResourceCustomization; - } - - @LinkedResource - public ConfigurationResource getConfigurationResource() { - return configurationResource; - } - - public void setConfigurationResource(ConfigurationResource configurationResource) { - this.configurationResource = configurationResource; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("created", created) - //.append("serviceProxyResourceCustomization", serviceProxyResourceCustomization) - .append("configResourceCustomization", configResourceCustomization) - .append("configurationResource", configurationResource).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ConfigurationResourceCustomization)) { - return false; - } - ConfigurationResourceCustomization castOther = (ConfigurationResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } + /** + * + */ + private static final long serialVersionUID = 1230671937560638856L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CONFIGURATION_FUNCTION") + private String nfFunction; + + @Column(name = "CONFIGURATION_TYPE") + private String nfType; + + @Column(name = "CONFIGURATION_ROLE") + private String nfRole; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") + private String serviceProxyResourceCustomizationUUID; + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") + private ConfigurationResourceCustomization configResourceCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_MODEL_UUID") + private ConfigurationResource configurationResource; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getNfFunction() { + return nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfType() { + return nfType; + } + + public void setNfType(String nfType) { + this.nfType = nfType; + } + + public String getNfRole() { + return nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public Date getCreated() { + return created; + } + + public String getServiceProxyResourceCustomizationUUID() { + return serviceProxyResourceCustomizationUUID; + } + + public void setServiceProxyResourceCustomizationUUID(String serviceProxyResourceCustomizationUUID) { + this.serviceProxyResourceCustomizationUUID = serviceProxyResourceCustomizationUUID; + } + + @LinkedResource + public ConfigurationResourceCustomization getConfigResourceCustomization() { + return configResourceCustomization; + } + + public void setConfigResourceCustomization(ConfigurationResourceCustomization configResourceCustomization) { + this.configResourceCustomization = configResourceCustomization; + } + + @LinkedResource + public ConfigurationResource getConfigurationResource() { + return configurationResource; + } + + public void setConfigurationResource(ConfigurationResource configurationResource) { + this.configurationResource = configurationResource; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("nfFunction", nfFunction) + .append("nfType", nfType).append("nfRole", nfRole).append("created", created) + // .append("serviceProxyResourceCustomization", serviceProxyResourceCustomization) + .append("configResourceCustomization", configResourceCustomization) + .append("configurationResource", configurationResource).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ConfigurationResourceCustomization)) { + return false; + } + ConfigurationResourceCustomization castOther = (ConfigurationResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java index de0dd39edc..425e0b8bbc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java @@ -20,13 +20,11 @@ package org.onap.so.db.catalog.beans; */ import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; - import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -37,70 +35,75 @@ import org.apache.commons.lang3.builder.EqualsBuilder; @Table(name = "CONTROLLER_SELECTION_REFERENCE") public class ControllerSelectionReference implements Serializable { - private static final long serialVersionUID = -608098800737567188L; - - @BusinessKey - @Id - @Column(name = "VNF_TYPE") - private String vnfType; - - @BusinessKey - @Id - @Column(name = "CONTROLLER_NAME") + private static final long serialVersionUID = -608098800737567188L; + + @BusinessKey + @Id + @Column(name = "VNF_TYPE") + private String vnfType; + + @BusinessKey + @Id + @Column(name = "CONTROLLER_NAME") private String controllerName; - - @BusinessKey - @Id - @Column(name = "ACTION_CATEGORY") + + @BusinessKey + @Id + @Column(name = "ACTION_CATEGORY") private String actionCategory; - - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - public String getControllerName() { - return controllerName; - } - public void setControllerName(String controllerName) { - this.controllerName = controllerName; - } - public String getActionCategory() { - return actionCategory; - } - public void setActionCategory(String actionCategory) { - this.actionCategory = actionCategory; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) - .append("actionCategory", actionCategory).toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(final Object other) { - if (!(other instanceof ControllerSelectionReference)) { - return false; - } - ControllerSelectionReference castOther = (ControllerSelectionReference) other; - return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) - .append(actionCategory, castOther.actionCategory).isEquals(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); - } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getControllerName() { + return controllerName; + } + + public void setControllerName(String controllerName) { + this.controllerName = controllerName; + } + + public String getActionCategory() { + return actionCategory; + } + + public void setActionCategory(String actionCategory) { + this.actionCategory = actionCategory; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) + .append("actionCategory", actionCategory).toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(final Object other) { + if (!(other instanceof ControllerSelectionReference)) { + return false; + } + ControllerSelectionReference castOther = (ControllerSelectionReference) other; + return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) + .append(actionCategory, castOther.actionCategory).isEquals(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java index e6ee349be6..f06519c74c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -30,54 +29,59 @@ import org.apache.commons.lang3.builder.EqualsBuilder; public class ControllerSelectionReferenceId implements Serializable { - private static final long serialVersionUID = 1L; - @BusinessKey - private String vnfType; - @BusinessKey + private static final long serialVersionUID = 1L; + @BusinessKey + private String vnfType; + @BusinessKey private String controllerName; - @BusinessKey + @BusinessKey private String actionCategory; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ControllerSelectionReferenceId)) { - return false; - } - ControllerSelectionReferenceId castOther = (ControllerSelectionReferenceId) other; - return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) - .append(actionCategory, castOther.actionCategory).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) - .append("actionCategory", actionCategory).toString(); - } - - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - public String getControllerName() { - return controllerName; - } - public void setControllerName(String controllerName) { - this.controllerName = controllerName; - } - public String getActionCategory() { - return actionCategory; - } - public void setActionCategory(String actionCategory) { - this.actionCategory = actionCategory; - } - + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ControllerSelectionReferenceId)) { + return false; + } + ControllerSelectionReferenceId castOther = (ControllerSelectionReferenceId) other; + return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) + .append(actionCategory, castOther.actionCategory).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) + .append("actionCategory", actionCategory).toString(); + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getControllerName() { + return controllerName; + } + + public void setControllerName(String controllerName) { + this.controllerName = controllerName; + } + + public String getActionCategory() { + return actionCategory; + } + + public void setActionCategory(String actionCategory) { + this.actionCategory = actionCategory; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java index 1e09c6e671..05d43d093c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java @@ -22,7 +22,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; @@ -37,174 +36,172 @@ 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.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "cvnfc_configuration_customization") public class CvnfcConfigurationCustomization implements Serializable { - private static final long serialVersionUID = -3153216266280581103L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CONFIGURATION_TYPE") - private String configurationType; - - @Column(name = "CONFIGURATION_ROLE") - private String configurationRole; - - @Column(name = "CONFIGURATION_FUNCTION") - private String configurationFunction; - - @Column(name = "POLICY_NAME") - private String policyName; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_MODEL_UUID") - private ConfigurationResource configurationResource; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID") - private CvnfcCustomization cvnfcCustomization; - - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CvnfcConfigurationCustomization)) { - return false; - } - CvnfcConfigurationCustomization castOther = (CvnfcConfigurationCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType) - .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction) - .append("policyName", policyName).append("created", created) - .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization).toString(); - } - - - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getConfigurationType() { - return configurationType; - } - - public void setConfigurationType(String configurationType) { - this.configurationType = configurationType; - } - - public String getConfigurationRole() { - return configurationRole; - } - - public void setConfigurationRole(String configurationRole) { - this.configurationRole = configurationRole; - } - - public String getConfigurationFunction() { - return configurationFunction; - } - - public void setConfigurationFunction(String configurationFunction) { - this.configurationFunction = configurationFunction; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } + private static final long serialVersionUID = -3153216266280581103L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CONFIGURATION_TYPE") + private String configurationType; + + @Column(name = "CONFIGURATION_ROLE") + private String configurationRole; + + @Column(name = "CONFIGURATION_FUNCTION") + private String configurationFunction; + + @Column(name = "POLICY_NAME") + private String policyName; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_MODEL_UUID") + private ConfigurationResource configurationResource; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID") + private CvnfcCustomization cvnfcCustomization; + + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CvnfcConfigurationCustomization)) { + return false; + } + CvnfcConfigurationCustomization castOther = (CvnfcConfigurationCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType) + .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction) + .append("policyName", policyName).append("created", created) + .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization) + .toString(); + } + + + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getConfigurationType() { + return configurationType; + } + + public void setConfigurationType(String configurationType) { + this.configurationType = configurationType; + } + + public String getConfigurationRole() { + return configurationRole; + } + + public void setConfigurationRole(String configurationRole) { + this.configurationRole = configurationRole; + } + + public String getConfigurationFunction() { + return configurationFunction; + } + + public void setConfigurationFunction(String configurationFunction) { + this.configurationFunction = configurationFunction; + } + + public String getPolicyName() { + return policyName; + } + + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public ConfigurationResource getConfigurationResource() { + return configurationResource; + } + + public void setConfigurationResource(ConfigurationResource configurationResource) { + this.configurationResource = configurationResource; + } - @LinkedResource - public ConfigurationResource getConfigurationResource() { - return configurationResource; - } - - public void setConfigurationResource(ConfigurationResource configurationResource) { - this.configurationResource = configurationResource; - } + @LinkedResource + public CvnfcCustomization getCvnfcCustomization() { + return cvnfcCustomization; + } - @LinkedResource - public CvnfcCustomization getCvnfcCustomization() { - return cvnfcCustomization; - } - - public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java index a7bbb9fb01..da3e391e11 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,226 +37,223 @@ 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.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "cvnfc_customization") public class CvnfcCustomization implements Serializable { - private static final long serialVersionUID = -3772469944364616486L; - - @Id - @Column(name = "ID") - @BusinessKey - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "NFC_FUNCTION") - private String nfcFunction; - - @Column(name = "NFC_NAMING_CODE") - private String nfcNamingCode; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID") - private VfModuleCustomization vfModuleCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID") - private VnfcCustomization vnfcCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization") - private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CvnfcCustomization)) { - return false; - } - CvnfcCustomization castOther = (CvnfcCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("modelName", modelName).append("toscaNodeType", toscaNodeType) - .append("description", description).append("nfcFunction", nfcFunction) - .append("nfcNamingCode", nfcNamingCode).append("created", created) - .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization) - .toString(); - } - - @LinkedResource - public VnfcCustomization getVnfcCustomization() { - return vnfcCustomization; - } - - public void setVnfcCustomization(VnfcCustomization vnfcCustomization) { - this.vnfcCustomization = vnfcCustomization; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @LinkedResource - public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { - return cvnfcConfigurationCustomization; - } - - public void setCvnfcConfigurationCustomization(Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { - this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getNfcFunction() { - return nfcFunction; - } - - public void setNfcFunction(String nfcFunction) { - this.nfcFunction = nfcFunction; - } - - public String getNfcNamingCode() { - return nfcNamingCode; - } - - public void setNfcNamingCode(String nfcNamingCode) { - this.nfcNamingCode = nfcNamingCode; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public VfModuleCustomization getVfModuleCustomization() { - return vfModuleCustomization; - } - - public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) { - this.vfModuleCustomization = vfModuleCustomization; - } + private static final long serialVersionUID = -3772469944364616486L; + + @Id + @Column(name = "ID") + @BusinessKey + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "NFC_FUNCTION") + private String nfcFunction; + + @Column(name = "NFC_NAMING_CODE") + private String nfcNamingCode; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID") + private VfModuleCustomization vfModuleCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID") + private VnfcCustomization vnfcCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization") + private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CvnfcCustomization)) { + return false; + } + CvnfcCustomization castOther = (CvnfcCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("modelName", modelName).append("toscaNodeType", toscaNodeType) + .append("description", description).append("nfcFunction", nfcFunction) + .append("nfcNamingCode", nfcNamingCode).append("created", created) + .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization).toString(); + } + + @LinkedResource + public VnfcCustomization getVnfcCustomization() { + return vnfcCustomization; + } + + public void setVnfcCustomization(VnfcCustomization vnfcCustomization) { + this.vnfcCustomization = vnfcCustomization; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @LinkedResource + public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { + return cvnfcConfigurationCustomization; + } + + public void setCvnfcConfigurationCustomization( + Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { + this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNfcFunction() { + return nfcFunction; + } + + public void setNfcFunction(String nfcFunction) { + this.nfcFunction = nfcFunction; + } + + public String getNfcNamingCode() { + return nfcNamingCode; + } + + public void setNfcNamingCode(String nfcNamingCode) { + this.nfcNamingCode = nfcNamingCode; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public VfModuleCustomization getVfModuleCustomization() { + return vfModuleCustomization; + } + + public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) { + this.vfModuleCustomization = vfModuleCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java index d076aebf86..f664e79702 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java @@ -21,112 +21,109 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; - 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; @Entity @Table(name = "external_service_to_internal_model_mapping") public class ExternalServiceToInternalService implements Serializable { - /** - * - */ - private static final long serialVersionUID = 3825246668050173010L; - - @Id - @Column(name = "Id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "SERVICE_NAME") - private String serviceName; - - @BusinessKey - @Column(name = "PRODUCT_FLAVOR") - private String productFlavor; - - @BusinessKey - @Column(name = "SUBSCRIPTION_SERVICE_TYPE") - private String subscriptionServiceType; - - @BusinessKey - @Column(name = "SERVICE_MODEL_UUID") - private String serviceModelUUID; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ExternalServiceToInternalService)) { - return false; - } - ExternalServiceToInternalService castOther = (ExternalServiceToInternalService) other; - return new EqualsBuilder().append(serviceName, castOther.serviceName) - .append(productFlavor, castOther.productFlavor) - .append(subscriptionServiceType, castOther.subscriptionServiceType) - .append(serviceModelUUID, castOther.serviceModelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(serviceName).append(productFlavor).append(subscriptionServiceType) - .append(serviceModelUUID).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("serviceName", serviceName) - .append("productFlavor", productFlavor).append("subscriptionServiceType", subscriptionServiceType) - .append("serviceModelUUID", serviceModelUUID).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getProductFlavor() { - return productFlavor; - } - - public void setProductFlavor(String productFlavor) { - this.productFlavor = productFlavor; - } - - public String getSubscriptionServiceType() { - return subscriptionServiceType; - } - - public void setSubscriptionServiceType(String subscriptionServiceType) { - this.subscriptionServiceType = subscriptionServiceType; - } - - public String getServiceModelUUID() { - return serviceModelUUID; - } - - public void setServiceModelUUID(String serviceModelUUID) { - this.serviceModelUUID = serviceModelUUID; - } + /** + * + */ + private static final long serialVersionUID = 3825246668050173010L; + + @Id + @Column(name = "Id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "SERVICE_NAME") + private String serviceName; + + @BusinessKey + @Column(name = "PRODUCT_FLAVOR") + private String productFlavor; + + @BusinessKey + @Column(name = "SUBSCRIPTION_SERVICE_TYPE") + private String subscriptionServiceType; + + @BusinessKey + @Column(name = "SERVICE_MODEL_UUID") + private String serviceModelUUID; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ExternalServiceToInternalService)) { + return false; + } + ExternalServiceToInternalService castOther = (ExternalServiceToInternalService) other; + return new EqualsBuilder().append(serviceName, castOther.serviceName) + .append(productFlavor, castOther.productFlavor) + .append(subscriptionServiceType, castOther.subscriptionServiceType) + .append(serviceModelUUID, castOther.serviceModelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(serviceName).append(productFlavor).append(subscriptionServiceType) + .append(serviceModelUUID).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("serviceName", serviceName) + .append("productFlavor", productFlavor).append("subscriptionServiceType", subscriptionServiceType) + .append("serviceModelUUID", serviceModelUUID).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public String getProductFlavor() { + return productFlavor; + } + + public void setProductFlavor(String productFlavor) { + this.productFlavor = productFlavor; + } + + public String getSubscriptionServiceType() { + return subscriptionServiceType; + } + + public void setSubscriptionServiceType(String subscriptionServiceType) { + this.subscriptionServiceType = subscriptionServiceType; + } + + public String getServiceModelUUID() { + return serviceModelUUID; + } + + public void setServiceModelUUID(String serviceModelUUID) { + this.serviceModelUUID = serviceModelUUID; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java index 6abe8d5110..511f7cf709 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.text.DateFormat; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -32,132 +31,130 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "heat_environment") public class HeatEnvironment implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUuid; - - @Column(name = "NAME") - private String name = null; - - @Column(name = "DESCRIPTION") - private String description = null; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String environment = null; - - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "VERSION") - private String version; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatEnvironment)) { - return false; - } - HeatEnvironment castOther = (HeatEnvironment) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getEnvironment() { - return this.environment; - } - - public void setEnvironment(String environment) { - this.environment = environment; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public Date getCreated() { - return created; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Artifact UUID=" + this.artifactUuid); - sb.append(", name="); - sb.append(name); - sb.append(", version="); - sb.append(version); - sb.append(", description="); - sb.append(this.description == null ? "null" : this.description); - sb.append(", body="); - sb.append(this.environment == null ? "null" : this.environment); - if (this.created != null) { - sb.append(",creationTimestamp="); - sb.append(DateFormat.getInstance().format(this.created)); - } - return sb.toString(); - } + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUuid; + + @Column(name = "NAME") + private String name = null; + + @Column(name = "DESCRIPTION") + private String description = null; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String environment = null; + + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "VERSION") + private String version; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatEnvironment)) { + return false; + } + HeatEnvironment castOther = (HeatEnvironment) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getEnvironment() { + return this.environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Date getCreated() { + return created; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Artifact UUID=" + this.artifactUuid); + sb.append(", name="); + sb.append(name); + sb.append(", version="); + sb.append(version); + sb.append(", description="); + sb.append(this.description == null ? "null" : this.description); + sb.append(", body="); + sb.append(this.environment == null ? "null" : this.environment); + if (this.created != null) { + sb.append(",creationTimestamp="); + sb.append(DateFormat.getInstance().format(this.created)); + } + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java index 6fe1e08f0d..3badf2ae11 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -31,127 +30,125 @@ 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; @Entity @Table(name = "heat_files") public class HeatFiles implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUuid; - - @Column(name = "DESCRIPTION") - private String description = null; + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUuid; + + @Column(name = "DESCRIPTION") + private String description = null; - @Column(name = "NAME") - private String fileName; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String fileBody; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; - - @Column(name = "VERSION") - private String version; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description) - .append("fileName", fileName).append("fileBody", fileBody).append("created", created) - .append("artifactChecksum", artifactChecksum).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatFiles)) { - return false; - } - HeatFiles castOther = (HeatFiles) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).toHashCode(); - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getFileName() { - return this.fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getFileBody() { - return this.fileBody; - } - - public void setFileBody(String fileBody) { - this.fileBody = fileBody; - } - - public Date getCreated() { - return created; - } - - public String getAsdcUuid() { - return this.artifactUuid; - } - - public void setAsdcUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } + @Column(name = "NAME") + private String fileName; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String fileBody; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; + + @Column(name = "VERSION") + private String version; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description) + .append("fileName", fileName).append("fileBody", fileBody).append("created", created) + .append("artifactChecksum", artifactChecksum).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatFiles)) { + return false; + } + HeatFiles castOther = (HeatFiles) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).toHashCode(); + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFileName() { + return this.fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileBody() { + return this.fileBody; + } + + public void setFileBody(String fileBody) { + this.fileBody = fileBody; + } + + public Date getCreated() { + return created; + } + + public String getAsdcUuid() { + return this.artifactUuid; + } + + public void setAsdcUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java index 2389793f33..82725f089d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java @@ -26,7 +26,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -39,173 +38,171 @@ 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 @Table(name = "heat_template") public class HeatTemplate implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID", length = 200) - private String artifactUuid; - - @Column(name = "NAME", length = 200) - private String templateName; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String templateBody = null; - - @Column(name = "TIMEOUT_MINUTES", length = 20) - private Integer timeoutMinutes; - - @BusinessKey - @Column(name = "VERSION") - private String version; - - @Column(name = "DESCRIPTION", length = 1200) - private String description; - - @Column(name = "ARTIFACT_CHECKSUM", length = 200) - private String artifactChecksum; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "heatTemplateArtifactUuid") - private Set<HeatTemplateParam> parameters; - - @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "heat_nested_template", joinColumns = @JoinColumn(name = "PARENT_HEAT_TEMPLATE_UUID"), inverseJoinColumns = @JoinColumn(name = "CHILD_HEAT_TEMPLATE_UUID")) - private List<HeatTemplate> childTemplates; - - public enum TemplateStatus { - PARENT, CHILD, PARENT_COMPLETE - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("templateName", templateName) - .append("templateBody", templateBody).append("timeoutMinutes", timeoutMinutes) - .append("version", version).append("description", description) - .append("artifactChecksum", artifactChecksum).append("created", created) - .append("parameters", parameters).append("childTemplates", childTemplates).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplate)) { - return false; - } - HeatTemplate castOther = (HeatTemplate) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); - } - - @LinkedResource - public List<HeatTemplate> getChildTemplates() { - if (childTemplates == null) - childTemplates = new ArrayList<>(); - return childTemplates; - } - - public void setChildTemplates(List<HeatTemplate> childTemplates) { - this.childTemplates = childTemplates; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - public String getTemplateBody() { - return templateBody; - } - - public void setTemplateBody(String templateBody) { - this.templateBody = templateBody; - } - - public Integer getTimeoutMinutes() { - return timeoutMinutes; - } - - public void setTimeoutMinutes(Integer timeout) { - this.timeoutMinutes = timeout; - } - - @LinkedResource - public Set<HeatTemplateParam> getParameters() { - if (parameters == null) - parameters = new HashSet<>(); - return parameters; - } - - public void setParameters(Set<HeatTemplateParam> parameters) { - this.parameters = parameters; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getHeatTemplate() { - return this.templateBody; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public Date getCreated() { - return created; - } + private static final long serialVersionUID = 768026109321305392L; + + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID", length = 200) + private String artifactUuid; + + @Column(name = "NAME", length = 200) + private String templateName; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String templateBody = null; + + @Column(name = "TIMEOUT_MINUTES", length = 20) + private Integer timeoutMinutes; + + @BusinessKey + @Column(name = "VERSION") + private String version; + + @Column(name = "DESCRIPTION", length = 1200) + private String description; + + @Column(name = "ARTIFACT_CHECKSUM", length = 200) + private String artifactChecksum; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "heatTemplateArtifactUuid") + private Set<HeatTemplateParam> parameters; + + @OneToMany(cascade = CascadeType.ALL) + @JoinTable(name = "heat_nested_template", joinColumns = @JoinColumn(name = "PARENT_HEAT_TEMPLATE_UUID"), + inverseJoinColumns = @JoinColumn(name = "CHILD_HEAT_TEMPLATE_UUID")) + private List<HeatTemplate> childTemplates; + + public enum TemplateStatus { + PARENT, CHILD, PARENT_COMPLETE + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("templateName", templateName) + .append("templateBody", templateBody).append("timeoutMinutes", timeoutMinutes) + .append("version", version).append("description", description) + .append("artifactChecksum", artifactChecksum).append("created", created) + .append("parameters", parameters).append("childTemplates", childTemplates).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplate)) { + return false; + } + HeatTemplate castOther = (HeatTemplate) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); + } + + @LinkedResource + public List<HeatTemplate> getChildTemplates() { + if (childTemplates == null) + childTemplates = new ArrayList<>(); + return childTemplates; + } + + public void setChildTemplates(List<HeatTemplate> childTemplates) { + this.childTemplates = childTemplates; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getTemplateBody() { + return templateBody; + } + + public void setTemplateBody(String templateBody) { + this.templateBody = templateBody; + } + + public Integer getTimeoutMinutes() { + return timeoutMinutes; + } + + public void setTimeoutMinutes(Integer timeout) { + this.timeoutMinutes = timeout; + } + + @LinkedResource + public Set<HeatTemplateParam> getParameters() { + if (parameters == null) + parameters = new HashSet<>(); + return parameters; + } + + public void setParameters(Set<HeatTemplateParam> parameters) { + this.parameters = parameters; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getHeatTemplate() { + return this.templateBody; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java index cdbe7aee7a..6abf695797 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java @@ -21,17 +21,14 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; - 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; @IdClass(HeatTemplateParamId.class) @@ -39,86 +36,86 @@ import com.openpojo.business.annotation.BusinessKey; @Table(name = "heat_template_params") public class HeatTemplateParam implements Serializable { - @BusinessKey - @Id - @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private String heatTemplateArtifactUuid; - - @BusinessKey - @Id - @Column(name = "PARAM_NAME") - private String paramName; - - @Column(name = "IS_REQUIRED") - private Boolean required; - - @Column(name = "PARAM_TYPE") - private String paramType; - - @Column(name = "PARAM_ALIAS") - private String paramAlias; - - public static final long serialVersionUID = -1322322139926390329L; - - @Override - public String toString() { - return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) - .append("paramName", paramName).append("required", required).append("paramType", paramType) - .append("paramAlias", paramAlias).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplateParam)) { - return false; - } - HeatTemplateParam castOther = (HeatTemplateParam) other; - return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) - .append(paramName, castOther.paramName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); - } - - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } - - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } - - public String getParamName() { - return paramName; - } - - public void setParamName(String paramName) { - this.paramName = paramName; - } - - public Boolean isRequired() { - return required; - } - - public void setRequired(Boolean required) { - this.required = required; - } - - public String getParamAlias() { - return paramAlias; - } - - public void setParamAlias(String paramAlias) { - this.paramAlias = paramAlias; - } - - public String getParamType() { - return paramType; - } - - public void setParamType(String paramType) { - this.paramType = paramType; - } + @BusinessKey + @Id + @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private String heatTemplateArtifactUuid; + + @BusinessKey + @Id + @Column(name = "PARAM_NAME") + private String paramName; + + @Column(name = "IS_REQUIRED") + private Boolean required; + + @Column(name = "PARAM_TYPE") + private String paramType; + + @Column(name = "PARAM_ALIAS") + private String paramAlias; + + public static final long serialVersionUID = -1322322139926390329L; + + @Override + public String toString() { + return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) + .append("paramName", paramName).append("required", required).append("paramType", paramType) + .append("paramAlias", paramAlias).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplateParam)) { + return false; + } + HeatTemplateParam castOther = (HeatTemplateParam) other; + return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) + .append(paramName, castOther.paramName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); + } + + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } + + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } + + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public Boolean isRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public String getParamAlias() { + return paramAlias; + } + + public void setParamAlias(String paramAlias) { + this.paramAlias = paramAlias; + } + + public String getParamType() { + return paramType; + } + + public void setParamType(String paramType) { + this.paramType = paramType; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java index 61c199c43f..6e494bf95f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java @@ -21,55 +21,53 @@ 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 HeatTemplateParamId implements Serializable { - @BusinessKey - private String heatTemplateArtifactUuid; - @BusinessKey - private String paramName; + @BusinessKey + private String heatTemplateArtifactUuid; + @BusinessKey + private String paramName; - public static final long serialVersionUID = -1322322139926390329L; + public static final long serialVersionUID = -1322322139926390329L; - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplateParamId)) { - return false; - } - HeatTemplateParamId castOther = (HeatTemplateParamId) other; - return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) - .append(paramName, castOther.paramName).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplateParamId)) { + return false; + } + HeatTemplateParamId castOther = (HeatTemplateParamId) other; + return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) + .append(paramName, castOther.paramName).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); + } - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } - public String getParamName() { - return this.paramName; - } + public String getParamName() { + return this.paramName; + } - public void setParamName(String paramName) { - this.paramName = paramName; - } + public void setParamName(String paramName) { + this.paramName = paramName; + } - @Override - public String toString() { - return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) - .append("paramName", paramName).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) + .append("paramName", paramName).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java index ef474be159..75871afe83 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java @@ -26,7 +26,6 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import uk.co.blackpepper.bowman.annotation.RemoteResource; import uk.co.blackpepper.bowman.annotation.ResourceId; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -35,8 +34,8 @@ import javax.persistence.Transient; import java.net.URI; /** - * EntityBean class for a HomingInstance. This bean represents a homing instance - * of a service, populated on successful homing + * EntityBean class for a HomingInstance. This bean represents a homing instance of a service, populated on successful + * homing * */ @RemoteResource("/homingInstance") @@ -69,11 +68,11 @@ public class HomingInstance { @Transient private URI uri; - public HomingInstance () { + public HomingInstance() { } - public HomingInstance (HomingInstance homingInstance) { + public HomingInstance(HomingInstance homingInstance) { this.serviceInstanceId = homingInstance.getServiceInstanceId(); this.cloudRegionId = homingInstance.getCloudRegionId(); this.cloudOwner = homingInstance.getCloudOwner(); @@ -105,7 +104,7 @@ public class HomingInstance { return this.cloudOwner; } - public void setCloudOwner (String cloudOwner) { + public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } @@ -131,8 +130,7 @@ public class HomingInstance { @Override public String toString() { return new ToStringBuilder(this).append("serviceInstanceId", serviceInstanceId) - .append("cloudRegionId", cloudRegionId) - .append("cloudOwner", cloudOwner) + .append("cloudRegionId", cloudRegionId).append("cloudOwner", cloudOwner) .append("oofDirectives", oofDirectives).toString(); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java index 43d4acffcc..d226ffee13 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; @@ -42,13 +41,10 @@ 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 @@ -57,177 +53,177 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "instance_group") public class InstanceGroup implements Serializable { - /** - * - */ - private static final long serialVersionUID = -263859017727376578L; - - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "ROLE") - private String role; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Enumerated(EnumType.STRING) - @Column(name = "INSTANCE_GROUP_TYPE") - private InstanceGroupType type; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CR_MODEL_UUID") - private CollectionResource collectionResource; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("role", role).append("toscaNodeType", toscaNodeType).append("type", type) - .append("created", created).append("collectionResource", collectionResource) - .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations) - .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof InstanceGroup)) { - return false; - } - InstanceGroup castOther = (InstanceGroup) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelUUID() { - return modelUUID; - } - - public Date getCreated() { - return created; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelName() { - return modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public InstanceGroupType getType() { - return type; - } - - public void setType(InstanceGroupType type) { - this.type = type; - } - - @LinkedResource - public CollectionResource getCollectionResource() { - return collectionResource; - } - - public void setCollectionResource(CollectionResource collectionResource) { - this.collectionResource = collectionResource; - } - - @LinkedResource - public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { - return collectionInstanceGroupCustomizations; - } - - public void setCollectionInstanceGroupCustomizations( - List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { - this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; - } - - @LinkedResource - public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() { - return vnfcInstanceGroupCustomizations; - } - - public void setVnfcInstanceGroupCustomizations( - List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { - this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; - } - - @LinkedResource - public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomizations() { - return collectionNetworkResourceCustomizations; - } - - public void setCollectionNetworkResourceCustomizations( - List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations) { - this.collectionNetworkResourceCustomizations = collectionNetworkResourceCustomizations; - } -}
\ No newline at end of file + /** + * + */ + private static final long serialVersionUID = -263859017727376578L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "ROLE") + private String role; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Enumerated(EnumType.STRING) + @Column(name = "INSTANCE_GROUP_TYPE") + private InstanceGroupType type; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CR_MODEL_UUID") + private CollectionResource collectionResource; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("role", role).append("toscaNodeType", toscaNodeType).append("type", type) + .append("created", created).append("collectionResource", collectionResource) + .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations) + .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof InstanceGroup)) { + return false; + } + InstanceGroup castOther = (InstanceGroup) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelUUID() { + return modelUUID; + } + + public Date getCreated() { + return created; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelName() { + return modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public InstanceGroupType getType() { + return type; + } + + public void setType(InstanceGroupType type) { + this.type = type; + } + + @LinkedResource + public CollectionResource getCollectionResource() { + return collectionResource; + } + + public void setCollectionResource(CollectionResource collectionResource) { + this.collectionResource = collectionResource; + } + + @LinkedResource + public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { + return collectionInstanceGroupCustomizations; + } + + public void setCollectionInstanceGroupCustomizations( + List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { + this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; + } + + @LinkedResource + public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() { + return vnfcInstanceGroupCustomizations; + } + + public void setVnfcInstanceGroupCustomizations( + List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { + this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; + } + + @LinkedResource + public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomizations() { + return collectionNetworkResourceCustomizations; + } + + public void setCollectionNetworkResourceCustomizations( + List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations) { + this.collectionNetworkResourceCustomizations = collectionNetworkResourceCustomizations; + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java index e67078b104..764d3c4a53 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum InstanceGroupType { - L3_NETWORK, VNFC; + L3_NETWORK, VNFC; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java index 9c5c23ef0e..0592e8f058 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Map; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -36,194 +35,193 @@ import javax.persistence.OneToMany; 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; + @Entity @Table(name = "model") public class Model implements Serializable { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - @Column(name = "MODEL_CUSTOMIZATION_ID", length = 40) - private String modelCustomizationId = null; - @Column(name = "MODEL_CUSTOMIZATION_NAME", length = 40) - private String modelCustomizationName = null; - @Column(name = "MODEL_INVARIANT_ID", length = 40) - private String modelInvariantId = null; - @Column(name = "MODEL_NAME", length = 40) - private String modelName = null; - @BusinessKey - @Column(name = "MODEL_TYPE", length = 20) - private String modelType = null; - @Column(name = "MODEL_VERSION", length = 20) - private String modelVersion = null; - @BusinessKey - @Column(name = "MODEL_VERSION_ID", length = 40) - private String modelVersionId = null; - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created = null; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy="modelId") - @MapKey(name = "action") - private Map<String,ModelRecipe> recipes; - - /** - * @return the id - */ - public Integer getId() { - return id; - } - - /** - * @return the modelCustomizationId - */ - public String getModelCustomizationId() { - return modelCustomizationId; - } - - /** - * @param modelCustomizationId the modelCustomizationId to set - */ - public void setModelCustomizationId(String modelCustomizationId) { - this.modelCustomizationId = modelCustomizationId; - } - - /** - * @return the modelCustomizationName - */ - public String getModelCustomizationName() { - return modelCustomizationName; - } - - /** - * @param modelCustomizationName the modelCustomizationName to set - */ - public void setModelCustomizationName(String modelCustomizationName) { - this.modelCustomizationName = modelCustomizationName; - } - - /** - * @return the modelInvariantId - */ - public String getModelInvariantId() { - return modelInvariantId; - } - - /** - * @param modelInvariantId the modelInvariantId to set - */ - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - /** - * @return the modelName - */ - public String getModelName() { - return modelName; - } - - /** - * @param modelName the modelName to set - */ - public void setModelName(String modelName) { - this.modelName = modelName; - } - - /** - * @return the modelType - */ - public String getModelType() { - return modelType; - } - - /** - * @param modelType the modelType to set - */ - public void setModelType(String modelType) { - this.modelType = modelType; - } - - /** - * @return the modelVersion - */ - public String getModelVersion() { - return modelVersion; - } - - /** - * @param modelVersion the modelVersion to set - */ - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - /** - * @return the modelVersionId - */ - public String getModelVersionId() { - return modelVersionId; - } - - /** - * @param modelVersionId the modelVersionId to set - */ - public void setModelVersionId(String modelVersionId) { - this.modelVersionId = modelVersionId; - } - - /** - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * @return the recipes - */ - public Map<String, ModelRecipe> getRecipes() { - return recipes; - } - - /** - * @param recipes the recipes to set - */ - public void setRecipes(Map<String, ModelRecipe> recipes) { - this.recipes = recipes; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof Model)) { - return false; - } - Model castOther = (Model) other; - return new EqualsBuilder().append(getModelType(), castOther.getModelType()) - .append(getModelVersionId(), castOther.getModelVersionId()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getModelType()).append(getModelVersionId()).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", getId()).append("modelCustomizationId", getModelCustomizationId()) - .append("modelCustomizationName", getModelCustomizationName()) - .append("modelInvariantId", getModelInvariantId()).append("modelName", getModelName()) - .append("modelType", getModelType()).append("modelVersion", getModelVersion()) - .append("modelVersionId", getModelVersionId()).append("created", getCreated()) - .append("recipes", getRecipes()).toString(); - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + @Column(name = "MODEL_CUSTOMIZATION_ID", length = 40) + private String modelCustomizationId = null; + @Column(name = "MODEL_CUSTOMIZATION_NAME", length = 40) + private String modelCustomizationName = null; + @Column(name = "MODEL_INVARIANT_ID", length = 40) + private String modelInvariantId = null; + @Column(name = "MODEL_NAME", length = 40) + private String modelName = null; + @BusinessKey + @Column(name = "MODEL_TYPE", length = 20) + private String modelType = null; + @Column(name = "MODEL_VERSION", length = 20) + private String modelVersion = null; + @BusinessKey + @Column(name = "MODEL_VERSION_ID", length = 40) + private String modelVersionId = null; + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created = null; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modelId") + @MapKey(name = "action") + private Map<String, ModelRecipe> recipes; + + /** + * @return the id + */ + public Integer getId() { + return id; + } + + /** + * @return the modelCustomizationId + */ + public String getModelCustomizationId() { + return modelCustomizationId; + } + + /** + * @param modelCustomizationId the modelCustomizationId to set + */ + public void setModelCustomizationId(String modelCustomizationId) { + this.modelCustomizationId = modelCustomizationId; + } + + /** + * @return the modelCustomizationName + */ + public String getModelCustomizationName() { + return modelCustomizationName; + } + + /** + * @param modelCustomizationName the modelCustomizationName to set + */ + public void setModelCustomizationName(String modelCustomizationName) { + this.modelCustomizationName = modelCustomizationName; + } + + /** + * @return the modelInvariantId + */ + public String getModelInvariantId() { + return modelInvariantId; + } + + /** + * @param modelInvariantId the modelInvariantId to set + */ + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + /** + * @return the modelName + */ + public String getModelName() { + return modelName; + } + + /** + * @param modelName the modelName to set + */ + public void setModelName(String modelName) { + this.modelName = modelName; + } + + /** + * @return the modelType + */ + public String getModelType() { + return modelType; + } + + /** + * @param modelType the modelType to set + */ + public void setModelType(String modelType) { + this.modelType = modelType; + } + + /** + * @return the modelVersion + */ + public String getModelVersion() { + return modelVersion; + } + + /** + * @param modelVersion the modelVersion to set + */ + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + /** + * @return the modelVersionId + */ + public String getModelVersionId() { + return modelVersionId; + } + + /** + * @param modelVersionId the modelVersionId to set + */ + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + /** + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * @return the recipes + */ + public Map<String, ModelRecipe> getRecipes() { + return recipes; + } + + /** + * @param recipes the recipes to set + */ + public void setRecipes(Map<String, ModelRecipe> recipes) { + this.recipes = recipes; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof Model)) { + return false; + } + Model castOther = (Model) other; + return new EqualsBuilder().append(getModelType(), castOther.getModelType()) + .append(getModelVersionId(), castOther.getModelVersionId()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getModelType()).append(getModelVersionId()).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", getId()).append("modelCustomizationId", getModelCustomizationId()) + .append("modelCustomizationName", getModelCustomizationName()) + .append("modelInvariantId", getModelInvariantId()).append("modelName", getModelName()) + .append("modelType", getModelType()).append("modelVersion", getModelVersion()) + .append("modelVersionId", getModelVersionId()).append("created", getCreated()) + .append("recipes", getRecipes()).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java index 3d7cb68172..3f89e9db74 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -31,176 +30,174 @@ import javax.persistence.Id; 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; @Entity @Table(name = "model_recipe") public class ModelRecipe implements Serializable { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - @BusinessKey - @Column(name = "MODEL_ID", nullable = false) - private Integer modelId; - @BusinessKey - @Column(name = "ACTION", length = 50) - private String action = null; - @Column(name = "SCHEMA_VERSION", length = 20) - private String schemaVersion = null; - @Column(name = "DESCRIPTION", length = 1200) - private String description = null; - @Column(name = "ORCHESTRATION_URI", length = 256) - private String orchestrationUri = null; - @Column(name = "MODEL_PARAM_XSD", length = 2048) - private String modelParamXSD = null; - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created = null; - - /** - * @return the id - */ - public Integer getId() { - return id; - } - - /** - * @return the modelId - */ - public Integer getModelId() { - return modelId; - } - - /** - * @param modelId the modelId to set - */ - public void setModelId(Integer modelId) { - this.modelId = modelId; - } - - /** - * @return the action - */ - public String getAction() { - return action; - } - - /** - * @param action the action to set - */ - public void setAction(String action) { - this.action = action; - } - - /** - * @return the versionStr - */ - public String getSchemaVersion() { - return schemaVersion; - } - - /** - * @param schemaVersion the versionStr to set - */ - public void setSchemaVersion(String schemaVersion) { - this.schemaVersion = schemaVersion; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @return the orchestrationUri - */ - public String getOrchestrationUri() { - return orchestrationUri; - } - - /** - * @param orchestrationUri the orchestrationUri to set - */ - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - /** - * @return the modelParamXSD - */ - public String getModelParamXSD() { - return modelParamXSD; - } - - /** - * @param modelParamXSD the modelParamXSD to set - */ - public void setModelParamXSD(String modelParamXSD) { - this.modelParamXSD = modelParamXSD; - } - - /** - * @return the recipeTimeout - */ - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - /** - * @param recipeTimeout the recipeTimeout to set - */ - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - /** - * @return the created - */ - public Date getCreated() { - return created; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ModelRecipe)) { - return false; - } - ModelRecipe castOther = (ModelRecipe) other; - return new EqualsBuilder().append(getModelId(), castOther.getModelId()) - .append(getAction(), castOther.getAction()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId()) - .append("action", getAction()).append("schemaVersion", getSchemaVersion()) - .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) - .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout()) - .append("created", getCreated()).toString(); - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + @BusinessKey + @Column(name = "MODEL_ID", nullable = false) + private Integer modelId; + @BusinessKey + @Column(name = "ACTION", length = 50) + private String action = null; + @Column(name = "SCHEMA_VERSION", length = 20) + private String schemaVersion = null; + @Column(name = "DESCRIPTION", length = 1200) + private String description = null; + @Column(name = "ORCHESTRATION_URI", length = 256) + private String orchestrationUri = null; + @Column(name = "MODEL_PARAM_XSD", length = 2048) + private String modelParamXSD = null; + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created = null; + + /** + * @return the id + */ + public Integer getId() { + return id; + } + + /** + * @return the modelId + */ + public Integer getModelId() { + return modelId; + } + + /** + * @param modelId the modelId to set + */ + public void setModelId(Integer modelId) { + this.modelId = modelId; + } + + /** + * @return the action + */ + public String getAction() { + return action; + } + + /** + * @param action the action to set + */ + public void setAction(String action) { + this.action = action; + } + + /** + * @return the versionStr + */ + public String getSchemaVersion() { + return schemaVersion; + } + + /** + * @param schemaVersion the versionStr to set + */ + public void setSchemaVersion(String schemaVersion) { + this.schemaVersion = schemaVersion; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the orchestrationUri + */ + public String getOrchestrationUri() { + return orchestrationUri; + } + + /** + * @param orchestrationUri the orchestrationUri to set + */ + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + /** + * @return the modelParamXSD + */ + public String getModelParamXSD() { + return modelParamXSD; + } + + /** + * @param modelParamXSD the modelParamXSD to set + */ + public void setModelParamXSD(String modelParamXSD) { + this.modelParamXSD = modelParamXSD; + } + + /** + * @return the recipeTimeout + */ + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + /** + * @param recipeTimeout the recipeTimeout to set + */ + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + /** + * @return the created + */ + public Date getCreated() { + return created; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ModelRecipe)) { + return false; + } + ModelRecipe castOther = (ModelRecipe) other; + return new EqualsBuilder().append(getModelId(), castOther.getModelId()) + .append(getAction(), castOther.getAction()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId()) + .append("action", getAction()).append("schemaVersion", getSchemaVersion()) + .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) + .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout()) + .append("created", getCreated()).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java index a1b51f9a6b..bb9079be23 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java @@ -21,33 +21,31 @@ package org.onap.so.db.catalog.beans; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.OneToMany; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @DiscriminatorValue(value = "NetworkCollection") public class NetworkCollectionResourceCustomization extends CollectionResourceCustomization { - /** - * - */ - private static final long serialVersionUID = -4571173204548832466L; + /** + * + */ + private static final long serialVersionUID = -4571173204548832466L; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "networkResourceCustomization") - private Set<CollectionNetworkResourceCustomization> networkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "networkResourceCustomization") + private Set<CollectionNetworkResourceCustomization> networkResourceCustomization; - @LinkedResource - public Set<CollectionNetworkResourceCustomization> getNetworkResourceCustomization() { - return networkResourceCustomization; - } + @LinkedResource + public Set<CollectionNetworkResourceCustomization> getNetworkResourceCustomization() { + return networkResourceCustomization; + } - public void setNetworkResourceCustomization( - Set<CollectionNetworkResourceCustomization> networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } + public void setNetworkResourceCustomization( + Set<CollectionNetworkResourceCustomization> networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java index edda4b8122..24782efcf0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java @@ -27,8 +27,8 @@ import javax.persistence.Entity; @DiscriminatorValue(value = "L3_NETWORK") public class NetworkInstanceGroup extends InstanceGroup { - /** - * - */ - private static final long serialVersionUID = 1934855643166769237L; + /** + * + */ + private static final long serialVersionUID = 1934855643166769237L; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java index 51bcd54ae1..7bdbe9cdba 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -30,156 +29,154 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "network_recipe") public class NetworkRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "ACTION") - protected String action; - - @Column(name = "DESCRIPTION") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - protected String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "VERSION_STR") - private String versionStr; + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "ACTION") + protected String action; + + @Column(name = "DESCRIPTION") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + protected String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "VERSION_STR") + private String versionStr; - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; - @BusinessKey - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "NETWORK_PARAM_XSD") - private String paramXsd; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkRecipe)) { - return false; - } - NetworkRecipe castOther = (NetworkRecipe) other; - return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) - .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName) - .toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public Date getCreated() { - return created; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(super.toString()); - sb.append(",modelName=" + modelName); - sb.append(",networkParamXSD=" + paramXsd); - return sb.toString(); - } - - public String getVersionStr() { - return versionStr; - } - - public void setVersionStr(String versionStr) { - this.versionStr = versionStr; - } + @BusinessKey + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "NETWORK_PARAM_XSD") + private String paramXsd; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkRecipe)) { + return false; + } + NetworkRecipe castOther = (NetworkRecipe) other; + return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) + .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName) + .toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public Date getCreated() { + return created; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.append(",modelName=" + modelName); + sb.append(",networkParamXSD=" + paramXsd); + return sb.toString(); + } + + public String getVersionStr() { + return versionStr; + } + + public void setVersionStr(String versionStr) { + this.versionStr = versionStr; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java index c31cd61ce0..6876200754 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java @@ -25,7 +25,6 @@ import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,268 +37,263 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "network_resource") public class NetworkResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; - @Column(name = "ORCHESTRATION_MODE") - private String orchestrationMode = null; + @Column(name = "ORCHESTRATION_MODE") + private String orchestrationMode = null; - @Column(name = "DESCRIPTION") - private String description = null; + @Column(name = "DESCRIPTION") + private String description = null; - @Column(name = "NEUTRON_NETWORK_TYPE") - private String neutronNetworkType = null; + @Column(name = "NEUTRON_NETWORK_TYPE") + private String neutronNetworkType = null; - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin = null; + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin = null; - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax = null; + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax = null; - @Column(name = "MODEL_NAME") - private String modelName; + @Column(name = "MODEL_NAME") + private String modelName; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @Column(name = "MODEL_VERSION") - private String modelVersion; + @Column(name = "MODEL_VERSION") + private String modelVersion; - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "RESOURCE_CATEGORY") - private String category; + @Column(name = "RESOURCE_CATEGORY") + private String category; - @Column(name = "RESOURCE_SUB_CATEGORY") - private String subCategory; + @Column(name = "RESOURCE_SUB_CATEGORY") + private String subCategory; - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") - private List<NetworkResourceCustomization> networkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") + private List<NetworkResourceCustomization> networkResourceCustomization; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") - private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") + private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization; - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate heatTemplate; + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate heatTemplate; - @PrePersist - protected void onCreate() { - this.created = new Date(); - } + @PrePersist + protected void onCreate() { + this.created = new Date(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkResource)) { - return false; - } - NetworkResource castOther = (NetworkResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkResource)) { + return false; + } + NetworkResource castOther = (NetworkResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } - @LinkedResource - public List<NetworkResourceCustomization> getNetworkResourceCustomization() { - return networkResourceCustomization; - } + @LinkedResource + public List<NetworkResourceCustomization> getNetworkResourceCustomization() { + return networkResourceCustomization; + } - public void addNetworkResourceCustomization(NetworkResourceCustomization networkResourceCustomization) { - if (this.networkResourceCustomization == null) - this.networkResourceCustomization = new ArrayList<>(); + public void addNetworkResourceCustomization(NetworkResourceCustomization networkResourceCustomization) { + if (this.networkResourceCustomization == null) + this.networkResourceCustomization = new ArrayList<>(); - this.networkResourceCustomization.add(networkResourceCustomization); - } + this.networkResourceCustomization.add(networkResourceCustomization); + } - public void setNetworkResourceCustomization(List<NetworkResourceCustomization> networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } + public void setNetworkResourceCustomization(List<NetworkResourceCustomization> networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } - @LinkedResource - public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomization() { - return collectionNetworkResourceCustomization; - } + @LinkedResource + public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomization() { + return collectionNetworkResourceCustomization; + } - public void setCollectionNetworkResourceCustomization( - List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization) { - this.collectionNetworkResourceCustomization = collectionNetworkResourceCustomization; - } - - public String getOrchestrationMode() { - return orchestrationMode; - } - - public void setOrchestrationMode(String orchestrationMode) { - this.orchestrationMode = orchestrationMode; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getNeutronNetworkType() { - return neutronNetworkType; - } - - public void setNeutronNetworkType(String neutronNetworkType) { - this.neutronNetworkType = neutronNetworkType; - } - - public Date getCreated() { - return created; - } - - public String getAicVersionMin() { - return aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - /** - * @return Returns the category. - */ - public String getCategory() { - return category; - } - - /** - * @param category - * The category to set. - */ - public void setCategory(String category) { - this.category = category; - } - - /** - * @return Returns the subCategory. - */ - public String getSubCategory() { - return subCategory; - } - - /** - * @param subCategory - * The subCategory to set. - */ - public void setSubCategory(String subCategory) { - this.subCategory = subCategory; - } - - @LinkedResource - public HeatTemplate getHeatTemplate() { - return heatTemplate; - } - - public void setHeatTemplate(HeatTemplate heatTemplate) { - this.heatTemplate = heatTemplate; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("NETWORK Resource:"); - sb.append("modelVersion="); - sb.append(modelVersion); - sb.append(",mode="); - sb.append(orchestrationMode); - sb.append(",neutronType="); - sb.append(neutronNetworkType); - sb.append(",aicVersionMin="); - sb.append(aicVersionMin); - sb.append(",aicVersionMax="); - sb.append(aicVersionMax); - sb.append(",modelName="); - sb.append(modelName); - sb.append(",modelInvariantUUID="); - sb.append(modelInvariantUUID); - sb.append(",toscaNodeType="); - sb.append(toscaNodeType); - sb.append(",modelUUID="); - sb.append(modelUUID); - - if (created != null) { - sb.append(",created="); - sb.append(DateFormat.getInstance().format(created)); - } - - return sb.toString(); - } + public void setCollectionNetworkResourceCustomization( + List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization) { + this.collectionNetworkResourceCustomization = collectionNetworkResourceCustomization; + } + + public String getOrchestrationMode() { + return orchestrationMode; + } + + public void setOrchestrationMode(String orchestrationMode) { + this.orchestrationMode = orchestrationMode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNeutronNetworkType() { + return neutronNetworkType; + } + + public void setNeutronNetworkType(String neutronNetworkType) { + this.neutronNetworkType = neutronNetworkType; + } + + public Date getCreated() { + return created; + } + + public String getAicVersionMin() { + return aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + /** + * @return Returns the category. + */ + public String getCategory() { + return category; + } + + /** + * @param category The category to set. + */ + public void setCategory(String category) { + this.category = category; + } + + /** + * @return Returns the subCategory. + */ + public String getSubCategory() { + return subCategory; + } + + /** + * @param subCategory The subCategory to set. + */ + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + @LinkedResource + public HeatTemplate getHeatTemplate() { + return heatTemplate; + } + + public void setHeatTemplate(HeatTemplate heatTemplate) { + this.heatTemplate = heatTemplate; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("NETWORK Resource:"); + sb.append("modelVersion="); + sb.append(modelVersion); + sb.append(",mode="); + sb.append(orchestrationMode); + sb.append(",neutronType="); + sb.append(neutronNetworkType); + sb.append(",aicVersionMin="); + sb.append(aicVersionMin); + sb.append(",aicVersionMax="); + sb.append(aicVersionMax); + sb.append(",modelName="); + sb.append(modelName); + sb.append(",modelInvariantUUID="); + sb.append(modelInvariantUUID); + sb.append(",toscaNodeType="); + sb.append(toscaNodeType); + sb.append(",modelUUID="); + sb.append(modelUUID); + + if (created != null) { + sb.append(",created="); + sb.append(DateFormat.getInstance().format(created)); + } + + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java index 1e3b6fc220..9287fbcf84 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java @@ -22,7 +22,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; @@ -34,149 +33,146 @@ 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 @Table(name = "network_resource_customization") public class NetworkResourceCustomization implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("networkTechnology", networkTechnology).append("networkType", networkType) - .append("networkScope", networkScope).append("networkRole", networkRole) - .append("networkResource", networkResource).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkResourceCustomization)) { - return false; - } - NetworkResourceCustomization castOther = (NetworkResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public NetworkResourceCustomization() { - super(); - } - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID = null; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "NETWORK_TECHNOLOGY") - private String networkTechnology; - - @Column(name = "NETWORK_TYPE") - private String networkType = null; - - @Column(name = "NETWORK_SCOPE") - private String networkScope; - - @Column(name = "NETWORK_ROLE") - private String networkRole; - - @Column(name = "RESOURCE_INPUT") - private String resourceInput; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") - private NetworkResource networkResource = null; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public NetworkResource getNetworkResource() { - return this.networkResource; - } - - public void setNetworkResource(NetworkResource networkResource) { - this.networkResource = networkResource; - } - - public String getNetworkType() { - return this.networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public Date getCreated() { - return this.created; - } - - public String getNetworkTechnology() { - return this.networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public String getNetworkScope() { - return this.networkScope; - } - - public void setNetworkScope(String networkScope) { - this.networkScope = networkScope; - } + public static final long serialVersionUID = -1322322139926390329L; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("networkTechnology", networkTechnology).append("networkType", networkType) + .append("networkScope", networkScope).append("networkRole", networkRole) + .append("networkResource", networkResource).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkResourceCustomization)) { + return false; + } + NetworkResourceCustomization castOther = (NetworkResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public NetworkResourceCustomization() { + super(); + } + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID = null; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "NETWORK_TECHNOLOGY") + private String networkTechnology; + + @Column(name = "NETWORK_TYPE") + private String networkType = null; + + @Column(name = "NETWORK_SCOPE") + private String networkScope; + + @Column(name = "NETWORK_ROLE") + private String networkRole; + + @Column(name = "RESOURCE_INPUT") + private String resourceInput; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") + private NetworkResource networkResource = null; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public NetworkResource getNetworkResource() { + return this.networkResource; + } + + public void setNetworkResource(NetworkResource networkResource) { + this.networkResource = networkResource; + } + + public String getNetworkType() { + return this.networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public Date getCreated() { + return this.created; + } + + public String getNetworkTechnology() { + return this.networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public String getNetworkScope() { + return this.networkScope; + } + + public void setNetworkScope(String networkScope) { + this.networkScope = networkScope; + } - public void setNetworkRole(String networkRole) { - this.networkRole = networkRole; - } + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } - public String getNetworkRole() { - return this.networkRole; - } + public String getNetworkRole() { + return this.networkRole; + } - public String getResourceInput() { - return resourceInput; - } + public String getResourceInput() { + return resourceInput; + } - public void setResourceInput(String resourceInput) { - this.resourceInput = resourceInput; - } + public void setResourceInput(String resourceInput) { + this.resourceInput = resourceInput; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java index 1fd254f254..cf8644eedc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java @@ -20,28 +20,20 @@ package org.onap.so.db.catalog.beans; -//TODO find this file a new location? +// TODO find this file a new location? public enum OrchestrationAction { - ASSIGN("Assign"), - UNASSIGN("Unassign"), - ACTIVATE("Activate"), - DEACTIVATE("Deactivate"), - CHANGE_MODEL("ChangeModel"), - CREATE("Create"), - DELETE("Delete"), - UPDATE("Update"), - ADD_MEMBERS("AddMembers"), - REMOVE_MEMBERS("RemoveMembers"), - CUSTOM("Custom"); - - private final String name; - - private OrchestrationAction(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } + ASSIGN("Assign"), UNASSIGN("Unassign"), ACTIVATE("Activate"), DEACTIVATE("Deactivate"), CHANGE_MODEL( + "ChangeModel"), CREATE("Create"), DELETE("Delete"), UPDATE( + "Update"), ADD_MEMBERS("AddMembers"), REMOVE_MEMBERS("RemoveMembers"), CUSTOM("Custom"); + + private final String name; + + private OrchestrationAction(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java index 0fa07cfe0f..e608bfed21 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java @@ -21,41 +21,37 @@ package org.onap.so.db.catalog.beans; public enum OrchestrationStatus { - ACTIVE("Active", "active"), - ASSIGNED("Assigned", "assigned"), - CREATED("Created", "created"), - INVENTORIED("Inventoried", "inventoried"), - PENDING("Pending", "pending"), - PENDING_ACTIVATION("PendingActivation", "pending.?activation"), - PENDING_CREATE("PendingCreate", "pending.?create"), - PENDING_DELETE("PendingDelete", "pending.?delete"), - PRECREATED("PreCreated", "pre.?created"), - CONFIGASSIGNED("ConfigAssigned", "config.?assigned"), - CONFIGURE("Configure" , "configure"), - CONFIGURED("Configured" , "configured"); + ACTIVE("Active", "active"), ASSIGNED("Assigned", "assigned"), CREATED("Created", "created"), INVENTORIED( + "Inventoried", "inventoried"), PENDING("Pending", "pending"), PENDING_ACTIVATION("PendingActivation", + "pending.?activation"), PENDING_CREATE("PendingCreate", "pending.?create"), PENDING_DELETE( + "PendingDelete", "pending.?delete"), PRECREATED("PreCreated", + "pre.?created"), CONFIGASSIGNED("ConfigAssigned", "config.?assigned"), CONFIGURE( + "Configure", "configure"), CONFIGURED("Configured", "configured"); - private final String name; - private final String fuzzyMatcher; - private OrchestrationStatus(String name, String fuzzyMatcher) { - this.name = name; - this.fuzzyMatcher = fuzzyMatcher; - } + private final String name; + private final String fuzzyMatcher; - @Override - public String toString() { - return name; - } - /** - * case insensitive regular expression match to enum value - * - * @param status - * @return - */ - public boolean fuzzyMap(String status) { - if (status != null) { - return status.matches("(?i)" + this.fuzzyMatcher); - } else { - return false; - } - } + private OrchestrationStatus(String name, String fuzzyMatcher) { + this.name = name; + this.fuzzyMatcher = fuzzyMatcher; + } + + @Override + public String toString() { + return name; + } + + /** + * case insensitive regular expression match to enum value + * + * @param status + * @return + */ + public boolean fuzzyMap(String status) { + if (status != null) { + return status.matches("(?i)" + this.fuzzyMatcher); + } else { + return false; + } + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java index 245fcdcf92..fd3f387e3f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -30,105 +29,103 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; - 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; @Entity @Table(name = "orchestration_status_state_transition_directive") public class OrchestrationStatusStateTransitionDirective implements Serializable { - private static final long serialVersionUID = -4626396955833442376L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Enumerated(EnumType.STRING) - @Column(name = "RESOURCE_TYPE") - @BusinessKey - private ResourceType resourceType; - - @Enumerated(EnumType.STRING) - @Column(name = "ORCHESTRATION_STATUS") - @BusinessKey - private OrchestrationStatus orchestrationStatus; - - @Enumerated(EnumType.STRING) - @Column(name = "TARGET_ACTION") - @BusinessKey - private OrchestrationAction targetAction; - - @Enumerated(EnumType.STRING) - @Column(name = "FLOW_DIRECTIVE") - @BusinessKey - private OrchestrationStatusValidationDirective flowDirective; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType) - .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction) - .append("flowDirective", flowDirective).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - - public OrchestrationStatus getOrchestrationStatus() { - return orchestrationStatus; - } - - public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { - this.orchestrationStatus = orchestrationStatus; - } - - public OrchestrationAction getTargetAction() { - return targetAction; - } - - public void setTargetAction(OrchestrationAction targetAction) { - this.targetAction = targetAction; - } - - public OrchestrationStatusValidationDirective getFlowDirective() { - return flowDirective; - } - - public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) { - this.flowDirective = flowDirective; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof OrchestrationStatusStateTransitionDirective)) { - return false; - } - OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other; - return new EqualsBuilder().append(getResourceType(), castOther.getResourceType()) - .append(getOrchestrationStatus(), castOther.getOrchestrationStatus()) - .append(getTargetAction(), castOther.getTargetAction()) - .append(getFlowDirective(), castOther.getFlowDirective()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus()) - .append(getTargetAction()).append(getFlowDirective()).toHashCode(); - } + private static final long serialVersionUID = -4626396955833442376L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Enumerated(EnumType.STRING) + @Column(name = "RESOURCE_TYPE") + @BusinessKey + private ResourceType resourceType; + + @Enumerated(EnumType.STRING) + @Column(name = "ORCHESTRATION_STATUS") + @BusinessKey + private OrchestrationStatus orchestrationStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "TARGET_ACTION") + @BusinessKey + private OrchestrationAction targetAction; + + @Enumerated(EnumType.STRING) + @Column(name = "FLOW_DIRECTIVE") + @BusinessKey + private OrchestrationStatusValidationDirective flowDirective; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType) + .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction) + .append("flowDirective", flowDirective).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public ResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public OrchestrationStatus getOrchestrationStatus() { + return orchestrationStatus; + } + + public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + + public OrchestrationAction getTargetAction() { + return targetAction; + } + + public void setTargetAction(OrchestrationAction targetAction) { + this.targetAction = targetAction; + } + + public OrchestrationStatusValidationDirective getFlowDirective() { + return flowDirective; + } + + public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) { + this.flowDirective = flowDirective; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof OrchestrationStatusStateTransitionDirective)) { + return false; + } + OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other; + return new EqualsBuilder().append(getResourceType(), castOther.getResourceType()) + .append(getOrchestrationStatus(), castOther.getOrchestrationStatus()) + .append(getTargetAction(), castOther.getTargetAction()) + .append(getFlowDirective(), castOther.getFlowDirective()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus()) + .append(getTargetAction()).append(getFlowDirective()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java index f92aadf7a7..269a73e2c2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java @@ -20,18 +20,18 @@ package org.onap.so.db.catalog.beans; -//TODO find this file a new location? +// TODO find this file a new location? public enum OrchestrationStatusValidationDirective { - SILENT_SUCCESS("SilentSuccess"), CONTINUE("Continue"), FAIL("Fail"), VALIDATION_SKIPPED("ValidationSkiPped"); + SILENT_SUCCESS("SilentSuccess"), CONTINUE("Continue"), FAIL("Fail"), VALIDATION_SKIPPED("ValidationSkiPped"); - private final String name; + private final String name; - private OrchestrationStatusValidationDirective(String name) { - this.name = name; - } + private OrchestrationStatusValidationDirective(String name) { + this.name = name; + } - @Override - public String toString() { - return name; - } + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java index 5e9a07443f..cb3195bbac 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java @@ -1,20 +1,15 @@ /* - * ============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 + * ============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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.beans; @@ -88,11 +83,10 @@ public class PnfResource implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description) - .append("orchestrationMode", orchestrationMode).append("created", created) - .append("pnfResourceCustomizations", pnfResourceCustomizations) - .toString(); + .append("modelName", modelName).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description) + .append("orchestrationMode", orchestrationMode).append("created", created) + .append("pnfResourceCustomizations", pnfResourceCustomizations).toString(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java index 0c236897cb..fabbc5007f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java @@ -1,20 +1,15 @@ /* - * ============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 + * ============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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.beans; @@ -91,12 +86,11 @@ public class PnfResourceCustomization implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) - .append("multiStageDesign", multiStageDesign).append("pnfResources", pnfResources) - .append("blueprintName", blueprintName).append("blueprintVersion", blueprintVersion) - .toString(); + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("nfFunction", nfFunction).append("nfType", nfType).append("nfRole", nfRole) + .append("nfNamingCode", nfNamingCode).append("multiStageDesign", multiStageDesign) + .append("pnfResources", pnfResources).append("blueprintName", blueprintName) + .append("blueprintVersion", blueprintVersion).toString(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java index ff6b713e6b..c030d44d81 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java @@ -21,15 +21,15 @@ package org.onap.so.db.catalog.beans; public interface Recipe { - public Integer getId(); + public Integer getId(); - public String getAction(); + public String getAction(); - public String getDescription(); + public String getDescription(); - public String getParamXsd(); + public String getParamXsd(); - public String getOrchestrationUri(); + public String getOrchestrationUri(); - public Integer getRecipeTimeout(); + public Integer getRecipeTimeout(); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java index 6d5c0fd9a8..b41548ca99 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java @@ -21,24 +21,18 @@ package org.onap.so.db.catalog.beans; public enum ResourceType { - SERVICE("Service"), - VNF("Vnf"), - VOLUME_GROUP("VolumeGroup"), - VF_MODULE("VfModule"), - NETWORK("Network"), - NETWORK_COLLECTION("NetworkCollection"), - CONFIGURATION("Configuration"), - INSTANCE_GROUP("InstanceGroup"), - NO_VALIDATE("NoValidate"); - - private final String name; - - private ResourceType(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } + SERVICE("Service"), VNF("Vnf"), VOLUME_GROUP("VolumeGroup"), VF_MODULE("VfModule"), NETWORK( + "Network"), NETWORK_COLLECTION("NetworkCollection"), CONFIGURATION( + "Configuration"), INSTANCE_GROUP("InstanceGroup"), NO_VALIDATE("NoValidate"); + + private final String name; + + private ResourceType(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java index 194215325b..92ba56cb4e 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum ServerType { - KEYSTONE, ORM, KEYSTONE_V3; + KEYSTONE, ORM, KEYSTONE_V3; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java index 2a8e86c5b0..c333033ba2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java @@ -26,7 +26,6 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -41,14 +40,11 @@ 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.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -98,36 +94,45 @@ public class Service implements Serializable { private String resourceOrder; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "network_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "network_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<NetworkResourceCustomization> networkCustomizations; @OneToMany(cascade = CascadeType.ALL, mappedBy = "service") private List<VnfResourceCustomization> vnfCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "allotted_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "allotted_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<AllottedResourceCustomization> allottedCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "collection_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "collection_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<CollectionResourceCustomization> collectionResourceCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<ServiceProxyResourceCustomization> serviceProxyCustomizations; - + @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<ConfigurationResourceCustomization> configurationCustomizations; - + @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<PnfResourceCustomization> pnfCustomizations; @OneToMany(cascade = CascadeType.ALL, mappedBy = "service") @MapKey(name = "action") private Map<String, ServiceRecipe> recipes; - + @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID") private ToscaCsar csar; @@ -143,10 +148,9 @@ public class Service implements Serializable { .append("allottedCustomizations", allottedCustomizations) .append("collectionResourceCustomizations", collectionResourceCustomizations) .append("serviceProxyCustomizations", serviceProxyCustomizations) - .append("configurationCustomizations", configurationCustomizations) - .append("pnfCustomizations", pnfCustomizations) - .append("recipes", recipes) - .append("csar", csar).toString(); + .append("configurationCustomizations", configurationCustomizations) + .append("pnfCustomizations", pnfCustomizations).append("recipes", recipes).append("csar", csar) + .toString(); } @PrePersist diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java index d725c505ff..d8be423f5a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -40,162 +39,158 @@ 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 @Table(name = "service_proxy_customization") public class ServiceProxyResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -2822457299134903084L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID") - private Service sourceService; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public Service getSourceService() { - return sourceService; - } - - public void setSourceService(Service sourceService) { - this.sourceService = sourceService; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType) - .append("modelUUID", modelUUID) - .append("modelInvariantUUID",modelInvariantUUID).append("modelName",modelName) - .append("description",description) - .append("created", created).append("sourceService", sourceService).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ServiceProxyResourceCustomization)) { - return false; - } - ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } + /** + * + */ + private static final long serialVersionUID = -2822457299134903084L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID") + private Service sourceService; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public Service getSourceService() { + return sourceService; + } + + public void setSourceService(Service sourceService) { + this.sourceService = sourceService; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType) + .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("description", description).append("created", created) + .append("sourceService", sourceService).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ServiceProxyResourceCustomization)) { + return false; + } + ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java index 79b27e7deb..5a241afc3a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java @@ -22,7 +22,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; @@ -34,168 +33,166 @@ 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; @Entity @Table(name = "service_recipe") public class ServiceRecipe implements Serializable, Recipe { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "SERVICE_MODEL_UUID") - private String serviceModelUUID; - - @BusinessKey - @Column(name = "ACTION") - private String action; - - @Column(name = "description") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - private String orchestrationUri; - - @Column(name = "SERVICE_PARAM_XSD") - private String paramXsd; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "SERVICE_TIMEOUT_INTERIM") - private Integer serviceTimeoutInterim; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID",insertable = false, updatable = false) - private Service service; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("serviceModelUUID", serviceModelUUID) - .append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("serviceParamXSD", paramXsd) - .append("recipeTimeout", recipeTimeout).append("serviceTimeoutInterim", serviceTimeoutInterim) - .append("created", created).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ServiceRecipe)) { - return false; - } - ServiceRecipe castOther = (ServiceRecipe) other; - return new EqualsBuilder().append(serviceModelUUID, castOther.serviceModelUUID).append(action, castOther.action) - .append(orchestrationUri, castOther.orchestrationUri).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(serviceModelUUID).append(action).append(orchestrationUri).toHashCode(); - } - - // This 'default' CTR is now needed for backward compatibility since a new - // CTR was added below - public ServiceRecipe() { - super(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public void setCreated(Date created) { - this.created = created; - } - - public String getServiceModelUUID() { - return serviceModelUUID; - } - - public void setServiceModelUUID(String serviceModelUUID) { - this.serviceModelUUID = serviceModelUUID; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public Integer getServiceTimeoutInterim() { - return serviceTimeoutInterim; - } - - public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { - this.serviceTimeoutInterim = serviceTimeoutInterim; - } - - public Service getService() { - return service; - } - - public void setService(Service service) { - this.service = service; - } - - public Date getCreated() { - return created; - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "SERVICE_MODEL_UUID") + private String serviceModelUUID; + + @BusinessKey + @Column(name = "ACTION") + private String action; + + @Column(name = "description") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + private String orchestrationUri; + + @Column(name = "SERVICE_PARAM_XSD") + private String paramXsd; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "SERVICE_TIMEOUT_INTERIM") + private Integer serviceTimeoutInterim; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID", insertable = false, updatable = false) + private Service service; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("serviceModelUUID", serviceModelUUID) + .append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("serviceParamXSD", paramXsd) + .append("recipeTimeout", recipeTimeout).append("serviceTimeoutInterim", serviceTimeoutInterim) + .append("created", created).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ServiceRecipe)) { + return false; + } + ServiceRecipe castOther = (ServiceRecipe) other; + return new EqualsBuilder().append(serviceModelUUID, castOther.serviceModelUUID).append(action, castOther.action) + .append(orchestrationUri, castOther.orchestrationUri).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(serviceModelUUID).append(action).append(orchestrationUri).toHashCode(); + } + + // This 'default' CTR is now needed for backward compatibility since a new + // CTR was added below + public ServiceRecipe() { + super(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public void setCreated(Date created) { + this.created = created; + } + + public String getServiceModelUUID() { + return serviceModelUUID; + } + + public void setServiceModelUUID(String serviceModelUUID) { + this.serviceModelUUID = serviceModelUUID; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public Integer getServiceTimeoutInterim() { + return serviceTimeoutInterim; + } + + public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { + this.serviceTimeoutInterim = serviceTimeoutInterim; + } + + public Service getService() { + return service; + } + + public void setService(Service service) { + this.service = service; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java index 3230d8427b..77663606a2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java @@ -21,14 +21,16 @@ package org.onap.so.db.catalog.beans; public enum SubType { - SUB_INTERFACE("SUB-INTERFACE"); - - private final String value; - SubType(String value){ - this.value = value; - } - @Override - public String toString() { - return this.value; - } + SUB_INTERFACE("SUB-INTERFACE"); + + private final String value; + + SubType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java index 484a5a9e97..b037b926f1 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java @@ -21,16 +21,13 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; - import com.openpojo.business.annotation.BusinessKey; @Entity @@ -38,82 +35,82 @@ import com.openpojo.business.annotation.BusinessKey; @IdClass(TempNetworkHeatTemplateLookupId.class) public class TempNetworkHeatTemplateLookup implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @BusinessKey - @Id - @Column(name = "NETWORK_RESOURCE_MODEL_NAME") - private String networkResourceModelName; - - @BusinessKey - @Id - @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private String heatTemplateArtifactUuid; - - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin; - - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof TempNetworkHeatTemplateLookup)) { - return false; - } - TempNetworkHeatTemplateLookup castOther = (TempNetworkHeatTemplateLookup) other; - return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) - .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); - } - - public TempNetworkHeatTemplateLookup() { - super(); - } - - public String getNetworkResourceModelName() { - return this.networkResourceModelName; - } - - public void setNetworkResourceModelName(String networkResourceModelName) { - this.networkResourceModelName = networkResourceModelName; - } - - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } - - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } - - public String getAicVersionMin() { - return this.aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return this.aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("NetworkResourceModelName=" + this.networkResourceModelName); - sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid); - sb.append("aicVersionMin=" + this.aicVersionMin); - sb.append("aicVersionMax=" + this.aicVersionMax); - return sb.toString(); - } + public static final long serialVersionUID = -1322322139926390329L; + + @BusinessKey + @Id + @Column(name = "NETWORK_RESOURCE_MODEL_NAME") + private String networkResourceModelName; + + @BusinessKey + @Id + @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private String heatTemplateArtifactUuid; + + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin; + + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof TempNetworkHeatTemplateLookup)) { + return false; + } + TempNetworkHeatTemplateLookup castOther = (TempNetworkHeatTemplateLookup) other; + return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) + .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); + } + + public TempNetworkHeatTemplateLookup() { + super(); + } + + public String getNetworkResourceModelName() { + return this.networkResourceModelName; + } + + public void setNetworkResourceModelName(String networkResourceModelName) { + this.networkResourceModelName = networkResourceModelName; + } + + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } + + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } + + public String getAicVersionMin() { + return this.aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return this.aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("NetworkResourceModelName=" + this.networkResourceModelName); + sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid); + sb.append("aicVersionMin=" + this.aicVersionMin); + sb.append("aicVersionMax=" + this.aicVersionMax); + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java index 2be6fe4e12..ff48b7b195 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java @@ -21,58 +21,56 @@ 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 TempNetworkHeatTemplateLookupId implements Serializable { - /** - * - */ - private static final long serialVersionUID = -3660507980620002091L; - @BusinessKey - private String networkResourceModelName; - @BusinessKey - private String heatTemplateArtifactUuid; + /** + * + */ + private static final long serialVersionUID = -3660507980620002091L; + @BusinessKey + private String networkResourceModelName; + @BusinessKey + private String heatTemplateArtifactUuid; - @Override - public String toString() { - return new ToStringBuilder(this).append("networkResourceModelName", networkResourceModelName) - .append("heatTemplateArtifactUuid", heatTemplateArtifactUuid).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("networkResourceModelName", networkResourceModelName) + .append("heatTemplateArtifactUuid", heatTemplateArtifactUuid).toString(); + } - public String getNetworkResourceModelName() { - return networkResourceModelName; - } + public String getNetworkResourceModelName() { + return networkResourceModelName; + } - public void setNetworkResourceModelName(String networkResourceModelName) { - this.networkResourceModelName = networkResourceModelName; - } + public void setNetworkResourceModelName(String networkResourceModelName) { + this.networkResourceModelName = networkResourceModelName; + } - public String getHeatTemplateArtifactUuid() { - return heatTemplateArtifactUuid; - } + public String getHeatTemplateArtifactUuid() { + return heatTemplateArtifactUuid; + } - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof TempNetworkHeatTemplateLookupId)) { - return false; - } - TempNetworkHeatTemplateLookupId castOther = (TempNetworkHeatTemplateLookupId) other; - return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) - .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof TempNetworkHeatTemplateLookupId)) { + return false; + } + TempNetworkHeatTemplateLookupId castOther = (TempNetworkHeatTemplateLookupId) other; + return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) + .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java index 567675044e..2f9b19ada0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,139 +32,135 @@ 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.fasterxml.jackson.annotation.JsonIgnore; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "tosca_csar") public class ToscaCsar implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUUID; - - @Column(name = "NAME") - private String name; + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUUID; + + @Column(name = "NAME") + private String name; - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; - @Column(name = "URL") - private String url; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "Version") - private String version; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "csar") - @JsonIgnore - private List<Service> services; - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUUID", artifactUUID).append("name", name) - .append("artifactChecksum", artifactChecksum).append("url", url).append("description", description) - .append("created", created).append("version", version).append("services", services).toString(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ToscaCsar)) { - return false; - } - ToscaCsar castOther = (ToscaCsar) other; - return new EqualsBuilder().append(artifactUUID, castOther.artifactUUID).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUUID).append(version).toHashCode(); - } - - public ToscaCsar() { - } - - public String getArtifactUUID() { - return artifactUUID; - } - - public void setArtifactUUID(String artifactUUID) { - this.artifactUUID = artifactUUID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public List<Service> getServices() { - return services; - } - - public void setServices(List<Service> services) { - this.services = services; - } + @Column(name = "URL") + private String url; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "Version") + private String version; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "csar") + @JsonIgnore + private List<Service> services; + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUUID", artifactUUID).append("name", name) + .append("artifactChecksum", artifactChecksum).append("url", url).append("description", description) + .append("created", created).append("version", version).append("services", services).toString(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ToscaCsar)) { + return false; + } + ToscaCsar castOther = (ToscaCsar) other; + return new EqualsBuilder().append(artifactUUID, castOther.artifactUUID).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUUID).append(version).toHashCode(); + } + + public ToscaCsar() {} + + public String getArtifactUUID() { + return artifactUUID; + } + + public void setArtifactUUID(String artifactUUID) { + this.artifactUUID = artifactUUID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public List<Service> getServices() { + return services; + } + + public void setServices(List<Service> services) { + this.services = services; + } } 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 7d23717b2f..a20647d5c1 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 @@ -4,7 +4,6 @@ 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; @@ -19,13 +18,10 @@ 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; @@ -34,153 +30,153 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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(); - } + 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/VFCInstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java index e44309e258..ea7d1adad6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java @@ -27,8 +27,8 @@ import javax.persistence.Entity; @DiscriminatorValue(value = "VNFC") public class VFCInstanceGroup extends InstanceGroup { - /** - * - */ - private static final long serialVersionUID = -6254325954630189563L; + /** + * + */ + private static final long serialVersionUID = -6254325954630189563L; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java index 7d53a0b843..0c7820f5f0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -39,194 +38,192 @@ 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.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "vf_module") public class VfModule implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @BusinessKey - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "IS_BASE") - private Boolean isBase; - - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VOL_HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate volumeHeatTemplate; - - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate moduleHeatTemplate; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "vf_module_to_heat_files", joinColumns = @JoinColumn(name = "VF_MODULE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "HEAT_FILES_ARTIFACT_UUID")) - private List<HeatFiles> heatFiles; - - @OneToMany(mappedBy = "vfModule") - private List<VfModuleCustomization> vfModuleCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") - private VnfResource vnfResources; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion).append("description", description) - .append("isBase", isBase).append("volumeHeatTemplate", volumeHeatTemplate) - .append("moduleHeatTemplate", moduleHeatTemplate).append("created", created) - .append("heatFiles", heatFiles).append("vfModuleCustomization", vfModuleCustomization) - .append("vnfResources", vnfResources).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VfModule)) { - return false; - } - VfModule castOther = (VfModule) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - @LinkedResource - public List<VfModuleCustomization> getVfModuleCustomization() { - if (vfModuleCustomization == null) - vfModuleCustomization = new ArrayList<>(); - - return vfModuleCustomization; - } - - public void setVfModuleCustomization(List<VfModuleCustomization> vfModuleCustomization) { - this.vfModuleCustomization = vfModuleCustomization; - } - - public String getModelName() { - return this.modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public Boolean getIsBase() { - return isBase; - } - - public void setIsBase(Boolean isBase) { - this.isBase = isBase; - } - - @LinkedResource - public List<HeatFiles> getHeatFiles() { - if (heatFiles == null) - heatFiles = new ArrayList<>(); - return heatFiles; - } - - public void setHeatFiles(List<HeatFiles> heatFiles) { - this.heatFiles = heatFiles; - } - - @LinkedResource - public VnfResource getVnfResources() { - return vnfResources; - } - - public void setVnfResources(VnfResource vnfResources) { - this.vnfResources = vnfResources; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - @LinkedResource - public HeatTemplate getVolumeHeatTemplate() { - return volumeHeatTemplate; - } - - public void setVolumeHeatTemplate(HeatTemplate volumeHeatTemplate) { - this.volumeHeatTemplate = volumeHeatTemplate; - } - - @LinkedResource - public HeatTemplate getModuleHeatTemplate() { - return moduleHeatTemplate; - } - - public void setModuleHeatTemplate(HeatTemplate moduleHeatTemplate) { - this.moduleHeatTemplate = moduleHeatTemplate; - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @BusinessKey + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "IS_BASE") + private Boolean isBase; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VOL_HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate volumeHeatTemplate; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate moduleHeatTemplate; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL) + @JoinTable(name = "vf_module_to_heat_files", joinColumns = @JoinColumn(name = "VF_MODULE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "HEAT_FILES_ARTIFACT_UUID")) + private List<HeatFiles> heatFiles; + + @OneToMany(mappedBy = "vfModule") + private List<VfModuleCustomization> vfModuleCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") + private VnfResource vnfResources; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("modelVersion", modelVersion).append("description", description) + .append("isBase", isBase).append("volumeHeatTemplate", volumeHeatTemplate) + .append("moduleHeatTemplate", moduleHeatTemplate).append("created", created) + .append("heatFiles", heatFiles).append("vfModuleCustomization", vfModuleCustomization) + .append("vnfResources", vnfResources).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VfModule)) { + return false; + } + VfModule castOther = (VfModule) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + @LinkedResource + public List<VfModuleCustomization> getVfModuleCustomization() { + if (vfModuleCustomization == null) + vfModuleCustomization = new ArrayList<>(); + + return vfModuleCustomization; + } + + public void setVfModuleCustomization(List<VfModuleCustomization> vfModuleCustomization) { + this.vfModuleCustomization = vfModuleCustomization; + } + + public String getModelName() { + return this.modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public Boolean getIsBase() { + return isBase; + } + + public void setIsBase(Boolean isBase) { + this.isBase = isBase; + } + + @LinkedResource + public List<HeatFiles> getHeatFiles() { + if (heatFiles == null) + heatFiles = new ArrayList<>(); + return heatFiles; + } + + public void setHeatFiles(List<HeatFiles> heatFiles) { + this.heatFiles = heatFiles; + } + + @LinkedResource + public VnfResource getVnfResources() { + return vnfResources; + } + + public void setVnfResources(VnfResource vnfResources) { + this.vnfResources = vnfResources; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + @LinkedResource + public HeatTemplate getVolumeHeatTemplate() { + return volumeHeatTemplate; + } + + public void setVolumeHeatTemplate(HeatTemplate volumeHeatTemplate) { + this.volumeHeatTemplate = volumeHeatTemplate; + } + + @LinkedResource + public HeatTemplate getModuleHeatTemplate() { + return moduleHeatTemplate; + } + + public void setModuleHeatTemplate(HeatTemplate moduleHeatTemplate) { + this.moduleHeatTemplate = moduleHeatTemplate; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java index 4ec2a92a73..29f8bcece5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java @@ -25,7 +25,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -39,208 +38,205 @@ 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 org.onap.so.db.catalog.beans.macro.OrchestrationFlow; - import com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "vf_module_customization") public class VfModuleCustomization implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "LABEL") - private String label; - - @Column(name = "MIN_INSTANCES") - private Integer minInstances; - - @Column(name = "MAX_INSTANCES") - private Integer maxInstances; - - @Column(name = "INITIAL_COUNT") - private Integer initialCount; - - @Column(name = "AVAILABILITY_ZONE_COUNT") - private Integer availabilityZoneCount; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VOL_ENVIRONMENT_ARTIFACT_UUID") - HeatEnvironment volumeHeatEnv; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "HEAT_ENVIRONMENT_ARTIFACT_UUID") - HeatEnvironment heatEnvironment; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VF_MODULE_MODEL_UUID") - private VfModule vfModule; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") - private VnfResourceCustomization vnfCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization") - private Set<CvnfcCustomization> cvnfcCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VfModuleCustomization)) { - return false; - } - VfModuleCustomization castOther = (VfModuleCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID).append("label", label) - .append("minInstances", minInstances).append("maxInstances", maxInstances) - .append("initialCount", initialCount).append("availabilityZoneCount", availabilityZoneCount) - .append("created", created).append("volumeHeatEnv", volumeHeatEnv) - .append("heatEnvironment", heatEnvironment).append("vfModule", vfModule).toString(); - } - - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public VnfResourceCustomization getVnfCustomization() { - return vnfCustomization; - } - - public void setVnfCustomization(VnfResourceCustomization vnfCustomization) { - this.vnfCustomization = vnfCustomization; - } - - public VfModuleCustomization() { - super(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - @LinkedResource - public HeatEnvironment getVolumeHeatEnv() { - return volumeHeatEnv; - } - - public void setVolumeHeatEnv(HeatEnvironment volumeHeatEnv) { - this.volumeHeatEnv = volumeHeatEnv; - } - - @LinkedResource - public HeatEnvironment getHeatEnvironment() { - return heatEnvironment; - } - - public void setHeatEnvironment(HeatEnvironment heatEnvironment) { - this.heatEnvironment = heatEnvironment; - } - - public Integer getMinInstances() { - return this.minInstances; - } - - public void setMinInstances(Integer minInstances) { - this.minInstances = minInstances; - } - - public Integer getMaxInstances() { - return this.maxInstances; - } - - public void setMaxInstances(Integer maxInstances) { - this.maxInstances = maxInstances; - } - - public Integer getInitialCount() { - return this.initialCount; - } - - public void setInitialCount(Integer initialCount) { - this.initialCount = initialCount; - } - - public Integer getAvailabilityZoneCount() { - return this.availabilityZoneCount; - } - - public void setAvailabilityZoneCount(Integer availabilityZoneCount) { - this.availabilityZoneCount = availabilityZoneCount; - } - - public Date getCreated() { - return created; - } - - public String getLabel() { - return this.label; - } - - public void setLabel(String label) { - this.label = label; - } - - @LinkedResource - public VfModule getVfModule() { - return this.vfModule; - } - - public void setVfModule(VfModule vfModule) { - this.vfModule = vfModule; - } - - @LinkedResource - public Set<CvnfcCustomization> getCvnfcCustomization() { - if (cvnfcCustomization == null) - cvnfcCustomization = new HashSet<>(); - return cvnfcCustomization; - } - - public void setCvnfcCustomization(Set<CvnfcCustomization> cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + public static final long serialVersionUID = -1322322139926390329L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "LABEL") + private String label; + + @Column(name = "MIN_INSTANCES") + private Integer minInstances; + + @Column(name = "MAX_INSTANCES") + private Integer maxInstances; + + @Column(name = "INITIAL_COUNT") + private Integer initialCount; + + @Column(name = "AVAILABILITY_ZONE_COUNT") + private Integer availabilityZoneCount; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VOL_ENVIRONMENT_ARTIFACT_UUID") + HeatEnvironment volumeHeatEnv; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "HEAT_ENVIRONMENT_ARTIFACT_UUID") + HeatEnvironment heatEnvironment; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VF_MODULE_MODEL_UUID") + private VfModule vfModule; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") + private VnfResourceCustomization vnfCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization") + private Set<CvnfcCustomization> cvnfcCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VfModuleCustomization)) { + return false; + } + VfModuleCustomization castOther = (VfModuleCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID).append("label", label) + .append("minInstances", minInstances).append("maxInstances", maxInstances) + .append("initialCount", initialCount).append("availabilityZoneCount", availabilityZoneCount) + .append("created", created).append("volumeHeatEnv", volumeHeatEnv) + .append("heatEnvironment", heatEnvironment).append("vfModule", vfModule).toString(); + } + + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public VnfResourceCustomization getVnfCustomization() { + return vnfCustomization; + } + + public void setVnfCustomization(VnfResourceCustomization vnfCustomization) { + this.vnfCustomization = vnfCustomization; + } + + public VfModuleCustomization() { + super(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + @LinkedResource + public HeatEnvironment getVolumeHeatEnv() { + return volumeHeatEnv; + } + + public void setVolumeHeatEnv(HeatEnvironment volumeHeatEnv) { + this.volumeHeatEnv = volumeHeatEnv; + } + + @LinkedResource + public HeatEnvironment getHeatEnvironment() { + return heatEnvironment; + } + + public void setHeatEnvironment(HeatEnvironment heatEnvironment) { + this.heatEnvironment = heatEnvironment; + } + + public Integer getMinInstances() { + return this.minInstances; + } + + public void setMinInstances(Integer minInstances) { + this.minInstances = minInstances; + } + + public Integer getMaxInstances() { + return this.maxInstances; + } + + public void setMaxInstances(Integer maxInstances) { + this.maxInstances = maxInstances; + } + + public Integer getInitialCount() { + return this.initialCount; + } + + public void setInitialCount(Integer initialCount) { + this.initialCount = initialCount; + } + + public Integer getAvailabilityZoneCount() { + return this.availabilityZoneCount; + } + + public void setAvailabilityZoneCount(Integer availabilityZoneCount) { + this.availabilityZoneCount = availabilityZoneCount; + } + + public Date getCreated() { + return created; + } + + public String getLabel() { + return this.label; + } + + public void setLabel(String label) { + this.label = label; + } + + @LinkedResource + public VfModule getVfModule() { + return this.vfModule; + } + + public void setVfModule(VfModule vfModule) { + this.vfModule = vfModule; + } + + @LinkedResource + public Set<CvnfcCustomization> getCvnfcCustomization() { + if (cvnfcCustomization == null) + cvnfcCustomization = new HashSet<>(); + return cvnfcCustomization; + } + + public void setCvnfcCustomization(Set<CvnfcCustomization> cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java index e4ac0d5816..58e7c6c61c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java @@ -21,151 +21,148 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; - 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; @Entity @Table(name = "vnf_components_recipe") public class VnfComponentsRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @Id - @Column(name = "id") - private Integer id; + @Id + @Column(name = "id") + private Integer id; - @BusinessKey - @Column(name = "ACTION") - private String action; + @BusinessKey + @Column(name = "ACTION") + private String action; - @Column(name = "DESCRIPTION") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - private String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @BusinessKey - @Column(name = "VNF_TYPE") - private String vnfType; - - @Column(name = "VNF_COMPONENT_PARAM_XSD") - private String paramXsd; - - @Column(name = "VNF_COMPONENT_TYPE") - private String vnfComponentType; - - @BusinessKey - @Column(name = "VF_MODULE_MODEL_UUID") - private String vfModuleModelUUID; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) - .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType) - .append("vfModuleModelUUID", vfModuleModelUUID).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfComponentsRecipe)) { - return false; - } - VnfComponentsRecipe castOther = (VnfComponentsRecipe) other; - return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) - .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID) - .toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public String getVnfComponentType() { - return vnfComponentType; - } - - public void setVnfComponentType(String vnfComponentType) { - this.vnfComponentType = vnfComponentType; - } - - public String getVfModuleModelUUID() { - return vfModuleModelUUID; - } - - public void setVfModuleModelUUID(String vfModuleModelUUID) { - this.vfModuleModelUUID = vfModuleModelUUID; - } - - @Override - public String getOrchestrationUri() { - return orchestrationUri; - } - - @Override - public Integer getRecipeTimeout() { - return recipeTimeout; - } + @Column(name = "DESCRIPTION") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + private String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @BusinessKey + @Column(name = "VNF_TYPE") + private String vnfType; + + @Column(name = "VNF_COMPONENT_PARAM_XSD") + private String paramXsd; + + @Column(name = "VNF_COMPONENT_TYPE") + private String vnfComponentType; + + @BusinessKey + @Column(name = "VF_MODULE_MODEL_UUID") + private String vfModuleModelUUID; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) + .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType) + .append("vfModuleModelUUID", vfModuleModelUUID).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfComponentsRecipe)) { + return false; + } + VnfComponentsRecipe castOther = (VnfComponentsRecipe) other; + return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) + .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID) + .toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public String getVnfComponentType() { + return vnfComponentType; + } + + public void setVnfComponentType(String vnfComponentType) { + this.vnfComponentType = vnfComponentType; + } + + public String getVfModuleModelUUID() { + return vfModuleModelUUID; + } + + public void setVfModuleModelUUID(String vfModuleModelUUID) { + this.vfModuleModelUUID = vfModuleModelUUID; + } + + @Override + public String getOrchestrationUri() { + return orchestrationUri; + } + + @Override + public Integer getRecipeTimeout() { + return recipeTimeout; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java index ab2eb622c1..8bf45b52c7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -30,169 +29,167 @@ 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; @Entity @Table(name = "vnf_recipe") public class VnfRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "NF_ROLE") - private String nfRole; - - @Column(name = "VNF_PARAM_XSD") - private String paramXsd; - - @Column(name = "VF_MODULE_ID") - private String vfModuleId; - - @BusinessKey - @Column(name = "ACTION") - protected String action; - - @Column(name = "description") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - protected String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "VERSION_STR") - private String versionStr; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd) - .append("vfModuleId", vfModuleId).append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) - .append("serviceType", serviceType).append("created", created).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfRecipe)) { - return false; - } - VnfRecipe castOther = (VnfRecipe) other; - return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action) - .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType) - .toHashCode(); - } - - public String getNfRole() { - return nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public Date getCreated() { - return created; - } - - public String getVersionStr() { - return versionStr; - } - - public void setVersionStr(String versionStr) { - this.versionStr = versionStr; - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "NF_ROLE") + private String nfRole; + + @Column(name = "VNF_PARAM_XSD") + private String paramXsd; + + @Column(name = "VF_MODULE_ID") + private String vfModuleId; + + @BusinessKey + @Column(name = "ACTION") + protected String action; + + @Column(name = "description") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + protected String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "VERSION_STR") + private String versionStr; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd) + .append("vfModuleId", vfModuleId).append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) + .append("serviceType", serviceType).append("created", created).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfRecipe)) { + return false; + } + VnfRecipe castOther = (VnfRecipe) other; + return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action) + .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType) + .toHashCode(); + } + + public String getNfRole() { + return nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public Date getCreated() { + return created; + } + + public String getVersionStr() { + return versionStr; + } + + public void setVersionStr(String versionStr) { + this.versionStr = versionStr; + } } 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 41269fb010..5d9deb6c89 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 @@ -24,7 +24,6 @@ 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; @@ -36,13 +35,10 @@ 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; @@ -51,228 +47,225 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "vnf_resource") public class VnfResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "ORCHESTRATION_MODE") - private String orchestrationMode; - - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin; - - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax; - - @Column(name = "RESOURCE_CATEGORY") - private String category; - - @Column(name = "RESOURCE_SUB_CATEGORY") - private String subCategory; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(fetch = FetchType.LAZY) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate heatTemplates; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources") - private List<VnfResourceCustomization> vnfResourceCustomizations; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource") - private List<VnfResourceWorkflow> vnfResourceWorkflow; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description) - .append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin) - .append("aicVersionMax", aicVersionMax).append("created", created) - .append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations) - .append("vnfResourceWorkflow",vnfResourceWorkflow) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfResource)) { - return false; - } - VnfResource castOther = (VnfResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - public String getOrchestrationMode() { - return orchestrationMode; - } - - public void setOrchestrationMode(String orchestrationMode) { - this.orchestrationMode = orchestrationMode; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public String getAicVersionMin() { - return this.aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return this.aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - /** - * @return Returns the category. - */ - public String getCategory() { - return category; - } - - /** - * @param category - * The category to set. - */ - public void setCategory(String category) { - this.category = category; - } - - /** - * @return Returns the subCategory. - */ - public String getSubCategory() { - return subCategory; - } - - /** - * @param subCategory - * The subCategory to set. - */ - public void setSubCategory(String subCategory) { - this.subCategory = subCategory; - } - - public String getModelInvariantUUID() { - return this.modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantId() { - return this.modelInvariantUUID; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - @LinkedResource - public List<VnfResourceCustomization> getVnfResourceCustomizations() { - if (vnfResourceCustomizations == null) - vnfResourceCustomizations = new ArrayList<>(); - return vnfResourceCustomizations; - } - - public void setVnfResourceCustomizations(List<VnfResourceCustomization> vnfResourceCustomizations) { - this.vnfResourceCustomizations = vnfResourceCustomizations; - } - - @LinkedResource - public HeatTemplate getHeatTemplates() { - return heatTemplates; - } - - public void setHeatTemplates(HeatTemplate heatTemplates) { - this.heatTemplates = heatTemplates; - } - - public String getModelVersion() { - return modelVersion; - } - - 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; - } + private static final long serialVersionUID = 768026109321305392L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "ORCHESTRATION_MODE") + private String orchestrationMode; + + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin; + + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax; + + @Column(name = "RESOURCE_CATEGORY") + private String category; + + @Column(name = "RESOURCE_SUB_CATEGORY") + private String subCategory; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(fetch = FetchType.LAZY) + @NotFound(action = NotFoundAction.IGNORE) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate heatTemplates; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources") + private List<VnfResourceCustomization> vnfResourceCustomizations; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource") + private List<VnfResourceWorkflow> vnfResourceWorkflow; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description) + .append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin) + .append("aicVersionMax", aicVersionMax).append("created", created) + .append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations) + .append("vnfResourceWorkflow", vnfResourceWorkflow).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfResource)) { + return false; + } + VnfResource castOther = (VnfResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + public String getOrchestrationMode() { + return orchestrationMode; + } + + public void setOrchestrationMode(String orchestrationMode) { + this.orchestrationMode = orchestrationMode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public String getAicVersionMin() { + return this.aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return this.aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + /** + * @return Returns the category. + */ + public String getCategory() { + return category; + } + + /** + * @param category The category to set. + */ + public void setCategory(String category) { + this.category = category; + } + + /** + * @return Returns the subCategory. + */ + public String getSubCategory() { + return subCategory; + } + + /** + * @param subCategory The subCategory to set. + */ + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getModelInvariantUUID() { + return this.modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantId() { + return this.modelInvariantUUID; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + @LinkedResource + public List<VnfResourceCustomization> getVnfResourceCustomizations() { + if (vnfResourceCustomizations == null) + vnfResourceCustomizations = new ArrayList<>(); + return vnfResourceCustomizations; + } + + public void setVnfResourceCustomizations(List<VnfResourceCustomization> vnfResourceCustomizations) { + this.vnfResourceCustomizations = vnfResourceCustomizations; + } + + @LinkedResource + public HeatTemplate getHeatTemplates() { + return heatTemplates; + } + + public void setHeatTemplates(HeatTemplate heatTemplates) { + this.heatTemplates = heatTemplates; + } + + public String getModelVersion() { + return modelVersion; + } + + 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/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java index 1cbc7b561f..af99aa8c80 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java @@ -26,7 +26,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -42,14 +41,11 @@ 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.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -57,13 +53,13 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; public class VnfResourceCustomization implements Serializable { private static final long serialVersionUID = 768026109321305392L; - + @Id @BusinessKey @Column(name = "ID") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; - + @Column(name = "MODEL_CUSTOMIZATION_UUID") private String modelCustomizationUUID; @@ -105,17 +101,17 @@ public class VnfResourceCustomization implements Serializable { @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") private VnfResource vnfResources; - + @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "SERVICE_MODEL_UUID") private Service service; - @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER, mappedBy = "vnfCustomization") + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "vnfCustomization") private List<VfModuleCustomization> vfModuleCustomizations; @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResourceCust") private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); - + @Column(name = "CDS_BLUEPRINT_NAME") private String blueprintName; @@ -175,7 +171,7 @@ public class VnfResourceCustomization implements Serializable { public void setId(Integer id) { this.id = id; } - + @LinkedResource public Service getService() { return service; @@ -295,7 +291,7 @@ public class VnfResourceCustomization implements Serializable { List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; } - + public String getResourceInput() { return resourceInput; } 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 8790e738ef..f49ae26305 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 @@ -22,7 +22,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; @@ -37,101 +36,97 @@ 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; - } - + + 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 index ad8aa0587d..837b9c09b2 100644 --- 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 @@ -21,61 +21,64 @@ 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; - } + 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 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 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(); - } + @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/VnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java index 8534242a58..f6ae503c61 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,7 +32,6 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -44,148 +42,148 @@ import org.apache.commons.lang3.builder.ToStringBuilder; @Table(name = "vnfc_customization") public class VnfcCustomization implements Serializable { - private static final long serialVersionUID = -3772469944364616486L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization") - private List<CvnfcCustomization> cvnfcCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfcCustomization)) { - return false; - } - VnfcCustomization castOther = (VnfcCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("modelName", modelName).append("toscaNodeType", toscaNodeType) - .append("description", description).append("created", created) - .append("cvnfcCustomization", cvnfcCustomization).toString(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - 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; - } - - public List<CvnfcCustomization> getCvnfcCustomization() { - return cvnfcCustomization; - } - - public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + private static final long serialVersionUID = -3772469944364616486L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization") + private List<CvnfcCustomization> cvnfcCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfcCustomization)) { + return false; + } + VnfcCustomization castOther = (VnfcCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("modelName", modelName).append("toscaNodeType", toscaNodeType) + .append("description", description).append("created", created) + .append("cvnfcCustomization", cvnfcCustomization).toString(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + 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; + } + + public List<CvnfcCustomization> getCvnfcCustomization() { + return cvnfcCustomization; + } + + public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java index db1c929f9d..695e5bbbb9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java @@ -22,7 +22,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; @@ -37,13 +36,10 @@ 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 @@ -51,108 +47,107 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "vnfc_instance_group_customization") public class VnfcInstanceGroupCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8288218040186901676L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") - private VnfResourceCustomization vnfResourceCust; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") - private InstanceGroup instanceGroup; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfcInstanceGroupCustomization)) { - return false; - } - VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("function", function).append("description", description) - .append("created", created).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Date getCreated(){ - return created; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public VnfResourceCustomization getVnfResourceCust() { - return vnfResourceCust; - } - - public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) { - this.vnfResourceCust = vnfResourceCust; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } + /** + * + */ + private static final long serialVersionUID = -8288218040186901676L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") + private VnfResourceCustomization vnfResourceCust; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") + private InstanceGroup instanceGroup; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfcInstanceGroupCustomization)) { + return false; + } + VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("function", function).append("description", description) + .append("created", created).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Date getCreated() { + return created; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public VnfResourceCustomization getVnfResourceCust() { + return vnfResourceCust; + } + + public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) { + this.vnfResourceCust = vnfResourceCust; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } } 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 cdbf41747c..1f46bc01f7 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 @@ -4,7 +4,6 @@ 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; @@ -19,13 +18,10 @@ 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; @@ -34,203 +30,202 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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(); - } + 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 index 8a1881edf3..4b497cc7da 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 @@ -22,7 +22,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; @@ -37,13 +36,10 @@ 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 @@ -51,87 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @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; - } - + 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 index f0a5759c3a..41af2ed3a5 100644 --- 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 @@ -21,62 +21,64 @@ 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; - } + 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 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 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(); - } + @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/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java index 4025e348f8..6319ae01eb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,181 +31,177 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; - 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 @Table(name = "northbound_request_ref_lookup") public class NorthBoundRequest implements Serializable { - /** - * - */ - private static final long serialVersionUID = -2238991039015148725L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "MACRO_ACTION") - private String macroAction; - - @BusinessKey - @Column(name = "ACTION") - private String action; - - @BusinessKey - @Column(name = "REQUEST_SCOPE") - private String requestScope; - - @BusinessKey - @Column(name = "IS_ALACARTE") - private Boolean isAlacarte; - - @BusinessKey - @Column(name = "IS_TOPLEVELFLOW") - private Boolean isToplevelflow; - - @BusinessKey - @Column(name = "MIN_API_VERSION") - private Double minApiVersion; - - @BusinessKey - @Column(name = "MAX_API_VERSION") - private Double maxApiVersion; - - @BusinessKey - @Column(name = "CLOUD_OWNER") - private String cloudOwner; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest") - private List<OrchestrationFlow> orchestrationFlowList; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope) - .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow) - .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion) - .append("cloudOwner",cloudOwner).append("serviceType",serviceType).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NorthBoundRequest)) { - return false; - } - NorthBoundRequest castOther = (NorthBoundRequest) other; - return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope) - .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow) - .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion) - .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow) - .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getMacroAction() { - return macroAction; - } - - public void setMacroAction(String macroAction) { - this.macroAction = macroAction; - } - - public String getRequestScope() { - return requestScope; - } - - public void setRequestScope(String requestScope) { - this.requestScope = requestScope; - } - - public Boolean getIsAlacarte() { - return isAlacarte; - } - - public void setIsAlacarte(Boolean isAlacarte) { - this.isAlacarte = isAlacarte; - } - - public Boolean getIsToplevelflow() { - return isToplevelflow; - } - - public void setIsToplevelflow(Boolean isToplevelflow) { - this.isToplevelflow = isToplevelflow; - } - - public Double getMinApiVersion() { - return minApiVersion; - } - - public void setMinApiVersion(Double minApiVersion) { - this.minApiVersion = minApiVersion; - } - - public Double getMaxApiVersion() { - return maxApiVersion; - } - - public void setMaxApiVersion(Double maxApiVersion) { - this.maxApiVersion = maxApiVersion; - } - - public String getCloudOwner() { - return cloudOwner; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - @LinkedResource - public List<OrchestrationFlow> getOrchestrationFlowList() { - return orchestrationFlowList; - } - - public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) { - this.orchestrationFlowList = orchestrationFlowList; - } + /** + * + */ + private static final long serialVersionUID = -2238991039015148725L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "MACRO_ACTION") + private String macroAction; + + @BusinessKey + @Column(name = "ACTION") + private String action; + + @BusinessKey + @Column(name = "REQUEST_SCOPE") + private String requestScope; + + @BusinessKey + @Column(name = "IS_ALACARTE") + private Boolean isAlacarte; + + @BusinessKey + @Column(name = "IS_TOPLEVELFLOW") + private Boolean isToplevelflow; + + @BusinessKey + @Column(name = "MIN_API_VERSION") + private Double minApiVersion; + + @BusinessKey + @Column(name = "MAX_API_VERSION") + private Double maxApiVersion; + + @BusinessKey + @Column(name = "CLOUD_OWNER") + private String cloudOwner; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest") + private List<OrchestrationFlow> orchestrationFlowList; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope) + .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow) + .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion) + .append("cloudOwner", cloudOwner).append("serviceType", serviceType).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NorthBoundRequest)) { + return false; + } + NorthBoundRequest castOther = (NorthBoundRequest) other; + return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope) + .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow) + .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion) + .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow) + .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getMacroAction() { + return macroAction; + } + + public void setMacroAction(String macroAction) { + this.macroAction = macroAction; + } + + public String getRequestScope() { + return requestScope; + } + + public void setRequestScope(String requestScope) { + this.requestScope = requestScope; + } + + public Boolean getIsAlacarte() { + return isAlacarte; + } + + public void setIsAlacarte(Boolean isAlacarte) { + this.isAlacarte = isAlacarte; + } + + public Boolean getIsToplevelflow() { + return isToplevelflow; + } + + public void setIsToplevelflow(Boolean isToplevelflow) { + this.isToplevelflow = isToplevelflow; + } + + public Double getMinApiVersion() { + return minApiVersion; + } + + public void setMinApiVersion(Double minApiVersion) { + this.minApiVersion = minApiVersion; + } + + public Double getMaxApiVersion() { + return maxApiVersion; + } + + public void setMaxApiVersion(Double maxApiVersion) { + this.maxApiVersion = maxApiVersion; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @LinkedResource + public List<OrchestrationFlow> getOrchestrationFlowList() { + return orchestrationFlowList; + } + + public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) { + this.orchestrationFlowList = orchestrationFlowList; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java index fc017c63aa..b74ade1e1f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,116 +31,113 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.onap.so.db.catalog.beans.BuildingBlockDetail; - import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "orchestration_flow_reference") public class OrchestrationFlow implements Serializable { - private static final long serialVersionUID = 2457818854397870011L; - - @Id - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "COMPOSITE_ACTION") - private String action; - - @BusinessKey - @Column(name = "SEQ_NO") - private Integer sequenceNumber; - - @BusinessKey - @Column(name = "FLOW_NAME") - private String flowName; - - @BusinessKey - @Column(name = "FLOW_VERSION") - private Double flowVersion; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID") - private NorthBoundRequest northBoundRequest; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action) - .append("sequenceNumber", sequenceNumber).append("flowName", flowName) - .append("flowVersion", flowVersion).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof OrchestrationFlow)) { - return false; - } - OrchestrationFlow castOther = (OrchestrationFlow) other; - return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber) - .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion) - .toHashCode(); - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public Integer getSequenceNumber() { - return sequenceNumber; - } - - public void setSequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - public String getFlowName() { - return flowName; - } - - public void setFlowName(String flowName) { - this.flowName = flowName; - } - - public Double getFlowVersion() { - return flowVersion; - } - - public void setFlowVersion(Double flowVersion) { - this.flowVersion = flowVersion; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - @LinkedResource - public NorthBoundRequest getNorthBoundRequest() { - return northBoundRequest; - } - - public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) { - this.northBoundRequest = northBoundRequest; - } + private static final long serialVersionUID = 2457818854397870011L; + + @Id + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "COMPOSITE_ACTION") + private String action; + + @BusinessKey + @Column(name = "SEQ_NO") + private Integer sequenceNumber; + + @BusinessKey + @Column(name = "FLOW_NAME") + private String flowName; + + @BusinessKey + @Column(name = "FLOW_VERSION") + private Double flowVersion; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID") + private NorthBoundRequest northBoundRequest; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action) + .append("sequenceNumber", sequenceNumber).append("flowName", flowName) + .append("flowVersion", flowVersion).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof OrchestrationFlow)) { + return false; + } + OrchestrationFlow castOther = (OrchestrationFlow) other; + return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber) + .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion) + .toHashCode(); + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public Integer getSequenceNumber() { + return sequenceNumber; + } + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + public String getFlowName() { + return flowName; + } + + public void setFlowName(String flowName) { + this.flowName = flowName; + } + + public Double getFlowVersion() { + return flowVersion; + } + + public void setFlowVersion(Double flowVersion) { + this.flowVersion = flowVersion; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @LinkedResource + public NorthBoundRequest getNorthBoundRequest() { + return northBoundRequest; + } + + public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) { + this.northBoundRequest = northBoundRequest; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java index 23d9d7bc6c..a12edac8a0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java @@ -21,146 +21,144 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; - 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; @Entity @Table(name = "rainy_day_handler_macro") public class RainyDayHandlerStatus implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "FLOW_NAME") - private String flowName; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @BusinessKey - @Column(name = "VNF_TYPE") - private String vnfType; - - @BusinessKey - @Column(name = "ERROR_CODE") - private String errorCode; - - @BusinessKey - @Column(name = "WORK_STEP") - private String workStep; - - @BusinessKey - @Column(name = "POLICY") - private String policy; - - @Column(name = "SECONDARY_POLICY") - private String secondaryPolicy; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("flowName", flowName) - .append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode) - .append("workStep", workStep).append("policy", policy).append("secondaryPolicy",secondaryPolicy).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof RainyDayHandlerStatus)) { - return false; - } - RainyDayHandlerStatus castOther = (RainyDayHandlerStatus) other; - return new EqualsBuilder().append(flowName, castOther.flowName).append(serviceType, castOther.serviceType) - .append(vnfType, castOther.vnfType).append(errorCode, castOther.errorCode) - .append(workStep, castOther.workStep).append(policy, castOther.policy).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(flowName).append(serviceType).append(vnfType).append(errorCode) - .append(workStep).append(policy).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getFlowName() { - return flowName; - } - - public void setFlowName(String flowName) { - this.flowName = flowName; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public String getWorkStep() { - return workStep; - } - - public void setWorkStep(String workStep) { - this.workStep = workStep; - } - - public String getPolicy() { - return policy; - } - - public void setPolicy(String policy) { - this.policy = policy; - } - - public String getSecondaryPolicy() { - return secondaryPolicy; - } - - public void setSecondaryPolicy(String secondaryPolicy) { - this.secondaryPolicy = secondaryPolicy; - } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "FLOW_NAME") + private String flowName; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @BusinessKey + @Column(name = "VNF_TYPE") + private String vnfType; + + @BusinessKey + @Column(name = "ERROR_CODE") + private String errorCode; + + @BusinessKey + @Column(name = "WORK_STEP") + private String workStep; + + @BusinessKey + @Column(name = "POLICY") + private String policy; + + @Column(name = "SECONDARY_POLICY") + private String secondaryPolicy; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("flowName", flowName) + .append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode) + .append("workStep", workStep).append("policy", policy).append("secondaryPolicy", secondaryPolicy) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof RainyDayHandlerStatus)) { + return false; + } + RainyDayHandlerStatus castOther = (RainyDayHandlerStatus) other; + return new EqualsBuilder().append(flowName, castOther.flowName).append(serviceType, castOther.serviceType) + .append(vnfType, castOther.vnfType).append(errorCode, castOther.errorCode) + .append(workStep, castOther.workStep).append(policy, castOther.policy).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(flowName).append(serviceType).append(vnfType).append(errorCode) + .append(workStep).append(policy).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getFlowName() { + return flowName; + } + + public void setFlowName(String flowName) { + this.flowName = flowName; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getWorkStep() { + return workStep; + } + + public void setWorkStep(String workStep) { + this.workStep = workStep; + } + + public String getPolicy() { + return policy; + } + + public void setPolicy(String policy) { + this.policy = policy; + } + + public String getSecondaryPolicy() { + return secondaryPolicy; + } + + public void setSecondaryPolicy(String secondaryPolicy) { + this.secondaryPolicy = secondaryPolicy; + } } 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 2ce1263f69..f75ccf0b2f 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 @@ -25,11 +25,9 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; - import javax.annotation.PostConstruct; import javax.persistence.EntityNotFoundException; import javax.ws.rs.core.UriBuilder; - import org.onap.so.db.catalog.beans.BuildingBlockDetail; import org.onap.so.db.catalog.beans.CloudSite; import org.onap.so.db.catalog.beans.CloudifyManager; @@ -75,14 +73,13 @@ import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; - import uk.co.blackpepper.bowman.Client; import uk.co.blackpepper.bowman.ClientFactory; import uk.co.blackpepper.bowman.Configuration; @Component("CatalogDbClient") public class CatalogDbClient { - + private static final Logger logger = LoggerFactory.getLogger(CatalogDbClient.class); private static final String CLOUD_SITE = "/cloudSite"; @@ -91,10 +88,12 @@ public class CatalogDbClient { private static final String RAINY_DAY_HANDLER_MACRO = "/rainy_day_handler_macro"; private static final String NORTHBOUND_REQUEST_REF_LOOKUP = "/northbound_request_ref_lookup"; private static final String NETWORK_RESOURCE_CUSTOMIZATION = "/networkResourceCustomization"; - private static final String COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION = "/collectionResourceInstanceGroupCustomization"; + private static final String COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION = + "/collectionResourceInstanceGroupCustomization"; private static final String VNFC_INSTANCE_GROUP_CUSTOMIZATION = "/vnfcInstanceGroupCustomization"; private static final String ORCHESTRATION_FLOW = "/orchestrationFlow"; - private static final String ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE = "/orchestrationStatusStateTransitionDirective"; + private static final String ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE = + "/orchestrationStatusStateTransitionDirective"; private static final String INSTANCE_GROUP = "/instanceGroup"; private static final String COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION = "/collectionNetworkResourceCustomization"; private static final String BUILDING_BLOCK_DETAIL = "/buildingBlockDetail"; @@ -146,7 +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 TARGET_ENTITY = "SO:CatalogDB"; private static final String ASTERISK = "*"; @@ -159,23 +158,34 @@ public class CatalogDbClient { private String findFirstByModelVersionAndModelInvariantUUIDURI = "/findFirstByModelVersionAndModelInvariantUUID"; private String findByModelInvariantUUIDURI = "/findByModelInvariantUUIDOrderByModelVersionDesc"; private String findFirstByModelNameAndAction = "/findFirstByModelNameAndAction"; - private String findFirstResourceByModelInvariantUUIDAndModelVersion = "/findFirstResourceByModelInvariantUUIDAndModelVersion"; + private String findFirstResourceByModelInvariantUUIDAndModelVersion = + "/findFirstResourceByModelInvariantUUIDAndModelVersion"; private String findByModelInstanceNameAndVnfResources = "/findByModelInstanceNameAndVnfResources"; private String findFirstVnfRecipeByNfRoleAndAction = "/findFirstVnfRecipeByNfRoleAndAction"; - private String findByModelCustomizationUUIDAndVfModuleModelUUID = "/findFirstByModelCustomizationUUIDAndVfModuleModelUUIDOrderByCreatedDesc"; - private String findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction"; - private String findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = "/findFirstVnfComponentsRecipeByVnfComponentTypeAndAction"; - private String findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = "/findByModelInvariantUUIDOrderByModelVersionDesc"; - private String findFirstVfModuleByModelInvariantUUIDAndModelVersion = "/findFirstVfModuleByModelInvariantUUIDAndModelVersion"; + private String findByModelCustomizationUUIDAndVfModuleModelUUID = + "/findFirstByModelCustomizationUUIDAndVfModuleModelUUIDOrderByCreatedDesc"; + private String findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = + "/findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction"; + private String findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = + "/findFirstVnfComponentsRecipeByVnfComponentTypeAndAction"; + private String findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = + "/findByModelInvariantUUIDOrderByModelVersionDesc"; + private String findFirstVfModuleByModelInvariantUUIDAndModelVersion = + "/findFirstVfModuleByModelInvariantUUIDAndModelVersion"; private String findOneByBuildingBlockName = "/findOneByBuildingBlockName"; - private String findOneByResourceTypeAndOrchestrationStatusAndTargetAction = "/findOneByResourceTypeAndOrchestrationStatusAndTargetAction"; + private String findOneByResourceTypeAndOrchestrationStatusAndTargetAction = + "/findOneByResourceTypeAndOrchestrationStatusAndTargetAction"; private String findByAction = "/findByAction"; private String findVnfcInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID"; - private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID"; + private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = + "/findByModelCustomizationUUID"; private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte"; - private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner"; - private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType"; - private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep"; + private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = + "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner"; + private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = + "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType"; + private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = + "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep"; private String findByClliAndCloudVersion = "/findByClliAndCloudVersion"; private String findServiceByServiceInstanceId = "/findServiceByServiceInstanceId"; private String findPnfResourceCustomizationByModelUuid = "/findPnfResourceCustomizationByModelUuid"; @@ -245,7 +255,7 @@ public class CatalogDbClient { private final Client<HomingInstance> homingInstanceClient; private final Client<CloudifyManager> cloudifyManagerClient; - + private final Client<CvnfcCustomization> cvnfcCustomizationClient; private final Client<ControllerSelectionReference> controllerSelectionReferenceClient; @@ -253,7 +263,7 @@ 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}}") @@ -266,49 +276,72 @@ public class CatalogDbClient { RestTemplate restTemplate; @PostConstruct - public void init(){ - findExternalToInternalServiceByServiceName = endpoint + EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING + SEARCH + findExternalToInternalServiceByServiceName; - findServiceByModelName = endpoint + SERVICE + SEARCH + findServiceByModelName; - findServiceRecipeByActionAndServiceModelUUID = endpoint + SERVICE_RECIPE + SEARCH + findServiceRecipeByActionAndServiceModelUUID; - findServiceByModelUUID = endpoint + SERVICE + SEARCH + findServiceByModelUUID; + public void init() { + findExternalToInternalServiceByServiceName = endpoint + EXTERNAL_SERVICE_TO_INTERNAL_MODEL_MAPPING + SEARCH + + findExternalToInternalServiceByServiceName; + findServiceByModelName = endpoint + SERVICE + SEARCH + findServiceByModelName; + findServiceRecipeByActionAndServiceModelUUID = + endpoint + SERVICE_RECIPE + SEARCH + findServiceRecipeByActionAndServiceModelUUID; + findServiceByModelUUID = endpoint + SERVICE + SEARCH + findServiceByModelUUID; findFirstByModelNameURI = endpoint + SERVICE + SEARCH + findFirstByModelNameURI; - findFirstByModelVersionAndModelInvariantUUIDURI = endpoint + SERVICE + SEARCH + findFirstByModelVersionAndModelInvariantUUIDURI; + findFirstByModelVersionAndModelInvariantUUIDURI = + endpoint + SERVICE + SEARCH + findFirstByModelVersionAndModelInvariantUUIDURI; findByModelInvariantUUIDURI = endpoint + SERVICE + SEARCH + findByModelInvariantUUIDURI; - findFirstByServiceModelUUIDAndActionURI = endpoint + SERVICE_RECIPE + SEARCH + findFirstByServiceModelUUIDAndActionURI; + findFirstByServiceModelUUIDAndActionURI = + endpoint + SERVICE_RECIPE + SEARCH + findFirstByServiceModelUUIDAndActionURI; findFirstByModelNameAndAction = endpoint + NETWORK_RECIPE + SEARCH + findFirstByModelNameAndAction; - findFirstResourceByModelInvariantUUIDAndModelVersion = endpoint + VNF_RESOURCE + SEARCH + findFirstResourceByModelInvariantUUIDAndModelVersion; - findByModelInstanceNameAndVnfResources = endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findByModelInstanceNameAndVnfResources; + findFirstResourceByModelInvariantUUIDAndModelVersion = + endpoint + VNF_RESOURCE + SEARCH + findFirstResourceByModelInvariantUUIDAndModelVersion; + findByModelInstanceNameAndVnfResources = + endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findByModelInstanceNameAndVnfResources; findFirstVnfRecipeByNfRoleAndAction = endpoint + VNF_RECIPE + SEARCH + findFirstVnfRecipeByNfRoleAndAction; - findByModelCustomizationUUIDAndVfModuleModelUUID = endpoint + VFMODULE_CUSTOMIZATION + SEARCH + findByModelCustomizationUUIDAndVfModuleModelUUID; - findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction; - findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVnfComponentTypeAndAction; - findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = endpoint + VFMODULE + SEARCH +findVfModuleByModelInvariantUUIDOrderByModelVersionDesc; - findFirstVfModuleByModelInvariantUUIDAndModelVersion = endpoint + VFMODULE + SEARCH + findFirstVfModuleByModelInvariantUUIDAndModelVersion; + findByModelCustomizationUUIDAndVfModuleModelUUID = + endpoint + VFMODULE_CUSTOMIZATION + SEARCH + findByModelCustomizationUUIDAndVfModuleModelUUID; + findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction = endpoint + VNF_COMPONENTS_RECIPE + + SEARCH + findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction; + findFirstVnfComponentsRecipeByVnfComponentTypeAndAction = + endpoint + VNF_COMPONENTS_RECIPE + SEARCH + findFirstVnfComponentsRecipeByVnfComponentTypeAndAction; + findVfModuleByModelInvariantUUIDOrderByModelVersionDesc = + endpoint + VFMODULE + SEARCH + findVfModuleByModelInvariantUUIDOrderByModelVersionDesc; + findFirstVfModuleByModelInvariantUUIDAndModelVersion = + endpoint + VFMODULE + SEARCH + findFirstVfModuleByModelInvariantUUIDAndModelVersion; findOneByBuildingBlockName = endpoint + BUILDING_BLOCK_DETAIL + SEARCH + findOneByBuildingBlockName; - findOneByResourceTypeAndOrchestrationStatusAndTargetAction = endpoint + ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE + SEARCH + findOneByResourceTypeAndOrchestrationStatusAndTargetAction; + findOneByResourceTypeAndOrchestrationStatusAndTargetAction = + endpoint + ORCHESTRATION_STATUS_STATE_TRANSITION_DIRECTIVE + SEARCH + + findOneByResourceTypeAndOrchestrationStatusAndTargetAction; findByAction = endpoint + ORCHESTRATION_FLOW + SEARCH + findByAction; - findVnfcInstanceGroupCustomizationByModelCustomizationUUID = endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findVnfcInstanceGroupCustomizationByModelCustomizationUUID; - findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID; - findOneByActionAndRequestScopeAndIsAlacarte = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte; - findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner; - findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType; - findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep; + findVnfcInstanceGroupCustomizationByModelCustomizationUUID = endpoint + VNFC_INSTANCE_GROUP_CUSTOMIZATION + + SEARCH + findVnfcInstanceGroupCustomizationByModelCustomizationUUID; + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = + endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID; + findOneByActionAndRequestScopeAndIsAlacarte = + endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte; + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner; + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = + endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType; + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep; findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion; findPnfResourceCustomizationByModelUuid = - endpoint + PNF_RESOURCE_CUSTOMIZATION + SEARCH + findPnfResourceCustomizationByModelUuid; - + endpoint + PNF_RESOURCE_CUSTOMIZATION + SEARCH + findPnfResourceCustomizationByModelUuid; + findWorkflowByArtifactUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByArtifactUUID; serviceURI = endpoint + SERVICE + URI_SEPARATOR; vfModuleURI = endpoint + VFMODULE + URI_SEPARATOR; vnfResourceURI = endpoint + VNF_RESOURCE + URI_SEPARATOR; vfModuleCustomizationURI = endpoint + VFMODULE_CUSTOMIZATION + URI_SEPARATOR; - networkCollectionResourceCustomizationURI = endpoint + NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; + networkCollectionResourceCustomizationURI = + endpoint + NETWORK_COLLECTION_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; networkResourceCustomizationURI = endpoint + NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; cvnfcResourceCustomizationURI = endpoint + CVNFC_CUSTOMZIATION + URI_SEPARATOR; vnfResourceCustomizationURI = endpoint + VNF_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; - collectionNetworkResourceCustomizationURI = endpoint + COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; + collectionNetworkResourceCustomizationURI = + endpoint + COLLECTION_NETWORK_RESOURCE_CUSTOMIZATION + URI_SEPARATOR; instanceGroupURI = endpoint + INSTANCE_GROUP + URI_SEPARATOR; cloudifyManagerURI = endpoint + CLOUDIFY_MANAGER + URI_SEPARATOR; cloudSiteURI = endpoint + CLOUD_SITE + URI_SEPARATOR; @@ -320,18 +353,20 @@ public class CatalogDbClient { } public CatalogDbClient() { - ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()); + ClientHttpRequestFactory factory = + new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()); - ClientFactory clientFactory = Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> { - restTemplate.getInterceptors().add((new SpringClientFilter())); + ClientFactory clientFactory = + Configuration.builder().setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> { + restTemplate.getInterceptors().add((new SpringClientFilter())); - restTemplate.getInterceptors().add((request, body, execution) -> { + restTemplate.getInterceptors().add((request, body, execution) -> { - request.getHeaders().add(HttpHeaders.AUTHORIZATION, msoAdaptersAuth); - request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER,TARGET_ENTITY); - return execution.execute(request, body); - }); - }).build().buildClientFactory(); + request.getHeaders().add(HttpHeaders.AUTHORIZATION, msoAdaptersAuth); + request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY); + return execution.execute(request, body); + }); + }).build().buildClientFactory(); serviceClient = clientFactory.create(Service.class); networkRecipeClient = clientFactory.create(NetworkRecipe.class); networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class); @@ -345,14 +380,16 @@ public class CatalogDbClient { northBoundRequestClient = clientFactory.create(NorthBoundRequest.class); rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class); buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class); - orchestrationStatusStateTransitionDirectiveClient = clientFactory - .create(OrchestrationStatusStateTransitionDirective.class); + orchestrationStatusStateTransitionDirectiveClient = + clientFactory.create(OrchestrationStatusStateTransitionDirective.class); vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class); - collectionResourceInstanceGroupCustomizationClient = clientFactory - .create(CollectionResourceInstanceGroupCustomization.class); + collectionResourceInstanceGroupCustomizationClient = + clientFactory.create(CollectionResourceInstanceGroupCustomization.class); instanceGroupClient = clientFactory.create(InstanceGroup.class); - networkCollectionResourceCustomizationClient = clientFactory.create(NetworkCollectionResourceCustomization.class); - collectionNetworkResourceCustomizationClient = clientFactory.create(CollectionNetworkResourceCustomization.class); + networkCollectionResourceCustomizationClient = + clientFactory.create(NetworkCollectionResourceCustomization.class); + collectionNetworkResourceCustomizationClient = + clientFactory.create(CollectionNetworkResourceCustomization.class); cloudSiteClient = clientFactory.create(CloudSite.class); homingInstanceClient = clientFactory.create(HomingInstance.class); cloudifyManagerClient = clientFactory.create(CloudifyManager.class); @@ -366,18 +403,20 @@ public class CatalogDbClient { } public CatalogDbClient(String baseUri, String auth) { - ClientHttpRequestFactory factory = new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()); + ClientHttpRequestFactory factory = + new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()); - ClientFactory clientFactory = Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory).setRestTemplateConfigurer(restTemplate -> { - restTemplate.getInterceptors().add((new SpringClientFilter())); + ClientFactory clientFactory = Configuration.builder().setBaseUri(baseUri).setClientHttpRequestFactory(factory) + .setRestTemplateConfigurer(restTemplate -> { + restTemplate.getInterceptors().add((new SpringClientFilter())); - restTemplate.getInterceptors().add((request, body, execution) -> { + restTemplate.getInterceptors().add((request, body, execution) -> { - request.getHeaders().add(HttpHeaders.AUTHORIZATION, auth); - request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER,TARGET_ENTITY); - return execution.execute(request, body); - }); - }).build().buildClientFactory(); + request.getHeaders().add(HttpHeaders.AUTHORIZATION, auth); + request.getHeaders().add(LogConstants.TARGET_ENTITY_HEADER, TARGET_ENTITY); + return execution.execute(request, body); + }); + }).build().buildClientFactory(); serviceClient = clientFactory.create(Service.class); networkRecipeClient = clientFactory.create(NetworkRecipe.class); networkResourceCustomizationClient = clientFactory.create(NetworkResourceCustomization.class); @@ -391,14 +430,16 @@ public class CatalogDbClient { northBoundRequestClient = clientFactory.create(NorthBoundRequest.class); rainyDayHandlerStatusClient = clientFactory.create(RainyDayHandlerStatus.class); buildingBlockDetailClient = clientFactory.create(BuildingBlockDetail.class); - orchestrationStatusStateTransitionDirectiveClient = clientFactory - .create(OrchestrationStatusStateTransitionDirective.class); + orchestrationStatusStateTransitionDirectiveClient = + clientFactory.create(OrchestrationStatusStateTransitionDirective.class); vnfcInstanceGroupCustomizationClient = clientFactory.create(VnfcInstanceGroupCustomization.class); - collectionResourceInstanceGroupCustomizationClient = clientFactory - .create(CollectionResourceInstanceGroupCustomization.class); + collectionResourceInstanceGroupCustomizationClient = + clientFactory.create(CollectionResourceInstanceGroupCustomization.class); instanceGroupClient = clientFactory.create(InstanceGroup.class); - networkCollectionResourceCustomizationClient = clientFactory.create(NetworkCollectionResourceCustomization.class); - collectionNetworkResourceCustomizationClient = clientFactory.create(CollectionNetworkResourceCustomization.class); + networkCollectionResourceCustomizationClient = + clientFactory.create(NetworkCollectionResourceCustomization.class); + collectionNetworkResourceCustomizationClient = + clientFactory.create(CollectionNetworkResourceCustomization.class); cloudSiteClient = clientFactory.create(CloudSite.class); homingInstanceClient = clientFactory.create(HomingInstance.class); cloudifyManagerClient = clientFactory.create(CloudifyManager.class); @@ -411,9 +452,11 @@ public class CatalogDbClient { workflowClient = clientFactory.create(Workflow.class); } - public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID(String modelCustomizationUUID) { + public NetworkCollectionResourceCustomization getNetworkCollectionResourceCustomizationByID( + String modelCustomizationUUID) { NetworkCollectionResourceCustomization networkCollectionResourceCustomization = - this.getSingleResource(networkCollectionResourceCustomizationClient, getUri(networkCollectionResourceCustomizationURI + modelCustomizationUUID)); + this.getSingleResource(networkCollectionResourceCustomizationClient, + getUri(networkCollectionResourceCustomizationURI + modelCustomizationUUID)); if (networkCollectionResourceCustomization != null) { networkCollectionResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID); } @@ -421,7 +464,7 @@ public class CatalogDbClient { } public Service getServiceByID(String modelUUID) { - Service service = getSingleResource(serviceClient,getUri(serviceURI + modelUUID)); + Service service = getSingleResource(serviceClient, getUri(serviceURI + modelUUID)); if (service != null) { service.setModelUUID(modelUUID); } @@ -429,14 +472,14 @@ public class CatalogDbClient { } public VfModule getVfModuleByModelUUID(String modelUUID) { - VfModule vfModule = getSingleResource(vfModuleClient,getUri(vfModuleURI + modelUUID)); + VfModule vfModule = getSingleResource(vfModuleClient, getUri(vfModuleURI + modelUUID)); if (vfModule != null) { vfModule.setModelUUID(modelUUID); } return vfModule; } - public VnfResource getVnfResourceByModelUUID(String modelUUID){ + public VnfResource getVnfResourceByModelUUID(String modelUUID) { VnfResource vnfResource = this.getSingleResource(vnfResourceClient, getUri(vnfResourceURI + modelUUID)); if (vnfResource != null) { @@ -445,17 +488,19 @@ public class CatalogDbClient { return vnfResource; } - //A VNFResource customization UUID is the same object across services, so we can return anyone from the list + // A VNFResource customization UUID is the same object across services, so we can return anyone from the list // In the future the client should query starting at a service model uuid - public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID){ - List<VnfResourceCustomization> vnfResourceCustomization = this.getMultipleResources(vnfResourceCustomizationClient,getUri(endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + "/findByModelCustomizationUUID" + "?MODEL_CUSTOMIZATION_UUID="+ modelCustomizationUUID)); - if(vnfResourceCustomization != null && !vnfResourceCustomization.isEmpty()){ + public VnfResourceCustomization getVnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID) { + List<VnfResourceCustomization> vnfResourceCustomization = this.getMultipleResources( + vnfResourceCustomizationClient, getUri(endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + + "/findByModelCustomizationUUID" + "?MODEL_CUSTOMIZATION_UUID=" + modelCustomizationUUID)); + if (vnfResourceCustomization != null && !vnfResourceCustomization.isEmpty()) { return vnfResourceCustomization.get(0); - } - else{ + } else { return null; } } + public PnfResource getPnfResourceByModelUUID(String modelUUID) { PnfResource PnfResource = this.getSingleResource(pnfResourceClient, getUri(pnfResourceURI + modelUUID)); if (PnfResource != null) { @@ -466,7 +511,7 @@ public class CatalogDbClient { public PnfResourceCustomization getPnfResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID) { PnfResourceCustomization pnfResourceCustomization = getSingleResource(pnfResourceCustomizationClient, - getUri(pnfResourceCustomizationURI + modelCustomizationUUID)); + getUri(pnfResourceCustomizationURI + modelCustomizationUUID)); if (pnfResourceCustomization != null) { pnfResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID); } @@ -474,15 +519,17 @@ public class CatalogDbClient { } public List<PnfResourceCustomization> getPnfResourceCustomizationByModelUuid(String modelUuid) { - return this.getMultipleResources(pnfResourceCustomizationClient, getUri( - UriBuilder.fromUri(findPnfResourceCustomizationByModelUuid).queryParam("SERVICE_MODEL_UUID", modelUuid) - .build().toString())); + return this.getMultipleResources(pnfResourceCustomizationClient, + getUri(UriBuilder.fromUri(findPnfResourceCustomizationByModelUuid) + .queryParam("SERVICE_MODEL_UUID", modelUuid).build().toString())); } - public CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomizationByID(String modelCustomizationUUID) { + public CollectionNetworkResourceCustomization getCollectionNetworkResourceCustomizationByID( + String modelCustomizationUUID) { CollectionNetworkResourceCustomization collectionNetworkResourceCustomization = - this.getSingleResource(collectionNetworkResourceCustomizationClient,getUri(UriBuilder - .fromUri(collectionNetworkResourceCustomizationURI + modelCustomizationUUID).build().toString())); + this.getSingleResource(collectionNetworkResourceCustomizationClient, + getUri(UriBuilder.fromUri(collectionNetworkResourceCustomizationURI + modelCustomizationUUID) + .build().toString())); if (collectionNetworkResourceCustomization != null) { collectionNetworkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID); } @@ -498,12 +545,16 @@ public class CatalogDbClient { } public VfModuleCustomization getVfModuleCustomizationByModelCuztomizationUUID(String modelCustomizationUUID) { - return this.getSingleResource(vfModuleCustomizationClient, getUri(endpoint + VFMODULE_CUSTOMIZATION + SEARCH + "/findFirstByModelCustomizationUUIDOrderByCreatedDesc" + "?MODEL_CUSTOMIZATION_UUID="+ modelCustomizationUUID)); + return this.getSingleResource(vfModuleCustomizationClient, + getUri(endpoint + VFMODULE_CUSTOMIZATION + SEARCH + + "/findFirstByModelCustomizationUUIDOrderByCreatedDesc" + "?MODEL_CUSTOMIZATION_UUID=" + + modelCustomizationUUID)); } - public NetworkResourceCustomization getNetworkResourceCustomizationByModelCustomizationUUID(String modelCustomizationUUID){ - NetworkResourceCustomization networkResourceCustomization = - this.getSingleResource(networkResourceCustomizationClient, getUri(networkResourceCustomizationURI + modelCustomizationUUID)); + public NetworkResourceCustomization getNetworkResourceCustomizationByModelCustomizationUUID( + String modelCustomizationUUID) { + NetworkResourceCustomization networkResourceCustomization = this.getSingleResource( + networkResourceCustomizationClient, getUri(networkResourceCustomizationURI + modelCustomizationUUID)); if (networkResourceCustomization != null) { networkResourceCustomization.setModelCustomizationUUID(modelCustomizationUUID); } @@ -512,8 +563,9 @@ public class CatalogDbClient { public BuildingBlockDetail getBuildingBlockDetail(String buildingBlockName) { - BuildingBlockDetail buildingBlockDetail = getSingleResource(buildingBlockDetailClient, getUri(UriBuilder - .fromUri(findOneByBuildingBlockName).queryParam(BUILDING_BLOCK_NAME, buildingBlockName).build().toString())); + BuildingBlockDetail buildingBlockDetail = + getSingleResource(buildingBlockDetailClient, getUri(UriBuilder.fromUri(findOneByBuildingBlockName) + .queryParam(BUILDING_BLOCK_NAME, buildingBlockName).build().toString())); if (buildingBlockDetail != null) { buildingBlockDetail.setBuildingBlockName(buildingBlockName); } @@ -523,228 +575,217 @@ public class CatalogDbClient { public OrchestrationStatusStateTransitionDirective getOrchestrationStatusStateTransitionDirective( ResourceType resourceType, OrchestrationStatus orchestrationStatus, OrchestrationAction targetAction) { - return getSingleResource(orchestrationStatusStateTransitionDirectiveClient, UriBuilder - .fromUri(findOneByResourceTypeAndOrchestrationStatusAndTargetAction) - .queryParam(RESOURCE_TYPE, resourceType.name()) - .queryParam(ORCHESTRATION_STATUS, orchestrationStatus.name()) - .queryParam(TARGET_ACTION, targetAction.name()).build()); + return getSingleResource(orchestrationStatusStateTransitionDirectiveClient, + UriBuilder.fromUri(findOneByResourceTypeAndOrchestrationStatusAndTargetAction) + .queryParam(RESOURCE_TYPE, resourceType.name()) + .queryParam(ORCHESTRATION_STATUS, orchestrationStatus.name()) + .queryParam(TARGET_ACTION, targetAction.name()).build()); } public List<OrchestrationFlow> getOrchestrationFlowByAction(String action) { - return this.getMultipleResources(orchestrationClient, UriBuilder - .fromUri(findByAction).queryParam(ACTION, action).build()); + return this.getMultipleResources(orchestrationClient, + UriBuilder.fromUri(findByAction).queryParam(ACTION, action).build()); } public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupsByVnfResourceCust(String modelCustomizationUUID) { - return this.getMultipleResources(vnfcInstanceGroupCustomizationClient, UriBuilder - .fromUri(findVnfcInstanceGroupCustomizationByModelCustomizationUUID) - .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build()); + return this.getMultipleResources(vnfcInstanceGroupCustomizationClient, + UriBuilder.fromUri(findVnfcInstanceGroupCustomizationByModelCustomizationUUID) + .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build()); } public List<CollectionResourceInstanceGroupCustomization> getCollectionResourceInstanceGroupCustomizationByModelCustUUID( String modelCustomizationUUID) { - return this.getMultipleResources(collectionResourceInstanceGroupCustomizationClient, UriBuilder - .fromUri(findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID) - .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build()); + return this.getMultipleResources(collectionResourceInstanceGroupCustomizationClient, + UriBuilder.fromUri(findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID) + .queryParam(MODEL_CUSTOMIZATION_UUID, modelCustomizationUUID).build()); } - public VfModuleCustomization getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID(String modelCustomizationUUID, String vfModuleModelUUID) { - return this.getSingleResource(vfModuleCustomizationClient, getUri(UriBuilder - .fromUri(findByModelCustomizationUUIDAndVfModuleModelUUID) - .queryParam("MODEL_CUSTOMIZATION_UUID",modelCustomizationUUID) - .queryParam("MODEL_UUID",vfModuleModelUUID).build().toString())); + public VfModuleCustomization getVfModuleCustomizationByModelCustomizationUUIDAndVfModuleModelUUID( + String modelCustomizationUUID, String vfModuleModelUUID) { + return this.getSingleResource(vfModuleCustomizationClient, + getUri(UriBuilder.fromUri(findByModelCustomizationUUIDAndVfModuleModelUUID) + .queryParam("MODEL_CUSTOMIZATION_UUID", modelCustomizationUUID) + .queryParam("MODEL_UUID", vfModuleModelUUID).build().toString())); } public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScope(String requestAction, String resourceName, boolean aLaCarte) { - return this.getSingleResource(northBoundRequestClient, UriBuilder - .fromUri(findOneByActionAndRequestScopeAndIsAlacarte) - .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) - .queryParam(IS_ALACARTE, aLaCarte).build()); + return this.getSingleResource(northBoundRequestClient, + UriBuilder.fromUri(findOneByActionAndRequestScopeAndIsAlacarte).queryParam(ACTION, requestAction) + .queryParam(REQUEST_SCOPE, resourceName).queryParam(IS_ALACARTE, aLaCarte).build()); } - + public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction, String resourceName, boolean aLaCarte, String cloudOwner) { - return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder - .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) - .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) - .queryParam(IS_ALACARTE, aLaCarte) - .queryParam(CLOUD_OWNER, cloudOwner) - .queryParam(SERVICE_TYPE, ASTERISK).build().toString())); - } - - public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType(String requestAction, - String resourceName, boolean aLaCarte, String cloudOwner, String serviceType) { - return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder - .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) - .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) - .queryParam(IS_ALACARTE, aLaCarte) - .queryParam(CLOUD_OWNER, cloudOwner) - .queryParam(SERVICE_TYPE, serviceType).build().toString())); + return this.getSingleResource(northBoundRequestClient, + getUri(UriBuilder.fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) + .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) + .queryParam(IS_ALACARTE, aLaCarte).queryParam(CLOUD_OWNER, cloudOwner) + .queryParam(SERVICE_TYPE, ASTERISK).build().toString())); + } + + public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType( + String requestAction, String resourceName, boolean aLaCarte, String cloudOwner, String serviceType) { + return this.getSingleResource(northBoundRequestClient, + getUri(UriBuilder.fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) + .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) + .queryParam(IS_ALACARTE, aLaCarte).queryParam(CLOUD_OWNER, cloudOwner) + .queryParam(SERVICE_TYPE, serviceType).build().toString())); } public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep( String flowName, String serviceType, String vnfType, String errorCode, String workStep) { - return this.getSingleResource(rainyDayHandlerStatusClient, getUri(UriBuilder - .fromUri(findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep) - .queryParam(FLOW_NAME, flowName).queryParam(SERVICE_TYPE, serviceType) - .queryParam(VNF_TYPE, vnfType).queryParam(ERROR_CODE, errorCode).queryParam(WORK_STEP, workStep) - .build().toString())); + return this.getSingleResource(rainyDayHandlerStatusClient, + getUri(UriBuilder.fromUri(findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep) + .queryParam(FLOW_NAME, flowName).queryParam(SERVICE_TYPE, serviceType) + .queryParam(VNF_TYPE, vnfType).queryParam(ERROR_CODE, errorCode).queryParam(WORK_STEP, workStep) + .build().toString())); } - public ServiceRecipe getFirstByServiceModelUUIDAndAction(String modelUUID, String action){ - return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder - .fromUri(findFirstByServiceModelUUIDAndActionURI) - .queryParam(SERVICE_MODEL_UUID,modelUUID) - .queryParam(ACTION,action).build().toString())); + public ServiceRecipe getFirstByServiceModelUUIDAndAction(String modelUUID, String action) { + return this.getSingleResource(serviceRecipeClient, + getUri(UriBuilder.fromUri(findFirstByServiceModelUUIDAndActionURI) + .queryParam(SERVICE_MODEL_UUID, modelUUID).queryParam(ACTION, action).build().toString())); } - public NetworkRecipe getFirstNetworkRecipeByModelNameAndAction(String modelName, String action){ - return this.getSingleResource(networkRecipeClient, UriBuilder - .fromUri(findFirstByModelNameAndAction) - .queryParam(MODEL_NAME,modelName) - .queryParam(ACTION,action).build()); + public NetworkRecipe getFirstNetworkRecipeByModelNameAndAction(String modelName, String action) { + return this.getSingleResource(networkRecipeClient, UriBuilder.fromUri(findFirstByModelNameAndAction) + .queryParam(MODEL_NAME, modelName).queryParam(ACTION, action).build()); } - - public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType, String actionCategory) { - return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder - .fromUri(endpoint + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory") - .queryParam("VNF_TYPE", vnfType).queryParam("ACTION_CATEGORY", actionCategory).build()); + + public ControllerSelectionReference getControllerSelectionReferenceByVnfTypeAndActionCategory(String vnfType, + String actionCategory) { + return this.getSingleResource(controllerSelectionReferenceClient, UriBuilder.fromUri(endpoint + + "/controllerSelectionReference/search/findControllerSelectionReferenceByVnfTypeAndActionCategory") + .queryParam("VNF_TYPE", vnfType).queryParam("ACTION_CATEGORY", actionCategory).build()); } - public Service getFirstByModelNameOrderByModelVersionDesc(String modelName){ - return this.getSingleResource(serviceClient,UriBuilder - .fromUri(findFirstByModelNameURI) - .queryParam(MODEL_NAME,modelName).build()); + public Service getFirstByModelNameOrderByModelVersionDesc(String modelName) { + return this.getSingleResource(serviceClient, + UriBuilder.fromUri(findFirstByModelNameURI).queryParam(MODEL_NAME, modelName).build()); } - public ExternalServiceToInternalService findExternalToInternalServiceByServiceName(String serviceName){ - return this.getSingleResource(externalServiceToInternalServiceClient, getUri(UriBuilder - .fromUri(findExternalToInternalServiceByServiceName) - .queryParam(SERVICE_NAME,serviceName).build().toString())); + public ExternalServiceToInternalService findExternalToInternalServiceByServiceName(String serviceName) { + return this.getSingleResource(externalServiceToInternalServiceClient, + getUri(UriBuilder.fromUri(findExternalToInternalServiceByServiceName) + .queryParam(SERVICE_NAME, serviceName).build().toString())); } - public ServiceRecipe findServiceRecipeByActionAndServiceModelUUID(String action,String modelUUID){ - return this.getSingleResource(serviceRecipeClient, getUri(UriBuilder - .fromUri(findServiceRecipeByActionAndServiceModelUUID) - .queryParam(ACTION,action) - .queryParam(SERVICE_MODEL_UUID,modelUUID).build().toString())); + public ServiceRecipe findServiceRecipeByActionAndServiceModelUUID(String action, String modelUUID) { + return this.getSingleResource(serviceRecipeClient, + getUri(UriBuilder.fromUri(findServiceRecipeByActionAndServiceModelUUID).queryParam(ACTION, action) + .queryParam(SERVICE_MODEL_UUID, modelUUID).build().toString())); } - public Service getServiceByModelName(String modelName){ - return this.getSingleResource(serviceClient,getUri(UriBuilder - .fromUri(findServiceByModelName) - .queryParam(MODEL_NAME,modelName).build().toString())); + public Service getServiceByModelName(String modelName) { + return this.getSingleResource(serviceClient, getUri( + UriBuilder.fromUri(findServiceByModelName).queryParam(MODEL_NAME, modelName).build().toString())); } - public Service getServiceByModelUUID(String modelModelUUID){ - return this.getSingleResource(serviceClient,getUri(UriBuilder - .fromUri(findServiceByModelUUID) - .queryParam(MODEL_UUID,modelModelUUID).build().toString())); + public Service getServiceByModelUUID(String modelModelUUID) { + return this.getSingleResource(serviceClient, getUri( + UriBuilder.fromUri(findServiceByModelUUID).queryParam(MODEL_UUID, modelModelUUID).build().toString())); } - public VnfResource getFirstVnfResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion){ - return this.getSingleResource(vnfResourceClient, getUri(UriBuilder - .fromUri(findFirstResourceByModelInvariantUUIDAndModelVersion) - .queryParam(MODEL_INVARIANT_UUID,modelInvariantUUID) - .queryParam(MODEL_VERSION,modelVersion).build().toString())); + public VnfResource getFirstVnfResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, + String modelVersion) { + return this.getSingleResource(vnfResourceClient, + getUri(UriBuilder.fromUri(findFirstResourceByModelInvariantUUIDAndModelVersion) + .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).queryParam(MODEL_VERSION, modelVersion) + .build().toString())); } - public VnfResourceCustomization getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources(String modelInstanceName, VnfResource vnfResource){ - return this.getSingleResource(vnfResourceCustomizationClient, getUri(UriBuilder - .fromUri(findByModelInstanceNameAndVnfResources) - .queryParam("MODEL_INSTANCE_NAME",modelInstanceName) - .queryParam("VNF_RESOURCE_MODEL_UUID",vnfResource.getModelUUID()).build().toString())); + public VnfResourceCustomization getFirstVnfResourceCustomizationByModelInstanceNameAndVnfResources( + String modelInstanceName, VnfResource vnfResource) { + return this.getSingleResource(vnfResourceCustomizationClient, + getUri(UriBuilder.fromUri(findByModelInstanceNameAndVnfResources) + .queryParam("MODEL_INSTANCE_NAME", modelInstanceName) + .queryParam("VNF_RESOURCE_MODEL_UUID", vnfResource.getModelUUID()).build().toString())); } - public VnfRecipe getFirstVnfRecipeByNfRoleAndAction(String nfRole, String action){ - return this.getSingleResource(vnfRecipeClient,getUri(UriBuilder - .fromUri(findFirstVnfRecipeByNfRoleAndAction) - .queryParam(NF_ROLE,nfRole) - .queryParam(ACTION,action).build().toString())); + public VnfRecipe getFirstVnfRecipeByNfRoleAndAction(String nfRole, String action) { + return this.getSingleResource(vnfRecipeClient, getUri(UriBuilder.fromUri(findFirstVnfRecipeByNfRoleAndAction) + .queryParam(NF_ROLE, nfRole).queryParam(ACTION, action).build().toString())); } - public VnfComponentsRecipe getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(String vfModuleModelUUID, String vnfComponentType, String action){ - return this.getSingleResource(vnfComponentsRecipeClient,getUri(UriBuilder - .fromUri(findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction) - .queryParam(VF_MODULE_MODEL_UUID,vfModuleModelUUID) - .queryParam(VNF_COMPONENT_TYPE,vnfComponentType) - .queryParam(ACTION,action).build().toString())); + public VnfComponentsRecipe getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction( + String vfModuleModelUUID, String vnfComponentType, String action) { + return this.getSingleResource(vnfComponentsRecipeClient, + getUri(UriBuilder.fromUri(findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction) + .queryParam(VF_MODULE_MODEL_UUID, vfModuleModelUUID) + .queryParam(VNF_COMPONENT_TYPE, vnfComponentType).queryParam(ACTION, action).build() + .toString())); } - public VnfComponentsRecipe getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType, String action) { - return this.getSingleResource(vnfComponentsRecipeClient,getUri(UriBuilder - .fromUri(findFirstVnfComponentsRecipeByVnfComponentTypeAndAction) - .queryParam(VNF_COMPONENT_TYPE,vnfComponentType) - .queryParam(ACTION,action).build().toString())); + public VnfComponentsRecipe getFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType, + String action) { + return this.getSingleResource(vnfComponentsRecipeClient, + getUri(UriBuilder.fromUri(findFirstVnfComponentsRecipeByVnfComponentTypeAndAction) + .queryParam(VNF_COMPONENT_TYPE, vnfComponentType).queryParam(ACTION, action).build() + .toString())); } - protected URI getUri(String template){ + + protected URI getUri(String template) { return URI.create(template); } public CloudifyManager getCloudifyManager(String id) { - return this.getSingleResource(cloudifyManagerClient,getUri(cloudifyManagerURI + id)); + return this.getSingleResource(cloudifyManagerClient, getUri(cloudifyManagerURI + id)); } - public CloudSite getCloudSite(String id){ - return this.getSingleResource(cloudSiteClient, - getUri(cloudSiteURI + id)); + public CloudSite getCloudSite(String id) { + return this.getSingleResource(cloudSiteClient, getUri(cloudSiteURI + id)); } - public CloudSite getCloudSite(String id, String uri){ - return this.getSingleResource(cloudSiteClient, - getUri(uri + id)); + public CloudSite getCloudSite(String id, String uri) { + return this.getSingleResource(cloudSiteClient, getUri(uri + id)); } - public void postCloudSite(CloudSite cloudSite){ + public void postCloudSite(CloudSite cloudSite) { this.postSingleResource(cloudSiteClient, cloudSite); } - public CloudSite getCloudSiteByClliAndAicVersion (String clli, String cloudVersion){ - return this.getSingleResource(cloudSiteClient, getUri(UriBuilder - .fromUri(findByClliAndCloudVersion) - .queryParam(CLLI,clli).queryParam(CLOUD_VERSION,cloudVersion).build().toString())); + public CloudSite getCloudSiteByClliAndAicVersion(String clli, String cloudVersion) { + return this.getSingleResource(cloudSiteClient, getUri(UriBuilder.fromUri(findByClliAndCloudVersion) + .queryParam(CLLI, clli).queryParam(CLOUD_VERSION, cloudVersion).build().toString())); } - public HomingInstance getHomingInstance (String serviceInstanceId){ - return this.getSingleResource(homingInstanceClient, - getUri(homingInstanceURI + serviceInstanceId)); + public HomingInstance getHomingInstance(String serviceInstanceId) { + return this.getSingleResource(homingInstanceClient, getUri(homingInstanceURI + serviceInstanceId)); } - public HomingInstance getHomingInstance (String serviceInstanceId, String uri){ - return this.getSingleResource(homingInstanceClient, - getUri(uri + serviceInstanceId)); + public HomingInstance getHomingInstance(String serviceInstanceId, String uri) { + return this.getSingleResource(homingInstanceClient, getUri(uri + serviceInstanceId)); } - public void postHomingInstance(HomingInstance homingInstance){ + public void postHomingInstance(HomingInstance homingInstance) { this.postSingleResource(homingInstanceClient, homingInstance); } public Service getServiceByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID) { - return this.getSingleResource(serviceClient, getUri(UriBuilder - .fromUri(findFirstByModelVersionAndModelInvariantUUIDURI) - .queryParam(MODEL_VERSION, modelVersion) - .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString())); + return this.getSingleResource(serviceClient, + getUri(UriBuilder.fromUri(findFirstByModelVersionAndModelInvariantUUIDURI) + .queryParam(MODEL_VERSION, modelVersion).queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID) + .build().toString())); } - public VfModule getVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion){ - return this.getSingleResource(vfModuleClient,getUri(UriBuilder - .fromUri(findFirstVfModuleByModelInvariantUUIDAndModelVersion) - .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID) - .queryParam(MODEL_VERSION, modelVersion).build().toString())); + public VfModule getVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion) { + return this.getSingleResource(vfModuleClient, + getUri(UriBuilder.fromUri(findFirstVfModuleByModelInvariantUUIDAndModelVersion) + .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).queryParam(MODEL_VERSION, modelVersion) + .build().toString())); } public List<Service> getServiceByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) { - return this.getMultipleResources(serviceClient, getUri(UriBuilder - .fromUri(findByModelInvariantUUIDURI) + return this.getMultipleResources(serviceClient, getUri(UriBuilder.fromUri(findByModelInvariantUUIDURI) .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString())); } public List<VfModule> getVfModuleByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID) { - return this.getMultipleResources(vfModuleClient, getUri(UriBuilder - .fromUri(findVfModuleByModelInvariantUUIDOrderByModelVersionDesc) - .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString())); + return this.getMultipleResources(vfModuleClient, + getUri(UriBuilder.fromUri(findVfModuleByModelInvariantUUIDOrderByModelVersionDesc) + .queryParam(MODEL_INVARIANT_UUID, modelInvariantUUID).build().toString())); } private <T> T getSingleResource(Client<T> client, URI uri) { @@ -759,64 +800,76 @@ public class CatalogDbClient { return list; } - private <T> URI postSingleResource(Client<T> client, T type){ + private <T> URI postSingleResource(Client<T> client, T type) { return client.post(type); } - + public List<CvnfcCustomization> getCvnfcCustomization(String serviceModelUUID, String vnfCustomizationUUID, - String vfModuleCustomizationUUID) { + String vfModuleCustomizationUUID) { Service service = this.getServiceByID(serviceModelUUID); - VnfResourceCustomization vnfResourceCust = findVnfResourceCustomizationInList(vnfCustomizationUUID, service.getVnfCustomizations()); - VfModuleCustomization vfModuleCust = findVfModuleCustomizationInList(vfModuleCustomizationUUID , vnfResourceCust.getVfModuleCustomizations()); + VnfResourceCustomization vnfResourceCust = + findVnfResourceCustomizationInList(vnfCustomizationUUID, service.getVnfCustomizations()); + VfModuleCustomization vfModuleCust = + findVfModuleCustomizationInList(vfModuleCustomizationUUID, vnfResourceCust.getVfModuleCustomizations()); return vfModuleCust.getCvnfcCustomization().stream().collect(Collectors.toList()); } - - private VnfResourceCustomization findVnfResourceCustomizationInList(String vnfCustomizationUUID , List<VnfResourceCustomization> vnfResourceCusts){ + + private VnfResourceCustomization findVnfResourceCustomizationInList(String vnfCustomizationUUID, + List<VnfResourceCustomization> vnfResourceCusts) { List<VnfResourceCustomization> filtered = vnfResourceCusts.stream() .filter(vnfCustRes -> vnfCustomizationUUID.equals(vnfCustRes.getModelCustomizationUUID())) .collect(Collectors.toList()); - if(filtered != null && !filtered.isEmpty() && filtered.size() == 1){ + if (filtered != null && !filtered.isEmpty() && filtered.size() == 1) { return filtered.get(0); - }else - throw new EntityNotFoundException("Unable to find VnfResourceCustomization ModelCustomizationUUID:" + vnfCustomizationUUID); + } else + throw new EntityNotFoundException( + "Unable to find VnfResourceCustomization ModelCustomizationUUID:" + vnfCustomizationUUID); } - - private VfModuleCustomization findVfModuleCustomizationInList(String vfModuleCustomizationUUID , List<VfModuleCustomization> vfModuleList){ + + private VfModuleCustomization findVfModuleCustomizationInList(String vfModuleCustomizationUUID, + List<VfModuleCustomization> vfModuleList) { List<VfModuleCustomization> filtered = vfModuleList.stream() .filter(vfModuleCust -> vfModuleCustomizationUUID.equals(vfModuleCust.getModelCustomizationUUID())) .collect(Collectors.toList()); - if(filtered != null && !filtered.isEmpty() && filtered.size() == 1){ + if (filtered != null && !filtered.isEmpty() && filtered.size() == 1) { return filtered.get(0); - }else - throw new EntityNotFoundException("Unable to find VfModuleCustomization ModelCustomizationUUID:" + vfModuleCustomizationUUID); + } else + throw new EntityNotFoundException( + "Unable to find VfModuleCustomization ModelCustomizationUUID:" + vfModuleCustomizationUUID); } - - private CvnfcCustomization findCvnfcCustomizationInAList(String cvnfcCustomizationUuid , List<CvnfcCustomization> cvnfcCustomList){ + + private CvnfcCustomization findCvnfcCustomizationInAList(String cvnfcCustomizationUuid, + List<CvnfcCustomization> cvnfcCustomList) { List<CvnfcCustomization> filtered = cvnfcCustomList.stream() .filter(cvnfc -> cvnfcCustomizationUuid.equals(cvnfc.getModelCustomizationUUID())) .collect(Collectors.toList()); - if(filtered != null && !filtered.isEmpty() && filtered.size() == 1){ + if (filtered != null && !filtered.isEmpty() && filtered.size() == 1) { logger.debug("Found CvnfcCustomization: {}", filtered.get(0)); return filtered.get(0); - }else - throw new EntityNotFoundException("Unable to find CvnfcCustomization ModelCustomizationUUID:" + cvnfcCustomizationUuid); + } else + throw new EntityNotFoundException( + "Unable to find CvnfcCustomization ModelCustomizationUUID:" + cvnfcCustomizationUuid); } - + public CvnfcConfigurationCustomization getCvnfcCustomization(String serviceModelUUID, String vnfCustomizationUuid, String vfModuleCustomizationUuid, String cvnfcCustomizationUuid) { - List<CvnfcCustomization> cvnfcCustomization = getCvnfcCustomization(serviceModelUUID,vnfCustomizationUuid,vfModuleCustomizationUuid); - CvnfcCustomization cvnfc = findCvnfcCustomizationInAList(cvnfcCustomizationUuid,cvnfcCustomization ); - List<CvnfcConfigurationCustomization> fabricConfigs = cvnfc.getCvnfcConfigurationCustomization().stream().filter(cvnfcCustom -> cvnfcCustom.getConfigurationResource().getToscaNodeType().contains("FabricConfiguration")).collect(Collectors.toList()); - if(fabricConfigs != null && !fabricConfigs.isEmpty() && fabricConfigs.size() == 1){ + List<CvnfcCustomization> cvnfcCustomization = + getCvnfcCustomization(serviceModelUUID, vnfCustomizationUuid, vfModuleCustomizationUuid); + CvnfcCustomization cvnfc = findCvnfcCustomizationInAList(cvnfcCustomizationUuid, cvnfcCustomization); + List<CvnfcConfigurationCustomization> fabricConfigs = cvnfc + .getCvnfcConfigurationCustomization().stream().filter(cvnfcCustom -> cvnfcCustom + .getConfigurationResource().getToscaNodeType().contains("FabricConfiguration")) + .collect(Collectors.toList()); + if (fabricConfigs != null && !fabricConfigs.isEmpty() && fabricConfigs.size() == 1) { logger.debug("Found Fabric Configuration: {}", fabricConfigs.get(0)); return fabricConfigs.get(0); - }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())); + } 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/AllottedResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceCustomizationRepository.java index 57fe2df182..4c2891be6a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceCustomizationRepository.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.data.repository; import java.util.List; - import org.onap.so.db.catalog.beans.AllottedResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @@ -30,9 +29,11 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "allottedResourceCustomization", path = "allottedResourceCustomization") public interface AllottedResourceCustomizationRepository extends JpaRepository<AllottedResourceCustomization, String> { - @Query(value = "SELECT * FROM ALLOTTED_RESOURCE_CUSTOMIZATION WHERE PROVIDING_SERVICE_MODEL_UUID =?0", nativeQuery = true) - List<AllottedResourceCustomization> queryByProvidingServiceModelUUID(String providingServiceModelUUID); + @Query(value = "SELECT * FROM ALLOTTED_RESOURCE_CUSTOMIZATION WHERE PROVIDING_SERVICE_MODEL_UUID =?0", + nativeQuery = true) + List<AllottedResourceCustomization> queryByProvidingServiceModelUUID(String providingServiceModelUUID); + + List<AllottedResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); - List<AllottedResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); - AllottedResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); -}
\ No newline at end of file + AllottedResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceRepository.java index 9d0ac92449..ba23f351b5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/AllottedResourceRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "allottedResource", path = "allottedResource") public interface AllottedResourceRepository extends JpaRepository<AllottedResource, String> { - AllottedResource findResourceByModelUUID(String modelUUID); + AllottedResource findResourceByModelUUID(String modelUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ArRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ArRecipeRepository.java index 22f3ccbead..bdc30b7220 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ArRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ArRecipeRepository.java @@ -27,6 +27,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "arRecipe", path = "arRecipe") public interface ArRecipeRepository extends JpaRepository<ArRecipe, String> { - ArRecipe findByModelNameAndAction(String modelName, String action); - ArRecipe findByModelNameAndActionAndVersion(String modelName, String action, String version); + ArRecipe findByModelNameAndAction(String modelName, String action); + + ArRecipe findByModelNameAndActionAndVersion(String modelName, String action, String version); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/BuildingBlockDetailRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/BuildingBlockDetailRepository.java index d86377127c..6a1028c868 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/BuildingBlockDetailRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/BuildingBlockDetailRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "buildingBlockDetail", path = "buildingBlockDetail") public interface BuildingBlockDetailRepository extends JpaRepository<BuildingBlockDetail, String> { - BuildingBlockDetail findOneByBuildingBlockName(String buildingBlockName); + BuildingBlockDetail findOneByBuildingBlockName(String buildingBlockName); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudSiteRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudSiteRepository.java index fc5a95769d..0ae0c186b5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudSiteRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CloudSiteRepository.java @@ -23,12 +23,11 @@ package org.onap.so.db.catalog.data.repository; import org.onap.so.db.catalog.beans.CloudSite; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; - import javax.transaction.Transactional; @RepositoryRestResource(collectionResourceRel = "cloudSite", path = "cloudSite") @Transactional public interface CloudSiteRepository extends JpaRepository<CloudSite, String> { - CloudSite findByClliAndCloudVersion(String clli,String cloudVersion); + CloudSite findByClliAndCloudVersion(String clli, String cloudVersion); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionNetworkResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionNetworkResourceCustomizationRepository.java index d27dce161e..5b006ec4ce 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionNetworkResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionNetworkResourceCustomizationRepository.java @@ -23,10 +23,11 @@ import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "collectionNetworkResourceCustomization", path = "collectionNetworkResourceCustomization") +@RepositoryRestResource(collectionResourceRel = "collectionNetworkResourceCustomization", + path = "collectionNetworkResourceCustomization") public interface CollectionNetworkResourceCustomizationRepository - extends JpaRepository<CollectionNetworkResourceCustomization, String> { - - CollectionNetworkResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); + extends JpaRepository<CollectionNetworkResourceCustomization, String> { -}
\ No newline at end of file + CollectionNetworkResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); + +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceCustomizationRepository.java index 6e33eac556..d86910e318 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceCustomizationRepository.java @@ -23,7 +23,9 @@ import org.onap.so.db.catalog.beans.CollectionResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "collectionResourceCustomization", path = "collectionResourceCustomization") -public interface CollectionResourceCustomizationRepository extends JpaRepository<CollectionResourceCustomization, Long> { - CollectionResourceCustomization findByModelCustomizationUUID(String modelCustomizationUUID); -}
\ No newline at end of file +@RepositoryRestResource(collectionResourceRel = "collectionResourceCustomization", + path = "collectionResourceCustomization") +public interface CollectionResourceCustomizationRepository + extends JpaRepository<CollectionResourceCustomization, Long> { + CollectionResourceCustomization findByModelCustomizationUUID(String modelCustomizationUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceInstanceGroupCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceInstanceGroupCustomizationRepository.java index 32e09bf2af..5336c65bdc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceInstanceGroupCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceInstanceGroupCustomizationRepository.java @@ -21,14 +21,14 @@ package org.onap.so.db.catalog.data.repository; import java.util.List; - import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "collectionResourceInstanceGroupCustomization", path = "collectionResourceInstanceGroupCustomization") +@RepositoryRestResource(collectionResourceRel = "collectionResourceInstanceGroupCustomization", + path = "collectionResourceInstanceGroupCustomization") public interface CollectionResourceInstanceGroupCustomizationRepository - extends JpaRepository<CollectionResourceInstanceGroupCustomization, String> { + extends JpaRepository<CollectionResourceInstanceGroupCustomization, String> { - List<CollectionResourceInstanceGroupCustomization> findByModelCustomizationUUID(String modelCustomizationlUUID); + List<CollectionResourceInstanceGroupCustomization> findByModelCustomizationUUID(String modelCustomizationlUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceRepository.java index 5d847b87fb..1d8da188ce 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CollectionResourceRepository.java @@ -25,5 +25,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "collectionResource", path = "collectionResource") public interface CollectionResourceRepository extends JpaRepository<CollectionResource, String> { - CollectionResource findByModelUUID(String modelUUID); -}
\ No newline at end of file + CollectionResource findByModelUUID(String modelUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceCustomizationRepository.java index cd96f05c3e..43104986ff 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceCustomizationRepository.java @@ -23,8 +23,9 @@ import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "configurationResourceCustomization", path = "configurationResourceCustomization") +@RepositoryRestResource(collectionResourceRel = "configurationResourceCustomization", + path = "configurationResourceCustomization") public interface ConfigurationResourceCustomizationRepository - extends JpaRepository<ConfigurationResourceCustomization, String> { + extends JpaRepository<ConfigurationResourceCustomization, String> { -}
\ No newline at end of file +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceRepository.java index 5a29035cdb..9500b57d4c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ConfigurationResourceRepository.java @@ -25,5 +25,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "configurationResource", path = "configurationResource") public interface ConfigurationResourceRepository extends JpaRepository<ConfigurationResource, Long> { - ConfigurationResource findResourceByModelUUID(String modelUUID); -}
\ No newline at end of file + ConfigurationResource findResourceByModelUUID(String modelUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java index ad162b547a..fa6f0ed7c0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ControllerSelectionReferenceRepository.java @@ -26,10 +26,10 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.repository.query.Param; import org.springframework.data.rest.core.annotation.RepositoryRestResource; - @RepositoryRestResource(collectionResourceRel = "controllerSelectionReference", path = "controllerSelectionReference") - public interface ControllerSelectionReferenceRepository extends JpaRepository<ControllerSelectionReference, String> { - - public ControllerSelectionReference findControllerSelectionReferenceByVnfTypeAndActionCategory(@Param("VNF_TYPE") String vnfType, - @Param("ACTION_CATEGORY") String actionCategory); - - } +@RepositoryRestResource(collectionResourceRel = "controllerSelectionReference", path = "controllerSelectionReference") +public interface ControllerSelectionReferenceRepository extends JpaRepository<ControllerSelectionReference, String> { + + public ControllerSelectionReference findControllerSelectionReferenceByVnfTypeAndActionCategory( + @Param("VNF_TYPE") String vnfType, @Param("ACTION_CATEGORY") String actionCategory); + +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcConfigurationCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcConfigurationCustomizationRepository.java index ddb089dede..1e5a07350d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcConfigurationCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcConfigurationCustomizationRepository.java @@ -24,7 +24,9 @@ import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "cvnfcConfigurationCustomization", path = "cvnfcConfigurationCustomization") -public interface CvnfcConfigurationCustomizationRepository extends JpaRepository<CvnfcConfigurationCustomization, Integer> { +@RepositoryRestResource(collectionResourceRel = "cvnfcConfigurationCustomization", + path = "cvnfcConfigurationCustomization") +public interface CvnfcConfigurationCustomizationRepository + extends JpaRepository<CvnfcConfigurationCustomization, Integer> { -}
\ No newline at end of file +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java index 879d7bf82f..927848e5d4 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/CvnfcCustomizationRepository.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.data.repository; import java.util.List; - import org.onap.so.db.catalog.beans.CvnfcCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @@ -30,7 +29,8 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "cvnfcCustomization", path = "cvnfcCustomization") public interface CvnfcCustomizationRepository extends JpaRepository<CvnfcCustomization, Integer> { - CvnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); - List<CvnfcCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); + CvnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); + + List<CvnfcCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); -}
\ No newline at end of file +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ExternalServiceToInternalServiceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ExternalServiceToInternalServiceRepository.java index 91a912920e..546d1819dc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ExternalServiceToInternalServiceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ExternalServiceToInternalServiceRepository.java @@ -24,9 +24,12 @@ import org.onap.so.db.catalog.beans.ExternalServiceToInternalService; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "externalServiceToInternalService", path = "externalServiceToInternalService") +@RepositoryRestResource(collectionResourceRel = "externalServiceToInternalService", + path = "externalServiceToInternalService") public interface ExternalServiceToInternalServiceRepository - extends JpaRepository<ExternalServiceToInternalService, Integer> { - ExternalServiceToInternalService findByServiceName(String serviceName); - ExternalServiceToInternalService findByServiceNameAndSubscriptionServiceType(String serviceName , String subscriptionServiceType); + extends JpaRepository<ExternalServiceToInternalService, Integer> { + ExternalServiceToInternalService findByServiceName(String serviceName); + + ExternalServiceToInternalService findByServiceNameAndSubscriptionServiceType(String serviceName, + String subscriptionServiceType); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatEnvironmentRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatEnvironmentRepository.java index 85d57e5b85..aa2f5fc039 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatEnvironmentRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatEnvironmentRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "heatEnvironment", path = "heatEnvironment") public interface HeatEnvironmentRepository extends JpaRepository<HeatEnvironment, String> { - HeatEnvironment findByArtifactUuid(String artifactUUID); + HeatEnvironment findByArtifactUuid(String artifactUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatTemplateRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatTemplateRepository.java index cb79506868..6390d932f8 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatTemplateRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HeatTemplateRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "heatTemplate", path = "heatTemplate") public interface HeatTemplateRepository extends JpaRepository<HeatTemplate, String> { - HeatTemplate findByArtifactUuid(String artifactUUID); -}
\ No newline at end of file + HeatTemplate findByArtifactUuid(String artifactUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HomingInstanceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HomingInstanceRepository.java index aea8d3e537..a86990afb0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HomingInstanceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/HomingInstanceRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "homingInstance", path = "homingInstance") public interface HomingInstanceRepository extends JpaRepository<HomingInstance, String> { - HomingInstance findServiceByServiceInstanceId(String serviceInstanceId); + HomingInstance findServiceByServiceInstanceId(String serviceInstanceId); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/InstanceGroupRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/InstanceGroupRepository.java index 5f5d85ae99..7e1f81ab6e 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/InstanceGroupRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/InstanceGroupRepository.java @@ -25,5 +25,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "instanceGroup", path = "instanceGroup") public interface InstanceGroupRepository extends JpaRepository<InstanceGroup, String> { - InstanceGroup findByModelUUID(String modelUUID); -}
\ No newline at end of file + InstanceGroup findByModelUUID(String modelUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRecipeRepository.java index c54331b43d..2c4c0b129a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRecipeRepository.java @@ -27,7 +27,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "modelRecipe", path = "modelRecipe") public interface ModelRecipeRepository extends JpaRepository<ModelRecipe, Integer> { - - ModelRecipe findByModelIdAndAction(String modelId, String action); - + + ModelRecipe findByModelIdAndAction(String modelId, String action); + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRepository.java index e6e2904d43..9867dce4a6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ModelRepository.java @@ -27,7 +27,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "model", path = "model") public interface ModelRepository extends JpaRepository<Model, Integer> { - - Model findByModelVersionIdAndModelType(String modelVersionid, String modelType); - + + Model findByModelVersionIdAndModelType(String modelVersionid, String modelType); + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkCollectionResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkCollectionResourceCustomizationRepository.java index 1d9bf71396..6073478d13 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkCollectionResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkCollectionResourceCustomizationRepository.java @@ -23,7 +23,9 @@ import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "networkCollectionResourceCustomization", path = "networkCollectionResourceCustomization") -public interface NetworkCollectionResourceCustomizationRepository extends JpaRepository<NetworkCollectionResourceCustomization, String> { - NetworkCollectionResourceCustomization findByModelCustomizationUUID(String modelCustomizationUUID); -}
\ No newline at end of file +@RepositoryRestResource(collectionResourceRel = "networkCollectionResourceCustomization", + path = "networkCollectionResourceCustomization") +public interface NetworkCollectionResourceCustomizationRepository + extends JpaRepository<NetworkCollectionResourceCustomization, String> { + NetworkCollectionResourceCustomization findByModelCustomizationUUID(String modelCustomizationUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkInstanceGroupRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkInstanceGroupRepository.java index e2981ce96e..91c8f365e3 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkInstanceGroupRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkInstanceGroupRepository.java @@ -25,6 +25,6 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "networkInstanceGroup", path = "networkInstanceGroup") -public interface NetworkInstanceGroupRepository extends JpaRepository<NetworkInstanceGroup, String> { - NetworkInstanceGroup findByModelUUID(String modelUUID); +public interface NetworkInstanceGroupRepository extends JpaRepository<NetworkInstanceGroup, String> { + NetworkInstanceGroup findByModelUUID(String modelUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkRecipeRepository.java index c74fade8e3..d163e5f87c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkRecipeRepository.java @@ -26,6 +26,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "networkRecipe", path = "networkRecipe") public interface NetworkRecipeRepository extends JpaRepository<NetworkRecipe, String> { - NetworkRecipe findFirstByModelNameAndAction(String modelName, String action); - NetworkRecipe findFirstByModelNameAndActionAndVersionStr(String modelName, String action, String versionStr); -}
\ No newline at end of file + NetworkRecipe findFirstByModelNameAndAction(String modelName, String action); + + NetworkRecipe findFirstByModelNameAndActionAndVersionStr(String modelName, String action, String versionStr); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java index 799d98c5e4..76f33995b5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceCustomizationRepository.java @@ -21,18 +21,17 @@ package org.onap.so.db.catalog.data.repository; import java.util.List; - import org.onap.so.db.catalog.beans.NetworkResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "networkResourceCustomization", path = "networkResourceCustomization") public interface NetworkResourceCustomizationRepository extends JpaRepository<NetworkResourceCustomization, String> { - List<NetworkResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); + List<NetworkResourceCustomization> findByModelCustomizationUUID(String modelCustomizationUUID); - NetworkResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); + NetworkResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUUID); - List<NetworkResourceCustomization> findByNetworkType(String networkType); + List<NetworkResourceCustomization> findByNetworkType(String networkType); - NetworkResourceCustomization findOneByNetworkType(String networkType); -}
\ No newline at end of file + NetworkResourceCustomization findOneByNetworkType(String networkType); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java index 94c57945d1..eaeb4292fb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkResourceRepository.java @@ -28,14 +28,18 @@ import org.springframework.stereotype.Repository; @Repository public interface NetworkResourceRepository extends JpaRepository<NetworkResource, String> { - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelName - * @return - */ - @Query(value = "SELECT * FROM network_resource WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - NetworkResource findFirstByModelNameOrderByModelVersionDesc(String modelName); - - NetworkResource findResourceByModelUUID(String modelUUID); - NetworkResource findOneByModelName(String modelName); + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelName + * @return + */ + @Query(value = "SELECT * FROM network_resource WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + NetworkResource findFirstByModelNameOrderByModelVersionDesc(String modelName); + + NetworkResource findResourceByModelUUID(String modelUUID); + + NetworkResource findOneByModelName(String modelName); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java index 09732c2d8b..2e2228f489 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java @@ -26,7 +26,12 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "northbound_request_ref_lookup", path = "northbound_request_ref_lookup") public interface NorthBoundRequestRepository extends JpaRepository<NorthBoundRequest, Integer> { - NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarte(String action, String requestScope, Boolean isALaCarte); - NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner(String action, String requestScope, Boolean isALaCarte, String cloudOwner); - NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType(String action, String requestScope, Boolean isALaCarte, String cloudOwner, String serviceType); + NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarte(String action, String requestScope, + Boolean isALaCarte); + + NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner(String action, String requestScope, + Boolean isALaCarte, String cloudOwner); + + NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType(String action, + String requestScope, Boolean isALaCarte, String cloudOwner, String serviceType); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationFlowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationFlowRepository.java index 12fbc418f7..e56aff7dc6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationFlowRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationFlowRepository.java @@ -23,12 +23,11 @@ package org.onap.so.db.catalog.data.repository; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; - import java.util.List; @RepositoryRestResource(collectionResourceRel = "orchestrationFlow", path = "orchestrationFlow") public interface OrchestrationFlowRepository extends JpaRepository<OrchestrationFlow, Integer> { - List<OrchestrationFlow> findByAction(String action); + List<OrchestrationFlow> findByAction(String action); - OrchestrationFlow findOneByAction(String action); + OrchestrationFlow findOneByAction(String action); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationStatusStateTransitionDirectiveRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationStatusStateTransitionDirectiveRepository.java index e88480a022..ac9e057790 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationStatusStateTransitionDirectiveRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/OrchestrationStatusStateTransitionDirectiveRepository.java @@ -27,7 +27,10 @@ import org.onap.so.db.catalog.beans.ResourceType; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "orchestrationStatusStateTransitionDirective", path = "orchestrationStatusStateTransitionDirective") -public interface OrchestrationStatusStateTransitionDirectiveRepository extends JpaRepository<OrchestrationStatusStateTransitionDirective, String> { - OrchestrationStatusStateTransitionDirective findOneByResourceTypeAndOrchestrationStatusAndTargetAction(ResourceType resourceType, OrchestrationStatus orchestrationStatus, OrchestrationAction targetAction); +@RepositoryRestResource(collectionResourceRel = "orchestrationStatusStateTransitionDirective", + path = "orchestrationStatusStateTransitionDirective") +public interface OrchestrationStatusStateTransitionDirectiveRepository + extends JpaRepository<OrchestrationStatusStateTransitionDirective, String> { + OrchestrationStatusStateTransitionDirective findOneByResourceTypeAndOrchestrationStatusAndTargetAction( + ResourceType resourceType, OrchestrationStatus orchestrationStatus, OrchestrationAction targetAction); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java index f64311a561..7b228294e7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfCustomizationRepository.java @@ -1,20 +1,15 @@ /* - * ============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 + * ============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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.data.repository; @@ -32,12 +27,14 @@ public interface PnfCustomizationRepository extends JpaRepository<PnfResourceCus /** * Used to fetch the @{link PnfResourceCustomization} by the Model UUID. * - * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide PnfResourceCustomization based on model UUID without projection. + * This operation is required by {@link org.onap.so.db.catalog.client.CatalogDbClient} to provide + * PnfResourceCustomization based on model UUID without projection. * * @param serviceModelUuid model UUID * @return List of PnfResourceCustomization */ - @Query(value = "select b.* from pnf_resource_customization_to_service a join pnf_resource_customization b where a.RESOURCE_MODEL_CUSTOMIZATION_UUID = b.MODEL_CUSTOMIZATION_UUID and a.SERVICE_MODEL_UUID = ?1", nativeQuery = true) + @Query(value = "select b.* from pnf_resource_customization_to_service a join pnf_resource_customization b where a.RESOURCE_MODEL_CUSTOMIZATION_UUID = b.MODEL_CUSTOMIZATION_UUID and a.SERVICE_MODEL_UUID = ?1", + nativeQuery = true) List<PnfResourceCustomization> findPnfResourceCustomizationByModelUuid( - @Param("SERVICE_MODEL_UUID") String serviceModelUuid); -}
\ No newline at end of file + @Param("SERVICE_MODEL_UUID") String serviceModelUuid); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java index bf8e83bbac..69006e5e7a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/PnfResourceRepository.java @@ -1,20 +1,15 @@ /* - * ============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 + * ============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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.data.repository; @@ -26,4 +21,4 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "pnfResource", path = "pnfResource") public interface PnfResourceRepository extends JpaRepository<PnfResource, String> { -}
\ No newline at end of file +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/RainyDayHandlerStatusRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/RainyDayHandlerStatusRepository.java index 5039384845..2c61d91d6b 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/RainyDayHandlerStatusRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/RainyDayHandlerStatusRepository.java @@ -26,6 +26,6 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "rainy_day_handler_macro", path = "rainy_day_handler_macro") public interface RainyDayHandlerStatusRepository extends JpaRepository<RainyDayHandlerStatus, Integer> { - RainyDayHandlerStatus findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep( - String flowName, String serviceType, String vnfType, String errorCode, String workStep); + RainyDayHandlerStatus findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep(String flowName, + String serviceType, String vnfType, String errorCode, String workStep); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceProxyResourceCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceProxyResourceCustomizationRepository.java index cb98c8a709..706873b125 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceProxyResourceCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceProxyResourceCustomizationRepository.java @@ -23,9 +23,10 @@ import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "serviceProxyResourceCustomization", path = "serviceProxyResourceCustomization") +@RepositoryRestResource(collectionResourceRel = "serviceProxyResourceCustomization", + path = "serviceProxyResourceCustomization") public interface ServiceProxyResourceCustomizationRepository - extends JpaRepository<ServiceProxyResourceCustomization, String> { - - ServiceProxyResourceCustomization findResourceByModelCustomizationUUID(String modelCustomizationUUID); -}
\ No newline at end of file + extends JpaRepository<ServiceProxyResourceCustomization, String> { + + ServiceProxyResourceCustomization findResourceByModelCustomizationUUID(String modelCustomizationUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java index 40ab1704fd..898911fd1c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRecipeRepository.java @@ -26,9 +26,9 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "serviceRecipe", path = "serviceRecipe") public interface ServiceRecipeRepository extends JpaRepository<ServiceRecipe, Long> { - ServiceRecipe findByActionAndServiceModelUUID(String action, String serviceModelUUID); + ServiceRecipe findByActionAndServiceModelUUID(String action, String serviceModelUUID); - ServiceRecipe findByAction(String action); + ServiceRecipe findByAction(String action); - ServiceRecipe findFirstByServiceModelUUIDAndAction(String serviceModelUUID, String action); -}
\ No newline at end of file + ServiceRecipe findFirstByServiceModelUUIDAndAction(String serviceModelUUID, String action); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java index 2d29a78351..c107192060 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/ServiceRepository.java @@ -24,72 +24,89 @@ import org.onap.so.db.catalog.beans.Service; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.rest.core.annotation.RepositoryRestResource; - import java.util.List; @RepositoryRestResource(collectionResourceRel = "service", path = "service") public interface ServiceRepository extends JpaRepository<Service, String> { - List<Service> findByModelName(String modelName); - - Service findOneByModelName(String modelName); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelName - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findFirstByModelNameOrderByModelVersionDesc(String modelName); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelName - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findByModelNameOrderByModelVersionDesc(String modelName); - - Service findOneByModelNameAndModelVersion(String modelName, String modelVersion); - - Service findByModelNameAndModelVersion(String modelName, String modelVersion); - - Service findByServiceType(String serviceType); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelUUID - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findFirstOneByModelUUIDOrderByModelVersionDesc(String modelUUID); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelUUID - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findOneByModelUUIDOrderByModelVersionDesc(String modelUUID); - - Service findFirstByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelInvariantUUID - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - Service findFirstByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); - - List<Service> findByModelUUID(String modelUUID); - - Service findOneByModelUUID(String modelUUID); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelInvariantUUID - * @return - */ - @Query(value = "SELECT * FROM service WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC;", nativeQuery = true) - List<Service> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); -}
\ No newline at end of file + List<Service> findByModelName(String modelName); + + Service findOneByModelName(String modelName); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelName + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + Service findFirstByModelNameOrderByModelVersionDesc(String modelName); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelName + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + Service findByModelNameOrderByModelVersionDesc(String modelName); + + Service findOneByModelNameAndModelVersion(String modelName, String modelVersion); + + Service findByModelNameAndModelVersion(String modelName, String modelVersion); + + Service findByServiceType(String serviceType); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelUUID + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + Service findFirstOneByModelUUIDOrderByModelVersionDesc(String modelUUID); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelUUID + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + Service findOneByModelUUIDOrderByModelVersionDesc(String modelUUID); + + Service findFirstByModelVersionAndModelInvariantUUID(String modelVersion, String modelInvariantUUID); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelInvariantUUID + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + Service findFirstByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); + + List<Service> findByModelUUID(String modelUUID); + + Service findOneByModelUUID(String modelUUID); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelInvariantUUID + * @return + */ + @Query(value = "SELECT * FROM service WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC;", + nativeQuery = true) + List<Service> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/TempNetworkHeatTemplateRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/TempNetworkHeatTemplateRepository.java index d506c5b585..d9b7399de6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/TempNetworkHeatTemplateRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/TempNetworkHeatTemplateRepository.java @@ -27,5 +27,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "tempNetworkHeatTemplateLookup", path = "tempNetworkHeatTemplateLookup") public interface TempNetworkHeatTemplateRepository extends JpaRepository<TempNetworkHeatTemplateLookup, String> { - TempNetworkHeatTemplateLookup findFirstBynetworkResourceModelName(String networkResourceModelName); -}
\ No newline at end of file + TempNetworkHeatTemplateLookup findFirstBynetworkResourceModelName(String networkResourceModelName); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFCInstanceGroupRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFCInstanceGroupRepository.java index da091827b7..69cabd948d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFCInstanceGroupRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFCInstanceGroupRepository.java @@ -25,6 +25,6 @@ import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vfcInstanceGroup", path = "vfcInstanceGroup") -public interface VFCInstanceGroupRepository extends JpaRepository<VFCInstanceGroup, String> { - VFCInstanceGroup findByModelUUID(String modelUUID); +public interface VFCInstanceGroupRepository extends JpaRepository<VFCInstanceGroup, String> { + VFCInstanceGroup findByModelUUID(String modelUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleCustomizationRepository.java index e8fb654f57..8b27c7bf10 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleCustomizationRepository.java @@ -27,7 +27,10 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vfModuleCustomization", path = "vfModuleCustomization") public interface VFModuleCustomizationRepository extends JpaRepository<VfModuleCustomization, Integer> { - VfModuleCustomization findFirstByModelCustomizationUUIDOrderByCreatedDesc(@Param("MODEL_CUSTOMIZATION_UUID")String modelCustomizationUUID); + VfModuleCustomization findFirstByModelCustomizationUUIDOrderByCreatedDesc( + @Param("MODEL_CUSTOMIZATION_UUID") String modelCustomizationUUID); - VfModuleCustomization findFirstByModelCustomizationUUIDAndVfModuleModelUUIDOrderByCreatedDesc(@Param("MODEL_CUSTOMIZATION_UUID")String modelCustomizationUUID, @Param("MODEL_UUID")String vfModuleModelUUID); -}
\ No newline at end of file + VfModuleCustomization findFirstByModelCustomizationUUIDAndVfModuleModelUUIDOrderByCreatedDesc( + @Param("MODEL_CUSTOMIZATION_UUID") String modelCustomizationUUID, + @Param("MODEL_UUID") String vfModuleModelUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleRepository.java index 56ae11f4cb..c937394a29 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VFModuleRepository.java @@ -24,34 +24,39 @@ import org.onap.so.db.catalog.beans.VfModule; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.rest.core.annotation.RepositoryRestResource; - import java.util.List; @RepositoryRestResource(collectionResourceRel = "vfModule", path = "vfModule") public interface VFModuleRepository extends JpaRepository<VfModule, String> { - VfModule findByModelUUID(String modelUUID); - - VfModule findFirstVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion); - - VfModule findByModelName(String modelName); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelName - * @return - */ - @Query(value = "SELECT * FROM vf_module WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", nativeQuery = true) - VfModule findFirstByModelNameOrderByModelVersionDesc(String modelName); - - VfModule findFirstByModelInvariantUUIDAndModelUUID(String modelCustomizationUUID, String modelUUID); - - VfModule findFirstByModelInvariantUUID(String modelCustomizationUUID); - - /** - * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the sorting - * @param modelInvariantUUID - * @return - */ - @Query(value = "SELECT * FROM vf_module WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC;", nativeQuery = true) - List<VfModule> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); -}
\ No newline at end of file + VfModule findByModelUUID(String modelUUID); + + VfModule findFirstVfModuleByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion); + + VfModule findByModelName(String modelName); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelName + * @return + */ + @Query(value = "SELECT * FROM vf_module WHERE MODEL_NAME = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC LIMIT 1;", + nativeQuery = true) + VfModule findFirstByModelNameOrderByModelVersionDesc(String modelName); + + VfModule findFirstByModelInvariantUUIDAndModelUUID(String modelCustomizationUUID, String modelUUID); + + VfModule findFirstByModelInvariantUUID(String modelCustomizationUUID); + + /** + * This method will not work for versions greater than 255, as it is utilizing an ip address function to do the + * sorting + * + * @param modelInvariantUUID + * @return + */ + @Query(value = "SELECT * FROM vf_module WHERE MODEL_INVARIANT_UUID = ?1 ORDER BY INET_ATON(SUBSTRING_INDEX(CONCAT(MODEL_VERSION,'.0.0.0'),'.',4)) DESC;", + nativeQuery = true) + List<VfModule> findByModelInvariantUUIDOrderByModelVersionDesc(String modelInvariantUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfComponentRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfComponentRecipeRepository.java index 440a675c97..cbca3cd1b7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfComponentRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfComponentRecipeRepository.java @@ -27,13 +27,13 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfComponentsRecipe", path = "vnfComponentsRecipe") public interface VnfComponentRecipeRepository extends JpaRepository<VnfComponentsRecipe, String> { - VnfComponentsRecipe findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfTypeAndAction(String vfModuleModelUUID, - String vnfType, String action); + VnfComponentsRecipe findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfTypeAndAction(String vfModuleModelUUID, + String vnfType, String action); - VnfComponentsRecipe findFirstVnfComponentsRecipeByVnfTypeAndAction(String vnfType, String action); + VnfComponentsRecipe findFirstVnfComponentsRecipeByVnfTypeAndAction(String vnfType, String action); - VnfComponentsRecipe findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction(String vfModuleModelUUID, - String vnfComponentType, String action); + VnfComponentsRecipe findFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction( + String vfModuleModelUUID, String vnfComponentType, String action); - VnfComponentsRecipe findFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType, String action); -}
\ No newline at end of file + VnfComponentsRecipe findFirstVnfComponentsRecipeByVnfComponentTypeAndAction(String vnfComponentType, String action); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java index fa8d8c065e..c72fade411 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfCustomizationRepository.java @@ -29,11 +29,15 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfResourceCustomization", path = "vnfResourceCustomization") public interface VnfCustomizationRepository extends JpaRepository<VnfResourceCustomization, Integer> { - List<VnfResourceCustomization> findByModelCustomizationUUID(@Param("MODEL_CUSTOMIZATION_UUID")String modelCustomizationUUID); + List<VnfResourceCustomization> findByModelCustomizationUUID( + @Param("MODEL_CUSTOMIZATION_UUID") String modelCustomizationUUID); VnfResourceCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); - @Query(value = "SELECT * FROM vnf_resource_customization WHERE MODEL_INSTANCE_NAME = ?1 AND VNF_RESOURCE_MODEL_UUID = ?2 LIMIT 1;", nativeQuery = true) - VnfResourceCustomization findByModelInstanceNameAndVnfResources(@Param("MODEL_INSTANCE_NAME")String modelInstanceName, @Param("VNF_RESOURCE_MODEL_UUID")String vnfResourceModelUUID); + @Query(value = "SELECT * FROM vnf_resource_customization WHERE MODEL_INSTANCE_NAME = ?1 AND VNF_RESOURCE_MODEL_UUID = ?2 LIMIT 1;", + nativeQuery = true) + VnfResourceCustomization findByModelInstanceNameAndVnfResources( + @Param("MODEL_INSTANCE_NAME") String modelInstanceName, + @Param("VNF_RESOURCE_MODEL_UUID") String vnfResourceModelUUID); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfRecipeRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfRecipeRepository.java index b99e2bd4b6..985e6674ea 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfRecipeRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfRecipeRepository.java @@ -26,9 +26,9 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfRecipe", path = "vnfRecipe") public interface VnfRecipeRepository extends JpaRepository<VnfRecipe, String> { - VnfRecipe findVnfRecipeByServiceTypeAndAction(String serviceType, String action); - - VnfRecipe findFirstVnfRecipeByNfRoleAndAction(String nfRole, String action); + VnfRecipe findVnfRecipeByServiceTypeAndAction(String serviceType, String action); - VnfRecipe findFirstVnfRecipeByNfRoleAndActionAndVersionStr(String nfRole, String action, String versionStr); -}
\ No newline at end of file + VnfRecipe findFirstVnfRecipeByNfRoleAndAction(String nfRole, String action); + + VnfRecipe findFirstVnfRecipeByNfRoleAndActionAndVersionStr(String nfRole, String action, String versionStr); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceRepository.java index e48f8bb653..965a85f504 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfResourceRepository.java @@ -27,15 +27,15 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfResource", path = "vnfResource") public interface VnfResourceRepository extends JpaRepository<VnfResource, String> { - VnfResource findResourceByModelNameAndModelUUID(String modelName, String modelUUID); + VnfResource findResourceByModelNameAndModelUUID(String modelName, String modelUUID); - VnfResource findByModelName(String modelName); + VnfResource findByModelName(String modelName); - VnfResource findByModelNameAndModelVersion(String modelName, String modelVersion); + VnfResource findByModelNameAndModelVersion(String modelName, String modelVersion); - VnfResource findResourceByModelUUID(String modelUUID); + VnfResource findResourceByModelUUID(String modelUUID); - VnfResource findResourceByModelInvariantUUID(String modelInvariantUUID); + VnfResource findResourceByModelInvariantUUID(String modelInvariantUUID); - VnfResource findFirstResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion); -}
\ No newline at end of file + VnfResource findFirstResourceByModelInvariantUUIDAndModelVersion(String modelInvariantUUID, String modelVersion); +} 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 index d722ab2d6a..9e4a2a303b 100644 --- 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 @@ -21,14 +21,12 @@ 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); +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/VnfcCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java index 64840f11f9..1dddd18697 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcCustomizationRepository.java @@ -26,5 +26,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; @RepositoryRestResource(collectionResourceRel = "vnfcCustomization", path = "vnfcCustomization") public interface VnfcCustomizationRepository extends JpaRepository<VnfcCustomization, String> { - VnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); -}
\ No newline at end of file + VnfcCustomization findOneByModelCustomizationUUID(String modelCustomizationUuid); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcInstanceGroupCustomizationRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcInstanceGroupCustomizationRepository.java index c18bf006da..0b9d50fa1e 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcInstanceGroupCustomizationRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/VnfcInstanceGroupCustomizationRepository.java @@ -21,12 +21,12 @@ package org.onap.so.db.catalog.data.repository; import java.util.List; - import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.rest.core.annotation.RepositoryRestResource; -@RepositoryRestResource(collectionResourceRel = "vnfcInstanceGroupCustomization", path = "vnfcInstanceGroupCustomization") +@RepositoryRestResource(collectionResourceRel = "vnfcInstanceGroupCustomization", + path = "vnfcInstanceGroupCustomization") public interface VnfcInstanceGroupCustomizationRepository - extends JpaRepository<VnfcInstanceGroupCustomization, String> { + extends JpaRepository<VnfcInstanceGroupCustomization, String> { } 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 f33a5b6ff9..b73896ac5c 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 @@ -26,5 +26,5 @@ 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 + Workflow findByArtifactUUID(String artifactUUID); +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java index f06d7c9c17..63a5614ea0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/exceptions/NoEntityFoundException.java @@ -29,7 +29,7 @@ public class NoEntityFoundException extends Exception { private static final long serialVersionUID = 545820289784366486L; public NoEntityFoundException(String errorMessage) { - super(errorMessage); + super(errorMessage); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java index fc968a4ef9..f9cbb0d462 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/rest/beans/ServiceMacroHolder.java @@ -22,173 +22,186 @@ package org.onap.so.db.catalog.rest.beans; import java.io.Serializable; import java.util.ArrayList; - import org.onap.so.db.catalog.beans.AllottedResourceCustomization; import org.onap.so.db.catalog.beans.NetworkResourceCustomization; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.VnfResource; import org.onap.so.db.catalog.beans.VnfResourceCustomization; - import com.openpojo.business.annotation.BusinessKey; /* - * A simple holder for Service and its associated elements: - * VnfResource, 1-n VfModule, Network TBD + * A simple holder for Service and its associated elements: VnfResource, 1-n VfModule, Network TBD */ public class ServiceMacroHolder implements Serializable { - - private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - private Service service; - private ArrayList<VnfResource> vnfResources; - private ArrayList<NetworkResourceCustomization> networkResourceCustomizations; - private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations; - private ArrayList<VnfResourceCustomization> vnfResourceCustomizations; - - - public ServiceMacroHolder() { - super(); - this.service = null; - this.vnfResources = new ArrayList<VnfResource>(); - this.networkResourceCustomizations = new ArrayList<>(); - this.allottedResourceCustomizations = new ArrayList<>(); - this.vnfResourceCustomizations = new ArrayList<>(); - } - public ServiceMacroHolder(Service service) { - this(); - this.service = service; - } - - public Service getService() { - return this.service; - } - public void setService(Service service) { - this.service = service; - } - - public void setVnfResources(ArrayList<VnfResource> vnfResources) { - this.vnfResources = vnfResources; - } - public ArrayList<VnfResource> getVnfResources() { - return this.vnfResources; - } - public void addVnfResource(VnfResource vr) { - if (vr != null) { - if (this.vnfResources != null) { - this.vnfResources.add(vr); - } else { - this.vnfResources = new ArrayList<>(); - this.vnfResources.add(vr); - } - } - } - - public void setVnfResourceCustomizations(ArrayList<VnfResourceCustomization> vnfResourceCustomizations) { - this.vnfResourceCustomizations = vnfResourceCustomizations; - } - public ArrayList<VnfResourceCustomization> getVnfResourceCustomizations() { - return this.vnfResourceCustomizations; - } - public void addVnfResourceCustomizations(VnfResourceCustomization vrc) { - if (vrc != null) { - if (this.vnfResourceCustomizations != null) { - this.vnfResourceCustomizations.add(vrc); - } else { - this.vnfResourceCustomizations = new ArrayList<>(); - this.vnfResourceCustomizations.add(vrc); - } - } - } - - public void setNetworkResourceCustomization(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) { - this.networkResourceCustomizations = networkResourceCustomizations; - } - public ArrayList<NetworkResourceCustomization> getNetworkResourceCustomization() { - return this.networkResourceCustomizations; - } - public void addNetworkResourceCustomization(NetworkResourceCustomization nrc) { - if (this.networkResourceCustomizations != null) { - this.networkResourceCustomizations.add(nrc); - } else { - this.networkResourceCustomizations = new ArrayList<>(); - this.networkResourceCustomizations.add(nrc); - } - } - - public void setAllottedResourceCustomization(ArrayList<AllottedResourceCustomization> allottedResourceCustomizations) { - this.allottedResourceCustomizations = allottedResourceCustomizations; - } - public ArrayList<AllottedResourceCustomization> getAllottedResourceCustomization() { - return this.allottedResourceCustomizations; - } - public void addAllottedResourceCustomization(AllottedResourceCustomization arc) { - if (this.allottedResourceCustomizations != null) { - this.allottedResourceCustomizations.add(arc); - } else { - this.allottedResourceCustomizations = new ArrayList<>(); - this.allottedResourceCustomizations.add(arc); - } - } + + private static final long serialVersionUID = 768026109321305392L; + @BusinessKey + private Service service; + private ArrayList<VnfResource> vnfResources; + private ArrayList<NetworkResourceCustomization> networkResourceCustomizations; + private ArrayList<AllottedResourceCustomization> allottedResourceCustomizations; + private ArrayList<VnfResourceCustomization> vnfResourceCustomizations; + + + public ServiceMacroHolder() { + super(); + this.service = null; + this.vnfResources = new ArrayList<VnfResource>(); + this.networkResourceCustomizations = new ArrayList<>(); + this.allottedResourceCustomizations = new ArrayList<>(); + this.vnfResourceCustomizations = new ArrayList<>(); + } + + public ServiceMacroHolder(Service service) { + this(); + this.service = service; + } + + public Service getService() { + return this.service; + } + + public void setService(Service service) { + this.service = service; + } + + public void setVnfResources(ArrayList<VnfResource> vnfResources) { + this.vnfResources = vnfResources; + } + + public ArrayList<VnfResource> getVnfResources() { + return this.vnfResources; + } + + public void addVnfResource(VnfResource vr) { + if (vr != null) { + if (this.vnfResources != null) { + this.vnfResources.add(vr); + } else { + this.vnfResources = new ArrayList<>(); + this.vnfResources.add(vr); + } + } + } + + public void setVnfResourceCustomizations(ArrayList<VnfResourceCustomization> vnfResourceCustomizations) { + this.vnfResourceCustomizations = vnfResourceCustomizations; + } + + public ArrayList<VnfResourceCustomization> getVnfResourceCustomizations() { + return this.vnfResourceCustomizations; + } + + public void addVnfResourceCustomizations(VnfResourceCustomization vrc) { + if (vrc != null) { + if (this.vnfResourceCustomizations != null) { + this.vnfResourceCustomizations.add(vrc); + } else { + this.vnfResourceCustomizations = new ArrayList<>(); + this.vnfResourceCustomizations.add(vrc); + } + } + } + + public void setNetworkResourceCustomization(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) { + this.networkResourceCustomizations = networkResourceCustomizations; + } + + public ArrayList<NetworkResourceCustomization> getNetworkResourceCustomization() { + return this.networkResourceCustomizations; + } + + public void addNetworkResourceCustomization(NetworkResourceCustomization nrc) { + if (this.networkResourceCustomizations != null) { + this.networkResourceCustomizations.add(nrc); + } else { + this.networkResourceCustomizations = new ArrayList<>(); + this.networkResourceCustomizations.add(nrc); + } + } + + public void setAllottedResourceCustomization( + ArrayList<AllottedResourceCustomization> allottedResourceCustomizations) { + this.allottedResourceCustomizations = allottedResourceCustomizations; + } + + public ArrayList<AllottedResourceCustomization> getAllottedResourceCustomization() { + return this.allottedResourceCustomizations; + } + + public void addAllottedResourceCustomization(AllottedResourceCustomization arc) { + if (this.allottedResourceCustomizations != null) { + this.allottedResourceCustomizations.add(arc); + } else { + this.allottedResourceCustomizations = new ArrayList<>(); + this.allottedResourceCustomizations.add(arc); + } + } @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("ServicePlus: "); - if (this.service != null) { - sb.append("service: " + this.service.toString()); - } else { - sb.append("service: null"); - } - if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) { - int i=0; - sb.append("VnfResources: "); - for (VnfResourceCustomization vrc : this.vnfResourceCustomizations) { - sb.append(", vnfResourceCustomization[" + i++ + "]:" + vrc.toString()); - } - } else { - sb.append("none"); - } - if (this.vnfResources != null && this.vnfResources.size() > 0) { - int i=0; - sb.append("VnfResources: "); - for (VnfResource vr : this.vnfResources) { - sb.append(", vnfResource[" + i++ + "]:" + vr.toString()); - } - } else { - sb.append("none"); - } - if (this.networkResourceCustomizations != null && this.networkResourceCustomizations.size() > 0) { - int i=0; - sb.append("NetworkResourceCustomizations:"); - for (NetworkResourceCustomization nrc : this.networkResourceCustomizations) { - sb.append("NRC[" + i++ + "]: " + nrc.toString()); - } - } - if (this.allottedResourceCustomizations != null && this.allottedResourceCustomizations.size() > 0) { - int i=0; - sb.append("AllottedResourceCustomizations:"); - for (AllottedResourceCustomization arc : this.allottedResourceCustomizations) { - sb.append("ARC[" + i++ + "]: " + arc.toString()); - } - } - - return sb.toString(); - } - public ArrayList<NetworkResourceCustomization> getNetworkResourceCustomizations() { - return networkResourceCustomizations; - } - public void setNetworkResourceCustomizations(ArrayList<NetworkResourceCustomization> networkResourceCustomizations) { - this.networkResourceCustomizations = networkResourceCustomizations; - } - public ArrayList<AllottedResourceCustomization> getAllottedResourceCustomizations() { - return allottedResourceCustomizations; - } - public void setAllottedResourceCustomizations(ArrayList<AllottedResourceCustomization> allottedResourceCustomizations) { - this.allottedResourceCustomizations = allottedResourceCustomizations; - } - - - - + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("ServicePlus: "); + if (this.service != null) { + sb.append("service: " + this.service.toString()); + } else { + sb.append("service: null"); + } + if (this.vnfResourceCustomizations != null && this.vnfResourceCustomizations.size() > 0) { + int i = 0; + sb.append("VnfResources: "); + for (VnfResourceCustomization vrc : this.vnfResourceCustomizations) { + sb.append(", vnfResourceCustomization[" + i++ + "]:" + vrc.toString()); + } + } else { + sb.append("none"); + } + if (this.vnfResources != null && this.vnfResources.size() > 0) { + int i = 0; + sb.append("VnfResources: "); + for (VnfResource vr : this.vnfResources) { + sb.append(", vnfResource[" + i++ + "]:" + vr.toString()); + } + } else { + sb.append("none"); + } + if (this.networkResourceCustomizations != null && this.networkResourceCustomizations.size() > 0) { + int i = 0; + sb.append("NetworkResourceCustomizations:"); + for (NetworkResourceCustomization nrc : this.networkResourceCustomizations) { + sb.append("NRC[" + i++ + "]: " + nrc.toString()); + } + } + if (this.allottedResourceCustomizations != null && this.allottedResourceCustomizations.size() > 0) { + int i = 0; + sb.append("AllottedResourceCustomizations:"); + for (AllottedResourceCustomization arc : this.allottedResourceCustomizations) { + sb.append("ARC[" + i++ + "]: " + arc.toString()); + } + } + + return sb.toString(); + } + + public ArrayList<NetworkResourceCustomization> getNetworkResourceCustomizations() { + return networkResourceCustomizations; + } + + public void setNetworkResourceCustomizations( + ArrayList<NetworkResourceCustomization> networkResourceCustomizations) { + this.networkResourceCustomizations = networkResourceCustomizations; + } + + public ArrayList<AllottedResourceCustomization> getAllottedResourceCustomizations() { + return allottedResourceCustomizations; + } + + public void setAllottedResourceCustomizations( + ArrayList<AllottedResourceCustomization> allottedResourceCustomizations) { + this.allottedResourceCustomizations = allottedResourceCustomizations; + } + + + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioning.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioning.java index 6951c4412d..a7610fec92 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioning.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioning.java @@ -24,89 +24,91 @@ package org.onap.so.db.catalog.utils; import java.io.Serializable; /** - * This class is the base class for object that requires a Version in Catalog DB. - * The version is built on a string as ASDC provides a number like 1.2 or 2.0 ... - * This class supports also 1.2.3.4... (Maven like version) + * This class is the base class for object that requires a Version in Catalog DB. The version is built on a string as + * ASDC provides a number like 1.2 or 2.0 ... This class supports also 1.2.3.4... (Maven like version) * * */ public class MavenLikeVersioning implements Serializable { - protected String version; - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - /** - * This method is used to compare the current object version to a specified one - * It is assumed that the version is like the maven one, eg: 2.0.1.5.6 - * - * @param versionToCompare The version that will be used for comparison - * @return True if the current object is more recent than the specified version, False otherwise - * - */ - public boolean isMoreRecentThan (String versionToCompare) { - if (versionToCompare == null || versionToCompare.trim().isEmpty() || this.version == null || this.version.trim().isEmpty()) { - return false; - } - String[] currentVersionArray = this.version.split("\\."); - String[] specifiedVersionArray = versionToCompare.split("\\."); - - int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length); - - for (int currentVersionIndex = 0; currentVersionIndex < smalestStringLength; ++currentVersionIndex) { - - if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer - .parseInt(specifiedVersionArray[currentVersionIndex])) { - return false; - } else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer - .parseInt(specifiedVersionArray[currentVersionIndex])) { - return true; - } - } - try { - // Even if versionToCompare has more digits, it means versionToCompare is more recent - return Integer.parseInt(currentVersionArray[smalestStringLength - 1]) != Integer - .parseInt(specifiedVersionArray[smalestStringLength - 1]) - || currentVersionArray.length > specifiedVersionArray.length; - } catch (NumberFormatException e) { - return false; - } - } - - /** - * This method is used to compare the current object version to a specified one - * It is assumed that the version is like the maven one, eg: 2.0.1.5.6 - * - * @param versionToCompare The version that will be used for comparison - * @return True if the current object is equal to the specified version, False otherwise - * - */ - public boolean isTheSameVersion (String versionToCompare) { - if (versionToCompare == null && this.version == null) { - return true; - } else if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null || this.version.trim().equals("")) { - return false; - } - String [] currentVersionArray = this.version.split("\\."); - String [] specifiedVersionArray = versionToCompare.split("\\."); - - if (currentVersionArray.length != specifiedVersionArray.length) { - return false; - } - - for (int currentVersionIndex=0;currentVersionIndex < currentVersionArray.length;++currentVersionIndex) { - - if (Integer.parseInt(currentVersionArray[currentVersionIndex]) != Integer.parseInt(specifiedVersionArray[currentVersionIndex])) { - return false; - } - } - - return true; - } + protected String version; + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + /** + * This method is used to compare the current object version to a specified one It is assumed that the version is + * like the maven one, eg: 2.0.1.5.6 + * + * @param versionToCompare The version that will be used for comparison + * @return True if the current object is more recent than the specified version, False otherwise + * + */ + public boolean isMoreRecentThan(String versionToCompare) { + if (versionToCompare == null || versionToCompare.trim().isEmpty() || this.version == null + || this.version.trim().isEmpty()) { + return false; + } + String[] currentVersionArray = this.version.split("\\."); + String[] specifiedVersionArray = versionToCompare.split("\\."); + + int smalestStringLength = Math.min(currentVersionArray.length, specifiedVersionArray.length); + + for (int currentVersionIndex = 0; currentVersionIndex < smalestStringLength; ++currentVersionIndex) { + + if (Integer.parseInt(currentVersionArray[currentVersionIndex]) < Integer + .parseInt(specifiedVersionArray[currentVersionIndex])) { + return false; + } else if (Integer.parseInt(currentVersionArray[currentVersionIndex]) > Integer + .parseInt(specifiedVersionArray[currentVersionIndex])) { + return true; + } + } + try { + // Even if versionToCompare has more digits, it means versionToCompare is more recent + return Integer.parseInt(currentVersionArray[smalestStringLength - 1]) != Integer + .parseInt(specifiedVersionArray[smalestStringLength - 1]) + || currentVersionArray.length > specifiedVersionArray.length; + } catch (NumberFormatException e) { + return false; + } + } + + /** + * This method is used to compare the current object version to a specified one It is assumed that the version is + * like the maven one, eg: 2.0.1.5.6 + * + * @param versionToCompare The version that will be used for comparison + * @return True if the current object is equal to the specified version, False otherwise + * + */ + public boolean isTheSameVersion(String versionToCompare) { + if (versionToCompare == null && this.version == null) { + return true; + } else if (versionToCompare == null || versionToCompare.trim().equals("") || this.version == null + || this.version.trim().equals("")) { + return false; + } + String[] currentVersionArray = this.version.split("\\."); + String[] specifiedVersionArray = versionToCompare.split("\\."); + + if (currentVersionArray.length != specifiedVersionArray.length) { + return false; + } + + for (int currentVersionIndex = 0; currentVersionIndex < currentVersionArray.length; ++currentVersionIndex) { + + if (Integer.parseInt(currentVersionArray[currentVersionIndex]) != Integer + .parseInt(specifiedVersionArray[currentVersionIndex])) { + return false; + } + } + + return true; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioningComparator.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioningComparator.java index 85fc9b3df2..be219e794c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioningComparator.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/MavenLikeVersioningComparator.java @@ -26,24 +26,24 @@ import java.util.Comparator; /** * This class can be used to sort object from MavenLikeVersioning type. * - * + * * */ public class MavenLikeVersioningComparator implements Comparator<MavenLikeVersioning> { - - @Override - public int compare(MavenLikeVersioning o1, MavenLikeVersioning o2) { - final int BEFORE = -1; - final int EQUAL = 0; - final int AFTER = 1; - - if (o1.isTheSameVersion(o2.getVersion())) { - return EQUAL; - } else if (o1.isMoreRecentThan(o2.getVersion())) { - return AFTER; - } else { - return BEFORE; - } - } + + @Override + public int compare(MavenLikeVersioning o1, MavenLikeVersioning o2) { + final int BEFORE = -1; + final int EQUAL = 0; + final int AFTER = 1; + + if (o1.isTheSameVersion(o2.getVersion())) { + return EQUAL; + } else if (o1.isMoreRecentThan(o2.getVersion())) { + return AFTER; + } else { + return BEFORE; + } + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/RecordNotFoundException.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/RecordNotFoundException.java index 4168492245..7759b01c6a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/RecordNotFoundException.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/utils/RecordNotFoundException.java @@ -21,30 +21,30 @@ package org.onap.so.db.catalog.utils; /* -* Exception of the ASDC controller. -*/ + * Exception of the ASDC controller. + */ public class RecordNotFoundException extends Exception { - /** - * serialization id. - */ - private static final long serialVersionUID = 8425657297510362736L; + /** + * serialization id. + */ + private static final long serialVersionUID = 8425657297510362736L; - /** - * @param message The message to dump - * @param cause The Throwable cause object - */ - public RecordNotFoundException(final String message) { - super (message); + /** + * @param message The message to dump + * @param cause The Throwable cause object + */ + public RecordNotFoundException(final String message) { + super(message); - } + } - /** - * @param message The message to dump - * @param cause The Throwable cause object - */ - public RecordNotFoundException(final String message, final Throwable cause) { - super (message, cause); + /** + * @param message The message to dump + * @param cause The Throwable cause object + */ + public RecordNotFoundException(final String message, final Throwable cause) { + super(message, cause); - } + } } |