Search in sources :

Example 1 with ProfileConfiguration

use of org.wso2.carbon.user.core.profile.ProfileConfiguration in project carbon-identity-framework by wso2.

the class MockRealm method init.

@Override
public void init(RealmConfiguration realmConfiguration, Map<String, ClaimMapping> claimMappingMap, Map<String, ProfileConfiguration> map1, int tenantId) throws UserStoreException {
    this.realmConfiguration = realmConfiguration;
    this.tenantId = tenantId;
    DataSource dataSource = MockInitialContextFactory.initializeDatasource(UM_DB_JNDI_NAME, this.getClass(), new String[] { UM_DB_SQL_FILE });
    userStoreManager = new MockUserStoreManager(dataSource);
    ((MockUserStoreManager) this.userStoreManager).setRealmConfiguration(this.realmConfiguration);
    claimManager = new MockClaimManager(claimMappingMap);
    ((MockUserStoreManager) this.userStoreManager).setClaimManager(this.claimManager);
    HybridRoleManager hybridRoleManager = new MockHybridRoleManager(dataSource, tenantId, realmConfiguration, this);
    ((MockUserStoreManager) this.userStoreManager).setHybridRoleManager(hybridRoleManager);
}
Also used : HybridRoleManager(org.wso2.carbon.user.core.hybrid.HybridRoleManager) DataSource(javax.sql.DataSource)

Example 2 with ProfileConfiguration

use of org.wso2.carbon.user.core.profile.ProfileConfiguration in project carbon-identity-framework by wso2.

the class UserProfileAdmin method getAvailableProfileConfiguration.

private String[] getAvailableProfileConfiguration(ProfileConfigurationManager profileAdmin) throws UserStoreException {
    ProfileConfiguration[] configurations;
    String[] profileNames = new String[0];
    try {
        configurations = (ProfileConfiguration[]) profileAdmin.getAllProfiles();
    } catch (org.wso2.carbon.user.api.UserStoreException e) {
        throw new UserStoreException(e);
    }
    if (configurations != null) {
        profileNames = new String[configurations.length];
        for (int i = 0; i < configurations.length; i++) {
            profileNames[i] = configurations[i].getProfileName();
        }
    }
    return profileNames;
}
Also used : UserStoreException(org.wso2.carbon.user.api.UserStoreException) ProfileConfiguration(org.wso2.carbon.user.core.profile.ProfileConfiguration) UserStoreException(org.wso2.carbon.user.api.UserStoreException)

Aggregations

DataSource (javax.sql.DataSource)1 UserStoreException (org.wso2.carbon.user.api.UserStoreException)1 HybridRoleManager (org.wso2.carbon.user.core.hybrid.HybridRoleManager)1 ProfileConfiguration (org.wso2.carbon.user.core.profile.ProfileConfiguration)1