1 package org.onap.portal.restTemplates;
3 import org.onap.portal.utils.EPCommonSystemProperties;
4 import org.onap.portalsdk.core.util.SystemProperties;
5 import org.springframework.http.HttpEntity;
6 import org.springframework.http.HttpMethod;
7 import org.springframework.http.ResponseEntity;
8 import org.springframework.stereotype.Component;
9 import org.springframework.web.client.RestTemplate;
12 public class AAFTemplate {
14 private final RestTemplate template = new RestTemplate();
16 public ResponseEntity<String> addPortalAdminInAAF(HttpEntity<String> addUserRole){
17 return template.exchange(
18 SystemProperties.getProperty(
19 EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
21 HttpMethod.POST, addUserRole, String.class);
24 public void deletePortalAdminFromAAF(final String name, final String extRole, final HttpEntity<String> addUserRole){
26 SystemProperties.getProperty(
27 EPCommonSystemProperties.EXTERNAL_CENTRAL_ACCESS_URL)
28 + "userRole/" + name + "/" + extRole,
29 HttpMethod.DELETE, addUserRole, String.class);