2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
8 * Unless otherwise specified, all software contained herein is licensed
9 * under the Apache License, Version 2.0 (the “License”);
10 * you may not use this software except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * Unless otherwise specified, all documentation contained herein is licensed
22 * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23 * you may not use this documentation except in compliance with the License.
24 * You may obtain a copy of the License at
26 * https://creativecommons.org/licenses/by/4.0/
28 * Unless required by applicable law or agreed to in writing, documentation
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 * ============LICENSE_END============================================
36 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38 package org.openecomp.portalapp.portal.service;
40 import java.util.List;
42 import org.hibernate.Session;
43 import org.openecomp.portalapp.portal.domain.CentralRoleFunction;
44 import org.openecomp.portalapp.portal.domain.EPApp;
45 import org.openecomp.portalapp.portal.domain.EPRole;
46 import org.openecomp.portalapp.portal.domain.EPUser;
47 import org.openecomp.portalapp.portal.transport.CentralRole;
48 import org.openecomp.portalsdk.core.domain.Role;
49 import org.openecomp.portalsdk.core.domain.RoleFunction;
50 import org.openecomp.portalsdk.core.restful.domain.EcompUser;
52 public interface ExternalAccessRolesService {
55 * It gets list of application roles
61 public List<EPRole> getAppRoles(Long appId) throws Exception;
64 * It returns single app record
70 public List<EPApp> getApp(String uebkey) throws Exception;
73 * Adds role in the external access system if fails throws exception
80 public boolean addRole(Role addRoles, String uebkey) throws Exception;
83 * It returns complete user information
86 * @return EPUser object
89 List<EPUser> getUser(String loginId) throws Exception;
92 * It returns complete user information including application roles permissions
99 String getUserWithRoles(String loginId, String uebkey) throws Exception;
102 * It returns list of all role functions
107 List<CentralRoleFunction> getRoleFuncList(String string) throws Exception;
110 * It return list of role provided by the app uebkey and roleId
114 * @return CentralRole
117 CentralRole getRoleInfo(Long roleId, String uebkey) throws Exception;
120 * It returns the CentralRoleFunction object
122 * @param functionCode
124 * @return CentralRoleFunction
127 public CentralRoleFunction getRoleFunction(String functionCode, String uebkey) throws Exception;
130 * It saves role function in the DB
132 * @param domainCentralRoleFunction
133 * @param requestedApp
134 * @return true else false
137 public boolean saveCentralRoleFunction(CentralRoleFunction domainCentralRoleFunction, EPApp requestedApp) throws Exception;
140 * It deletes role function in the DB
145 public boolean deleteCentralRoleFunction(String code, EPApp app);
148 * It gets all roles the applications
154 public List<CentralRole> getRolesForApp(String uebkey) throws Exception;
157 * It saves role function in the DB
163 boolean saveRoleForApplication(Role saveRole, String uebkey) throws Exception;
166 * It deletes role in the DB
170 * @return true else false
173 boolean deleteRoleForApplication(String code, String uebkey) throws Exception;
176 * It gets all active roles for single application
182 List<CentralRole> getActiveRoles(String uebkey) throws Exception;
185 * It deletes user related roles for an application in the table
189 * @return true else false
192 public boolean deleteDependencyRoleRecord(Long roleId, String uebkey, String LoginId) throws Exception;
195 * It sync new functions codes and names from and updates role functions from external access system
200 public void syncRoleFunctionFromExternalAccessSystem(EPApp app) throws Exception;
203 * It uploads portal functions into external auth system
208 public Integer bulkUploadFunctions(String uebkey) throws Exception;
211 * It uploads portal roles into external auth system
216 public Integer bulkUploadRoles(String uebkey) throws Exception;
219 * It uploads partner application role functions into external auth system
225 public void bulkUploadPartnerFunctions(String uebkey, List<RoleFunction> upload) throws Exception;
228 * It uploads partner application role functions into external auth system
234 public void bulkUploadPartnerRoles(String uebkey, List<Role> upload) throws Exception;
237 * It returns total no. of portal application role functions records added in external auth system
242 Integer bulkUploadRolesFunctions(String uebkey) throws Exception;
245 * It syncs the roles and rolefunctions to the ecomp DB from AAF
249 void syncApplicationRolesWithEcompDB(EPApp app) throws Exception;
252 * It uploads list of user roles of the application into external auth system
258 public Integer bulkUploadUserRoles(String uebkey) throws Exception;
261 * It Uploads partner application role functions into external auth system
267 void bulkUploadPartnerRoleFunctions(String uebkey, List<Role> roleList) throws Exception;
270 * it deletes all dependency role records
272 * @param localSession
277 public void deleteRoleDependencyRecords(Session localSession, Long roleId, Long appId) throws Exception;
280 * It returns list of applications functions along with functions associated with global role
286 List<String> getMenuFunctionsList(String uebkey) throws Exception;
290 * @param uebkey applications UebKey
293 * Method getAllUsers returns all the active users of application
295 List<EcompUser> getAllAppUsers(String uebkey) throws Exception;