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;
43 import com.fasterxml.jackson.annotation.JsonProperty;
44 import com.fasterxml.jackson.annotation.JsonProperty.Access;
47 * Model of rows in the fn_app table; serialized as a message add or update an
48 * on-boarded application.
50 public class OnboardingApp {
54 private String appName;
56 private String imageUrl;
58 private String imageLink;
60 private String appDescription;
62 private String appNotes;
64 private String landingPage;
66 private String alternateLandingPage;
68 private String restUrl;
71 private String applicationType;
73 private Boolean isOpen;
75 private Boolean isEnabled;
79 private String myLoginsAppName;
81 private String myLoginsAppOwner;
83 private String appBasicAuthUsername;
85 @JsonProperty(access = Access.WRITE_ONLY)
86 private String appBasicAuthPassword;
88 private String thumbnail;
90 private String uebTopicName;
92 private String uebKey;
94 private String uebSecret;
96 private Boolean restrictedApp;
98 private Boolean rolesInAAF;
100 private String nameSpace;
103 private String modeOfIntegration;
105 private Boolean appAck;
107 private Boolean usesCadi;
110 * Sets the name, myLoginsAppName, myLoginsAppOwner, username and
111 * appPassword fields to the empty string OR trims leading/trailing space,
114 public void normalize() {
115 this.appName = (this.appName == null) ? "" : this.appName.trim();
116 this.myLoginsAppName = (this.myLoginsAppName == null) ? "" : this.myLoginsAppName.trim();
117 this.myLoginsAppOwner = (this.myLoginsAppOwner == null) ? "" : this.myLoginsAppOwner.trim();
118 this.appBasicAuthUsername = (this.appBasicAuthUsername == null) ? "" : this.appBasicAuthUsername.trim();
119 this.appBasicAuthPassword = (this.appBasicAuthPassword == null) ? "" : this.appBasicAuthPassword.trim();
122 public Long getId() {
126 public void setId(Long id) {
130 public String getAppName() {
134 public void setAppName(String appName) {
135 this.appName = appName;
138 public String getImageUrl() {
142 public void setImageUrl(String imageUrl) {
143 this.imageUrl = imageUrl;
146 public String getImageLink() {
150 public void setImageLink(String imageLink) {
151 this.imageLink = imageLink;
154 public String getAppDescription() {
155 return appDescription;
158 public void setAppDescription(String appDescription) {
159 this.appDescription = appDescription;
162 public String getAppNotes() {
166 public void setAppNotes(String appNotes) {
167 this.appNotes = appNotes;
170 public String getLandingPage() {
174 public void setLandingPage(String landingPage) {
175 this.landingPage = landingPage;
178 public String getAlternateLandingPage() {
179 return alternateLandingPage;
182 public void setAlternateLandingPage(String alternateLandingPage) {
183 this.alternateLandingPage = alternateLandingPage;
186 public String getRestUrl() {
190 public void setRestUrl(String restUrl) {
191 this.restUrl = restUrl;
194 public Boolean getIsOpen() {
198 public void setIsOpen(Boolean isOpen) {
199 this.isOpen = isOpen;
202 public Boolean getIsEnabled() {
206 public void setIsEnabled(Boolean isEnabled) {
207 this.isEnabled = isEnabled;
210 public Long getMotsId() {
214 public void setMotsId(Long motsId) {
215 this.motsId = motsId;
218 public String getMyLoginsAppName() {
219 return myLoginsAppName;
222 public void setMyLoginsAppName(String myLoginsAppName) {
223 this.myLoginsAppName = myLoginsAppName;
226 public String getMyLoginsAppOwner() {
227 return myLoginsAppOwner;
230 public void setMyLoginsAppOwner(String myLoginsAppOwner) {
231 this.myLoginsAppOwner = myLoginsAppOwner;
234 public String getAppBasicAuthUsername() {
235 return appBasicAuthUsername;
238 public void setAppBasicAuthUsername(String appBasicAuthUsername) {
239 this.appBasicAuthUsername = appBasicAuthUsername;
242 public String getAppBasicAuthPassword() {
243 return appBasicAuthPassword;
246 public void setAppBasicAuthPassword(String appBasicAuthPassword) {
247 this.appBasicAuthPassword = appBasicAuthPassword;
250 public String getThumbnail() {
254 public void setThumbnail(String thumbnail) {
255 this.thumbnail = thumbnail;
258 public String getUebTopicName() {
262 public void setUebTopicName(String uebTopicName) {
263 this.uebTopicName = uebTopicName;
266 public String getUebKey() {
270 public void setUebKey(String uebKey) {
271 this.uebKey = uebKey;
274 public String getUebSecret() {
278 public void setUebSecret(String uebSecret) {
279 this.uebSecret = uebSecret;
282 public Boolean getRestrictedApp() {
283 return restrictedApp;
286 public void setRestrictedApp(Boolean restrictedApp) {
287 this.restrictedApp = restrictedApp;
290 public Boolean getRolesInAAF() {
294 public void setRolesInAAF(Boolean rolesInAAF) {
295 this.rolesInAAF = rolesInAAF;
298 public String getNameSpace() {
302 public void setNameSpace(String nameSpace) {
303 this.nameSpace = nameSpace;
306 public String getModeOfIntegration() {
307 return modeOfIntegration;
310 public void setModeOfIntegration(String modeOfIntegration) {
311 this.modeOfIntegration = modeOfIntegration;
314 public Boolean getAppAck() {
318 public void setAppAck(Boolean appAck) {
319 this.appAck = appAck;
322 public Boolean getUsesCadi() {
326 public void setUsesCadi(Boolean usesCadi) {
327 this.usesCadi = usesCadi;
330 public String getApplicationType() {
331 return applicationType;
334 public void setApplicationType(String applicationType) {
335 this.applicationType = applicationType;
338 public Integer appTypePersistedValue() {
339 switch (this.getApplicationType()) {
340 case EpAppType.GUI_STR:
341 return EpAppType.GUI;
342 case EpAppType.HYPERLINK_STR:
343 return EpAppType.HYPERLINK;
344 case EpAppType.NONGUI_STR:
345 return EpAppType.NONGUI;