2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ===================================================================
10 * Unless otherwise specified, all software contained herein is licensed
11 * under the Apache License, Version 2.0 (the "License");
12 * you may not use this software except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 * Unless otherwise specified, all documentation contained herein is licensed
24 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
25 * you may not use this documentation except in compliance with the License.
26 * You may obtain a copy of the License at
28 * https://creativecommons.org/licenses/by/4.0/
30 * Unless required by applicable law or agreed to in writing, documentation
31 * distributed under the License is distributed on an "AS IS" BASIS,
32 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 * See the License for the specific language governing permissions and
34 * limitations under the License.
36 * ============LICENSE_END============================================
41 package org.onap.portal.domain.dto.ecomp;
43 import javax.persistence.Lob;
44 import javax.validation.Valid;
45 import lombok.AllArgsConstructor;
46 import lombok.EqualsAndHashCode;
49 import org.apache.commons.lang.StringUtils;
50 import org.hibernate.validator.constraints.SafeHtml;
51 import org.onap.portal.domain.dto.DomainVo;
55 @EqualsAndHashCode(callSuper = false)
57 public class EPApp extends DomainVo {
59 private static final long serialVersionUID = 1L;
64 private String imageUrl;
66 private String description;
72 private String alternateUrl;
74 private String appRestEndpoint;
76 private String mlAppName;
78 private String mlAppAdminId;
81 private String username;
83 private String appPassword;
85 private byte[] thumbnail;
87 private Boolean enabled;
89 private String uebTopicName;
91 private String uebKey;
93 private String uebSecret;
94 private Integer appType;
96 private AppContactUs contactUs;
97 private Boolean centralAuth;
99 private String nameSpace;
104 this.mlAppAdminId = "";
106 this.appPassword = "";
107 this.open = Boolean.FALSE;
108 this.enabled = Boolean.TRUE;
109 this.uebTopicName = "";
116 public void setName(String name) {
117 if (StringUtils.isEmpty(name)) {
123 public void setMlAppName(String mlAppName) {
124 if (StringUtils.isEmpty(mlAppName)) {
127 this.mlAppName = mlAppName;
130 public void setMlAppAdminId(String mlAppAdminId) {
131 if (StringUtils.isEmpty(mlAppAdminId)) {
134 this.mlAppAdminId = mlAppAdminId;
138 public void setAppPassword(String appPassword) {
139 if (StringUtils.isEmpty(appPassword)) {
142 this.appPassword = appPassword;
145 public void setOpen(Boolean open) {
147 open = Boolean.FALSE;
152 public void setEnabled(Boolean enabled) {
153 if (enabled == null) {
154 enabled = Boolean.TRUE;
156 this.enabled = enabled;
159 public void setAppType(Integer appType) {
160 if (appType == null) {
163 this.appType = appType;
166 public void setRestrictedApp(Boolean restrictedApp) {
171 this.appType = result;
174 public Boolean isRestrictedApp() {
175 return (this.appType == 2);
178 public int compareTo(Object obj) {
180 Long c2 = ((EPApp) obj).getId();
182 return c1.compareTo(c2);
185 public void setUebTopicName(String topicName) {
186 if (StringUtils.isEmpty(topicName)) {
187 this.uebTopicName = "";
189 this.uebTopicName = topicName;
192 public void setUebKey(String uebKey) {
193 if (StringUtils.isEmpty(uebKey)) {
196 this.uebKey = uebKey;
200 public void setUebSecret(String uebSecret) {
201 if (StringUtils.isEmpty(uebSecret)) {
204 this.uebSecret = uebSecret;
207 public void setCentralAuth(Boolean centralAuth) {
208 if (centralAuth == null) {
209 centralAuth = Boolean.FALSE;
211 this.centralAuth = centralAuth;
214 public void setNameSpace(String nameSpace) {
215 if (StringUtils.isEmpty(nameSpace)) {
218 this.nameSpace = nameSpace;
222 public String toString() {
223 return "[" + getId() + ":" + getName() + "]";