2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 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============================================
39 package org.onap.portalapp.portal.service;
41 import java.util.List;
43 import org.apache.cxf.transport.http.HTTPException;
44 import org.onap.portalapp.externalsystemapproval.model.ExternalSystemUser;
45 import org.onap.portalapp.portal.domain.EPRole;
46 import org.onap.portalapp.portal.domain.EPUser;
47 import org.onap.portalapp.portal.domain.EPUserApp;
48 import org.onap.portalapp.portal.domain.EPUserAppCatalogRoles;
49 import org.onap.portalapp.portal.domain.ExternalSystemAccess;
50 import org.onap.portalapp.portal.transport.AppWithRolesForUser;
51 import org.onap.portalapp.portal.transport.ExternalRequestFieldsValidator;
52 import org.onap.portalapp.portal.transport.FieldsValidator;
53 import org.onap.portalapp.portal.transport.RoleInAppForUser;
54 import org.onap.portalapp.portal.transport.UserApplicationRoles;
56 public interface UserRolesService {
59 * Returns list of app roles of a single app
64 * ID of row in fn_user
65 * @param extRequestValue
66 * set to false if request is from users page otherwise true
68 * @return List<RoleInAppForUser>
70 public List<RoleInAppForUser> getAppRolesForUser(Long appId, String userId, Boolean extRequestValue, EPUser user );
72 public ExternalRequestFieldsValidator setAppWithUserRoleStateForUser(EPUser user, AppWithRolesForUser newAppRolesForUser);
74 public List<UserApplicationRoles> getUsersFromAppEndpoint(Long appId) throws HTTPException;
76 public List<EPRole> importRolesFromRemoteApplication(Long appId) throws HTTPException;
79 * Gets entries from the local fn_user_role table for the specified user and
85 * ID of row in fn_user
86 * @return List of EPRole; empty if none found.
88 public List<EPUserApp> getCachedAppRolesForUser(Long appId, Long userId);
90 public FieldsValidator putUserAppRolesRequest(AppWithRolesForUser userAppRolesData, EPUser user);
93 * Save user app roles in the database from the external request
95 * @param newAppRolesForUser
97 * contains login id, app name, request id, and list of role
100 * @return if any exceptions, returns detail message and true or false
102 ExternalRequestFieldsValidator setExternalRequestUserAppRole(ExternalSystemUser newAppRolesForUser, String reqType);
104 public List<EPUserAppCatalogRoles> getUserAppCatalogRoles(EPUser user, String appName);
106 public String updateRemoteUserProfile(String orgUserId, Long appId);
108 public ExternalSystemAccess getExternalRequestAccess();
110 public List<EPUserApp> getEPUserAppList(Long appId, Long userId, Long roleId);