1 package org.openecomp.sdc.be.resources.data;
3 import com.datastax.driver.mapping.annotations.Column;
4 import com.datastax.driver.mapping.annotations.PartitionKey;
5 import com.datastax.driver.mapping.annotations.Table;
6 import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
9 import java.util.HashSet;
12 @Table(keyspace = "sdcrepository", name = "operationalEnvironment")
13 public class OperationalEnvironmentEntry {
16 @Column(name = "environment_id")
17 private String environmentId;
19 @Column(name = "tenant")
20 private String tenant;
22 @Column(name = "is_production")
23 private Boolean isProduction;
25 @Column(name = "ecomp_workload_context")
26 private String ecompWorkloadContext;
28 @Column(name = "dmaap_ueb_address")
29 private Set<String> dmaapUebAddress;
31 @Column(name = "ueb_api_key")
32 private String uebApikey;
34 @Column(name = "ueb_secret_key")
35 private String uebSecretKey;
37 @Column(name = "status")
38 private String status;
40 public Date getLastModified() {
44 public void setLastModified(Date lastModified) {
45 this.lastModified = lastModified;
48 @Column(name = "last_modified")
49 private Date lastModified;
52 public String getEnvironmentId() {
56 //must be unique, add any validation if neccessary
57 public void setEnvironmentId(String environmentId) {
58 this.environmentId = environmentId;
61 public String getTenant() {
65 public void setTenant(String tenant) {
69 public Boolean getIsProduction() {
73 public void setIsProduction(Boolean production) {
74 isProduction = production;
77 public String getEcompWorkloadContext() {
78 return ecompWorkloadContext;
81 public void setEcompWorkloadContext(String ecompWorkloadContext) {
82 this.ecompWorkloadContext = ecompWorkloadContext;
85 public String getStatus() {
89 public void setStatus(String status) {
90 //log if status doesn't exists in EnvironmentStatusEnum
94 public void setStatus(EnvironmentStatusEnum status) {
95 this.status = status.getName();
98 public Set<String> getDmaapUebAddress() {
99 return dmaapUebAddress;
102 public void setDmaapUebAddress(Set<String> dmaapUebAddress) {
103 this.dmaapUebAddress = dmaapUebAddress;
106 public void addDmaapUebAddress(String address) {
107 if ( this.dmaapUebAddress == null )
108 this.dmaapUebAddress = new HashSet<>();
109 dmaapUebAddress.add(address);
112 public String getUebApikey() {
116 public void setUebApikey(String uebApikey) {
117 this.uebApikey = uebApikey;
120 public String getUebSecretKey() {
124 public void setUebSecretKey(String uebSecretKey) {
125 this.uebSecretKey = uebSecretKey;
129 public String toString() {
130 return "OperationalEnvironmentEntry [environmentId=" + environmentId + ", tenant=" + tenant + ", isProduction="
131 + isProduction + ", ecompWorkloadContext=" + ecompWorkloadContext + ", dmaapUebAddress="
132 + dmaapUebAddress + ", uebApikey=" + uebApikey + ", status=" + status
133 + ", lastModified=" + lastModified + "]";