Added oparent to sdc main
[sdc.git] / catalog-dao / src / main / java / org / openecomp / sdc / be / resources / data / OperationalEnvironmentEntry.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.resources.data;
22
23 import com.datastax.driver.mapping.annotations.Column;
24 import com.datastax.driver.mapping.annotations.PartitionKey;
25 import com.datastax.driver.mapping.annotations.Table;
26 import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
27
28 import java.util.Date;
29 import java.util.HashSet;
30 import java.util.Set;
31
32 @Table(keyspace = "sdcrepository", name = "operationalEnvironment")
33 public class OperationalEnvironmentEntry {
34
35     @PartitionKey(0)
36     @Column(name = "environment_id")
37     private String environmentId;
38
39     @Column(name = "tenant")
40     private String tenant;
41
42     @Column(name = "is_production")
43     private Boolean isProduction;
44
45     @Column(name = "ecomp_workload_context")
46     private String ecompWorkloadContext;
47
48     @Column(name = "dmaap_ueb_address")
49     private Set<String> dmaapUebAddress;
50
51     @Column(name = "ueb_api_key")
52     private String uebApikey;
53
54     @Column(name = "ueb_secret_key")
55     private String uebSecretKey;
56
57     @Column(name = "status")
58     private String status;
59
60     public Date getLastModified() {
61         return lastModified;
62     }
63
64     public void setLastModified(Date lastModified) {
65         this.lastModified = lastModified;
66     }
67
68     @Column(name = "last_modified")
69     private Date lastModified;
70
71
72     public String getEnvironmentId() {
73         return environmentId;
74     }
75
76     //must be unique, add any validation if neccessary
77     public void setEnvironmentId(String environmentId) {
78         this.environmentId = environmentId;
79     }
80
81     public String getTenant() {
82         return tenant;
83     }
84
85     public void setTenant(String tenant) {
86         this.tenant = tenant;
87     }
88
89     public Boolean getIsProduction() {
90         return isProduction;
91     }
92
93     public void setIsProduction(Boolean production) {
94         isProduction = production;
95     }
96
97     public String getEcompWorkloadContext() {
98         return ecompWorkloadContext;
99     }
100
101     public void setEcompWorkloadContext(String ecompWorkloadContext) {
102         this.ecompWorkloadContext = ecompWorkloadContext;
103     }
104
105     public String getStatus() {
106         return status;
107     }
108
109     public void setStatus(String status) {
110         //log if status doesn't exists in EnvironmentStatusEnum
111         this.status = status;
112     }
113
114     public void setStatus(EnvironmentStatusEnum status) {
115         this.status = status.getName();
116     }
117
118     public Set<String> getDmaapUebAddress() {
119         return dmaapUebAddress;
120     }
121
122     public void setDmaapUebAddress(Set<String> dmaapUebAddress) {
123         this.dmaapUebAddress = dmaapUebAddress;
124     }
125
126     public void addDmaapUebAddress(String address) {
127         if ( this.dmaapUebAddress == null )
128             this.dmaapUebAddress = new HashSet<>();
129         dmaapUebAddress.add(address);
130     }
131
132     public String getUebApikey() {
133         return uebApikey;
134     }
135
136     public void setUebApikey(String uebApikey) {
137         this.uebApikey = uebApikey;
138     }
139
140     public String getUebSecretKey() {
141         return uebSecretKey;
142     }
143
144     public void setUebSecretKey(String uebSecretKey) {
145         this.uebSecretKey = uebSecretKey;
146     }
147     
148     @Override
149         public String toString() {
150                 return "OperationalEnvironmentEntry [environmentId=" + environmentId + ", tenant=" + tenant + ", isProduction="
151                                 + isProduction + ", ecompWorkloadContext=" + ecompWorkloadContext + ", dmaapUebAddress="
152                                 + dmaapUebAddress + ", uebApikey=" + uebApikey + ", status=" + status
153                                 + ", lastModified=" + lastModified + "]";
154         }
155
156
157 }