当前位置: 首页>>代码示例>>Java>>正文


Java DatabaseUtil.getRealmDataSource方法代码示例

本文整理汇总了Java中org.wso2.carbon.user.core.util.DatabaseUtil.getRealmDataSource方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseUtil.getRealmDataSource方法的具体用法?Java DatabaseUtil.getRealmDataSource怎么用?Java DatabaseUtil.getRealmDataSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.wso2.carbon.user.core.util.DatabaseUtil的用法示例。


在下文中一共展示了DatabaseUtil.getRealmDataSource方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDatasource

import org.wso2.carbon.user.core.util.DatabaseUtil; //导入方法依赖的package包/类
private void initDatasource() {
    try {
        dataSource = DatabaseUtil.getRealmDataSource(CarbonContext.getThreadLocalCarbonContext().getUserRealm().
                getRealmConfiguration());
    } catch (UserStoreException e) {
        log.error("Error while retrieving user management data source", e);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:9,代码来源:UmPersistenceManager.java

示例2: initUMDataSource

import org.wso2.carbon.user.core.util.DatabaseUtil; //导入方法依赖的package包/类
/**
 * This method initializes and execute the um migration scripts.
 * @throws Exception
 */
private void initUMDataSource() throws SQLException, IOException {
    umDataSource = DatabaseUtil.getRealmDataSource(ServiceHolder.getRealmService().getBootstrapRealmConfiguration());
    MigrationDatabaseCreator migrationDatabaseCreator = new MigrationDatabaseCreator(dataSource, umDataSource);
    try {
        migrationDatabaseCreator.executeUmMigrationScript();
    } catch (IOException e) {
        throw new IOException("Error while reading um migration script. ",e);
    }
}
 
开发者ID:wso2,项目名称:product-es,代码行数:14,代码来源:EmailUserNameMigrationClient.java

示例3: databaseMigration

import org.wso2.carbon.user.core.util.DatabaseUtil; //导入方法依赖的package包/类
@Override
public void databaseMigration() throws EsMigrationException {
    try {
        umDataSource = DatabaseUtil.getRealmDataSource(ServiceHolder.getRealmService().getBootstrapRealmConfiguration());
        MigrationDatabaseCreator migrationDatabaseCreator = new MigrationDatabaseCreator(dataSource, umDataSource);
        migrationDatabaseCreator.executeUserPermissionFixScript();
        log.info("Database migration completed successfully.");
    } catch (Exception e) {
        String msg = "Error occurred while executing the database migration.";
        log.error(msg, e);
        throw new EsMigrationException(msg, e);
    }
}
 
开发者ID:wso2,项目名称:product-es,代码行数:14,代码来源:MigrateData.java

示例4: CassandraUserStoreManager

import org.wso2.carbon.user.core.util.DatabaseUtil; //导入方法依赖的package包/类
public CassandraUserStoreManager(RealmConfiguration realmConfig, Map<String, Object> properties,
                                 ClaimManager claimManager, ProfileConfigurationManager profileManager, UserRealm realm, Integer tenantId)
        throws UserStoreException {

    this(realmConfig, tenantId);

    if (log.isDebugEnabled()) {
        log.debug("Started " + System.currentTimeMillis());
    }
    this.claimManager = claimManager;
    this.userRealm = realm;

    dataSource = (DataSource) properties.get(UserCoreConstants.DATA_SOURCE);
    if (dataSource == null) {
        dataSource = DatabaseUtil.getRealmDataSource(realmConfig);
    }
    if (dataSource == null) {
        throw new UserStoreException("User Management Data Source is null");
    }

    doInitialSetup();
    this.persistDomain();
    if (realmConfig.isPrimary()) {
        addInitialAdminData(Boolean.parseBoolean(realmConfig.getAddAdmin()), !isInitSetupDone());
    }

    properties.put(UserCoreConstants.DATA_SOURCE, dataSource);

    if (log.isDebugEnabled()) {
        log.debug("The jdbcDataSource being used by JDBCUserStoreManager :: " + dataSource.hashCode());
    }

    if (log.isDebugEnabled()) {
        log.debug("Ended " + System.currentTimeMillis());
    }

    domain = realmConfig.getUserStoreProperty(UserCoreConstants.RealmConfig.PROPERTY_DOMAIN_NAME);
    /*
     * Initialize user roles cache as implemented in AbstractUserStoreManager
     */
    initUserRolesCache();
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:43,代码来源:CassandraUserStoreManager.java


注:本文中的org.wso2.carbon.user.core.util.DatabaseUtil.getRealmDataSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。