Package org.wso2.carbon.registry.api

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


            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

        String accessKeyId = null;
        String secretAccessKeyId = null;
        Collection userCollection;
        try {
            if (registry.resourceExists(RegistryConstants.PROFILES_PATH + userName)) {
                userCollection = (Collection) registry.get(RegistryConstants.PROFILES_PATH + userName);
                accessKeyId = userCollection.getProperty(MessageBoxConstants.ACCESS_KEY_ID);
                secretAccessKeyId = userCollection.getProperty(MessageBoxConstants.SECRET_ACCESS_KEY_ID);
            }
View Full Code Here

                accessKeyId = userCollection.getProperty(MessageBoxConstants.ACCESS_KEY_ID);
                secretAccessKeyId = userCollection.getProperty(MessageBoxConstants.SECRET_ACCESS_KEY_ID);
            }

            if (accessKeyId == null || secretAccessKeyId == null ||
                (!registry.resourceExists(RegistryConstants.PROFILES_PATH + userName))) {

                // generate keys
                accessKeyId = UUID.randomUUID().toString();
                secretAccessKeyId = UUID.fromString(accessKeyId).toString().
                        concat(UUID.randomUUID().toString()).replaceAll("-", "").substring(24);
View Full Code Here

                registry.put(RegistryConstants.PROFILES_PATH + userName, userCollection);


                // store user/access key in registry
                String accessKeyIndexPath = MessageBoxConstants.REGISTRY_ACCESS_KEY_INDEX_PATH;
                if (!registry.resourceExists(accessKeyIndexPath)) {
                    userCollection = registry.newCollection();
                    registry.put(accessKeyIndexPath, userCollection);
                }
                userCollection = (Collection) registry.get(accessKeyIndexPath);
                userCollection.addProperty(accessKeyId, userName);
View Full Code Here

            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

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.