Examples of buildRealmConfiguration()


Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

        TenantManager tenantManager = realmService.getTenantManager();

        String userMgtXML = getUserManagementConfigurationPath();

        RealmConfigXMLProcessor processor = new RealmConfigXMLProcessor();
        RealmConfiguration realmConfig = processor.buildRealmConfiguration(new FileInputStream(
                userMgtXML));

        Tenant tenant = new Tenant();
        tenant.setDomain("wso2.org");
        tenant.setRealmConfig(realmConfig);
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

        Date createdDate = new Date(result.getTimestamp(
            "UM_CREATED_DATE").getTime());
        InputStream is = result.getBinaryStream("UM_USER_CONFIG");
                 
          RealmConfigXMLProcessor processor = new RealmConfigXMLProcessor();
          RealmConfiguration realmConfig = processor.buildRealmConfiguration(is);
          realmConfig.setTenantId(id);
         
        tenant = new Tenant();
        tenant.setId(id);
        tenant.setDomain(domain);
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

        this.parentElement = getConfigurationElement();
        OMElement realmElement = parentElement.getFirstChildWithName(new QName(
                UserCoreConstants.RealmConfig.LOCAL_NAME_REALM));
        RealmConfigXMLProcessor rmProcessor = new RealmConfigXMLProcessor();
        rmProcessor.setSecretResolver(parentElement);
        return rmProcessor.buildRealmConfiguration(realmElement);
    }

    private TenantMgtConfiguration buildTenantMgtConfig(BundleContext bc)
            throws UserStoreException {
        TenantMgtXMLProcessor tenantMgtXMLProcessor = new TenantMgtXMLProcessor();
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

    public static final String JDBC_URL_PROPERTY_NAME = "url";

    public static RealmConfiguration buildRealmConfigWithJDBCConnectionUrl(InputStream inStream,
            String connectionUrl) throws UserStoreException {
        RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
        RealmConfiguration realmConfig = builder.buildRealmConfiguration(inStream);
        Map<String, String> map = realmConfig.getRealmProperties();
        map.put(JDBC_URL_PROPERTY_NAME, connectionUrl);
        return realmConfig;
    }
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

        tenantMan = new JDBCTenantManager(ds, "super.com");
    }

    public void doTenantStuff() throws Exception{
        RealmConfigXMLProcessor processor = new RealmConfigXMLProcessor();
        RealmConfiguration realmConfig = processor.buildRealmConfiguration(new FileInputStream(CarbonUtils.getUserMgtXMLPath()));
        Tenant[] tarray = TenantTestUtil.createTenant(realmConfig);

        assertEquals(1,tenantMan.addTenant(tarray[0]));
        assertEquals(2,tenantMan.addTenant(tarray[1]));
        assertEquals(3,tenantMan.addTenant(tarray[2]));
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

            creator.createRegistryDatabase();
            RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
            InputStream inStream = new FileInputStream(
                    "src/test/resources/user-test/user-mgt-registry-test.xml");
            try {
                bootstrapRealmConfig = builder.buildRealmConfiguration(inStream);
            } finally {
                inStream.close();
            }
        } catch (Exception e) {
            String msg = "Failed to initialize the user manager. " + e.getMessage();
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

       
        this.addIntialData(ds);
        RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
        InputStream inStream = this.getClass().getClassLoader().getResource(
                "jdbc-readonly-test.xml").openStream();
        RealmConfiguration realmConfig = builder.buildRealmConfiguration(inStream);
        inStream.close();
        realm = new DefaultRealm();
        realm.init(realmConfig, ClaimTestUtil.getClaimTestData(), ClaimTestUtil
                .getProfileTestData(), 0);
        assertTrue(realm.getUserStoreManager().isExistingRole("adminx"));
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

    public void doSQLQueryStuff() throws IOException, UserStoreException {

        InputStream inStream = this.getClass().getClassLoader().getResource(JDBCRealmTest.JDBC_TEST_USERMGT_XML).openStream();

        RealmConfigXMLProcessor realmConfigProcessor = new RealmConfigXMLProcessor();
        realmConfig = realmConfigProcessor.buildRealmConfiguration(inStream);

        assertEquals(realmConfig.getUserStoreProperty(JDBCRealmConstants.ADD_ROLE), null);
        assertEquals(realmConfig.getUserStoreProperty(JDBCRealmConstants.SELECT_USER), JDBCRealmConstants.SELECT_USER_SQL);
        realmConfig.setUserStoreProperties(JDBCRealmUtil.getSQL(realmConfig.getUserStoreProperties()));
        assertEquals(realmConfig.getUserStoreProperty(JDBCRealmConstants.ADD_ROLE), JDBCRealmConstants.ADD_ROLE_SQL);
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

           UserStoreManager admin = realm.getUserStoreManager();

           InputStream inStream = this.getClass().getClassLoader().getResource(JDBCRealmTest.
                                  JDBC_TEST_USERMGT_XML).openStream();
           RealmConfigXMLProcessor realmConfigProcessor = new RealmConfigXMLProcessor();
           RealmConfiguration realmConfig = realmConfigProcessor.buildRealmConfiguration(inStream);

           admin.addRole("role2", null, null);
           admin.addRole("role3", null, null);
           admin.addRole("role4", null, null);
           assertEquals(7, admin.getRoleNames().length);//admin,everyone,role1,role2,role3,role4
View Full Code Here

Examples of org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration()

       
        this.addIntialData(ds);
        RealmConfigXMLProcessor builder = new RealmConfigXMLProcessor();
        InputStream inStream = this.getClass().getClassLoader().getResource(
                "adv-jdbc-readonly-test.xml").openStream();
        RealmConfiguration realmConfig = builder.buildRealmConfiguration(inStream);
        inStream.close();
        realm = new DefaultRealm();
        realm.init(realmConfig, ClaimTestUtil.getClaimTestData(), ClaimTestUtil
                .getProfileTestData(), 0);
        assertTrue(realm.getUserStoreManager().isExistingRole("adminx"));
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.