a3a320ebc8944ffa134da8fc3cc9486b58015adb
[portal/sdk.git] /
1 /*-
2  * ================================================================================
3  * ECOMP Portal SDK
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalsdk.core.onboarding.rest;
21
22 /**
23  * Provides a convenience method for fetching the functional menu for a user
24  * from the ECOMP Portal via UEB.
25  */
26 public class FunctionalMenuClient {
27
28         /**
29          * Fetches the functional menu data from the configured ECOMP Portal
30          * instance.
31          * 
32          * @param userId
33          *            userId for the user to whom the menu will be shown
34          * @param appName
35          *            Application name for logging etc.
36          * @param requestId
37          *            128-bit UUID value to uniquely identify the transaction; if
38          *            null, a new one is generated.
39          * @param appUserName
40          *            REST API user name, used by Portal to authenticate the request
41          * @param appPassword
42          *            REST API password (in the clear, not encrypted), used by
43          *            Portal to authenticate the request
44          * @return JSON with functional menu
45          * @throws Exception
46          *             on any failure
47          */
48         public static String getFunctionalMenu(String userId, String appName, String requestId, String appUserName,
49                         String appPassword) throws Exception {
50                 return RestWebServiceClient.getInstance().getPortalContent("/functionalMenuItemsForUser", userId, appName,
51                                 requestId, appUserName, appPassword);
52         }
53
54 }