nexus site path corrected
[portal.git] / ecomp-portal-BE / src / main / java / org / openecomp / portalapp / portal / service / EPAppService.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.service;
21
22 import java.util.List;
23
24 import org.openecomp.portalapp.portal.domain.AdminUserApplications;
25 import org.openecomp.portalapp.portal.domain.AppIdAndNameTransportModel;
26 import org.openecomp.portalapp.portal.domain.AppsResponse;
27 import org.openecomp.portalapp.portal.domain.EPApp;
28 import org.openecomp.portalapp.portal.domain.EPUser;
29 import org.openecomp.portalapp.portal.domain.EcompApp;
30 import org.openecomp.portalapp.portal.domain.UserRoles;
31 import org.openecomp.portalapp.portal.transport.FieldsValidator;
32 import org.openecomp.portalapp.portal.transport.LocalRole;
33 import org.openecomp.portalapp.portal.transport.OnboardingApp;
34 import org.openecomp.portalapp.portal.ecomp.model.AppCatalogItem;
35
36 public interface EPAppService {
37
38         /**
39          * Get all applications adminId is an admin
40          * 
41          * @param adminId
42          *            - the admin
43          * @return the admin's applications
44          */
45         List<EPApp> getUserAsAdminApps(EPUser user);
46
47         List<EPApp> getUserByOrgUserIdAsAdminApps(String attuid);
48
49         /**
50          * Gets all rows and all fields from the fn_app table.
51          * 
52          * @return list of EPApp objects
53          */
54         List<EPApp> getAppsFullList();
55
56         /**
57          * Gets all rows and most fields from the fn_app table.
58          * 
59          * @return list of EcompApp objects.
60          */
61         List<EcompApp> getEcompAppAppsFullList();
62
63         /**
64          * Get apps with app app admins
65          * 
66          * @return
67          */
68         List<AdminUserApplications> getAppsAdmins();
69
70         /**
71          * Get all apps from fn_app table (index, name, title only). If all is true,
72          * return active and inactive apps; otherwise, just active apps.
73          * 
74          * @return List of AppsResponse objects.
75          */
76         List<AppsResponse> getAllApps(Boolean all);
77
78         UserRoles getUserProfile(String loginId);
79
80         List<LocalRole> getAppRoles(Long appId);
81
82         List<AppIdAndNameTransportModel> getAdminApps(EPUser user);
83
84         List<AppIdAndNameTransportModel> getAppsForSuperAdminAndAccountAdmin(EPUser user);
85         
86         List<EPApp> getUserRemoteApps(String id);
87
88         /**
89          * Gets the applications accessible to the specified user, which includes
90          * all enabled open applications, plus all enabled applications for which
91          * the user has a defined role for that app.
92          * 
93          * @param user
94          *            EPUser object with the user's UID 
95          * @return the user's list of applications, which may be empty.
96          */
97         List<EPApp> getUserApps(EPUser user);
98
99         /**
100          * Gets the user-personalized list of applications for the Portal (super)
101          * admin, which includes enabled open applications, enabled applications for
102          * which the user has a defined role for that app, and/or enabled
103          * applications which the user has chosen to show.
104          * 
105          * @param user
106          *            EPUser object with the user's UID
107          * @return the user's personalized list of applications, which may be empty.
108          */
109         List<EPApp> getPersAdminApps(EPUser user);
110
111         /**
112          * Gets the user-personalized list of accessible applications, which
113          * includes enabled open applications and/or enabled applications for which
114          * the user has a defined role for that app. Personalization means the user
115          * can indicate an accessible application should be excluded from this
116          * result.
117          * 
118          * @param user
119          *            EPUser object with the user's UID
120          * @return the user's personalized list of applications, which may be empty.
121          */
122         List<EPApp> getPersUserApps(EPUser user);
123
124         /**
125          * Gets the application catalog for the specified user who is a super admin.
126          * This includes all enabled applications. Each item indicates whether the
127          * user has access (open or via a role), and whether the application is
128          * selected for showing in the user's home (applications) page. Admin sees
129          * slightly different behavior - can force an app onto the home page using
130          * the personalization feature (user-app-selection table).
131          * 
132          * @param user
133          * @return list of all enabled applications, which may be empty
134          */
135         List<AppCatalogItem> getAdminAppCatalog(EPUser user);
136
137         /**
138          * Gets the application catalog for the specified user, who is a regular
139          * user. This includes all enabled applications. Each item indicates whether
140          * the user has access (open or via a role), and whether the application is
141          * selected for showing in the user's home (applications) page.
142          * 
143          * @param user
144          * @return list of all enabled applications, which may be empty
145          */
146         List<AppCatalogItem> getUserAppCatalog(EPUser user);
147
148         List<OnboardingApp> getOnboardingApps();
149
150         List<OnboardingApp> getEnabledNonOpenOnboardingApps();
151
152         FieldsValidator modifyOnboardingApp(OnboardingApp modifiedOnboardingApp, EPUser user);
153
154         FieldsValidator addOnboardingApp(OnboardingApp newOnboardingApp, EPUser user);
155
156         FieldsValidator deleteOnboardingApp(EPUser user, Long onboardingAppId);
157
158         List<EcompApp> transformAppsToEcompApps(List<EPApp> appsList);
159
160         EPApp getApp(Long appId);
161
162         void writeAppsImagesToDiskCacheIfNecessary();
163
164 }