Examples of ProfileConfigurationBuilder


Examples of org.wso2.carbon.user.core.profile.builder.ProfileConfigurationBuilder

    }

    private Map<String, ProfileConfiguration> loadDefaultProfileConfiguration()
            throws UserStoreException {
        try {
            ProfileConfigurationBuilder profilBuilder = new ProfileConfigurationBuilder(tenantId);
            Map<String, ProfileConfiguration> profileConfig = profilBuilder
                    .buildProfileConfigurationFromConfigFile();
            return profileConfig;
        } catch (ProfileBuilderException e) {
            log.error(e.getMessage(), e);
            throw new UserStoreException(e.getMessage(), e);
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.builder.ProfileConfigurationBuilder

    private void populateProfileAndClaimMaps(Map<String, ClaimMapping> claimMappings,
            Map<String, ProfileConfiguration> profileConfigs) throws UserStoreException {
        ClaimDAO claimDAO = new ClaimDAO(dataSource, tenantId);
        ProfileConfigDAO profileDAO = new ProfileConfigDAO(dataSource, tenantId);
        ClaimBuilder claimBuilder = new ClaimBuilder(tenantId);
        ProfileConfigurationBuilder profileBilder = new ProfileConfigurationBuilder(tenantId);

        int count = claimDAO.getDialectCount();
        if (count == 0) {
            try {
                claimMappings.putAll(claimBuilder.buildClaimMappingsFromConfigFile());
            } catch (ClaimBuilderException e) {
                String msg = "Error in building claims.";
                log.error(msg);
                throw new UserStoreException(msg, e);
            }
            claimDAO.addCliamMappings(claimMappings.values().toArray(
                    new ClaimMapping[claimMappings.size()]));
            try {
                profileConfigs.putAll(profileBilder.buildProfileConfigurationFromConfigFile());
            } catch (ProfileBuilderException e) {
                String msg = "Error in building the profile.";
                log.error(msg);
                throw new UserStoreException(msg, e);
            }
            profileDAO.addProfileConfig(profileConfigs.values().toArray(
                    new ProfileConfiguration[profileConfigs.size()]));
        } else {
            try {
                claimMappings.putAll(claimBuilder.buildClaimMappingsFromDatabase(dataSource,
                        UserCoreConstants.INTERNAL_USERSTORE));
            } catch (ClaimBuilderException e) {
                String msg = "Error in building claims.";
                log.error(msg);
                throw new UserStoreException(msg, e);
            }
            try {
                profileConfigs.putAll(profileBilder.buildProfileConfigurationFromDatabase(dataSource,
                        UserCoreConstants.INTERNAL_USERSTORE));
            } catch (ProfileBuilderException e) {
                String msg = "Error in building the profile.";
                log.error(msg);
                throw new UserStoreException(msg, e);
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.builder.ProfileConfigurationBuilder

    public void doProfileConfigManStuff() throws Exception {

        String[] claimset = {ClaimTestUtil.CLAIM_URI1,ClaimTestUtil.CLAIM_URI2,ClaimTestUtil.CLAIM_URI3};
        ProfileConfiguration[] newProfConfigs;
        ProfileConfigDAO dao = new ProfileConfigDAO(ds,tenantId);
        ProfileConfigurationBuilder builder = new ProfileConfigurationBuilder(tenantId);
        Map<String, ProfileConfiguration> newProfileMaps;

        //add profile configuration
        newProfConfigs = createProfiles();
        dao.addProfileConfig(newProfConfigs);
       
        ProfileConfiguration TestProfile=null;
        try{
            dao.addProfileConfig(TestProfile);
            fail("Exception at Null Profile Configuration failed");
        }catch(Exception e){
             //caught exception
        }
        try{
            newProfileMaps = builder.buildProfileConfigurationFromDatabase(null,realmName);
            fail("Exception at Null Data Source failed");
        }catch(Exception e){
            //caught exception
        }

        //build Profile configuration from database
        newProfileMaps = builder.buildProfileConfigurationFromDatabase(ds,realmName);

        profileConfigMan = new DefaultProfileConfigurationManager(newProfileMaps,ds,tenantId);

        ProfileConfiguration p4 = new ProfileConfiguration();
        p4.setProfileName("week");
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.