stratos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ud...@apache.org
Subject git commit: Revert "Code review changes"
Date Thu, 02 Oct 2014 07:06:23 GMT
Repository: stratos
Updated Branches:
  refs/heads/master 38c05a5af -> 60fdd83ea


Revert "Code review changes"

This reverts commit e1eb346dd472bed6df5b05a365d244bc04d916d8.


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/60fdd83e
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/60fdd83e
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/60fdd83e

Branch: refs/heads/master
Commit: 60fdd83eaf7bc3d84c0b6bfeb33ad2f2d073bcd3
Parents: 38c05a5
Author: Udara Liyanage <udara@wso2.com>
Authored: Thu Oct 2 12:32:55 2014 +0530
Committer: Udara Liyanage <udara@wso2.com>
Committed: Thu Oct 2 12:32:55 2014 +0530

----------------------------------------------------------------------
 .../manager/listener/TenantUserRoleCreator.java | 17 ++--
 .../manager/user/mgt/StratosUserManager.java    | 35 ++++----
 .../mgt/exception/UserManagementException.java  | 19 ++++-
 .../stratos/manager/utils/UserRoleCreator.java  |  7 +-
 .../rest/endpoint/services/ServiceUtils.java    | 84 ++++++++++++++++++++
 .../rest/endpoint/services/StratosAdmin.java    | 81 +++----------------
 6 files changed, 145 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/listener/TenantUserRoleCreator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/listener/TenantUserRoleCreator.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/listener/TenantUserRoleCreator.java
index a3b0532..5bd9ba3 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/listener/TenantUserRoleCreator.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/listener/TenantUserRoleCreator.java
@@ -26,18 +26,21 @@ import org.apache.stratos.common.exception.StratosException;
 import org.apache.stratos.common.listeners.TenantMgtListener;
 import org.apache.stratos.manager.internal.DataHolder;
 import org.apache.stratos.manager.user.mgt.exception.UserManagementException;
+import org.apache.stratos.manager.utils.CartridgeConstants;
 import org.apache.stratos.manager.utils.UserRoleCreator;
+import org.wso2.carbon.context.CarbonContext;
 import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.user.api.Permission;
 import org.wso2.carbon.user.api.UserStoreException;
 import org.wso2.carbon.user.api.UserStoreManager;
 import org.wso2.carbon.user.api.UserRealm;
+import org.wso2.carbon.user.mgt.UserMgtConstants;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+
 
-/**
- * Listener for Tenant create event to create a new Role
- */
 public class TenantUserRoleCreator implements TenantMgtListener {
 
-    private static final Log log = LogFactory.getLog(TenantUserRoleCreator.class);
+    private transient static final Log log = LogFactory.getLog(TenantUserRoleCreator.class);
 
     /**
      * Create an 'user' role at tenant creation time
@@ -60,12 +63,10 @@ public class TenantUserRoleCreator implements TenantMgtListener {
                 UserRoleCreator.createTenantUserRole(userStoreManager);
 
             } catch (UserStoreException e) {
-                String msg = "Error while retrieving the user store for tenant : "+ tenantInfo.getTenantDomain();
-                log.error(msg, e);
+                log.error(e.getMessage(), e);
                 throw new StratosException(e.getMessage(), e);
             } catch (UserManagementException e) {
-                String msg = "Error while creating the user role in tenant : "+ tenantInfo.getTenantDomain();
-                log.error(msg, e);
+                log.error(e.getMessage(), e);
                 throw new StratosException(e.getMessage(), e);
             } finally {
                 PrivilegedCarbonContext.endTenantFlow();

http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
index ad00e3d..59c2d8e 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/StratosUserManager.java
@@ -22,11 +22,15 @@ package org.apache.stratos.manager.user.mgt;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.common.beans.TenantInfoBean;
+import org.apache.stratos.manager.internal.DataHolder;
 import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
 import org.apache.stratos.manager.user.mgt.exception.UserManagementException;
+import org.wso2.carbon.user.api.UserRealm;
 import org.wso2.carbon.user.api.UserStoreException;
 import org.wso2.carbon.user.api.UserStoreManager;
 import org.wso2.carbon.user.core.UserCoreConstants;
+import org.wso2.carbon.user.core.service.RealmService;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -46,8 +50,8 @@ public class StratosUserManager {
     /**
      * Add a user to the user-store of the particular tenant
      *
-     * @param userStoreManager  UserStoreManager
-     * @param userInfoBean      UserInfoBean
+     * @param userStoreManager
+     * @param userInfoBean
      * @throws UserManagementException
      */
     public void addUser(UserStoreManager userStoreManager, UserInfoBean userInfoBean)
@@ -73,8 +77,7 @@ public class StratosUserManager {
             }
 
         } catch (UserStoreException e) {
-            String msg = "Error in adding the user : "+ userInfoBean.getUserName();
-            log.error(msg, e);
+            log.error(e.getMessage(), e);
             throw new UserManagementException(e.getMessage(), e);
         }
     }
