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;
55 private AppContactUs contactUs;
59 // We set here all default values. We also place protection
60 // into setters for fields with default values.
61 // If we don't use such protection we are able to place null
62 // to these fields and save such fields into DB even if DB has
63 // default values for these fields.
66 this.mlAppAdminId = "";
68 this.appPassword = "";
69 this.open = new Boolean(false);
70 this.enabled = new Boolean(true);
71 this.uebTopicName = "";
77 public String getName() {
81 public void setName(String name) {
82 if (StringUtils.isEmpty(name)) {
88 public String getImageUrl() {
92 public void setImageUrl(String imageUrl) {
93 this.imageUrl = imageUrl;
96 public byte[] getThumbnail() {
97 return this.thumbnail;
100 public void setThumbnail(byte[] thumbnail) {
101 this.thumbnail = thumbnail;
104 public String getDescription() {
108 public void setDescription(String description) {
109 this.description = description;
112 public String getNotes() {
116 public void setNotes(String notes) {
120 public String getUrl() {
124 public void setUrl(String url) {
128 public String getAlternateUrl() {
132 public void setAlternateUrl(String alternateUrl) {
133 this.alternateUrl = alternateUrl;
136 public String getAppRestEndpoint() {
137 return appRestEndpoint;
140 public void setAppRestEndpoint(String appRestEndpoint) {
141 this.appRestEndpoint = appRestEndpoint;
144 public String getMlAppName() {
148 public void setMlAppName(String mlAppName) {
149 if (StringUtils.isEmpty(mlAppName)) {
152 this.mlAppName = mlAppName;
155 public String getMlAppAdminId() {
159 public void setMlAppAdminId(String mlAppAdminId) {
160 if (StringUtils.isEmpty(mlAppAdminId)) {
163 this.mlAppAdminId = mlAppAdminId;
166 public Long getMotsId() {
170 public void setMotsId(Long motsId) {
171 this.motsId = motsId;
174 public String getUsername() {
178 public void setUsername(String username) {
179 this.username = username;
182 public String getAppPassword() {
186 public void setAppPassword(String appPassword) {
187 if (StringUtils.isEmpty(appPassword)) {
190 this.appPassword = appPassword;
193 public Boolean getOpen() {
197 public void setOpen(Boolean open) {
199 open = new Boolean(false);
204 public Boolean getEnabled() {
208 public void setEnabled(Boolean enabled) {
209 if (enabled == null) {
210 enabled = new Boolean(true);
212 this.enabled = enabled;
215 public Integer getAppType() {
219 public void setAppType(Integer appType) {
220 if (appType == null) {
221 appType = new Integer(1);
223 this.appType = appType;
226 public void setRestrictedApp(Boolean restrictedApp) {
231 this.appType = result;
234 public Boolean isRestrictedApp() {
235 return (this.appType == 2 ? true : false);
238 public int compareTo(Object obj) {
240 Long c2 = ((EPApp) obj).getId();
242 return c1.compareTo(c2);
245 public String getUebTopicName() {
246 return this.uebTopicName;
249 public void setUebTopicName(String topicName) {
250 if (StringUtils.isEmpty(topicName)) {
251 this.uebTopicName = "";
253 this.uebTopicName = topicName;
256 public String getUebKey() {
260 public void setUebKey(String uebKey) {
261 if (StringUtils.isEmpty(uebKey)) {
264 this.uebKey = uebKey;
267 public String getUebSecret() {
268 return this.uebSecret;
271 public void setUebSecret(String uebSecret) {
272 if (StringUtils.isEmpty(uebSecret)) {
275 this.uebSecret = uebSecret;
278 public AppContactUs getContactUs() {
282 public void setContactUs(AppContactUs contactUs) {
283 this.contactUs = contactUs;
287 public String toString() {
288 String str = "[" + getId() + ":" + getName() + "]";