Package org.wso2.carbon.registry.core

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


                    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" +
                    "first-applicable\n";
                InputStream inputStream = new ByteArrayInputStream(ruleCombiningAlgorithms.getBytes());
View Full Code Here


                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" +
                    "ordered-deny-overrides\n"+
View Full Code Here

                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);
            }           
                     
            if(!registry.resourceExists(resourcePath + "functionId")){
View Full Code Here

            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();
                resource.setProperty(PERM_TREE_TIMESTAMP_PROP,
                                     String.valueOf(lastModifiedTime));
                registry.put(PERM_TREE_TIMESTAMP_LOC, resource);

            }
View Full Code Here

        UserRealm adminRealm = adminRegistry.getUserRealm();

        Resource r1 = adminRegistry.newCollection();

        String r2Content = "R1";
        Resource r2 = adminRegistry.newResource();
        r2.setContent(r2Content.getBytes());

        try {
            adminRegistry.put("/r1", r1);
            adminRegistry.put("/r1/r2", r2);
View Full Code Here

        UserRegistry adminRegistry = embeddedRegistryService.getUserRegistry(
                realmConfig.getAdminUserName(), realmConfig.getAdminPassword());
        UserRealm adminRealm = adminRegistry.getUserRealm();

        String r1Content = "R1";
        Resource r1 = adminRegistry.newResource();
        r1.setContent(r1Content.getBytes());

        try {
            adminRegistry.put("/r1", r1);
        } catch (RegistryException e) {
View Full Code Here

        // first we generate a UUID
        UserRegistry systemRegistry =
                TenantMgtServiceComponent.getRegistryService().getGovernanceSystemRegistry();
        String uuid = UUIDGenerator.generateUUID();
        // store it in the registry.
        Resource resource = systemRegistry.newResource();
        String tenantIdStr = Integer.toString(tenantId);
        resource.setProperty(MultitenantConstants.TENANT_ID, tenantIdStr);
        String uuidPath = StratosConstants.TENANT_CREATION_THEME_PAGE_TOKEN
                          + RegistryConstants.PATH_SEPARATOR + uuid;
        systemRegistry.put(uuidPath, resource);
View Full Code Here

                String filename = file.getName();
                String fileRegistryPath = Constants.CLOUD_SERVICE_ICONS_STORE_PATH +
                                RegistryConstants.PATH_SEPARATOR + filename;

                // Add the file to registry
                Resource newResource = registry.newResource();
                String mediaType = null;
                if (filename.contains(".")) {
                    String fileExt = filename.substring(filename.lastIndexOf(".") + 1);
                    mediaType = extensionToMediaTypeMap.get(fileExt.toLowerCase());
                }
View Full Code Here

        try {
            String domainValidationPath = StratosConstants.TENANT_DOMAIN_VERIFICATION_FLAG_PATH +
                                                  RegistryConstants.PATH_SEPARATOR + tenant.getId();
            UserRegistry superTenantRegistry = TenantMgtCoreServiceComponent.
                    getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID);
            Resource validationFlagR = superTenantRegistry.newResource();
            validationFlagR.setProperty(tenant.getDomain(), "true");
            superTenantRegistry.put(domainValidationPath, validationFlagR);

        } catch (RegistryException e) {
            String msg = "Error in storing the domain validation flag to the registry";
View Full Code Here

    }

  public static void main(String[] args) throws Exception {
    WSRegistryServiceClient client;
    client = initialize();
    Resource resource = client.newResource();
    resource.setContent("Hello Out there!");

    String resourcePath = "/abc";
    registry.put(resourcePath, resource);
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.