Examples of UserAdminException


Examples of org.wso2.carbon.user.mgt.common.UserAdminException

    public void changePassword(String userName, String newPassword) throws UserAdminException {
        //Checking whether the passwords are managed externally, if so throw an exception
        UserStoreInfo userStoreInfo = getUserStoreInfo();
        if (null != userStoreInfo) {
            if (userStoreInfo.isPasswordsExternallyManaged()) {
                throw new UserAdminException("Passwords are managed externally. Therefore cannot change password.");
            }
        } else {

            throw new UserAdminException("An error occurred while changing the password. The UserStoreInfo object is null");
        }

        UserRealmProxy userAdminCore = new UserRealmProxy(super.getUserRealm());
        userAdminCore.changePassword(userName, newPassword);
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

                                                     UserMgtDSComponent.
                                                                       getRegistryService().
                                                                       getGovernanceSystemRegistry());
        } catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException();
        }
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

                                 getRolePermissions(roleName, tenantId, UserMgtDSComponent.
                                                                                          getRegistryService().
                                                                                          getGovernanceSystemRegistry());
        } catch (RegistryException e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException();
        }
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

    }

    public void bulkImportUsers(String fileName, DataHandler handler, String defaultPassword)
            throws UserAdminException {
        if(fileName == null || handler == null || defaultPassword == null) {
            throw new UserAdminException("Required data not provided");
        }
        try {
            UserRealmProxy userAdminCore = new UserRealmProxy(super.getUserRealm());
            InputStream inStream = handler.getInputStream();
            userAdminCore.bulkImportUsers(fileName, inStream, defaultPassword);
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

        //Checking whether the passwords are managed externally, if so throw an exception
        UserStoreInfo userStoreInfo = getUserStoreInfo();
        if (null != userStoreInfo) {
            if (userStoreInfo.isPasswordsExternallyManaged()) {
                throw new UserAdminException("Passwords are managed externally. Therefore cannot change password.");
            }
        } else {

            throw new UserAdminException("An error occurred while changing the password. The UserStoreInfo object is null");
        }

        UserRealmProxy userAdminCore = new UserRealmProxy(super.getUserRealm());
        try {
        userAdminCore.changePasswordByUser(oldPassword, newPassword);
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

    private void setPermissionUpdateTimestampUserAdmin() throws UserAdminException {
        try {
            super.setPermissionUpdateTimestamp();
        } catch (RegistryException e) {
            throw new UserAdminException("An error occurred while saving the timestamp", e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

            Workbook wb = this.createWorkbook();
            Sheet sheet = wb.getSheet(wb.getSheetName(0));
            String password = config.getDefaultPassword();
          
            if (sheet == null || sheet.getLastRowNum() == -1) {
                throw new UserAdminException("The first sheet is empty");
            }
            int limit = sheet.getLastRowNum();
            boolean isDuplicate = false;
            for (int i = 1; i < limit+1; i++) {
                Row row = sheet.getRow(i);
                Cell cell = row.getCell(0);
                String userName = cell.getStringCellValue();
                if (!userStore.isExistingUser(userName)) {
                    userStore.addUser(userName, password, null, null, null, true);
                } else {
                    isDuplicate = true;
                }
            }
           
            if (isDuplicate == true) {
                throw new UserAdminException(
                        "Detected duplicate usernames. Failed to import duplicate users. Non-duplicate user names were successfually imported.");
            }
        } catch (UserAdminException e) {
            throw e;
        } catch (Throwable e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

                POIFSFileSystem fs = new POIFSFileSystem(ins);
                wb = new HSSFWorkbook(fs);
            }
        } catch (Exception e) {
            log.error("Bulk import failed" + e.getMessage(), e);
            throw new UserAdminException("Bulk import failed" + e.getMessage(), e);
        }
        return wb;
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

                }
                line = csvReader.readNext();
            }
           
            if (isDuplicate == true) {
                throw new UserAdminException(
                        "Detected duplicate usernames. Failed to import duplicate users. Non-duplicate user names were successfually imported.");
            }
        } catch (UserAdminException e) {
            throw e;
        } catch (Throwable e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException(e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.user.mgt.common.UserAdminException

    public String[] listUsers(String filter) throws UserAdminException {
        try {
            return realm.getUserStoreManager().listUsers(filter, -1);
        } catch (UserStoreException e) {
            // previously logged so logging not needed
            throw new UserAdminException(e.getMessage(), e);
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            throw new UserAdminException(e.getMessage(), e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.