aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java
diff options
context:
space:
mode:
authorSmokowski, Steven <steve.smokowski@att.com>2020-03-19 17:57:25 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-03-19 17:57:25 -0400
commit0c6057ea8f21c63af4791107c2440a6ed992f5f0 (patch)
tree7475d19646f176f30b4f80fcfacd6c68ab18b136 /mso-catalog-db/src/main/java
parentc1fcea306877deed8ec05e3608b2a7534b345900 (diff)
mso to add support for creating the cloud region
mso to add support for creating the cloud region Updated tag name to msoRequest on deletes. Issue-ID: SO-2753 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: I80e318ce34f5938a42896398eb1a38b5c5f6e831
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java15
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkTechnologyReference.java101
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkTechnologyReferenceRepository.java32
3 files changed, 147 insertions, 1 deletions
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 deaa2a3221..0d7fe7d38f 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
@@ -93,6 +93,11 @@ public class CloudSite {
@Column(name = "CLOUDIFY_ID")
private String cloudifyId;
+ @JsonProperty("cloud_owner")
+ @BusinessKey
+ @Column(name = "CLOUD_OWNER")
+ private String cloudOwner;
+
// Derived property (set by CloudConfig loader based on identityServiceId)
@BusinessKey
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@@ -266,12 +271,20 @@ public class CloudSite {
this.identityServiceId = identityServiceId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("regionId", getRegionId())
.append("identityServiceId", getIdentityServiceId()).append("cloudVersion", getCloudVersion())
.append("clli", getClli()).append("cloudifyId", getCloudifyId()).append("platform", getPlatform())
- .append("orchestrator", getOrchestrator()).toString();
+ .append("orchestrator", getOrchestrator()).append("cloud-owner", getCloudOwner()).toString();
}
@Override
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkTechnologyReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkTechnologyReference.java
new file mode 100644
index 0000000000..1f19dcc1dd
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkTechnologyReference.java
@@ -0,0 +1,101 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Tech Mahindra
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import 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 = "network_technology_reference")
+public class NetworkTechnologyReference implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer id;
+
+ @BusinessKey
+ @Column(name = "cloud_owner")
+ private String cloudOwner;
+
+ @BusinessKey
+ @Column(name = "network_technology")
+ private String networkTechnology;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("id", id).append("cloudOwner", cloudOwner)
+ .append("networkTechnology", networkTechnology).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof NetworkTechnologyReference)) {
+ return false;
+ }
+ NetworkTechnologyReference castOther = (NetworkTechnologyReference) other;
+ return new EqualsBuilder().append(cloudOwner, castOther.cloudOwner)
+ .append(networkTechnology, castOther.networkTechnology).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(cloudOwner).append(networkTechnology).toHashCode();
+ }
+
+ public static long getSerialversionuid() {
+ return serialVersionUID;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
+ public String getNetworkTechnology() {
+ return networkTechnology;
+ }
+
+ public void setNetworkTechnology(String networkTechnology) {
+ this.networkTechnology = networkTechnology;
+ }
+
+
+
+}
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkTechnologyReferenceRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkTechnologyReferenceRepository.java
new file mode 100644
index 0000000000..0b7065490b
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NetworkTechnologyReferenceRepository.java
@@ -0,0 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Tech Mahindra
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.so.db.catalog.data.repository;
+
+
+import java.util.List;
+import org.onap.so.db.catalog.beans.NetworkTechnologyReference;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+
+public interface NetworkTechnologyReferenceRepository extends JpaRepository<NetworkTechnologyReference, Integer> {
+
+ List<NetworkTechnologyReference> findAllByCloudOwner(String cloudOwner);
+}