Package org.wso2.carbon.registry.core.session

Examples of org.wso2.carbon.registry.core.session.UserRegistry


    public void setContent(String content){
        this.content = content;
    }

    private boolean queryExists(String queryPath) throws RegistryException {
        UserRegistry registry = (UserRegistry) Utils.getRegistry();
        return registry.resourceExists(queryPath);
    }
View Full Code Here


        UserRegistry registry = (UserRegistry) Utils.getRegistry();
        return registry.resourceExists(queryPath);
    }

    private void defineQueries(String queryPath, String queryContent) throws RegistryException {
        UserRegistry registry =
                (UserRegistry) Utils.getRegistry();

        Resource q1 = registry.newResource();
        q1.setContent(queryContent);
        q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
        q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
                RegistryConstants.RESOURCES_RESULT_TYPE);
        registry.put(queryPath, q1);

    }
View Full Code Here

    }

    public static UserRegistry getThemeMgtSystemRegistry(String tenantPass) throws RegistryException {
        if (tenantPass != null && !tenantPass.equals("")) {
            // tenant 0th system registry
            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
            Resource resource = systemRegistry.get(
                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
            String tenantIdStr = resource.getProperty("tenantId");
            int tenantId = Integer.parseInt(tenantIdStr);

            return registryService.getGovernanceSystemRegistry(tenantId);
View Full Code Here

    }

    public static void removeTheUUID(String tenantPass) throws RegistryException {
        if (tenantPass != null && !tenantPass.equals("")) {
            // tenant 0th system registry
            UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
            if(systemRegistry.resourceExists(
                    StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass)) {
                systemRegistry.delete(
                        StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN + "/" + tenantPass);
            }
        }
    }
View Full Code Here

        try {
            String domainValidationPath =
                                          StratosConstants.TENANT_DOMAIN_VERIFICATION_FLAG_PATH +
                                                  RegistryConstants.PATH_SEPARATOR + tenant.getId();
            UserRegistry tenantZeroRegistry =
                                              TenantMgtCoreServiceComponent.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
            Resource validationFlagR = tenantZeroRegistry.newResource();
            validationFlagR.setProperty(tenant.getDomain(), "true");
            tenantZeroRegistry.put(domainValidationPath, validationFlagR);

        } catch (RegistryException e) {
            String msg = "Error in storing the domain validation flag to the registry";
            log.error(msg, e);
            throw new RegistryException(msg, e);
View Full Code Here

        }

    }

    public static UserRegistry getThemeRegistryFromTenantPass(String tenantPass) throws RegistryException {
        UserRegistry themeMgtSystemRegistry = getThemeMgtSystemRegistry(tenantPass);
        if (themeMgtSystemRegistry != null) {
            return themeMgtSystemRegistry.getChrootedRegistry(THEME_ADMIN_PATH);
        } else {
            return null;
        }
    }
View Full Code Here

        return ((UserRegistry)registry).getChrootedRegistry(THEME_ADMIN_PATH);
    }

    public static void loadResourceThemes() throws RegistryException {
        // loads the tenant0's system registry
        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();
        // we are not checking whether the theme resources already exists to make sure, the newly
        // added themes can be loaded just at the activation of the component
        String themeRootFileName = System.getProperty(ServerConstants.CARBON_HOME) + File
                .separator + "resources" + File.separator + "allthemes";
        // we are always making this accessible from anyware
        File themeRootFile = new File(themeRootFileName);
        ThemeUtil.transferAllThemesToRegistry(themeRootFile, systemRegistry, StratosConstants.ALL_THEMES_PATH);

        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH + StratosConstants.ALL_THEMES_PATH,
                systemRegistry.getUserRealm());
    }
View Full Code Here

     *            tenant id
     * @throws Exception
     *             UserStoreException
     */
    private void copyUIPermissions(int tenantId) throws Exception {
        UserRegistry tenantZeroConfigSystemRegistry =
                                                      TenantMgtCoreServiceComponent.getConfigSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
//        Writer writer = new StringWriter();
//        tenantZeroConfigSystemRegistry.dump(CarbonConstants.UI_ADMIN_PERMISSION_COLLECTION, writer);
//        Reader reader = new StringReader(writer.toString());
//        UserRegistry tenantConfigSystemRegistry =
View Full Code Here

           
            if(cloudServicesDesc == null ) {
                cloudServicesDesc = CloudServiceConfigParser.loadCloudServicesConfiguration();
            }
          
            UserRegistry superTenantUserReg =
                                              TenantMgtCoreServiceComponent.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
           
            if (originalService != null && !originalService.equals(StratosConstants.CLOUD_MANAGER_SERVICE) ) {
                CloudServicesUtil.activateOriginalAndCompulsoryServices(cloudServicesDesc,  originalService, tenantId);
                useDefaultConfig = false;
View Full Code Here


    public static void loadTheme(int tenantId) throws RegistryException {
        // get the util functions from the theme
        // this is always the 0th system reigstry
        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry(tenantId);
        String[] allThemes = getAvailableThemes();
        if (allThemes.length == 0) {
            log.info("No themes found.");
            return;
        }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.session.UserRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.