[PORTAL-7] Rebase
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / OnboardingApp.java
1 /*-\r
2  * ================================================================================\r
3  * ECOMP Portal\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
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \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
19  */\r
20 package org.openecomp.portalapp.portal.transport;\r
21 \r
22 /**\r
23  * Model of rows in the fn_app table; serialized as a message add or update an\r
24  * on-boarded application.\r
25  */\r
26 public class OnboardingApp {\r
27 \r
28         public Long id;\r
29 \r
30         public String name;\r
31 \r
32         public String imageUrl;\r
33 \r
34         public String description;\r
35 \r
36         public String notes;\r
37 \r
38         public String url;\r
39 \r
40         public String alternateUrl;\r
41 \r
42         public String restUrl;\r
43 \r
44         public Boolean isOpen;\r
45 \r
46         public Boolean isEnabled;\r
47 \r
48         public Long motsId;\r
49 \r
50         public String myLoginsAppName;\r
51 \r
52         public String myLoginsAppOwner;\r
53 \r
54         public String username;\r
55 \r
56         public String appPassword;\r
57 \r
58         public String thumbnail;\r
59 \r
60         public String uebTopicName;\r
61 \r
62         public String uebKey;\r
63 \r
64         public String uebSecret;\r
65 \r
66         public Boolean restrictedApp;\r
67 \r
68         /**\r
69          * Sets the name, myLoginsAppName, myLoginsAppOwner, username and\r
70          * appPassword fields to the empty string OR trims leading/trailing space,\r
71          * as appropriate.\r
72          */\r
73         public void normalize() {\r
74                 this.name = (this.name == null) ? "" : this.name.trim();\r
75                 this.myLoginsAppName = (this.myLoginsAppName == null) ? "" : this.myLoginsAppName.trim();\r
76                 this.myLoginsAppOwner = (this.myLoginsAppOwner == null) ? "" : this.myLoginsAppOwner.trim();\r
77                 this.username = (this.username == null) ? "" : this.username.trim();\r
78                 this.appPassword = (this.appPassword == null) ? "" : this.appPassword.trim();\r
79         }\r
80 \r
81         public void setUebTopicName(String topicName) {\r
82                 this.uebTopicName = topicName;\r
83         }\r
84 \r
85         public void setUebKey(String key) {\r
86                 this.uebKey = key;\r
87         }\r
88 \r
89         public void setUebSecret(String secret) {\r
90                 this.uebSecret = secret;\r
91         }\r
92 \r
93         // Hide the implementation of restricted and normal app from the front end.\r
94         // The json sent and received will include restrictedApp but not appType.\r
95 \r
96         public void setRestrictedApp(Boolean restrictedApp) {\r
97                 this.restrictedApp = restrictedApp;\r
98         }\r
99 }\r