77ce88c5c5b2f4a9bbaa52324c5ad3c25872c42a
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / service / ExternalAccessRolesService.java
1 package org.openecomp.portalapp.portal.service;
2
3 import java.util.List;
4
5 import org.hibernate.Session;
6 import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
7 import org.openecomp.portalapp.portal.domain.EPApp;
8 import org.openecomp.portalapp.portal.domain.EPRole;
9 import org.openecomp.portalapp.portal.domain.EPUser;
10 import org.openecomp.portalapp.portal.transport.CentralRole;
11 import org.openecomp.portalsdk.core.domain.Role;
12 import org.openecomp.portalsdk.core.domain.RoleFunction;
13 import org.openecomp.portalsdk.core.restful.domain.EcompUser;
14
15 public interface ExternalAccessRolesService {
16         
17         /**
18          * It gets list of application roles 
19          * 
20          * @param appId
21          * @return List
22          * @throws Exception 
23          */
24         public List<EPRole> getAppRoles(Long appId) throws Exception;
25         
26         /**
27          * It returns single app record
28          * 
29          * @param uebkey
30          * @return List
31          * @throws Exception 
32          */             
33         public List<EPApp> getApp(String uebkey) throws Exception;
34         
35         /**
36          * Adds role in the external access system if fails throws exception
37          * 
38          * @param addRoles
39          * @param UE
40          * @return boolean
41          * @throws Exception
42          */
43         public boolean addRole(Role addRoles, String uebkey) throws Exception;
44
45         /**
46          * It returns complete user information
47          * 
48          * @param loginId
49          * @return EPUser object
50          * @throws Exception
51          */
52         List<EPUser> getUser(String loginId) throws Exception;
53         
54         /**
55          * It returns complete user information including application roles permissions
56          * 
57          * @param loginId
58          * @param uebkey
59          * @return String
60          * @throws Exception
61          */
62         String getUserWithRoles(String loginId, String uebkey) throws Exception;
63
64         /**
65          * It returns list of all role functions
66          * @param string 
67          * @return List
68          * @throws Exception 
69          */
70         List<CentralRoleFunction> getRoleFuncList(String string) throws Exception;
71         
72         /**
73          * It return list of role provided by the app uebkey and roleId
74          * 
75          * @param roleId
76          * @param uebkey
77          * @return CentralRole
78          * @throws Exception
79          */
80         CentralRole getRoleInfo(Long roleId, String uebkey) throws Exception;
81         
82         /**
83          *  It returns the CentralRoleFunction object 
84          *   
85          * @param functionCode
86          * @param uebkey 
87          * @return CentralRoleFunction
88          * @throws Exception 
89          */
90         public CentralRoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception;
91
92         /**
93          *  It saves role function in the DB
94          *  
95          * @param domainCentralRoleFunction
96          * @param requestedApp 
97          * @return true else false
98          * @throws Exception 
99          */
100         public boolean saveCentralRoleFunction(CentralRoleFunction domainCentralRoleFunction, EPApp requestedApp) throws Exception;
101
102         /**
103          * It deletes role function in the DB
104          * 
105          * @param code
106          * @param app 
107          */
108         public boolean deleteCentralRoleFunction(String code, EPApp app);
109
110         /**
111          * It gets all roles the applications
112          * 
113          * @param uebkey
114          * @return List
115          * @throws Exception 
116          */
117         public List<CentralRole> getRolesForApp(String uebkey) throws Exception;
118         
119         /**
120          * It saves role function in the DB
121          * 
122          * @param saveRole
123          * @param uebkey
124          * @throws Exception 
125          */
126         boolean saveRoleForApplication(Role saveRole, String uebkey) throws Exception;
127
128         /**
129          *  It deletes role in the DB
130          *  
131          * @param code
132          * @param uebkey
133          * @return true else false
134          * @throws Exception 
135          */
136         boolean deleteRoleForApplication(String code, String uebkey) throws Exception;
137
138         /**
139          * It gets all active roles for single application 
140          * 
141          * @param uebkey
142          * @return List
143          * @throws Exception
144          */
145         List<CentralRole> getActiveRoles(String uebkey) throws Exception;
146         
147         /**
148          * It deletes user related roles for an application in the table
149          * @param roleId
150          * @param uebkey
151          * @param LoginId 
152          * @return true else false
153          * @throws Exception 
154          */
155         public boolean deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception;
156         
157         /**
158          * It sync new functions codes and names from and updates role functions from external access system
159          * 
160          * @param app
161          * @throws Exception
162          */
163         public void syncRoleFunctionFromExternalAccessSystem(EPApp app) throws Exception;
164
165         /**
166          * It uploads portal functions into external auth system
167          * @param uebkey
168          * @return
169          * @throws Exception
170          */
171         public Integer bulkUploadFunctions(String uebkey) throws Exception;
172
173         /**
174          * It uploads portal roles into external auth system
175          * @param uebkey
176          * @return
177          * @throws Exception
178          */
179         public Integer bulkUploadRoles(String uebkey) throws Exception;
180
181         /**
182          * It uploads partner application role functions into external auth system
183          * 
184          * @param uebkey
185          * @param upload
186          * @throws Exception
187          */
188         public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> upload) throws Exception;
189
190         /** 
191          * It uploads partner application role functions into external auth system
192          * 
193          * @param uebkey
194          * @param upload
195          * @throws Exception
196          */
197         public void bulkUploadPartnerRoles(String uebkey, List<Role> upload) throws Exception;
198
199         /**
200          * It returns total no. of portal application role functions records added in external auth system 
201          * @param uebkey
202          * @return
203          * @throws Exception
204          */
205         Integer bulkUploadRolesFunctions(String uebkey) throws Exception;
206         
207         /**
208          *  It syncs the roles and rolefunctions to the ecomp DB from AAF
209          * @param app
210          * @throws Exception
211          */
212         void syncApplicationRolesWithEcompDB(EPApp app) throws Exception;
213
214         /**
215          * It uploads list of user roles of the application into external auth system 
216          * 
217          * @param uebkey
218          * @return
219          * @throws Exception
220          */
221         public Integer bulkUploadUserRoles(String uebkey) throws Exception;
222
223         /**
224          * It Uploads partner application role functions into external auth system
225          * 
226          * @param uebkey
227          * @param roleList
228          * @throws Exception
229          */
230         void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception;
231
232         /**
233          * it deletes all dependency role records 
234          * 
235          * @param localSession
236          * @param roleId
237          * @param appId
238          * @throws Exception
239          */
240         public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId) throws Exception;
241
242         /**
243          * It returns list of applications functions along with functions associated with global role
244          * 
245          * @param uebkey
246          * @return
247          * @throws Exception
248          */
249         List<String> getMenuFunctionsList(String uebkey) throws Exception;
250         
251         /**
252          * 
253          * @param uebkey applications UebKey
254          * @return
255          * @throws Exception
256          * Method getAllUsers returns all the active users of application
257          */
258         List<EcompUser> getAllAppUsers(String uebkey) throws Exception;
259
260 }