2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
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 * ================================================================================
20 package org.openecomp.portalapp.portal.domain;
22 import javax.persistence.Lob;
24 import org.apache.commons.lang.StringUtils;
25 import org.openecomp.portalsdk.core.domain.support.DomainVo;
28 * Model for all columns in the fn_app table.
30 public class EPApp extends DomainVo {
32 private static final long serialVersionUID = 1L;
35 private String imageUrl;
36 private String description;
39 private String alternateUrl;
40 private String appRestEndpoint;
41 private String mlAppName;
42 private String mlAppAdminId;
44 private String username;
45 private String appPassword;
47 private byte[] thumbnail;
49 private Boolean enabled;
50 private String uebTopicName;
51 private String uebKey;
52 private String uebSecret;
53 private Integer appType;
54 private AppContactUs contactUs;
55 private Boolean centralAuth;
56 private String nameSpace;
60 // We set here all default values. We also place protection
61 // into setters for fields with default values.
62 // If we don't use such protection we are able to place null
63 // to these fields and save such fields into DB even if DB has
64 // default values for these fields.
67 this.mlAppAdminId = "";
69 this.appPassword = "";
70 this.open = new Boolean(false);
71 this.enabled = new Boolean(true);
72 this.uebTopicName = "";
78 public String getName() {
82 public void setName(String name) {
83 if (StringUtils.isEmpty(name)) {
89 public String getImageUrl() {
93 public void setImageUrl(String imageUrl) {
94 this.imageUrl = imageUrl;
97 public byte[] getThumbnail() {
98 return this.thumbnail;
101 public void setThumbnail(byte[] thumbnail) {
102 this.thumbnail = thumbnail;
105 public String getDescription() {
109 public void setDescription(String description) {
110 this.description = description;
113 public String getNotes() {
117 public void setNotes(String notes) {
121 public String getUrl() {
125 public void setUrl(String url) {
129 public String getAlternateUrl() {
133 public void setAlternateUrl(String alternateUrl) {
134 this.alternateUrl = alternateUrl;
137 public String getAppRestEndpoint() {
138 return appRestEndpoint;
141 public void setAppRestEndpoint(String appRestEndpoint) {
142 this.appRestEndpoint = appRestEndpoint;
145 public String getMlAppName() {
149 public void setMlAppName(String mlAppName) {
150 if (StringUtils.isEmpty(mlAppName)) {
153 this.mlAppName = mlAppName;
156 public String getMlAppAdminId() {
160 public void setMlAppAdminId(String mlAppAdminId) {
161 if (StringUtils.isEmpty(mlAppAdminId)) {
164 this.mlAppAdminId = mlAppAdminId;
167 public Long getMotsId() {
171 public void setMotsId(Long motsId) {
172 this.motsId = motsId;
175 public String getUsername() {
179 public void setUsername(String username) {
180 this.username = username;
183 public String getAppPassword() {
187 public void setAppPassword(String appPassword) {
188 if (StringUtils.isEmpty(appPassword)) {
191 this.appPassword = appPassword;
194 public Boolean getOpen() {
198 public void setOpen(Boolean open) {
200 open = new Boolean(false);
205 public Boolean getEnabled() {
209 public void setEnabled(Boolean enabled) {
210 if (enabled == null) {
211 enabled = new Boolean(true);
213 this.enabled = enabled;
216 public Integer getAppType() {
220 public void setAppType(Integer appType) {
221 if (appType == null) {
222 appType = new Integer(1);
224 this.appType = appType;
227 public void setRestrictedApp(Boolean restrictedApp) {
232 this.appType = result;
235 public Boolean isRestrictedApp() {
236 return (this.appType == 2 ? true : false);
239 public int compareTo(Object obj) {
241 Long c2 = ((EPApp) obj).getId();
243 return c1.compareTo(c2);
246 public String getUebTopicName() {
247 return this.uebTopicName;
250 public void setUebTopicName(String topicName) {
251 if (StringUtils.isEmpty(topicName)) {
252 this.uebTopicName = "";
254 this.uebTopicName = topicName;
257 public String getUebKey() {
261 public void setUebKey(String uebKey) {
262 if (StringUtils.isEmpty(uebKey)) {
265 this.uebKey = uebKey;
268 public String getUebSecret() {
269 return this.uebSecret;
272 public void setUebSecret(String uebSecret) {
273 if (StringUtils.isEmpty(uebSecret)) {
276 this.uebSecret = uebSecret;
279 public AppContactUs getContactUs() {
283 public void setContactUs(AppContactUs contactUs) {
284 this.contactUs = contactUs;
287 public Boolean getCentralAuth() {
291 public void setCentralAuth(Boolean centralAuth) {
292 if (centralAuth == null) {
293 centralAuth = new Boolean(false);
295 this.centralAuth = centralAuth;
298 public String getNameSpace() {
302 public void setNameSpace(String nameSpace) {
303 if (StringUtils.isEmpty(nameSpace)) {
306 this.nameSpace = nameSpace;
310 public String toString() {
311 String str = "[" + getId() + ":" + getName() + "]";