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

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


            if (registry.resourceExists(resourcePath)) {
                paramResource = registry.get(resourcePath);
                paramResource.setContent("<parameter name=\"" + paramName + "\" locked=\"false\">" + paramValue + "</parameter>");
                registry.put(resourcePath, paramResource);
            } else {
                paramResource = registry.newResource();
                paramResource.setContent("<parameter name=\"" + paramName + "\" locked=\"false\">" + paramValue + "</parameter>");
                paramResource.addProperty(RegistryResources.NAME, paramName);
                registry.put(resourcePath, paramResource);
            }
View Full Code Here


            String resourcePath = moduleResourcePath + RegistryResources.POLICIES + sandeshaPolicy.getId();
            Resource policyResource = null;
            if (registry.resourceExists(resourcePath)) {
                policyResource = registry.get(resourcePath);
            } else {
                policyResource = registry.newResource();
                policyResource.setProperty(RegistryResources.ServiceProperties.POLICY_TYPE,
                        String.valueOf(PolicyInclude.SERVICE_POLICY));
                policyResource.setProperty(RegistryResources.ServiceProperties.POLICY_UUID, "RMPolicy");
            }
View Full Code Here

            String secretKey = UUID.randomUUID().toString();

            // The password reset request hasn't been verified by the tenant yet.
            // Hence using the super tenant registry instance
            Registry registry = Util.getConfigSystemRegistry(0);
            Resource resource = registry.newResource();
            // store the redirector url
            resource.setProperty("redirectPath", serviceConfig.getRedirectPath());
            // store the user data, redirectPath can be overwritten here.
            for (String s : data.keySet()) {
                resource.setProperty(s, data.get(s));
View Full Code Here

                byte[] uuidBytes = (byte[])resource.getContent();
                uuid = new String(uuidBytes);
            }
            if (uuid == null) {
                uuid = UUIDGenerator.generateUUID();
                Resource resource = systemRegistry.newResource();
                resource.setContent(uuid);
                systemRegistry.put(instIdPath, resource);
            }
            isSuccess = true;
        }
View Full Code Here

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

            Set<String> actions = accessValidation.getActions();
            for (String action : actions) {
                boolean blockAction = accessValidation.isTenantBlocked(action);
View Full Code Here

            systemRegistry = EventingServiceComponent.getRegistry();

            systemRegistry.beginTransaction();

            if (!systemRegistry.resourceExists(SUBSCRIBERS_PATH)) {
                resource = systemRegistry.newResource();
                resource.setContent(getDefaultSubcribers().toString());
                systemRegistry.put(SUBSCRIBERS_PATH, resource);
            }

            if (!systemRegistry.resourceExists(SUBSCRIBER_STORES_PATH)) {
View Full Code Here

                resource.setContent(getDefaultSubcribers().toString());
                systemRegistry.put(SUBSCRIBERS_PATH, resource);
            }

            if (!systemRegistry.resourceExists(SUBSCRIBER_STORES_PATH)) {
                resource = systemRegistry.newResource();
                resource.setContent(getDefaultSubcriberStores().toString());
                systemRegistry.put(SUBSCRIBER_STORES_PATH, resource);
            }

            if (!systemRegistry.resourceExists(FILTERS_PATH)) {
View Full Code Here

                resource.setContent(getDefaultSubcriberStores().toString());
                systemRegistry.put(SUBSCRIBER_STORES_PATH, resource);
            }

            if (!systemRegistry.resourceExists(FILTERS_PATH)) {
                resource = systemRegistry.newResource();
                resource.setContent(getDefaultFilters().toString());
                systemRegistry.put(FILTERS_PATH, resource);
            }

            if (!systemRegistry.resourceExists(PROTOCOL_PATH)) {
View Full Code Here

                resource.setContent(getDefaultFilters().toString());
                systemRegistry.put(FILTERS_PATH, resource);
            }

            if (!systemRegistry.resourceExists(PROTOCOL_PATH)) {
                resource = systemRegistry.newResource();
                resource.setContent(getDefaultProtocols().toString());
                systemRegistry.put(PROTOCOL_PATH, resource);
            }

            systemRegistry.commitTransaction();
View Full Code Here

            byte[] imageBytes = CarbonUtils.getBytesFromFile(tempFile);

            // saving the image
            Registry superTenantRegistry = TenantMgtServiceComponent.getConfigSystemRegistry(
                    MultitenantConstants.SUPER_TENANT_ID);
            Resource imageResource = superTenantRegistry.newResource();
            imageResource.setContent(imageBytes);
            superTenantRegistry.put(imagePath, imageResource);


            // prepare the captcha info bean
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.