org.wso2.carbon.registry.core.jdbc
Class EmbeddedRegistryService

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService
All Implemented Interfaces:
org.wso2.carbon.registry.api.RegistryService
Direct Known Subclasses:
InMemoryEmbeddedRegistryService

public class EmbeddedRegistryService
extends Object
implements RegistryService

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 EmbeddedRegistry. 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");

See Also:
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(String userName)
          Creates a Registry instance for the given user from the configuration registry space.
 UserRegistry getConfigUserRegistry(String userName, int tenantId)
          Creates a Registry instance for the given user from the configuration registry space with the tenant id.
 UserRegistry getConfigUserRegistry(String userName, String password)
          Creates Registry instances for normal users from the configuration registry space.
 UserRegistry getConfigUserRegistry(String userName, 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(String userName)
          Creates a Registry instance for anonymous user from the Governance space.
 UserRegistry getGovernanceUserRegistry(String userName, int tenantId)
          Creates a Registry instance for anonymous user from the Governance space.
 UserRegistry getGovernanceUserRegistry(String userName, String password)
          Creates a Registry instance for anonymous user from the Governance space.
 UserRegistry getGovernanceUserRegistry(String userName, 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(String userName)
          Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'.
 UserRegistry getRegistry(String userName, int tenantId)
          Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'.
 UserRegistry getRegistry(String userName, int tenantId, String chroot)
          Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'.
 UserRegistry getRegistry(String userName, String password)
          Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'.
 UserRegistry getRegistry(String userName, String password, int tenantId)
          Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'.
 UserRegistry getRegistry(String userName, String password, int tenantId, 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, 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(String userName)
          Creates a UserRegistry instance for the given user.
 UserRegistry getUserRegistry(String userName, int tenantId)
          Creates a UserRegistry instance for the given user.
 UserRegistry getUserRegistry(String userName, int tenantId, String chroot)
          Creates a UserRegistry instance for the given user.
 UserRegistry getUserRegistry(String userName, String password)
          Creates UserRegistry instances for normal users.
 UserRegistry getUserRegistry(String userName, String password, int tenantId)
          Creates UserRegistry instances for normal users.
 UserRegistry getUserRegistry(String userName, String password, int tenantId, 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

registryContext

protected RegistryContext registryContext
The registry context used by this registry service instance.

Constructor Detail

EmbeddedRegistryService

public EmbeddedRegistryService(RegistryContext context)
                        throws RegistryException
Instantiates the EmbeddedRegistry using the configuration given in the context and the given UserRealm. Data source given in the context will be used for the resource store. User store is accessed from the given UserRealm, which may point to a different source.

Parameters:
context - Registry Context containing the configuration.
Throws:
RegistryException - if the creation of the embedded registry service fails.

EmbeddedRegistryService

protected EmbeddedRegistryService()
This constructor is used by the inherited InMemoryEmbeddedRegistry class as it has to be instantiated using the default constructor.

Method Detail

configure

protected void configure(org.wso2.carbon.user.core.service.RealmService realmService)
                  throws RegistryException
Method to configure the embedded registry service.

Parameters:
realmService - the user realm service instance.
Throws:
RegistryException - if an error occurs.

getUserRegistry

public UserRegistry getUserRegistry()
                             throws RegistryException
Creates a UserRegistry instance for anonymous user. Permissions set for anonymous user will be applied for all operations performed using this instance.

Returns:
UserRegistry for the anonymous user.
Throws:
RegistryException

getSystemRegistry

public UserRegistry getSystemRegistry()
                               throws RegistryException
Returns a registry to be used for system operations. Human users should not be allowed log in using this registry.

Returns:
User registry for system user.
Throws:
RegistryException

getSystemRegistry

public UserRegistry getSystemRegistry(int tenantId)
                               throws RegistryException
Returns a registry to be used for system operations. Human users should not be allowed log in using this registry.

Parameters:
tenantId - tenant id of the user tenant.
Returns:
User registry for system user.
Throws:
RegistryException

getSystemRegistry

public UserRegistry getSystemRegistry(int tenantId,
                                      String chroot)
                               throws RegistryException
Returns a registry to be used for system operations. Human users should not be allowed log in using this registry.

Parameters:
tenantId - tenant id of the user tenant.
chroot - to return a chrooted registry
Returns:
User registry for system user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName,
                                    String password)
                             throws RegistryException
Creates UserRegistry instances for normal users. Applications should use this method to create UserRegistry instances, unless there is a specific need documented in other methods. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested UserRegistry instance.

Parameters:
userName - User name of the user.
password - Password of the user.
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName,
                                    String password,
                                    int tenantId)
                             throws RegistryException
Creates UserRegistry instances for normal users. Applications should use this method to create UserRegistry instances, unless there is a specific need documented in other methods. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested UserRegistry instance.

Parameters:
userName - User name of the user.
password - Password of the user.
tenantId - Tenant id of the user tenant.
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName,
                                    String password,
                                    int tenantId,
                                    String chroot)
                             throws RegistryException
Creates UserRegistry instances for normal users. Applications should use this method to create UserRegistry instances, unless there is a specific need documented in other methods. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested UserRegistry instance.

Parameters:
userName - User name of the user.
password - Password of the user.
tenantId - Tenant id of the user tenant.
chroot - to return a chrooted registry
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName)
                             throws RegistryException
