2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the "License");
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
38 package org.onap.portalapp.portal.transport;
40 import org.hibernate.validator.constraints.SafeHtml;
41 import org.onap.portalapp.portal.domain.EpAppType;
44 * Model of rows in the fn_app table; serialized as a message add or update an
45 * on-boarded application.
47 public class OnboardingApp {
51 private String appName;
53 private String imageUrl;
55 private String imageLink;
57 private String appDescription;
59 private String appNotes;
61 private String landingPage;
63 private String alternateLandingPage;
65 private String restUrl;
68 private String applicationType;
70 private Boolean isOpen;
72 private Boolean isEnabled;
76 private String myLoginsAppName;
78 private String myLoginsAppOwner;
80 private String appBasicAuthUsername;
82 private String appBasicAuthPassword;
84 private String thumbnail;
86 private String uebTopicName;
88 private String uebKey;
90 private String uebSecret;
92 private Boolean restrictedApp;
94 private Boolean rolesInAAF;
96 private String nameSpace;
99 private String modeOfIntegration;
101 private Boolean appAck;
103 private Boolean usesCadi;
106 * Sets the name, myLoginsAppName, myLoginsAppOwner, username and
107 * appPassword fields to the empty string OR trims leading/trailing space,
110 public void normalize() {
111 this.appName = (this.appName == null) ? "" : this.appName.trim();
112 this.myLoginsAppName = (this.myLoginsAppName == null) ? "" : this.myLoginsAppName.trim();
113 this.myLoginsAppOwner = (this.myLoginsAppOwner == null) ? "" : this.myLoginsAppOwner.trim();
114 this.appBasicAuthUsername = (this.appBasicAuthUsername == null) ? "" : this.appBasicAuthUsername.trim();
115 this.appBasicAuthPassword = (this.appBasicAuthPassword == null) ? "" : this.appBasicAuthPassword.trim();
118 public Long getId() {
122 public void setId(Long id) {
126 public String getAppName() {
130 public void setAppName(String appName) {
131 this.appName = appName;
134 public String getImageUrl() {
138 public void setImageUrl(String imageUrl) {
139 this.imageUrl = imageUrl;
142 public String getImageLink() {
146 public void setImageLink(String imageLink) {
147 this.imageLink = imageLink;
150 public String getAppDescription() {
151 return appDescription;
154 public void setAppDescription(String appDescription) {
155 this.appDescription = appDescription;
158 public String getAppNotes() {
162 public void setAppNotes(String appNotes) {
163 this.appNotes = appNotes;
166 public String getLandingPage() {
170 public void setLandingPage(String landingPage) {
171 this.landingPage = landingPage;
174 public String getAlternateLandingPage() {
175 return alternateLandingPage;
178 public void setAlternateLandingPage(String alternateLandingPage) {
179 this.alternateLandingPage = alternateLandingPage;
182 public String getRestUrl() {
186 public void setRestUrl(String restUrl) {
187 this.restUrl = restUrl;
190 public Boolean getIsOpen() {
194 public void setIsOpen(Boolean isOpen) {
195 this.isOpen = isOpen;
198 public Boolean getIsEnabled() {
202 public void setIsEnabled(Boolean isEnabled) {
203 this.isEnabled = isEnabled;
206 public Long getMotsId() {
210 public void setMotsId(Long motsId) {
211 this.motsId = motsId;
214 public String getMyLoginsAppName() {
215 return myLoginsAppName;
218 public void setMyLoginsAppName(String myLoginsAppName) {
219 this.myLoginsAppName = myLoginsAppName;
222 public String getMyLoginsAppOwner() {
223 return myLoginsAppOwner;
226 public void setMyLoginsAppOwner(String myLoginsAppOwner) {
227 this.myLoginsAppOwner = myLoginsAppOwner;
230 public String getAppBasicAuthUsername() {
231 return appBasicAuthUsername;
234 public void setAppBasicAuthUsername(String appBasicAuthUsername) {
235 this.appBasicAuthUsername = appBasicAuthUsername;
238 public String getAppBasicAuthPassword() {
239 return appBasicAuthPassword;
242 public void setAppBasicAuthPassword(String appBasicAuthPassword) {
243 this.appBasicAuthPassword = appBasicAuthPassword;
246 public String getThumbnail() {
250 public void setThumbnail(String thumbnail) {
251 this.thumbnail = thumbnail;
254 public String getUebTopicName() {
258 public void setUebTopicName(String uebTopicName) {
259 this.uebTopicName = uebTopicName;
262 public String getUebKey() {
266 public void setUebKey(String uebKey) {
267 this.uebKey = uebKey;
270 public String getUebSecret() {
274 public void setUebSecret(String uebSecret) {
275 this.uebSecret = uebSecret;
278 public Boolean getRestrictedApp() {
279 return restrictedApp;
282 public void setRestrictedApp(Boolean restrictedApp) {
283 this.restrictedApp = restrictedApp;
286 public Boolean getRolesInAAF() {
290 public void setRolesInAAF(Boolean rolesInAAF) {
291 this.rolesInAAF = rolesInAAF;
294 public String getNameSpace() {
298 public void setNameSpace(String nameSpace) {
299 this.nameSpace = nameSpace;
302 public String getModeOfIntegration() {
303 return modeOfIntegration;
306 public void setModeOfIntegration(String modeOfIntegration) {
307 this.modeOfIntegration = modeOfIntegration;
310 public Boolean getAppAck() {
314 public void setAppAck(Boolean appAck) {
315 this.appAck = appAck;
318 public Boolean getUsesCadi() {
322 public void setUsesCadi(Boolean usesCadi) {
323 this.usesCadi = usesCadi;
326 public String getApplicationType() {
327 return applicationType;
330 public void setApplicationType(String applicationType) {
331 this.applicationType = applicationType;
334 public Integer appTypePersistedValue() {
335 switch (this.getApplicationType()) {
336 case EpAppType.GUI_STR:
337 return EpAppType.GUI;
338 case EpAppType.HYPERLINK_STR:
339 return EpAppType.HYPERLINK;
340 case EpAppType.NONGUI_STR:
341 return EpAppType.NONGUI;