|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService
public class EmbeddedRegistryService
This is a core class used by application that use registry in the embedded mode. This class is used to create embedded registry instances for user sessions.
UserRegistry is the embedded mode implementation of the Registry API. In this mode, all registry accesses has to be done using a UserRegistry instance. And there has to be separate UserRegistry instance for each user to access the registry. These UserRegistry instances has be obtained from theEmbeddedRegistry
. It is recommended to have only one EmbeddedRegistry instance per
application. But there can be exceptions, where it is required to maintain two or more registries
pointing to different data sources.
Applications should initialize an EmbeddedRegistry instance at the start-up using following
code.
InputStream configStream = new FileInputStream("/projects/registry.xml"); RegistryContext
registryContext = new RegistryContext(configStream); EmbeddedRegistry embeddedRegistry = new
EmbeddedRegistry(registryContext);
After initializing an EmbeddedRegistry instance it should be stored in some globally accessible
location, so that it can be used by necessary modules to create UserRegistry instances. From
this, it is possible to create UserRegistry instances using various parameter combinations
documented in getXXRegistry methods.
UserRegistry adminRegistry = embeddedRegistry.getRegistry("admin", "admin");
EmbeddedRegistry
,
UserRegistry
Field Summary | |
---|---|
protected RegistryContext |
registryContext
The registry context used by this registry service instance. |
Constructor Summary | |
---|---|
protected |
EmbeddedRegistryService()
This constructor is used by the inherited InMemoryEmbeddedRegistry class as it has to be instantiated using the default constructor. |
|
EmbeddedRegistryService(RegistryContext context)
Instantiates the EmbeddedRegistry using the configuration given in the context and the given UserRealm. |
Method Summary | |
---|---|
protected void |
configure(org.wso2.carbon.user.core.service.RealmService realmService)
Method to configure the embedded registry service. |
UserRegistry |
getConfigSystemRegistry()
Returns a registry to be used for system operations. |
UserRegistry |
getConfigSystemRegistry(int tenantId)
Returns a registry to be used for system operations. |
UserRegistry |
getConfigUserRegistry()
Creates a Registry instance for anonymous user from the configuration registry space. |
UserRegistry |
getConfigUserRegistry(java.lang.String userName)
Creates a Registry instance for the given user from the configuration registry space. |
UserRegistry |
getConfigUserRegistry(java.lang.String userName,
int tenantId)
Creates a Registry instance for the given user from the configuration registry space with the tenant id. |
UserRegistry |
getConfigUserRegistry(java.lang.String userName,
java.lang.String password)
Creates Registry instances for normal users from the configuration registry space. |
UserRegistry |
getConfigUserRegistry(java.lang.String userName,
java.lang.String password,
int tenantId)
Creates Registry instances for normal users from the configuration registry space. |
UserRegistry |
getGovernanceSystemRegistry()
Creates a Registry instance for the Governance space. |
UserRegistry |
getGovernanceSystemRegistry(int tenantId)
Creates a Registry instance for the Governance space. |
UserRegistry |
getGovernanceUserRegistry()
Creates a Registry instance for anonymous user from the Governance space. |
UserRegistry |
getGovernanceUserRegistry(java.lang.String userName)
Creates a Registry instance for anonymous user from the Governance space. |
UserRegistry |
getGovernanceUserRegistry(java.lang.String userName,
int tenantId)
Creates a Registry instance for anonymous user from the Governance space. |
UserRegistry |
getGovernanceUserRegistry(java.lang.String userName,
java.lang.String password)
Creates a Registry instance for anonymous user from the Governance space. |
UserRegistry |
getGovernanceUserRegistry(java.lang.String userName,
java.lang.String password,
int tenantId)
Creates a Registry instance for anonymous user from the Governance space. |
UserRegistry |
getLocalRepository()
Returns a registry to be used for node-specific system operations. |
UserRegistry |
getLocalRepository(int tenantId)
Returns a registry to be used for node-specific system operations. |
UserRegistry |
getRegistry()
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName,
int tenantId)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName,
int tenantId,
java.lang.String chroot)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName,
java.lang.String password)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName,
java.lang.String password,
int tenantId)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getRegistry(java.lang.String userName,
java.lang.String password,
int tenantId,
java.lang.String chroot)
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. |
UserRegistry |
getSystemRegistry()
Returns a registry to be used for system operations. |
UserRegistry |
getSystemRegistry(int tenantId)
Returns a registry to be used for system operations. |
UserRegistry |
getSystemRegistry(int tenantId,
java.lang.String chroot)
Returns a registry to be used for system operations. |
org.wso2.carbon.user.core.UserRealm |
getUserRealm(int tenantId)
This will return a realm specific to the tenant. |
UserRegistry |
getUserRegistry()
Creates a UserRegistry instance for anonymous user. |
UserRegistry |
getUserRegistry(java.lang.String userName)
Creates a UserRegistry instance for the given user. |
UserRegistry |
getUserRegistry(java.lang.String userName,
int tenantId)
Creates a UserRegistry instance for the given user. |
UserRegistry |
getUserRegistry(java.lang.String userName,
int tenantId,
java.lang.String chroot)
Creates a UserRegistry instance for the given user. |
UserRegistry |
getUserRegistry(java.lang.String userName,
java.lang.String password)
Creates UserRegistry instances for normal users. |
UserRegistry |
getUserRegistry(java.lang.String userName,
java.lang.String password,
int tenantId)
Creates UserRegistry instances for normal users. |
UserRegistry |
getUserRegistry(java.lang.String userName,
java.lang.String password,
int tenantId,
java.lang.String chroot)
Creates UserRegistry instances for normal users. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RegistryContext registryContext
Constructor Detail |
---|
public EmbeddedRegistryService(RegistryContext context) throws RegistryException
context
- Registry Context containing the configuration.
RegistryException
- if the creation of the embedded registry service fails.protected EmbeddedRegistryService()
Method Detail |
---|
protected void configure(org.wso2.carbon.user.core.service.RealmService realmService) throws RegistryException
realmService
- the user realm service instance.
RegistryException
- if an error occurs.public UserRegistry getUserRegistry() throws RegistryException
RegistryException
public UserRegistry getSystemRegistry() throws RegistryException
RegistryException
public UserRegistry getSystemRegistry(int tenantId) throws RegistryException
tenantId
- tenant id of the user tenant.
RegistryException
public UserRegistry getSystemRegistry(int tenantId, java.lang.String chroot) throws RegistryException
tenantId
- tenant id of the user tenant.chroot
- to return a chrooted registry
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName, java.lang.String password) throws RegistryException
userName
- User name of the user.password
- Password of the user.
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName, java.lang.String password, int tenantId) throws RegistryException
userName
- User name of the user.password
- Password of the user.tenantId
- Tenant id of the user tenant.
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName, java.lang.String password, int tenantId, java.lang.String chroot) throws RegistryException
userName
- User name of the user.password
- Password of the user.tenantId
- Tenant id of the user tenant.chroot
- to return a chrooted registry
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName) throws RegistryException
userName
- User name of the user.
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName, int tenantId) throws RegistryException
userName
- User name of the user.tenantId
- Tenant id of the user tenant.
RegistryException
public UserRegistry getUserRegistry(java.lang.String userName, int tenantId, java.lang.String chroot) throws RegistryException
userName
- User name of the user.tenantId
- Tenant id of the user tenant.chroot
- to return a chrooted registry
RegistryException
public org.wso2.carbon.user.core.UserRealm getUserRealm(int tenantId) throws RegistryException
RegistryService
tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName, int tenantId, java.lang.String chroot) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.chroot
- to return a chrooted registry. The whole registry can be accessed by using
the chroot, '/', and a subset of the registry can be accessed by using a
chroot, '/x/y/z'. For example, the repository of the configuration local
registry can be obtained from '/_system/config/repository'.
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName, java.lang.String password, int tenantId, java.lang.String chroot) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.chroot
- to return a chrooted registry. The whole registry can be accessed by using
the chroot, '/', and a subset of the registry can be accessed by using a
chroot, '/x/y/z'. For example, the repository of the configuration local
registry can be obtained from '/_system/config/repository'.
RegistryException
- if an error occurspublic UserRegistry getRegistry() throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName, int tenantId) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName, java.lang.String password) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.
RegistryException
- if an error occurspublic UserRegistry getRegistry(java.lang.String userName, java.lang.String password, int tenantId) throws RegistryException
RegistryService
getRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getLocalRepository() throws RegistryException
RegistryService
getLocalRepository
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getLocalRepository(int tenantId) throws RegistryException
RegistryService
getLocalRepository
in interface org.wso2.carbon.registry.api.RegistryService
tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getConfigSystemRegistry(int tenantId) throws RegistryException
RegistryService
getConfigSystemRegistry
in interface org.wso2.carbon.registry.api.RegistryService
tenantId
- the tenant id of the system. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getConfigSystemRegistry() throws RegistryException
RegistryService
getConfigSystemRegistry
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getConfigUserRegistry(java.lang.String userName, int tenantId) throws RegistryException
RegistryService
getConfigUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getConfigUserRegistry(java.lang.String userName, java.lang.String password, int tenantId) throws RegistryException
RegistryService
getConfigUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getConfigUserRegistry() throws RegistryException
RegistryService
getConfigUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getConfigUserRegistry(java.lang.String userName) throws RegistryException
RegistryService
getConfigUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.
RegistryException
- if an error occurspublic UserRegistry getConfigUserRegistry(java.lang.String userName, java.lang.String password) throws RegistryException
RegistryService
getConfigUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.
RegistryException
- if an error occurspublic UserRegistry getGovernanceSystemRegistry(int tenantId) throws RegistryException
RegistryService
getGovernanceSystemRegistry
in interface org.wso2.carbon.registry.api.RegistryService
tenantId
- the tenant id of the system. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getGovernanceSystemRegistry() throws RegistryException
RegistryService
getGovernanceSystemRegistry
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getGovernanceUserRegistry(java.lang.String userName, int tenantId) throws RegistryException
RegistryService
getGovernanceUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getGovernanceUserRegistry(java.lang.String userName, java.lang.String password, int tenantId) throws RegistryException
RegistryService
getGovernanceUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.tenantId
- tenant id of the user tenant. The tenant id '0', corresponds to the super
tenant of the system, whereas identifiers greater than '0' correspond to
valid tenants.
RegistryException
- if an error occurspublic UserRegistry getGovernanceUserRegistry() throws RegistryException
RegistryService
getGovernanceUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
RegistryException
- if an error occurspublic UserRegistry getGovernanceUserRegistry(java.lang.String userName) throws RegistryException
RegistryService
getGovernanceUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.
RegistryException
- if an error occurspublic UserRegistry getGovernanceUserRegistry(java.lang.String userName, java.lang.String password) throws RegistryException
RegistryService
getGovernanceUserRegistry
in interface org.wso2.carbon.registry.api.RegistryService
userName
- User name of the user.password
- Password of the user.
RegistryException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |