2 * ================================================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ================================================================================
\r
20 package org.openecomp.portalapp.portal.domain;
\r
22 import javax.persistence.Lob;
\r
24 import org.apache.commons.lang.StringUtils;
\r
25 import org.openecomp.portalsdk.core.domain.support.DomainVo;
\r
28 * Model for all columns in the fn_app table.
\r
30 public class EPApp extends DomainVo {
\r
32 private static final long serialVersionUID = 1L;
\r
34 private String name;
\r
35 private String imageUrl;
\r
36 private String description;
\r
37 private String notes;
\r
39 private String alternateUrl;
\r
40 private String appRestEndpoint;
\r
41 private String mlAppName;
\r
42 private String mlAppAdminId;
\r
43 private Long motsId;
\r
44 private String username;
\r
45 private String appPassword;
\r
47 private byte[] thumbnail;
\r
48 private Boolean open;
\r
49 private Boolean enabled;
\r
50 private String uebTopicName;
\r
51 private String uebKey;
\r
52 private String uebSecret;
\r
53 private Integer appType;
\r
55 private AppContactUs contactUs;
\r
59 // We set here all default values. We also place protection
\r
60 // into setters for fields with default values.
\r
61 // If we don't use such protection we are able to place null
\r
62 // to these fields and save such fields into DB even if DB has
\r
63 // default values for these fields.
\r
65 this.mlAppName = "";
\r
66 this.mlAppAdminId = "";
\r
68 this.appPassword = "";
\r
69 this.open = new Boolean(false);
\r
70 this.enabled = new Boolean(true);
\r
71 this.uebTopicName = "";
\r
73 this.uebSecret = "";
\r
77 public String getName() {
\r
81 public void setName(String name) {
\r
82 if (StringUtils.isEmpty(name)) {
\r
88 public String getImageUrl() {
\r
92 public void setImageUrl(String imageUrl) {
\r
93 this.imageUrl = imageUrl;
\r
96 public byte[] getThumbnail() {
\r
97 return this.thumbnail;
\r
100 public void setThumbnail(byte[] thumbnail) {
\r
101 this.thumbnail = thumbnail;
\r
104 public String getDescription() {
\r
105 return description;
\r
108 public void setDescription(String description) {
\r
109 this.description = description;
\r
112 public String getNotes() {
\r
116 public void setNotes(String notes) {
\r
117 this.notes = notes;
\r
120 public String getUrl() {
\r
124 public void setUrl(String url) {
\r
128 public String getAlternateUrl() {
\r
129 return alternateUrl;
\r
132 public void setAlternateUrl(String alternateUrl) {
\r
133 this.alternateUrl = alternateUrl;
\r
136 public String getAppRestEndpoint() {
\r
137 return appRestEndpoint;
\r
140 public void setAppRestEndpoint(String appRestEndpoint) {
\r
141 this.appRestEndpoint = appRestEndpoint;
\r
144 public String getMlAppName() {
\r
148 public void setMlAppName(String mlAppName) {
\r
149 if (StringUtils.isEmpty(mlAppName)) {
\r
152 this.mlAppName = mlAppName;
\r
155 public String getMlAppAdminId() {
\r
156 return mlAppAdminId;
\r
159 public void setMlAppAdminId(String mlAppAdminId) {
\r
160 if (StringUtils.isEmpty(mlAppAdminId)) {
\r
163 this.mlAppAdminId = mlAppAdminId;
\r
166 public Long getMotsId() {
\r
170 public void setMotsId(Long motsId) {
\r
171 this.motsId = motsId;
\r
174 public String getUsername() {
\r
178 public void setUsername(String username) {
\r
179 this.username = username;
\r
182 public String getAppPassword() {
\r
183 return appPassword;
\r
186 public void setAppPassword(String appPassword) {
\r
187 if (StringUtils.isEmpty(appPassword)) {
\r
190 this.appPassword = appPassword;
\r
193 public Boolean getOpen() {
\r
197 public void setOpen(Boolean open) {
\r
198 if (open == null) {
\r
199 open = new Boolean(false);
\r
204 public Boolean getEnabled() {
\r
208 public void setEnabled(Boolean enabled) {
\r
209 if (enabled == null) {
\r
210 enabled = new Boolean(true);
\r
212 this.enabled = enabled;
\r
215 public Integer getAppType() {
\r
219 public void setAppType(Integer appType) {
\r
220 if (appType == null) {
\r
221 appType = new Integer(1);
\r
223 this.appType = appType;
\r
226 public void setRestrictedApp(Boolean restrictedApp) {
\r
227 Integer result = 1;
\r
228 if (restrictedApp) {
\r
231 this.appType = result;
\r
234 public Boolean isRestrictedApp() {
\r
235 return (this.appType == 2 ? true : false);
\r
238 public int compareTo(Object obj) {
\r
240 Long c2 = ((EPApp) obj).getId();
\r
242 return c1.compareTo(c2);
\r
245 public String getUebTopicName() {
\r
246 return this.uebTopicName;
\r
249 public void setUebTopicName(String topicName) {
\r
250 if (StringUtils.isEmpty(topicName)) {
\r
251 this.uebTopicName = "";
\r
253 this.uebTopicName = topicName;
\r
256 public String getUebKey() {
\r
257 return this.uebKey;
\r
260 public void setUebKey(String uebKey) {
\r
261 if (StringUtils.isEmpty(uebKey)) {
\r
264 this.uebKey = uebKey;
\r
267 public String getUebSecret() {
\r
268 return this.uebSecret;
\r
271 public void setUebSecret(String uebSecret) {
\r
272 if (StringUtils.isEmpty(uebSecret)) {
\r
273 this.uebSecret = "";
\r
275 this.uebSecret = uebSecret;
\r
278 public AppContactUs getContactUs() {
\r
282 public void setContactUs(AppContactUs contactUs) {
\r
283 this.contactUs = contactUs;
\r
287 public String toString() {
\r
288 String str = "[" + getId() + ":" + getName() + "]";
\r