Package org.wso2.carbon.user.mgt.common

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


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


    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

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

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

    }

    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

        //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

    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

            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

                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

                }
                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

TOP

Related Classes of org.wso2.carbon.user.mgt.common.UserAdminException

Copyright © 2018 www.massapicom. 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.