Examples of resourceExists()


Examples of org.wso2.carbon.registry.api.Registry.resourceExists()

            Registry reg = SuperTenantCarbonContext.getCurrentContext(
                    msgContext.getConfigurationContext()).
                    getRegistry(RegistryType.SYSTEM_GOVERNANCE);
            path = path.substring(UnifiedEndpointConstants.VIRTUAL_GOV_REG.length());
            try {
                if (reg.resourceExists(path)) {
                    Resource policyResource = reg.get(path);
                    policyDoc = PolicyEngine.getPolicy(policyResource.getContentStream());
                }
            } catch (RegistryException e) {
                String errMsg = "Exception while loading policy from Governance registry: " + path;
View Full Code Here

Examples of org.wso2.carbon.registry.api.Registry.resourceExists()

            Registry reg = SuperTenantCarbonContext.getCurrentContext(
                    msgContext.getConfigurationContext()).
                    getRegistry(RegistryType.SYSTEM_CONFIGURATION);
            path = path.substring(UnifiedEndpointConstants.VIRTUAL_CONF_REG.length());
            try {
                if (reg.resourceExists(path)) {
                    Resource policyResource = reg.get(path);
                    policyDoc = PolicyEngine.getPolicy(policyResource.getContentStream());
                }
            } catch (RegistryException e) {
                String errMsg = "Exception while loading policy from Configuration registry: " + path;
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

        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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

    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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

                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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

                            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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

        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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

        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

Examples of org.wso2.carbon.registry.core.Registry.resourceExists()

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