@@ -82,8 +85,8 @@ public class StratosUserManager {
     /**
      * Delete the user with the given username in the relevant tenant space
      *
-     * @param userStoreManager  UserStoreManager
-     * @param userName          UserName
+     * @param userStoreManager
+     * @param userName
      * @throws UserManagementException
      */
     public void deleteUser(UserStoreManager userStoreManager, String userName)
@@ -92,8 +95,7 @@ public class StratosUserManager {
         try {
             userStoreManager.deleteUser(userName);
         } catch (UserStoreException e) {
-            String msg = "Error in deleting the user : "+ userName;
-            log.error(msg, e);
+            log.error(e.getMessage(), e);
             throw new UserManagementException(e.getMessage(), e);
         }
     }
@@ -102,8 +104,8 @@ public class StratosUserManager {
     /**
      * Updates the user info given the new UserInfoBean
      *
-     * @param userStoreManager  UserStoreManager
-     * @param userInfoBean      UserInfoBean
+     * @param userStoreManager
+     * @param userInfoBean
      * @throws UserManagementException
      */
     public void updateUser(UserStoreManager userStoreManager, UserInfoBean userInfoBean)
@@ -117,6 +119,11 @@ public class StratosUserManager {
 
                 String[] newRoles = new String[1];
                 newRoles[0] = userInfoBean.getRole();
+                Map<String, String> claims = new HashMap<String, String>();
+
+                claims.put(UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS, userInfoBean.getEmail());
+                claims.put(UserCoreConstants.ClaimTypeURIs.GIVEN_NAME, userInfoBean.getFirstName());
+                claims.put(UserCoreConstants.ClaimTypeURIs.SURNAME, userInfoBean.getLastName());
 
                 userStoreManager.updateRoleListOfUser(userInfoBean.getUserName(), getRefinedListOfRolesOfUser(userStoreManager,
userInfoBean.getUserName()), newRoles);
                 userStoreManager.setUserClaimValue(userInfoBean.getUserName(), UserCoreConstants.ClaimTypeURIs.EMAIL_ADDRESS,
userInfoBean.getEmail(), userInfoBean.getProfileName());
@@ -126,8 +133,7 @@ public class StratosUserManager {
 
             }
         } catch (UserStoreException e) {
-            String msg = "Error in updating the user : "+ userInfoBean.getUserName();
-            log.error(msg, e);
+            log.error(e.getMessage(), e);
             throw new UserManagementException(e.getMessage(), e);
         }
 
@@ -143,7 +149,7 @@ public class StratosUserManager {
     public List<UserInfoBean> getAllUsers(UserStoreManager userStoreManager)
             throws UserManagementException {
 
-        String[] users;
+        String[] users = null;
         List<UserInfoBean> userList = new ArrayList<UserInfoBean>();
 
         try {
@@ -158,8 +164,7 @@ public class StratosUserManager {
             }
 
         } catch (UserStoreException e) {
-            String msg = "Error in listing users";
-            log.error(msg, e);
+            log.error(e.getMessage(), e);
             throw new UserManagementException(e.getMessage(), e);
         }
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/exception/UserManagementException.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/exception/UserManagementException.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/exception/UserManagementException.java
index ba75eac..1fb8b62 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/exception/UserManagementException.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/user/mgt/exception/UserManagementException.java
@@ -22,7 +22,20 @@ package org.apache.stratos.manager.user.mgt.exception;
 
 public class UserManagementException extends Exception {
 
-    public UserManagementException(String message, Throwable cause) {
-        super(message, cause);
+        private static final long serialVersionUID = 1L;
+
+        public UserManagementException() {
+        }
+
+        public UserManagementException(String message) {
+            super(message);
+        }
+
+        public UserManagementException(String message, Throwable cause) {
+            super(message, cause);
+        }
+
+        public UserManagementException(Throwable cause) {
+            super(cause);
+        }
     }
-}

http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/UserRoleCreator.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/UserRoleCreator.java
b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/UserRoleCreator.java
index d511b65..a6021fa 100644
--- a/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/UserRoleCreator.java
+++ b/components/org.apache.stratos.manager/src/main/java/org/apache/stratos/manager/utils/UserRoleCreator.java
@@ -22,22 +22,25 @@ package org.apache.stratos.manager.utils;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.manager.internal.DataHolder;
 import org.apache.stratos.manager.user.mgt.exception.UserManagementException;
 import org.wso2.carbon.user.api.Permission;
 import org.wso2.carbon.user.api.UserStoreException;
 import org.wso2.carbon.user.api.UserStoreManager;
+import org.wso2.carbon.user.core.UserRealm;
+import org.wso2.carbon.user.core.service.RealmService;
 import org.wso2.carbon.user.mgt.UserMgtConstants;
 
 public class UserRoleCreator {
 
-    private static final Log log = LogFactory.getLog(UserRoleCreator.class);
+    private transient static final Log log = LogFactory.getLog(UserRoleCreator.class);
+    private static String userRole = "Internal/user";
 
     /**
      * Creating a Internal/user Role at Carbon Server Start-up
      */
     public static void createTenantUserRole(UserStoreManager manager) throws UserManagementException{
 
-        String userRole = "Internal/user";
         try {
 
             if (!manager.isExistingRole(userRole)) {

http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
index a40286a..ef1157b 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/ServiceUtils.java
@@ -48,6 +48,9 @@ import org.apache.stratos.manager.subscription.CartridgeSubscription;
 import org.apache.stratos.manager.subscription.DataCartridgeSubscription;
 import org.apache.stratos.manager.subscription.SubscriptionData;
 import org.apache.stratos.manager.topology.model.TopologyClusterInformationModel;
+import org.apache.stratos.manager.user.mgt.StratosUserManager;
+import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
+import org.apache.stratos.manager.user.mgt.exception.UserManagementException;
 import org.apache.stratos.manager.utils.ApplicationManagementUtil;
 import org.apache.stratos.manager.utils.CartridgeConstants;
 import org.apache.stratos.messaging.domain.topology.Cluster;
@@ -70,6 +73,10 @@ import org.apache.stratos.rest.endpoint.bean.repositoryNotificationInfoBean.Payl
 import org.apache.stratos.rest.endpoint.bean.subscription.domain.SubscriptionDomainBean;
 import org.apache.stratos.rest.endpoint.bean.util.converter.PojoConverter;
 import org.apache.stratos.rest.endpoint.exception.RestAPIException;
+import org.wso2.carbon.context.CarbonContext;
+import org.wso2.carbon.user.api.UserRealm;
+import org.wso2.carbon.user.api.UserStoreException;
+import org.wso2.carbon.user.api.UserStoreManager;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import java.rmi.RemoteException;
@@ -85,6 +92,7 @@ public class ServiceUtils {
 
     private static Log log = LogFactory.getLog(ServiceUtils.class);
     private static ServiceDeploymentManager serviceDeploymentManager = new ServiceDeploymentManager();
+    private static StratosUserManager stratosUserManager = new StratosUserManager();
 
     static void deployCartridge(CartridgeDefinitionBean cartridgeDefinitionBean, ConfigurationContext
ctxt,
                                 String userName, String tenantDomain) throws RestAPIException
{
@@ -1259,7 +1267,83 @@ public class ServiceUtils {
 
     }
 
+    public static void addUser(UserInfoBean userInfoBean) throws RestAPIException {
 
+        try {
+
+            stratosUserManager.addUser(getTenantUserStoreManager(), userInfoBean);
+
+        } catch (UserManagementException e) {
+            log.error(e.getMessage(), e);
+            throw new RestAPIException(e.getMessage(), e);
+        }
+        log.info("Successfully added an user with Username " + userInfoBean.getUserName());
+    }
+
+    public static void updateUser(UserInfoBean userInfoBean) throws RestAPIException {
+
+        try {
+
+            stratosUserManager.updateUser(getTenantUserStoreManager(), userInfoBean);
+
+        } catch (UserManagementException e) {
+            log.error(e.getMessage(), e);
+            throw new RestAPIException(e.getMessage(), e);
+        }
+        log.info("Successfully updated an user with Username " + userInfoBean.getUserName());
+    }
+
+    public static void deleteUser(String userName) throws RestAPIException {
+
+        try {
+
+            stratosUserManager.deleteUser(getTenantUserStoreManager(), userName);
+
+        } catch (UserManagementException e) {
+            log.error(e.getMessage(), e);
+            throw new RestAPIException(e.getMessage(), e);
+        }
+        log.info("Successfully deleted an user with Username " + userName);
+    }
+
+    public static List<UserInfoBean> getAllUsers() throws RestAPIException {
+
+        List<UserInfoBean> userList = null;
+
+        try {
+
+            userList = stratosUserManager.getAllUsers(getTenantUserStoreManager());
+
+        } catch (UserManagementException e) {
+            log.error(e.getMessage(), e);
+            throw new RestAPIException(e.getMessage(), e);
+        }
+        return userList;
+    }
+
+    /**
+     * Get Tenant aware UserStoreManager
+     *
+     * @return UserStoreManager
+     * @throws RestAPIException
+     */
+    private static UserStoreManager getTenantUserStoreManager() throws RestAPIException {
+
+        CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
+        UserRealm userRealm = null;
+        UserStoreManager userStoreManager = null;
+
+        try {
+            userRealm = carbonContext.getUserRealm();
+            userStoreManager = userRealm.getUserStoreManager();
+
+        } catch (UserStoreException e) {
+            log.error(e.getMessage(), e);
+            throw new RestAPIException(e.getMessage(), e);
+        }
+
+        return userStoreManager;
+    }
 
     public static boolean deployKubernetesGroup(KubernetesGroup kubernetesGroupBean) throws
RestAPIException {
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/60fdd83e/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
index 2a6bd82..c8980b2 100644
--- a/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
+++ b/components/org.apache.stratos.rest.endpoint/src/main/java/org/apache/stratos/rest/endpoint/services/StratosAdmin.java
@@ -31,9 +31,7 @@ import org.apache.stratos.manager.exception.DomainMappingExistsException;
 import org.apache.stratos.manager.exception.ServiceDoesNotExistException;
 import org.apache.stratos.manager.subscription.CartridgeSubscription;
 import org.apache.stratos.manager.subscription.SubscriptionDomain;
-import org.apache.stratos.manager.user.mgt.StratosUserManager;
 import org.apache.stratos.manager.user.mgt.beans.UserInfoBean;
-import org.apache.stratos.manager.user.mgt.exception.UserManagementException;
 import org.apache.stratos.rest.endpoint.ServiceHolder;
 import org.apache.stratos.rest.endpoint.Utils;
 import org.apache.stratos.rest.endpoint.annotation.AuthorizationAction;
@@ -57,7 +55,6 @@ import org.apache.stratos.rest.endpoint.exception.RestAPIException;
 import org.apache.stratos.rest.endpoint.exception.TenantNotFoundException;
 import org.apache.stratos.tenant.mgt.core.TenantPersistor;
 import org.apache.stratos.tenant.mgt.util.TenantMgtUtil;
-import org.wso2.carbon.context.CarbonContext;
 import org.wso2.carbon.context.PrivilegedCarbonContext;
 import org.wso2.carbon.context.RegistryType;
 import org.wso2.carbon.registry.core.exceptions.RegistryException;
@@ -1151,23 +1148,14 @@ public class StratosAdmin extends AbstractAdmin {
         }
         return Response.status(Response.Status.NOT_FOUND).build();
     }
+
     @POST
     @Path("/user")
     @Consumes("application/json")
     @Produces("application/json")
     @AuthorizationAction("/permission/admin/manage/add/users")
     public Response addUser(UserInfoBean userInfoBean) throws RestAPIException {
-
-        StratosUserManager stratosUserManager = new StratosUserManager();
-
-        try {
-            stratosUserManager.addUser(getTenantUserStoreManager(), userInfoBean);
-
-        } catch (UserManagementException e) {
-            log.error(e.getMessage(), e);
-            throw new RestAPIException(e.getMessage(), e);
-        }
-        log.info("Successfully added an user with Username " + userInfoBean.getUserName());
+        ServiceUtils.addUser(userInfoBean);
         URI url = uriInfo.getAbsolutePathBuilder().path(userInfoBean.getUserName()).build();
         return Response.created(url).build();
     }
@@ -1178,17 +1166,7 @@ public class StratosAdmin extends AbstractAdmin {
     @Produces("application/json")
     @AuthorizationAction("/permission/admin/manage/add/users")
     public Response deleteUser(@PathParam("userName") String userName) throws RestAPIException
{
-
-        StratosUserManager stratosUserManager = new StratosUserManager();
-
-        try {
-            stratosUserManager.deleteUser(getTenantUserStoreManager(), userName);
-
-        } catch (UserManagementException e) {
-            log.error(e.getMessage(), e);
-            throw new RestAPIException(e.getMessage(), e);
-        }
-        log.info("Successfully deleted an user with Username " + userName);
+        ServiceUtils.deleteUser(userName);
         return Response.noContent().build();
     }
 
@@ -1198,17 +1176,7 @@ public class StratosAdmin extends AbstractAdmin {
     @Produces("application/json")
     @AuthorizationAction("/permission/admin/manage/add/users")
     public Response updateUser(UserInfoBean userInfoBean) throws RestAPIException {
-
-        StratosUserManager stratosUserManager = new StratosUserManager();
-
-        try {
-            stratosUserManager.updateUser(getTenantUserStoreManager(), userInfoBean);
-
-        } catch (UserManagementException e) {
-            log.error(e.getMessage(), e);
-            throw new RestAPIException(e.getMessage(), e);
-        }
-        log.info("Successfully updated an user with Username " + userInfoBean.getUserName());
+        ServiceUtils.updateUser(userInfoBean);
         URI url = uriInfo.getAbsolutePathBuilder().path(userInfoBean.getUserName()).build();
         return Response.created(url).build();
     }
@@ -1217,45 +1185,18 @@ public class StratosAdmin extends AbstractAdmin {
     @Path("/user/list")
     @Produces("application/json")
     @AuthorizationAction("/permission/admin/manage/add/users")
-    public UserInfoBean[] listUsers() throws RestAPIException {
-
-        StratosUserManager stratosUserManager = new StratosUserManager();
-        List<UserInfoBean> userList;
-
+    public UserInfoBean[] retrieveUsers() throws RestAPIException {
+        List<UserInfoBean> userList = null;
         try {
-            userList = stratosUserManager.getAllUsers(getTenantUserStoreManager());
-
-        } catch (UserManagementException e) {
-            log.error(e.getMessage(), e);
-            throw new RestAPIException(e.getMessage(), e);
+            userList = ServiceUtils.getAllUsers();
+        } catch (Exception e) {
+            String msg = "Error in retrieving users";
+            log.error(msg, e);
+            throw new RestAPIException(msg);
         }
         return userList.toArray(new UserInfoBean[userList.size()]);
     }
 
-    /**
-     * Get Tenant UserStoreManager
-     *
-     * @return UserStoreManager
-     * @throws RestAPIException
-     */
-    private static UserStoreManager getTenantUserStoreManager() throws RestAPIException {
-
-        CarbonContext carbonContext = CarbonContext.getThreadLocalCarbonContext();
-        UserRealm userRealm = null;
-        UserStoreManager userStoreManager = null;
-
-        try {
-            userRealm = carbonContext.getUserRealm();
-            userStoreManager = userRealm.getUserStoreManager();
-
-        } catch (UserStoreException e) {
-            log.error(e.getMessage(), e);
-            throw new RestAPIException(e.getMessage(), e);
-        }
-
-        return userStoreManager;
-    }
-
     @POST
     @Path("/kubernetes/deploy/group")
     @Produces("application/json")


Mime
View raw message