|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.registry.jdbc.EmbeddedRegistry
public class EmbeddedRegistry
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 the EmbeddeedRegistry. 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 datasources. Applications should initialize an EmbeddedRegistry instance at the startup 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 varous parameter combinations documeneted in getUserRegistry(...) methods. UserRegistry adminRegistry = embeddedRegistry.getUserRegistry("admin", "admin");
Field Summary | |
---|---|
protected RegistryContext |
registryContext
|
Constructor Summary | |
---|---|
protected |
EmbeddedRegistry()
This contructor is used by the inherited InMemoryEmbeddedRegistry class as it has to be instantiated using the default contructor. |
|
EmbeddedRegistry(RegistryContext context)
Instantiates the EmbeddedRegistry using the configuration given in RegistryContext. |
|
EmbeddedRegistry(RegistryContext context,
UserRealm realm)
Intantiates the EmbeddedRegistry using the configuration given in the context and the given UserRealm. |
Method Summary | |
---|---|
protected void |
configure()
|
protected void |
configure(UserRealm defaultRealm)
|
UserRegistry |
getSystemRegistry()
Returns a registry to be used for system operations. |
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,
java.lang.String password)
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 EmbeddedRegistry(RegistryContext context) throws RegistryException
context
- RegistryContext containing the configuration.
RegistryException
public EmbeddedRegistry(RegistryContext context, UserRealm realm) throws RegistryException
context
- RegistryContex containing the configuration.realm
- UserRealm containing the user store.
RegistryException
protected EmbeddedRegistry()
Method Detail |
---|
protected void configure() throws RegistryException
RegistryException
protected void configure(UserRealm defaultRealm) throws RegistryException
RegistryException
public UserRegistry getUserRegistry() throws RegistryException
RegistryException
public UserRegistry getSystemRegistry() throws RegistryException
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) throws RegistryException
userName
- User name of the user.
RegistryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |