Package org.wso2.carbon.registry.core

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


                                         RegistryConstants.PATH_SEPARATOR +
                                         StratosConstants.VALIDATION_KEY_RESOURCE_NAME;

        // we have to reset the domain validation key everytime
        String domainValidationKey = UUIDGenerator.generateUUID();
        Resource resource = governanceSystemRegistry.newResource();
        resource.setContent(domainValidationKey);
        ((ResourceImpl) resource).setVersionableChange(false);
        governanceSystemRegistry.put(domainValidatorInfoPath, resource);
        CommonUtil.setAnonAuthorization(RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH +
                                        domainValidatorInfoPath,
View Full Code Here


            for (String operation : permissionLabel.getOperations()) {
                operationsString.append(operation);
                operationsString.append(MessageBoxConstants.JMS_MESSAGE_SHARED_USER_OPERATION_SEPARATOR);
            }
            UserRegistry userRegistry = Utils.getUserRegistry();
            Resource permissionResource = userRegistry.newResource();
            permissionResource.addProperty(MessageBoxConstants.MB_REGISTRY_PROPERTY_SHARED_USERS,
                                           sharedUsersString.toString());
            permissionResource.addProperty(MessageBoxConstants.MB_REGISTRY_PROPERTY_OPERATIONS,
                                           operationsString.toString());
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

                                       RegistryConstants.PATH_SEPARATOR + tenantId;
        try {
            if (superTenantGovernanceSystemRegistry.resourceExists(emailVerificationPath)) {
                resource = superTenantGovernanceSystemRegistry.get(emailVerificationPath);
            } else {
                resource = superTenantGovernanceSystemRegistry.newResource();
            }
            resource.setContent(confirmationKey);
        } catch (RegistryException e) {
            String msg = "Error in creating the resource or getting the resource" +
                         "from the email verification path";
View Full Code Here

                                     RegistryConstants.PATH_SEPARATOR + tenantId;

        if (superTenantGovernanceSystemRegistry.resourceExists(adminManagementPath)) {
            resource = superTenantGovernanceSystemRegistry.get(adminManagementPath);
        } else {
            resource = superTenantGovernanceSystemRegistry.newResource();
        }
        resource.setContent(confirmationKey);
        superTenantGovernanceSystemRegistry.put(adminManagementPath, resource);

        // data map
View Full Code Here

                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" +
                "urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of\n" +
                "urn:oasis:names:tc:xacml:1.0:function:string-union\n" +
View Full Code Here

                registry.put(resourcePath + "functionId" , functionId);
            }

            if (!registry.resourceExists(resourcePath + "matchId")){

                Resource matchId = registry.newResource();
                String matchIds =
                "urn:oasis:names:tc:xacml:1.0:function:string-equal\n" +
                "urn:oasis:names:tc:xacml:1.0:function:integer-equal\n" +
                "urn:oasis:names:tc:xacml:1.0:function:double-equal\n" +
                "urn:oasis:names:tc:xacml:1.0:function:date-equal\n" +
View Full Code Here

                matchId.setContent(inputStream);
                registry.put(resourcePath + "matchId" , matchId);
            }
            if(!registry.resourceExists(resourcePath + "dataType")) {

                Resource dataType = registry.newResource();
                String dataTypes =
                    "http://www.w3.org/2001/XMLSchema#string\n" +
                    "http://www.w3.org/2001/XMLSchema#boolean\n" +
                    "http://www.w3.org/2001/XMLSchema#integer\n" +
                    "http://www.w3.org/2001/XMLSchema#double\n" +
View Full Code Here

                dataType.setContent(inputStream);
                registry.put(resourcePath + "dataType" , dataType);
            }

            if(!registry.resourceExists(resourcePath + "mustBePresent")) {
                Resource mustBePresent = registry.newResource();
                String mustBePresents =
                        "true\n" +
                        "false";
                InputStream inputStream = new ByteArrayInputStream(mustBePresents.getBytes());
                mustBePresent.setContent(inputStream);
View Full Code Here

                mustBePresent.setContent(inputStream);
                registry.put(resourcePath + "mustBePresent" , mustBePresent);
            }

            if(!registry.resourceExists(resourcePath + "ruleEffect")) {
                Resource ruleEffect = registry.newResource();
                String ruleEffects =
                        "Permit\n" +
                        "Deny";
                InputStream inputStream = new ByteArrayInputStream(ruleEffects.getBytes());
                ruleEffect.setContent(inputStream);
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.