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

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


            return;
        }
        String throttlingRuleFile = CarbonUtils.getCarbonConfigDirPath() +
                File.separator + THROTTLING_RULE_FILE;
        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
        Resource ruleResource = systemRegistry.newResource();
        ruleResource.setContent(content);
        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
    }
}
View Full Code Here


                                         RegistryConstants.PATH_SEPARATOR +
                                         StratosConstants.VALIDATION_KEY_RESOURCE_NAME;

        // we have to reset the domain validation key everytime
        String domainValidationKey = UUIDGenerator.generateUUID();
        Resource resource = governanceSystemRegistry.newResource();
        resource.setContent(domainValidationKey);
        ((ResourceImpl) resource).setVersionableChange(false);
        governanceSystemRegistry.put(domainValidatorInfoPath, resource);
        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH +
                                        domainValidatorInfoPath,
View Full Code Here

        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);
        superTenantSystemRegistry.put(emailVerificationPath, resource);

        try {
View Full Code Here

        String domainValidationPath = StratosConstants.TENANT_DOMAIN_VERIFICATION_FLAG_PATH +
                RegistryConstants.PATH_SEPARATOR + tenantId;
        UserRegistry superTenantRegistry =
                Util.getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
        Resource validationFlagR = superTenantRegistry.newResource();
        validationFlagR.setProperty(validatedDomain, "true");
        superTenantRegistry.put(domainValidationPath, validationFlagR);

        return true;
    }
View Full Code Here

   
    public void saveTrottlingRules(String throttlingRuleFile) throws Exception {
        UserRegistry systemRegistry = registryService.getGovernanceSystemRegistry();

        byte[] content = CarbonUtils.getBytesFromFile(new File(throttlingRuleFile));
        Resource ruleResource = systemRegistry.newResource();
        ruleResource.setContent(content);
        systemRegistry.put(StratosConstants.THROTTLING_RULES_PATH, ruleResource);
    }

    public void putEmptyResource() throws Exception {
View Full Code Here

                                            int tenantId) throws RegistryException {

        Resource resource;
        UserRegistry localRepository = getLocalRepository(tenantId);
        if (!localRepository.resourceExists(DeploymentSynchronizerConstants.CARBON_REPOSITORY)) {
            resource = localRepository.newResource();
        } else {
            resource = localRepository.get(DeploymentSynchronizerConstants.CARBON_REPOSITORY);
        }

        resource.setProperty(DeploymentSynchronizerConstants.AUTO_COMMIT_MODE,
View Full Code Here

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

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

        UserRegistry registry = initRegistry();

        try {
            registry.beginTransaction();
            Resource nodeResource = registry.newResource();
            nodeResource.setContent(resourceBytes);
            // store the resource in the registry
            registry.put(path, nodeResource);
            if (tag != null) {
                // apply the tag
View Full Code Here

        // first we generate a UUID
        UserRegistry systemRegistry =
                TenantMgtServiceComponent.getRegistryService().getGovernanceSystemRegistry();
        String uuid = UUIDGenerator.generateUUID();
        // store it in the registry.
        Resource resource = systemRegistry.newResource();
        String tenantIdStr = Integer.toString(tenantId);
        resource.setProperty(MultitenantConstants.TENANT_ID, tenantIdStr);
        String uuidPath = StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN
                          + RegistryConstants.PATH_SEPARATOR + uuid;
        systemRegistry.put(uuidPath, resource);
View Full Code Here

    }

  public static void main(String[] args) throws Exception {
    WSRegistryServiceClient client;
    client = initialize();
    Resource resource = client.newResource();
    resource.setContent("Hello Out there!");

    String resourcePath = "/abc";
    registry.put(resourcePath, resource);
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.