org.wso2.carbon.registry.core.jdbc.realm
Class InMemoryRealmService

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService
All Implemented Interfaces:
org.wso2.carbon.user.api.UserRealmService, org.wso2.carbon.user.core.service.RealmService

public class InMemoryRealmService
extends Object
implements org.wso2.carbon.user.core.service.RealmService

Class used to represent an in memory realm service.


Constructor Summary
InMemoryRealmService()
          Construct a in memory realm service.
 
Method Summary
 org.wso2.carbon.user.core.UserRealm getBootstrapRealm()
          Get the bootstrap realm.
 org.wso2.carbon.user.api.RealmConfiguration getBootstrapRealmConfiguration()
          Get the boot strap configuration (tenant0's configuration).
 org.wso2.carbon.user.core.UserRealm getCachedUserRealm(int tenantId)
           
 org.wso2.carbon.user.core.config.multitenancy.MultiTenantRealmConfigBuilder getMultiTenantRealmConfigBuilder()
           
 org.wso2.carbon.user.core.tenant.TenantManager getTenantManager()
          Return the tenant manager.
 org.wso2.carbon.user.api.TenantMgtConfiguration getTenantMgtConfiguration()
          This method is used in default realm service in tenant-mgt.
 org.wso2.carbon.user.api.UserRealm getTenantUserRealm(int tenantId)
           
 org.wso2.carbon.user.core.UserRealm getUserRealm(org.wso2.carbon.user.api.RealmConfiguration tenantRealmConfig)
          Method to return a user realm for the given realm configuration.
 org.wso2.carbon.user.core.UserRealm initializeRealm(org.wso2.carbon.user.api.RealmConfiguration realmConfig, DataSource dataSource, int tenantId)
          Initialize the realm for a tenant id.
 void setTenantManager(org.wso2.carbon.user.api.TenantManager tenantManager)
           
 void setTenantManager(org.wso2.carbon.user.core.tenant.TenantManager t)
           
 void setup()
          Setup the realm service.
 void setUserRealm(int tenantId, org.wso2.carbon.user.core.UserRealm realm)
          Method to set a user realm instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryRealmService

public InMemoryRealmService()
                     throws RegistryException
Construct a in memory realm service.

Throws:
RegistryException - throws if the operation failed.
Method Detail

getUserRealm

public org.wso2.carbon.user.core.UserRealm getUserRealm(org.wso2.carbon.user.api.RealmConfiguration tenantRealmConfig)
                                                 throws org.wso2.carbon.user.core.UserStoreException
Method to return a user realm for the given realm configuration.

Specified by:
getUserRealm in interface org.wso2.carbon.user.core.service.RealmService
Parameters:
tenantRealmConfig - the realm configuration.
Returns:
the user realm
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

setUserRealm

public void setUserRealm(int tenantId,
                         org.wso2.carbon.user.core.UserRealm realm)
                  throws org.wso2.carbon.user.core.UserStoreException
Method to set a user realm instance.

Parameters:
tenantId - the tenant identifier
realm - the user realm of the tenant
Throws:
org.wso2.carbon.user.core.UserStoreException - if the operation failed.

getBootstrapRealmConfiguration

public org.wso2.carbon.user.api.RealmConfiguration getBootstrapRealmConfiguration()
Get the boot strap configuration (tenant0's configuration).

Specified by:
getBootstrapRealmConfiguration in interface org.wso2.carbon.user.api.UserRealmService
Specified by:
getBootstrapRealmConfiguration in interface org.wso2.carbon.user.core.service.RealmService
Returns:
the bootstrap realm configuration.

setup

public void setup()
           throws RegistryException
Setup the realm service.

Throws:
RegistryException - if the operation failed.

getBootstrapRealm

public org.wso2.carbon.user.core.UserRealm getBootstrapRealm()
                                                      throws org.wso2.carbon.user.core.UserStoreException
Get the bootstrap realm.

Specified by:
getBootstrapRealm in interface org.wso2.carbon.user.api.UserRealmService
Specified by:
getBootstrapRealm in interface org.wso2.carbon.user.core.service.RealmService
Returns:
the bootstrap realm.
Throws:
org.wso2.carbon.user.core.UserStoreException - throws if the operation failed.

setTenantManager

public void setTenantManager(org.wso2.carbon.user.api.TenantManager tenantManager)
                      throws org.wso2.carbon.user.api.UserStoreException
Specified by:
setTenantManager in interface org.wso2.carbon.user.api.UserRealmService
Throws:
org.wso2.carbon.user.api.UserStoreException

getTenantManager

public org.wso2.carbon.user.core.tenant.TenantManager getTenantManager()
Return the tenant manager.

Specified by:
getTenantManager in interface org.wso2.carbon.user.api.UserRealmService
Specified by:
getTenantManager in interface org.wso2.carbon.user.core.service.RealmService
Returns:
the tenant manager.

getTenantUserRealm

public org.wso2.carbon.user.api.UserRealm getTenantUserRealm(int tenantId)
                                                      throws org.wso2.carbon.user.core.UserStoreException
Specified by:
getTenantUserRealm in interface org.wso2.carbon.user.api.UserRealmService
Throws:
org.wso2.carbon.user.core.UserStoreException

initializeRealm

public org.wso2.carbon.user.core.UserRealm initializeRealm(org.wso2.carbon.user.api.RealmConfiguration realmConfig,
                                                           DataSource dataSource,
                                                           int tenantId)
                                                    throws org.wso2.carbon.user.core.UserStoreException
Initialize the realm for a tenant id.

Parameters:
realmConfig - realm configuration.
dataSource - data source
tenantId - tenant id
Returns:
the user realm.
Throws:
org.wso2.carbon.user.core.UserStoreException - the user realm.

setTenantManager

public void setTenantManager(org.wso2.carbon.user.core.tenant.TenantManager t)
Specified by:
setTenantManager in interface org.wso2.carbon.user.core.service.RealmService

getMultiTenantRealmConfigBuilder

public org.wso2.carbon.user.core.config.multitenancy.MultiTenantRealmConfigBuilder getMultiTenantRealmConfigBuilder()
                                                                                                             throws org.wso2.carbon.user.core.UserStoreException
Specified by:
getMultiTenantRealmConfigBuilder in interface org.wso2.carbon.user.core.service.RealmService
Throws:
org.wso2.carbon.user.core.UserStoreException

getCachedUserRealm

public org.wso2.carbon.user.core.UserRealm getCachedUserRealm(int tenantId)
                                                       throws org.wso2.carbon.user.core.UserStoreException
Specified by:
getCachedUserRealm in interface org.wso2.carbon.user.core.service.RealmService
Throws:
org.wso2.carbon.user.core.UserStoreException

getTenantMgtConfiguration

public org.wso2.carbon.user.api.TenantMgtConfiguration getTenantMgtConfiguration()
This method is used in default realm service in tenant-mgt. Hence no implementation for this method.

Specified by:
getTenantMgtConfiguration in interface org.wso2.carbon.user.api.UserRealmService


Copyright © 2011 WSO2 Inc. All Rights Reserved.