Deliver centralized role management feature
[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.transport.CentralRole;
10 import org.openecomp.portalsdk.core.domain.Role;
11 import org.openecomp.portalsdk.core.domain.RoleFunction;
12
13 public interface ExternalAccessRolesService {
14         
15         /**
16          * It gets all application roles 
17          * 
18          * @param appId
19          * @param extRequestValue
20          * @return List
21          * @throws Exception 
22          */
23         public List<EPRole> getAppRoles(Long appId, Boolean extRequestValue) throws Exception;
24         
25         /**
26          * It returns application details
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          * Updates role in the external access system otherwise throws exception
46          * 
47          * @param updateRole
48          * @param uebkey
49          * @return boolean
50          * @throws Exception
51          */
52         void updateRole(Role updateRole, EPApp app) 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 getUser(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          * @throws Exception 
98          */
99         public void saveCentralRoleFunction(CentralRoleFunction domainCentralRoleFunction, EPApp requestedApp) throws Exception;
100
101         /**
102          * It deletes role function in the DB
103          * 
104          * @param code
105          * @param string 
106          */
107         public void deleteCentralRoleFunction(String code, String string);
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         void saveRoleForApplication(Role saveRole, String uebkey) throws Exception;
126
127         /**
128          *  It deletes role in the DB
129          *  
130          * @param code
131          * @param uebkey
132          * @throws Exception 
133          */
134         void deleteRoleForApplication(String code, String uebkey) throws Exception;
135
136         /**
137          * It gets all active roles for single application 
138          * 
139          * @param uebkey
140          * @return List
141          * @throws Exception
142          */
143         List<CentralRole> getActiveRoles(String uebkey) throws Exception;
144         
145         /**
146          * It deletes user related roles for an application in the table
147          * @param roleId
148          * @param uebkey
149          * @param LoginId 
150          * @return
151          * @throws Exception 
152          */
153         public void deleteDependcyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception;
154         
155         /**
156          * It sync new functions codes and names from and updates role functions from external access system
157          * 
158          * @param app
159          * @throws Exception
160          */
161         public void syncRoleFunctionFromExternalAccessSystem(EPApp app) throws Exception;
162
163         public Integer bulkUploadFunctions(String uebkey) throws Exception;
164
165         public Integer bulkUploadRoles(String uebkey) throws Exception;
166
167         public void bulkUploadPartnerFunctions(String header, List<RoleFunction> upload) throws Exception;
168
169         public void bulkUploadPartnerRoles(String header, List<Role> upload) throws Exception;
170
171         Integer bulkUploadRolesFunctions(String uebkey) throws Exception;
172         
173         /**
174          * SyncApplicationRolesWithEcompDB sync the roles and rolefunctions to the ecomp DB from AAF
175          * @param app
176          * @throws Exception
177          */
178
179         void SyncApplicationRolesWithEcompDB(EPApp app) throws Exception;
180
181         public Integer bulkUploadUserRoles(String uebkey) throws Exception;
182
183         void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception;
184
185         public void deleteRoleDependeciesRecord(Session localSession, Long roleId) throws Exception;
186
187         List<String> getMenuFunctionsList(String uebkey) throws Exception;
188
189
190 }