Creates a UserRegistry instance for the given user. This method will NOT authenticate the user before creating the UserRegistry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

Parameters:
userName - User name of the user.
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName,
                                    int tenantId)
                             throws RegistryException
Creates a UserRegistry instance for the given user. This method will NOT authenticate the user before creating the UserRegistry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

Parameters:
userName - User name of the user.
tenantId - Tenant id of the user tenant.
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRegistry

public UserRegistry getUserRegistry(String userName,
                                    int tenantId,
                                    String chroot)
                             throws RegistryException
Creates a UserRegistry instance for the given user. This method will NOT authenticate the user before creating the UserRegistry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

Parameters:
userName - User name of the user.
tenantId - Tenant id of the user tenant.
chroot - to return a chrooted registry
Returns:
UserRegistry instance for the given user.
Throws:
RegistryException

getUserRealm

public org.wso2.carbon.user.core.UserRealm getUserRealm(int tenantId)
                                                 throws RegistryException
Description copied from interface: RegistryService
This will return a realm specific to the tenant.

Parameters:
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.
Returns:
UserRealm instance associated with the tenant id.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName,
                                int tenantId,
                                String chroot)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry. This method can be used to obtain instances of Registry belonging to users of multiple tenants. The returned Registry will be chrooted to the given path, making it possible to use relative paths.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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'.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName,
                                String password,
                                int tenantId,
                                String chroot)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance. This method can be used to obtain instances of Registry belonging to users of multiple tenants. The returned Registry will be chrooted to the given path, making it possible to use relative paths.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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'.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry()
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. Permissions set for anonymous user will be applied for all operations performed using this instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Complete Registry for the anonymous user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

This registry instance belongs to the super tenant of the system.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName,
                                int tenantId)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry. This method can be used to obtain instances of Registry belonging to users of multiple tenants.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName,
                                String password)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
password - Password of the user.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getRegistry

public UserRegistry getRegistry(String userName,
                                String password,
                                int tenantId)
                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user which contains the entire registry tree starting from '/'. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance. This method can be used to obtain instances of Registry belonging to users of multiple tenants.

Specified by:
getRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Complete Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getLocalRepository

public UserRegistry getLocalRepository()
                                throws RegistryException
Description copied from interface: RegistryService
Returns a registry to be used for node-specific system operations. Human users should not be allowed to log in to this registry. This is the Local Repository which can only be used by the system.

This registry instance belongs to the super tenant of the system.

Specified by:
getLocalRepository in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Local Repository for system user.
Throws:
RegistryException - if an error occurs

getLocalRepository

public UserRegistry getLocalRepository(int tenantId)
                                throws RegistryException
Description copied from interface: RegistryService
Returns a registry to be used for node-specific system operations. Human users should not be allowed to log in to this registry. This is the Local Repository which can only be used by the system.

This registry instance belongs to a valid tenant of the system.

Specified by:
getLocalRepository in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Local Repository for system user.
Throws:
RegistryException - if an error occurs

getConfigSystemRegistry

public UserRegistry getConfigSystemRegistry(int tenantId)
                                     throws RegistryException
Description copied from interface: RegistryService
Returns a registry to be used for system operations. Human users should not be allowed log in using this registry. This is the Configuration registry space which is used by the system.

Specified by:
getConfigSystemRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
User registry for system user.
Throws:
RegistryException - if an error occurs

getConfigSystemRegistry

public UserRegistry getConfigSystemRegistry()
                                     throws RegistryException
