Adding UI extensibility
[aai/sparky-be.git] / src / main / java / org / onap / aai / sparky / security / portal / PortalRestAPIServiceImpl.java
index 798022a..d3ffac3 100644 (file)
@@ -48,34 +48,6 @@ public class PortalRestAPIServiceImpl implements IPortalRestAPIService {
   private static final Logger LOG = LoggerFactory.getLogger(PortalRestAPIServiceImpl.class);
   private static final String ERROR_MESSAGE = "Failed to {0} user [loginId:{1}]";
 
-  /**
-   * @return the userManager
-   */
-  public UserManager getUserManager() {
-    return userManager;
-  }
-
-  /**
-   * @param userManager the userManager to set
-   */
-  public void setUserManager(UserManager userManager) {
-    this.userManager = userManager;
-  }
-
-  /**
-   * @return the log
-   */
-  public static Logger getLog() {
-    return LOG;
-  }
-
-  /**
-   * @return the errorMessage
-   */
-  public static String getErrorMessage() {
-    return ERROR_MESSAGE;
-  }
-
   private UserManager userManager;
 
   /**
@@ -101,8 +73,8 @@ public class PortalRestAPIServiceImpl implements IPortalRestAPIService {
     LOG.debug("Push user [loginId:" + user.getLoginId() + "]");
 
     if (userManager.getUser(user.getLoginId()).isPresent()) {
-      String message = getMessage(ERROR_MESSAGE, "push", user.getLoginId())
-          + ", user is already stored";
+      String message =
+          getMessage(ERROR_MESSAGE, "push", user.getLoginId()) + ", user is already stored";
       LOG.error(message);
       throw new PortalAPIException(message);
     }
@@ -175,14 +147,12 @@ public class PortalRestAPIServiceImpl implements IPortalRestAPIService {
   /////////////////////////////////////////////////////////////////////////////
   // Role interface
   /////////////////////////////////////////////////////////////////////////////
+  public List<EcompRole> getAvailableRoles() throws PortalAPIException {
+    LOG.debug("Get available roles");
+    return UserManager.getRoles();
+  }
 
-  /*
-   * (non-Javadoc)
-   *
-   * @see com.att.fusion.core.onboarding.crossapi.IPortalRestAPIService#getAvailableRoles()
-   */
-  @Override
-  public List<EcompRole> getAvailableRoles(String role) throws PortalAPIException {
+  public List<EcompRole> getAvailableRoles(String requestedLoginId) throws PortalAPIException {
     LOG.debug("Get available roles");
     return UserManager.getRoles();
   }
@@ -250,5 +220,4 @@ public class PortalRestAPIServiceImpl implements IPortalRestAPIService {
     formatter.applyPattern(message);
     return formatter.format(args);
   }
-
-}
\ No newline at end of file
+}