Package org.wso2.carbon.registry.api

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


        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

            String dashboardConfigFile = dashboardDiskRoot + File.separator + "dashboard.xml";
            String gadgetsDiskLocation = dashboardDiskRoot + File.separator + "gadgets";

            // Check whether the system dasboard is already available if not populate
            Registry registry = DashboardPopulatorContext.getRegistry();
            if (!registry.resourceExists(REGISTRY_SYSTEM_DASHBOARDS_ROOT)) {

                // Creating an OMElement from file
                File dashboardConfigXml = new File(dashboardConfigFile);

                if (dashboardConfigXml.exists()) {
View Full Code Here

        try {
            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                registry.beginTransaction();
            }
            if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
                Collection kstores = registry.newCollection();
                registry.put(SecurityConstants.KEY_STORES, kstores);

                Resource primResource = registry.newResource();
                if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
View Full Code Here

                            "'. Giving up.");
                }
            }

            // Check whether Gadgets are stored. If not store
            if (!registry.resourceExists(GadgetPopulator.SYSTEM_GADGETS_PATH)) {

                File gadgetsDir = new File(gadgetsDiskLocation);
                if (gadgetsDir.exists()) {
                    GadgetPopulator.beginFileTansfer(gadgetsDir);
View Full Code Here

            if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
                Collection kstores = registry.newCollection();
                registry.put(SecurityConstants.KEY_STORES, kstores);

                Resource primResource = registry.newResource();
                if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
                    registry.put(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE,
                                 primResource);
                }
            }
            if (!transactionStarted) {
View Full Code Here

            Registry registry = SecurityServiceHolder.getRegistryService().getConfigSystemRegistry(tenantID);
            String servicePath = RegistryResources.SERVICE_GROUPS
                    + service.getAxisServiceGroup().getServiceGroupName()
                    + RegistryResources.SERVICES + service.getName();
            Resource serviceResource = null;
            if (registry.resourceExists(servicePath)) {
                serviceResource = registry.get(servicePath);
            } else {
                return InvocationResponse.CONTINUE;
            }
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.