Package org.wso2.carbon.registry.core

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


     */
    public void removeConfigurationFromRegistry(String name, int tenantId) throws BMConfigurationException{
        String pathToBroker = BROKER_BASE + "/" + name;
        try {
            Registry registry = RegistryHolder.getInstance().getRegistry(tenantId);
            if (registry.resourceExists(pathToBroker)) {
                registry.delete(pathToBroker);
                if (log.isInfoEnabled()) {
                    log.info("Broker configuration with name " + name + " successfully removed from registry.");
                }
            } else {
View Full Code Here


        try {
            // remove collections
            List<RegistryConfig.Collection> collections = registryConfig.getCollections();
            for (RegistryConfig.Collection col : collections) {
                Registry reg = getRegistryInstance(col.getRegistryType());
                if (reg != null && reg.resourceExists(col.getPath())) {
                    reg.delete(col.getPath());
                }
            }
            // remove resources
            List<RegistryConfig.Resourse> resources = registryConfig.getResources();
View Full Code Here

            }
            // remove resources
            List<RegistryConfig.Resourse> resources = registryConfig.getResources();
            for (RegistryConfig.Resourse res : resources) {
                Registry reg  = getRegistryInstance(res.getRegistryType());
                if (reg != null && reg.resourceExists(res.getPath())) {
                    reg.delete(AppDeployerUtils.computeResourcePath(res.getPath(),
                            res.getFileName()));
                }
            }
            // remove associations
View Full Code Here

            // we have to get the stored query without checking the user permissions.
            // all query actions are blocked for all users. they are allowed to read the
            // queries, only when executing them.
            if (path != null) {
                String purePath = RegistryUtils.getPureResourcePath(path);
                if (systemRegistry.resourceExists(purePath)) {
                    query = systemRegistry.get(purePath);
                    // If no media type was specified, the query should not work at all.
                    // This is also used in the remote registry scenario, where we send '/' as the
                    // query path, when path is null.
                    if (query != null && (query.getMediaType() == null ||
View Full Code Here

            accessValidation = new ThrottlingAccessValidation();
            throttlingDataContext.setAccessValidation(accessValidation);
        }
        try {
            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();
            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
                Resource tenantValidationInfoResource =
                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
                Properties properties = tenantValidationInfoResource.getProperties();
                Set<String> actions = MeteringAccessValidationUtils.getAvailableActions(properties);
View Full Code Here

        ThrottlingAccessValidation accessValidation = throttlingDataContext.getAccessValidation();
        try {
            Registry governanceSystemRegistry = Util.getSuperTenantGovernanceSystemRegistry();

            Resource tenantValidationInfoResource;
            if (governanceSystemRegistry.resourceExists(tenantValidationInfoResourcePath)) {
                tenantValidationInfoResource =
                        governanceSystemRegistry.get(tenantValidationInfoResourcePath);
            } else {
                tenantValidationInfoResource = governanceSystemRegistry.newResource();
            }
View Full Code Here

                systemRegistry.getUserRealm());
    }

    public static String[] getAvailableThemes() throws RegistryException {
        Registry systemRegistry = registryService.getGovernanceSystemRegistry();
        if (!systemRegistry.resourceExists(StratosConstants.ALL_THEMES_PATH)) {
            log.info("The theme root path: " + StratosConstants.ALL_THEMES_PATH + " doesn't exist.");
            return new String[0];
        }
        Collection c = (Collection)systemRegistry.get(StratosConstants.ALL_THEMES_PATH);
        String[] childPaths = c.getChildren();
View Full Code Here

                baseString = baseString + "&Signature:=" + signature;

                Registry registry = registryService.getConfigSystemRegistry(tenantId);
                String path = RegistryConstants.PROFILES_PATH + username;
                Collection profile = null;
                if (!registry.resourceExists(path)) {
                    profile = registry.newCollection();
                    registry.put(path, profile);
                } else {
                    profile = (Collection) registry.get(path);
                }
View Full Code Here

        Registry registry = getConfigSystemRegistry();
        try {
            registry.removeAssociation(servicePath, getModuleResourcePath(mercuryModule),
                    RegistryResources.Associations.ENGAGED_MODULES);
            String policyPath = servicePath + RegistryResources.POLICIES + RM_POLICY_ID;
            if (registry.resourceExists(policyPath)) {
                registry.delete(policyPath);
            }

        } catch (RegistryException e) {
            log.error("Error ocurred in disengaging the module ", e);
View Full Code Here

        try {
            String resourcePath = serviceResourcePath + RegistryResources.POLICIES +
                    RM_POLICY_ID;

            Resource policyResource;
            if (registry.resourceExists(resourcePath)) {
                policyResource = registry.get(resourcePath);
            } else {
                policyResource = registry.newResource();
                policyResource.setProperty(RegistryResources.ServiceProperties.POLICY_TYPE,
                        String.valueOf(PolicyInclude.SERVICE_POLICY));
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.