Examples of ProfileConfigDAO


Examples of org.wso2.carbon.user.core.profile.dao.ProfileConfigDAO

    }

    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));
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.dao.ProfileConfigDAO

    }

    public Map<String, ProfileConfiguration> buildProfileConfigurationFromDatabase(DataSource ds, String realmName)
            throws ProfileBuilderException {
        try {
            ProfileConfigDAO profileDAO = new ProfileConfigDAO(ds, tenantId);
            Map<String, ProfileConfiguration> profileConfigs = profileDAO.loadProfileConfigs();
            return profileConfigs;
        } catch (UserStoreException e) {
            log.error(e.getMessage(), e);
            throw new ProfileBuilderException(e.getMessage(), e);
        }
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.dao.ProfileConfigDAO

    public DefaultProfileConfigurationManager(Map<String, ProfileConfiguration> profileConfigs,
            DataSource dataSource, int tenantId) {
        this.profileConfigs = new ConcurrentHashMap<String, ProfileConfiguration>();
        this.profileConfigs.putAll(profileConfigs);
        profileDAO = new ProfileConfigDAO(dataSource, tenantId);
    }
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.dao.ProfileConfigDAO

    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{
View Full Code Here

Examples of org.wso2.carbon.user.core.profile.dao.ProfileConfigDAO

        creator.createRegistryDatabase();      
       
        claims = ClaimTestUtil.getClaimTestData();
        profConfigs = ClaimTestUtil.getProfileTestData();
        claimDAO = new ClaimDAO(ds, 0);
        profileDAO = new ProfileConfigDAO(ds, 0);
    }
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.