re base code
[sdc.git] / catalog-dao / src / main / java / org / openecomp / sdc / be / resources / data / OperationalEnvironmentEntry.java
1 package org.openecomp.sdc.be.resources.data;
2
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;
7
8 import java.util.Date;
9 import java.util.HashSet;
10 import java.util.Set;
11
12 @Table(keyspace = "sdcrepository", name = "operationalEnvironment")
13 public class OperationalEnvironmentEntry {
14
15     @PartitionKey(0)
16     @Column(name = "environment_id")
17     private String environmentId;
18
19     @Column(name = "tenant")
20     private String tenant;
21
22     @Column(name = "is_production")
23     private Boolean isProduction;
24
25     @Column(name = "ecomp_workload_context")
26     private String ecompWorkloadContext;
27
28     @Column(name = "dmaap_ueb_address")
29     private Set<String> dmaapUebAddress;
30
31     @Column(name = "ueb_api_key")
32     private String uebApikey;
33
34     @Column(name = "ueb_secret_key")
35     private String uebSecretKey;
36
37     @Column(name = "status")
38     private String status;
39
40     public Date getLastModified() {
41         return lastModified;
42     }
43
44     public void setLastModified(Date lastModified) {
45         this.lastModified = lastModified;
46     }
47
48     @Column(name = "last_modified")
49     private Date lastModified;
50
51
52     public String getEnvironmentId() {
53         return environmentId;
54     }
55
56     //must be unique, add any validation if neccessary
57     public void setEnvironmentId(String environmentId) {
58         this.environmentId = environmentId;
59     }
60
61     public String getTenant() {
62         return tenant;
63     }
64
65     public void setTenant(String tenant) {
66         this.tenant = tenant;
67     }
68
69     public Boolean getIsProduction() {
70         return isProduction;
71     }
72
73     public void setIsProduction(Boolean production) {
74         isProduction = production;
75     }
76
77     public String getEcompWorkloadContext() {
78         return ecompWorkloadContext;
79     }
80
81     public void setEcompWorkloadContext(String ecompWorkloadContext) {
82         this.ecompWorkloadContext = ecompWorkloadContext;
83     }
84
85     public String getStatus() {
86         return status;
87     }
88
89     public void setStatus(String status) {
90         //log if status doesn't exists in EnvironmentStatusEnum
91         this.status = status;
92     }
93
94     public void setStatus(EnvironmentStatusEnum status) {
95         this.status = status.getName();
96     }
97
98     public Set<String> getDmaapUebAddress() {
99         return dmaapUebAddress;
100     }
101
102     public void setDmaapUebAddress(Set<String> dmaapUebAddress) {
103         this.dmaapUebAddress = dmaapUebAddress;
104     }
105
106     public void addDmaapUebAddress(String address) {
107         if ( this.dmaapUebAddress == null )
108             this.dmaapUebAddress = new HashSet<>();
109         dmaapUebAddress.add(address);
110     }
111
112     public String getUebApikey() {
113         return uebApikey;
114     }
115
116     public void setUebApikey(String uebApikey) {
117         this.uebApikey = uebApikey;
118     }
119
120     public String getUebSecretKey() {
121         return uebSecretKey;
122     }
123
124     public void setUebSecretKey(String uebSecretKey) {
125         this.uebSecretKey = uebSecretKey;
126     }
127     
128     @Override
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 + "]";
134         }
135
136
137 }