Package org.wso2.carbon.event.core.subscription

Examples of org.wso2.carbon.event.core.subscription.Subscription.addProperty()


            resource = registry.get(path);
            resource.addProperty(RegistryConstants.REGISTRY_EXISTING_RESOURCE, "true");
        } else {
            resource = new CollectionImpl();
        }
        resource.addProperty(RegistryConstants.REGISTRY_NON_RECURSIVE, "true");
        resource.addProperty(RegistryConstants.REGISTRY_LINK_RESTORATION,
                path + RegistryConstants.URL_SEPARATOR + target +
                        RegistryConstants.URL_SEPARATOR + targetSubPath +
                        RegistryConstants.URL_SEPARATOR + CurrentSession.getUser());
        registry.put(path, resource);
View Full Code Here


            resource.addProperty(RegistryConstants.REGISTRY_EXISTING_RESOURCE, "true");
        } else {
            resource = new CollectionImpl();
        }
        resource.addProperty(RegistryConstants.REGISTRY_NON_RECURSIVE, "true");
        resource.addProperty(RegistryConstants.REGISTRY_LINK_RESTORATION,
                path + RegistryConstants.URL_SEPARATOR + target +
                        RegistryConstants.URL_SEPARATOR + targetSubPath +
                        RegistryConstants.URL_SEPARATOR + CurrentSession.getUser());
        registry.put(path, resource);
        resource.discard();
View Full Code Here

    public void handleNewModuleAddition(AxisModule axisModule, String moduleName,String moduleVersion) throws Exception {
        try{
            configRegistry.beginTransaction();
            Resource module = configRegistry.newCollection();
            module.addProperty(RegistryResources.ModuleProperties.NAME,moduleName);

            if (!moduleVersion.equals(RegistryResources.ModuleProperties.UNDEFINED)) {
                module.addProperty(RegistryResources.ModuleProperties.VERSION, moduleVersion);
            }
            AxisConfigurator configurator = axisConfig.getConfigurator();
View Full Code Here

            configRegistry.beginTransaction();
            Resource module = configRegistry.newCollection();
            module.addProperty(RegistryResources.ModuleProperties.NAME,moduleName);

            if (!moduleVersion.equals(RegistryResources.ModuleProperties.UNDEFINED)) {
                module.addProperty(RegistryResources.ModuleProperties.VERSION, moduleVersion);
            }
            AxisConfigurator configurator = axisConfig.getConfigurator();
            boolean isGloballyEngaged = false;
            if(configurator instanceof CarbonAxisConfigurator) {
                isGloballyEngaged =
View Full Code Here

                ((CarbonAxisConfigurator) configurator).isGlobalyEngaged(axisModule);
            } else if (configurator instanceof TenantAxisConfigurator) {
                isGloballyEngaged =
                ((TenantAxisConfigurator) configurator).isGlobalyEngaged(axisModule);
            }
            module.addProperty(RegistryResources.ModuleProperties.GLOBALLY_ENGAGED,
                               String.valueOf(isGloballyEngaged));

            String registryResourcePath = RegistryResources.MODULES + moduleName + "/" + moduleVersion + "/";
            configRegistry.put(registryResourcePath, module);
           
View Full Code Here

            // add the subscription index
            String fullPath = this.indexStoragePath;
            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);
View Full Code Here

            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) {
            throw new EventBrokerException("Can not save to registry ", e);
View Full Code Here

                paramResource.setContent("<parameter name=\"" + paramName + "\" locked=\"false\">" + paramValue + "</parameter>");
                registry.put(resourcePath, paramResource);
            } else {
                paramResource = registry.newResource();
                paramResource.setContent("<parameter name=\"" + paramName + "\" locked=\"false\">" + paramValue + "</parameter>");
                paramResource.addProperty(RegistryResources.NAME, paramName);
                registry.put(resourcePath, paramResource);
            }

        } catch (RegistryException e) {
            throw new AxisFault("Problem when setting parameter values");
View Full Code Here

                    "(R.REG_PATH_ID=RT.REG_PATH_ID AND R.REG_NAME=RT.REG_RESOURCE_NAME)) " +
                    "AND R.REG_DESCRIPTION LIKE ?";
            Resource q1 = registry.newResource();
            q1.setContent(sql1);
            q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
            q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
                    RegistryConstants.RATINGS_RESULT_TYPE);
            registry.put(QUERY_PATH, q1);
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

    public void testResourcePropertyVersioning() throws Exception {

        Resource r1 = registry.newResource();
        r1.setContent("content 1");
        r1.addProperty("p1", "v1");
        registry.put("/v4/r1", r1);

        Resource r1v2 = registry.get("/v4/r1");
        r1v2.addProperty("p2", "v2");
        registry.put("/v4/r1", r1v2);
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.