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

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


        Resource resource;
        String emailVerificationPath = StratosConstants.ADMIN_EMAIL_VERIFICATION_FLAG_PATH +
                                       RegistryConstants.PATH_SEPARATOR +
                                       tenantInfoBean.getTenantId();
        try {
            if (superTenantGovernanceSystemRegistry.resourceExists(emailVerificationPath)) {
                resource = superTenantGovernanceSystemRegistry.get(emailVerificationPath);
            } else {
                resource = superTenantGovernanceSystemRegistry.newResource();
            }
            resource.setContent(confirmationKey);
View Full Code Here


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

            UserRegistry superTenantGovernanceRegistry = (UserRegistry)registryService.getGovernanceSystemRegistry();
            String tenantValidationInfoResourcePath =
                    StratosConstants.TENANT_USER_VALIDATION_STORE_PATH +
                            RegistryConstants.PATH_SEPARATOR + tenantId;

            if (superTenantGovernanceRegistry.resourceExists(tenantValidationInfoResourcePath)) {
                Resource tenantValidationInfoResource =
                        superTenantGovernanceRegistry.get(tenantValidationInfoResourcePath);
                Properties properties = tenantValidationInfoResource.getProperties();
                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
                for (String action : actions) {
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

                Util.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
        String domainValidatorInfoPath = StratosConstants.DOMAIN_VALIDATOR_INFO_PATH +
                                         RegistryConstants.PATH_SEPARATOR +
                                         domain + RegistryConstants.PATH_SEPARATOR +
                                         StratosConstants.VALIDATION_KEY_RESOURCE_NAME;
        if (governanceSystemRegistry.resourceExists(domainValidatorInfoPath)) {
            Resource resource = governanceSystemRegistry.get(domainValidatorInfoPath);
            Object contentObj = resource.getContent();
            if (contentObj instanceof String) {
                return (String) contentObj;
            } else if (contentObj instanceof byte[]) {
View Full Code Here

                                         RegistryConstants.PATH_SEPARATOR +
                                         domain + RegistryConstants.PATH_SEPARATOR +
                                         StratosConstants.VALIDATION_KEY_RESOURCE_NAME;
       
        String domainValidationKey = "";
        if (!governanceSystemRegistry.resourceExists(domainValidatorInfoPath)) {
            return "false";
        }
        Resource resource = governanceSystemRegistry.get(domainValidatorInfoPath);
        Object content = resource.getContent();
        if (content instanceof String) {
View Full Code Here

        String domainValidatorInfoPath = StratosConstants.DOMAIN_VALIDATOR_INFO_PATH +
                                         RegistryConstants.PATH_SEPARATOR +
                                         domain + RegistryConstants.PATH_SEPARATOR +
                                         StratosConstants.VALIDATION_KEY_RESOURCE_NAME;
        String domainValidationKey = "";
        if (!governanceSystemRegistry.resourceExists(domainValidatorInfoPath)) {
            return "false";
        }
        Resource resource = governanceSystemRegistry.get(domainValidatorInfoPath);
        Object content = resource.getContent();
        if (content instanceof String) {
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

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.