Examples of ClaimBuilder


Examples of org.wso2.carbon.user.core.claim.builder.ClaimBuilder

        return config;
    }

    private Map<String, ClaimMapping> loadDefaultClaimMapping() throws UserStoreException {
        try {
            ClaimBuilder claimBuilder = new ClaimBuilder(tenantId);
            Map<String, ClaimMapping> claimMapping = claimBuilder
                    .buildClaimMappingsFromConfigFile();
            return claimMapping;
        } catch (ClaimBuilderException e) {
            log.error(e.getMessage(), e);
            throw new UserStoreException(e.getMessage(), e);
View Full Code Here

Examples of org.wso2.carbon.user.core.claim.builder.ClaimBuilder

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

Examples of org.wso2.carbon.user.core.claim.builder.ClaimBuilder

        Map<String, ClaimMapping> FromDB;

        defaultClaims = ClaimTestUtil.getClaimTestData();
        claimDao.addCliamMappings(defaultClaims.values().toArray(new ClaimMapping[defaultClaims.size()]));
        //the mappings have not been added to the db in given order at ClaimTestUtil
        ClaimBuilder builder = new ClaimBuilder(0);
    }
View Full Code Here

Examples of org.wso2.carbon.user.core.claim.builder.ClaimBuilder

        assertEquals(4,claimMan.getAllSupportClaimsByDefault().length);
        assertEquals(5,claimMan.getAllClaims().length);
    }

    public Map<String, ClaimMapping> doClaimBuilderStuff() throws Exception{
        ClaimBuilder claimB = new ClaimBuilder(0);
        Map<String, ClaimMapping> claims ;

        claims = claimB.buildClaimMappingsFromDatabase(ds,"test");
      
       return claims;
    }
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.