Examples of newResource()


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

        RealmConfiguration realmConfig = ctx.getRealmService().getBootstrapRealmConfiguration();
        // first we will fill the user store for tenant 0
        UserRegistry registry1 =
                embeddedRegistryService.getUserRegistry(realmConfig.getAdminUserName(), 0);

        Resource r = registry1.newResource();
        registry1.put("/test2", r);

        UserRealm userRealm1 = registry1.getUserRealm();
        UserStoreManager userStoreManager1;
        try {
View Full Code Here

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

                        role, this.topicStoragePath, EventBrokerConstants.EB_PERMISSION_PUBLISH);

            }
            // we need to create the index here only it is not exists.
            if (!userRegistry.resourceExists(this.indexStoragePath)) {
                userRegistry.put(this.indexStoragePath, userRegistry.newResource());
            }

        } catch (RegistryException e) {
            throw new EventBrokerConfigurationException("Can not access the registry ", e);
        } catch (UserStoreException e) {
View Full Code Here

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

        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());
            String resourcePath = getResourcePath(subscription.getId(), subscription.getTopicName());

            Resource resource = userRegistry.newResource();
            resource.setProperty(EventBrokerConstants.EB_RES_SUBSCRIPTION_URL, subscription.getEventSinkURL());
            resource.setProperty(EventBrokerConstants.EB_RES_EVENT_DISPATCHER_NAME, subscription.getEventDispatcherName());

            if (subscription.getExpires() != null){
               resource.setProperty(EventBrokerConstants.EB_RES_EXPIRS, ConverterUtil.convertToString(subscription.getExpires()));
View Full Code Here

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

            Resource topicIndexResource;
            if(userRegistry.resourceExists(fullPath)){
                topicIndexResource = userRegistry.get(fullPath);
                topicIndexResource.addProperty(subscription.getId(), subscription.getTopicName());
            }else{
               topicIndexResource = userRegistry.newResource();
               topicIndexResource.addProperty(subscription.getId(), subscription.getTopicName());               
            }
            userRegistry.put(fullPath, topicIndexResource);

        } catch (RegistryException e) {
View Full Code Here

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

    private void defineQueries(Registry configSystemRegistry, String queryPath, String queryContent) throws RegistryException {
        UserRegistry registry =
                (UserRegistry) configSystemRegistry;

        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

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

    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

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

            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";
View Full Code Here

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

        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

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

        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

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

   
    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
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.