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

Examples of org.wso2.carbon.registry.core.session.UserRegistry.resourceExists()


        this.content = content;
    }

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

    private void defineQueries(String queryPath, String queryContent) throws RegistryException {
        UserRegistry registry =
                (UserRegistry) Utils.getRegistry();
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

        String targetPath = THEME_PATH;

        UserRegistry systemZeroRegistry = registryService.getGovernanceSystemRegistry();

        // if the themes doesn't exist we would exclude applying it
        if (!systemZeroRegistry.resourceExists(sourcePath)) {
            log.info("The theme source path: " + sourcePath + " doesn't exist.");
            return;
        }

        // first delete the old one, or we can backup it if required
View Full Code Here

        List<PermissionConfig> permissionConfigs = cloudServiceConfig.getPermissionConfigs();
        for (PermissionConfig permissionConfig : permissionConfigs) {
            String path = permissionConfig.getPath();
            String name = permissionConfig.getName();
            if (active) {
                if (!configRegistry.resourceExists(path)) {
                    Collection collection = configRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    configRegistry.put(path, collection);
                }
            } else {
View Full Code Here

                    Collection collection = configRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    configRegistry.put(path, collection);
                }
            } else {
                if (configRegistry.resourceExists(path)) {
                    configRegistry.delete(path);
                }
            }
        }
    }
View Full Code Here

        UserRegistry superTenantSystemRegistry =
                Util.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
        Resource resource;
        String emailVerificationPath = StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                                       RegistryConstants.PATH_SEPARATOR + tenantId;
        if (superTenantSystemRegistry.resourceExists(emailVerificationPath)) {
            resource = superTenantSystemRegistry.get(emailVerificationPath);
        } else {
            resource = superTenantSystemRegistry.newResource();
        }
        resource.setContent(confirmationKey);
View Full Code Here

        String domainValidationPath = StratosConstants.TENANT_DOMAIN_VERIFICATION_FLAG_PATH +
                                      RegistryConstants.PATH_SEPARATOR + tenantId;
        UserRegistry superTenantRegistry = Util.getGovernanceSystemRegistry(
                MultitenantConstants.SUPER_TENANT_ID);
        if (superTenantRegistry.resourceExists(domainValidationPath)) {
            Resource validationFlagR = superTenantRegistry.get(domainValidationPath);
            return "true".equals(validationFlagR.getProperty(domainName));
        }
        return false;
    }
View Full Code Here

        UserRegistry superTenantSystemRegistry =
                Util.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
        String emailVerificationPath = StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                                       RegistryConstants.PATH_SEPARATOR +
                                       userRegistry.getTenantId();
        if (!superTenantSystemRegistry.resourceExists(emailVerificationPath)) {
            // the confirmation key should exist,otherwise fail registration
            return false;
        }
        Resource resource = superTenantSystemRegistry.get(emailVerificationPath);
View Full Code Here

        UserRegistry superTenantSystemRegistry = Util.getGovernanceSystemRegistry(
                MultitenantConstants.SUPER_TENANT_ID);
        String emailVerificationPath =
                StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                RegistryConstants.PATH_SEPARATOR + tenantId;
        if (!superTenantSystemRegistry.resourceExists(emailVerificationPath)) {
            // the confirmation key should exist,otherwise fail registraion
            String msg = "The confirmationKey doesn't exist in service.";
            log.error(msg);
            throw new RegistryException(msg);
        }
View Full Code Here

     *
     * @throws Exception, if loading the throttling rules failed.
     */
    public static void loadTrottlingRules() throws Exception {
        UserRegistry systemRegistry = getSuperTenantGovernanceSystemRegistry();
        if (systemRegistry.resourceExists(StratosConstants.THROTTLING_RULES_PATH)) {
            return;
        }
        String throttlingRuleFile = CarbonUtils.getCarbonConfigDirPath() +
                                    RegistryConstants.PATH_SEPARATOR + THROTTLING_RULE_FILE;
        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.