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.onap.portalsdk.core.onboarding.crossapi;
42 import javax.servlet.http.HttpServletRequest;
44 import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
45 import org.onap.portalsdk.core.restful.domain.EcompUser;
47 public interface IPortalRestCentralService {
50 * Gets and returns the Map with username, password and appName of application .If any error
51 * occurs, the method should throw PortalApiException with an appropriate
52 * message. The FW library will catch the exception and send an appropriate
55 * @return a map with keys username, password and appName
57 public Map<String, String> getAppCredentials() throws PortalAPIException;
60 * Creates a user with the specified details. If any error occurs, for example
61 * the user exists, the method should throw PortalApiException with an
62 * appropriate message. The FW library will catch the exception and send an
63 * appropriate response to Portal.
66 * Model object with attributes of user to be created.
67 * @throws PortalAPIException
68 * If any error occurs while processing the request; for example,
71 public void pushUser(EcompUser user) throws PortalAPIException;
74 * Updates details about the user with the specified loginId. For example, mark
75 * user as inactive. If any error occurs, the method should throw
76 * PortalApiException with an appropriate message. The FW library will catch the
77 * exception and send an appropriate response to Portal.
80 * EcompUser ID to be updated.
82 * Model object with attributes of user to be updated.
83 * @throws PortalAPIException
84 * If any error occurs while processing the request; for example,
87 public void editUser(String loginId, EcompUser user) throws PortalAPIException;
90 * Gets and returns the userId for the logged-in user based on the request. If
91 * any error occurs, the method should throw PortalApiException with an
92 * appropriate message. The FW library will catch the exception and send an
93 * appropriate response to Portal.
97 * @return true if the request contains appropriate credentials, else false.
98 * @throws PortalAPIException
99 * If an unexpected error occurs while processing the request.
101 public String getUserId(HttpServletRequest request) throws PortalAPIException;