2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.resources.data;
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;
28 import java.util.Date;
29 import java.util.HashSet;
32 @Table(keyspace = "sdcrepository", name = "operationalEnvironment")
33 public class OperationalEnvironmentEntry {
36 @Column(name = "environment_id")
37 private String environmentId;
39 @Column(name = "tenant")
40 private String tenant;
42 @Column(name = "is_production")
43 private Boolean isProduction;
45 @Column(name = "ecomp_workload_context")
46 private String ecompWorkloadContext;
48 @Column(name = "dmaap_ueb_address")
49 private Set<String> dmaapUebAddress;
51 @Column(name = "ueb_api_key")
52 private String uebApikey;
54 @Column(name = "ueb_secret_key")
55 private String uebSecretKey;
57 @Column(name = "status")
58 private String status;
60 public Date getLastModified() {
64 public void setLastModified(Date lastModified) {
65 this.lastModified = lastModified;
68 @Column(name = "last_modified")
69 private Date lastModified;
72 public String getEnvironmentId() {
76 //must be unique, add any validation if neccessary
77 public void setEnvironmentId(String environmentId) {
78 this.environmentId = environmentId;
81 public String getTenant() {
85 public void setTenant(String tenant) {
89 public Boolean getIsProduction() {
93 public void setIsProduction(Boolean production) {
94 isProduction = production;
97 public String getEcompWorkloadContext() {
98 return ecompWorkloadContext;
101 public void setEcompWorkloadContext(String ecompWorkloadContext) {
102 this.ecompWorkloadContext = ecompWorkloadContext;
105 public String getStatus() {
109 public void setStatus(String status) {
110 //log if status doesn't exists in EnvironmentStatusEnum
111 this.status = status;
114 public void setStatus(EnvironmentStatusEnum status) {
115 this.status = status.getName();
118 public Set<String> getDmaapUebAddress() {
119 return dmaapUebAddress;
122 public void setDmaapUebAddress(Set<String> dmaapUebAddress) {
123 this.dmaapUebAddress = dmaapUebAddress;
126 public void addDmaapUebAddress(String address) {
127 if ( this.dmaapUebAddress == null )
128 this.dmaapUebAddress = new HashSet<>();
129 dmaapUebAddress.add(address);
132 public String getUebApikey() {
136 public void setUebApikey(String uebApikey) {
137 this.uebApikey = uebApikey;
140 public String getUebSecretKey() {
144 public void setUebSecretKey(String uebSecretKey) {
145 this.uebSecretKey = uebSecretKey;
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 + "]";