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