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