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

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


        try {
            UserRegistry registry = registryService.getGovernanceSystemRegistry(MultitenantConstants.
                    SUPER_TENANT_ID);
            Collection policyResourceCollection = registry.newCollection();
            registry.put(resourcePath, policyResourceCollection);
            if(!registry.resourceExists(resourcePath + "ruleCombiningAlgorithms")){

                Resource ruleCombiningAlgorithm  = registry.newResource();
                String ruleCombiningAlgorithms =
                    "deny-overrides\n" +
                    "permit-overrides\n" +
View Full Code Here


                InputStream inputStream = new ByteArrayInputStream(ruleCombiningAlgorithms.getBytes());
                ruleCombiningAlgorithm.setContent(inputStream);
                registry.put(resourcePath + "ruleCombiningAlgorithms" , ruleCombiningAlgorithm);
            }

            if(!registry.resourceExists(resourcePath + "policyCombiningAlgorithms")){
                Resource policyCombiningAlgorithm  = registry.newResource();
                String policyCombiningAlgorithms =
                    "deny-overrides\n" +
                    "permit-overrides\n" +
                    "first-applicable\n" +
View Full Code Here

                InputStream inputStream = new ByteArrayInputStream(policyCombiningAlgorithms.getBytes());
                policyCombiningAlgorithm.setContent(inputStream);
                registry.put(resourcePath + "policyCombiningAlgorithms" , policyCombiningAlgorithm);
            }

            if(!registry.resourceExists(resourcePath + "globalPolicyCombiningAlgorithm")){
                Resource globalPolicyCombiningAlgorithm  = registry.newResource();
                globalPolicyCombiningAlgorithm.setProperty("globalPolicyCombiningAlgorithm", "deny-overrides" );
                registry.put(resourcePath + "globalPolicyCombiningAlgorithm" , globalPolicyCombiningAlgorithm);
            }           
                     
View Full Code Here

                Resource globalPolicyCombiningAlgorithm  = registry.newResource();
                globalPolicyCombiningAlgorithm.setProperty("globalPolicyCombiningAlgorithm", "deny-overrides" );
                registry.put(resourcePath + "globalPolicyCombiningAlgorithm" , globalPolicyCombiningAlgorithm);
            }           
                     
            if(!registry.resourceExists(resourcePath + "functionId")){

                Resource functionId = registry.newResource();
                String functionIds =
                "urn:oasis:names:tc:xacml:1.0:function:string-equal\n" +
                "urn:oasis:names:tc:xacml:1.0:function:string-intersection\n" +
View Full Code Here

                }
                ((JDBCAuthorizationManager) authzManager).populatePermissionTreeFromDB();
            }
            UserRegistry registry = registryService.getGovernanceSystemRegistry(tenantId);
            Long lastModifiedTime = System.currentTimeMillis();
            if (registry.resourceExists(PERM_TREE_TIMESTAMP_LOC)) {
                Resource resource = registry.get(PERM_TREE_TIMESTAMP_LOC);
                lastModifiedTime =
                        new Long(resource.getProperty(PERM_TREE_TIMESTAMP_PROP).trim());
            } else {
                Resource resource = registry.newResource();
View Full Code Here

     */
    public static boolean needsUpdating(int tenantId) throws Exception {
        RegistryService registryService = dataHolder.getRegistryService();
        UserRegistry registry = registryService.getGovernanceSystemRegistry(tenantId);

        if (!registry.resourceExists(PERM_TREE_TIMESTAMP_LOC)) {
            return false;
        }

        if (permTreeModifiedTimeStampMap.containsKey(tenantId)) {
            Resource resource = registry.get(PERM_TREE_TIMESTAMP_LOC);
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

        List<PermissionConfig> permissionConfigs = cloudServiceConfig.getPermissionConfigs();
        for (PermissionConfig permissionConfig : permissionConfigs) {
            String path = permissionConfig.getPath();
            String name = permissionConfig.getName();
            if (active) {
                if (!systemConfigRegistry.resourceExists(path)) {
                    Collection collection = systemConfigRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    systemConfigRegistry.put(path, collection);
                }
            } else {
View Full Code Here

                    Collection collection = systemConfigRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    systemConfigRegistry.put(path, collection);
                }
            } else {
                if (systemConfigRegistry.resourceExists(path)) {
                    systemConfigRegistry.delete(path);
                }
            }
        }
    }
View Full Code Here

        String cloudServiceInfoPath =
                Constants.CLOUD_SERVICE_INFO_STORE_PATH + RegistryConstants.PATH_SEPARATOR +
                        tenantId + RegistryConstants.PATH_SEPARATOR + cloudServiceName;
       
        if (systemGovernanceRegistry.resourceExists(cloudServiceInfoPath)) {
            Resource cloudServiceInfoResource = systemGovernanceRegistry.get(cloudServiceInfoPath);
            String isActiveStr = cloudServiceInfoResource.getProperty(
                    Constants.CLOUD_SERVICE_IS_ACTIVE_PROP_KEY);
            return "true".equals(isActiveStr);
        }
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.