Description copied from interface: RegistryService
Returns a registry to be used for system operations. Human users should not be allowed log in using this registry. This is the Configuration registry space which is used by the system.

This registry instance belongs to the super tenant of the system.

Specified by:
getConfigSystemRegistry in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Config Registry for system user.
Throws:
RegistryException - if an error occurs

getConfigUserRegistry

public UserRegistry getConfigUserRegistry(String userName,
                                          int tenantId)
                                   throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for the given user from the configuration registry space with the tenant id. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the registry service.

Specified by:
getConfigUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Config Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getConfigUserRegistry

public UserRegistry getConfigUserRegistry(String userName,
                                          String password,
                                          int tenantId)
                                   throws RegistryException
Description copied from interface: RegistryService
Creates Registry instances for normal users from the configuration registry space. Applications should use this method to create Registry instances, unless there is a specific need documented in other methods. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance.

Specified by:
getConfigUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Config Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getConfigUserRegistry

public UserRegistry getConfigUserRegistry()
                                   throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the configuration registry space. Permissions set for anonymous user will be applied for all operations performed using this instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getConfigUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Config Registry for the anonymous user.
Throws:
RegistryException - if an error occurs

getConfigUserRegistry

public UserRegistry getConfigUserRegistry(String userName)
                                   throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for the given user from the configuration registry space. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

This registry instance belongs to the super tenant of the system.

Specified by:
getConfigUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
Returns:
Config Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getConfigUserRegistry

public UserRegistry getConfigUserRegistry(String userName,
                                          String password)
                                   throws RegistryException
Description copied from interface: RegistryService
Creates Registry instances for normal users from the configuration registry space. Applications should use this method to create Registry instances, unless there is a specific need documented in other methods. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getConfigUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
password - Password of the user.
Returns:
Config Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getGovernanceSystemRegistry

public UserRegistry getGovernanceSystemRegistry(int tenantId)
                                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for the Governance space. This is the Governance registry space which is used by the system.

Specified by:
getGovernanceSystemRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Governance registry for system user.
Throws:
RegistryException - if an error occurs

getGovernanceSystemRegistry

public UserRegistry getGovernanceSystemRegistry()
                                         throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for the Governance space. This is the Governance registry space which is used by the system.

This registry instance belongs to the super tenant of the system.

Specified by:
getGovernanceSystemRegistry in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Governance Registry for system user.
Throws:
RegistryException - if an error occurs

getGovernanceUserRegistry

public UserRegistry getGovernanceUserRegistry(String userName,
                                              int tenantId)
                                       throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the Governance space. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry. This method can be used to obtain instances of Registry belonging to users of multiple tenants.

Specified by:
getGovernanceUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Governance Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getGovernanceUserRegistry

public UserRegistry getGovernanceUserRegistry(String userName,
                                              String password,
                                              int tenantId)
                                       throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the Governance space. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance. This method can be used to obtain instances of Registry belonging to users of multiple tenants.

Specified by:
getGovernanceUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
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.
Returns:
Governance Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getGovernanceUserRegistry

public UserRegistry getGovernanceUserRegistry()
                                       throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the Governance space. Permissions set for anonymous user will be applied for all operations performed using this instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getGovernanceUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Returns:
Governance Registry for the anonymous user.
Throws:
RegistryException - if an error occurs

getGovernanceUserRegistry

public UserRegistry getGovernanceUserRegistry(String userName)
                                       throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the Governance space. This method will NOT authenticate the user before creating the Registry instance. It assumes that the user is authenticated outside the EmbeddedRegistry.

This registry instance belongs to the super tenant of the system.

Specified by:
getGovernanceUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
Returns:
Governance Registry instance for the given user.
Throws:
RegistryException - if an error occurs

getGovernanceUserRegistry

public UserRegistry getGovernanceUserRegistry(String userName,
                                              String password)
                                       throws RegistryException
Description copied from interface: RegistryService
Creates a Registry instance for anonymous user from the Governance space. User name and the password will be authenticated by the EmbeddedRegistry before creating the requested Registry instance.

This registry instance belongs to the super tenant of the system.

Specified by:
getGovernanceUserRegistry in interface org.wso2.carbon.registry.api.RegistryService
Parameters:
userName - User name of the user.
password - Password of the user.
Returns:
Governance Registry instance for the given user.
Throws:
RegistryException - if an error occurs


Copyright © 2013 WSO2 Inc. All Rights Reserved.