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

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


            throw new CEPConfigurationException(errorMessage, e);
        }

        String parentCollectionPath = CEPConstants.CEP_CONF_ELE_CEP_BUCKETS + CEPConstants.CEP_REGISTRY_BS;
        try {
            if (registry.resourceExists(parentCollectionPath)) {
                if (registry.get(parentCollectionPath) instanceof Collection) {
                    Collection cepBucketsCollection = (Collection) registry.get(parentCollectionPath);
                    buckets = new Bucket[cepBucketsCollection.getChildCount()];
                    int bucketCount = 0;
                    for (String bucketName : cepBucketsCollection.getChildren()) {
View Full Code Here


        try {
            Registry registry = CEPServiceValueHolder.getInstance().getRegistry(tenantId);

            String parentCollectionPath = CEPConstants.CEP_CONF_ELE_CEP_BUCKETS + CEPConstants.CEP_REGISTRY_BS + bucket.getName();
            if (registry.resourceExists(parentCollectionPath) == true) {
                return;
            }
            registry.put(parentCollectionPath, registry.newCollection());

            Resource bucketProperties = registry.newResource();
View Full Code Here

    public static void modifyBucketInRegistry(Bucket bucket, int tenantId) throws CEPConfigurationException {
        try {
            Registry registry = CEPServiceValueHolder.getInstance().getRegistry(tenantId);

            String parentCollectionPath = CEPConstants.CEP_CONF_ELE_CEP_BUCKETS + CEPConstants.CEP_REGISTRY_BS + bucket.getName();
            if (registry.resourceExists(parentCollectionPath)) {
                registry.put(parentCollectionPath, registry.newCollection());

                Resource bucketProperties = registry.newResource();
                bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_NAME, bucket.getName());
                bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_DESCRIPTION, bucket.getDescription());
View Full Code Here

                bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_DESCRIPTION, bucket.getDescription());
                bucketProperties.addProperty(CEPConstants.CEP_CONF_ELE_CEP_ENGINE_PROVIDER, bucket.getEngineProvider());
//               registry.put(parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_PROPERTIES, bucketProperties);

                String inputsCollectionPath = parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_INPUTS;
                if (!registry.resourceExists(inputsCollectionPath)) {
                    registry.put(inputsCollectionPath, registry.newCollection());
                }
                for (Input input : bucket.getInputs()) {
                    String inputResourcePath = inputsCollectionPath + "/" + input.getTopic();
View Full Code Here

                            registry.put(mappingPath + CEPConstants.CEP_REGISTRY_PROPERTIES + CEPConstants.CEP_REGISTRY_BS + property.getName(), propertyResource);
                        }
                    }
                }
                String queriesCollectionPath = parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_QUERIES;
                if (registry.resourceExists(queriesCollectionPath)) {
                    registry.put(queriesCollectionPath, registry.newCollection());
                }
                for (Query query : bucket.getQueries()) {
                    String queryPath = queriesCollectionPath + "/" + query.getName();
                    registry.put(queryPath, registry.newCollection());
View Full Code Here

        String parentCollectionPath = CEPConstants.CEP_CONF_ELE_CEP_BUCKETS + CEPConstants.CEP_REGISTRY_BS + bucketName;
        String queriesCollectionPath = parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_QUERIES;
        String queryPath = queriesCollectionPath + "/" + queryName;
        try {
            Registry registry = CEPServiceValueHolder.getInstance().getRegistry(tenantId);
            if (registry.resourceExists(queryPath)) {
                registry.delete(queryPath);
            }
        } catch (RegistryException e) {
            String errorMessage = "Error in deleting the query to be deleted ";
            log.error(errorMessage, e);
View Full Code Here

        String parentCollectionPath = CEPConstants.CEP_CONF_ELE_CEP_BUCKETS + CEPConstants.CEP_REGISTRY_BS + bucketName;
        String inputsCollectionPath = parentCollectionPath + CEPConstants.CEP_REGISTRY_BS + CEPConstants.CEP_REGISTRY_INPUTS;
        String inputPath = inputsCollectionPath + "/" + inputTopic;
        try {
            Registry registry = CEPServiceValueHolder.getInstance().getRegistry(tenantId);
            if (registry.resourceExists(inputPath)) {
                registry.delete(inputPath);
            }
        } catch (RegistryException e) {
            String errorMessage = "Error in deleting the input to be deleted ";
            log.error(errorMessage, e);
View Full Code Here

        boolean success = false;
        try {
            registry.beginTransaction();

            String secretKeyPath = EMAIL_VERIFICATION_COLLECTION + "/" + secretKey;
            if (!registry.resourceExists(secretKeyPath)) {
                String msg = "Email verification failed.";
                log.error(msg);
                throw new Exception(msg);
            }
            Resource resource = registry.get(secretKeyPath);
View Full Code Here

                if (!scenarioId.equals(SecurityConstants.SCENARIO_DISABLE_SECURITY) &&
                        !scenarioId.equals(SecurityConstants.POLICY_FROM_REG_SCENARIO)) {
                    Resource scenarioResource = new ResourceImpl();
                    scenarioResource.setContentStream(
                            bundleContext.getBundle().getResource(scenarioId + "-policy.xml").openStream());
                    if (!registry.resourceExists(resourceUri)) {
                        registry.put(resourceUri, scenarioResource);
                    }
                }

            }
View Full Code Here

                String policyResourcePath = servicePath + RegistryResources.POLICIES;
                int tenantID = SuperTenantCarbonContext.getCurrentContext(axisService).getTenantId();
                Registry registry = SecurityServiceHolder.getRegistryService()
                        .getConfigSystemRegistry(tenantID);
                if (!registry.resourceExists(policyResourcePath)) {
                    // do nothing, because no policy
                    return;
                }

                Collection coll = (Collection) registry.get(policyResourcePath);
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.