Examples of newResource()


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

            List<String> serverRolesListToAdd = ServerRoleUtils.arrayToList(serverRolesArray);

            Resource resource = this.getResourceFromRegistry(configReg, regPath);
            if (resource == null) {
                try {
                    resource = configReg.newResource();
                    resource.setProperty(serverRoleType, serverRolesListToAdd);
                } catch (RegistryException e) {
                    this.handleException(e.getMessage(), e);
                }
            } else {
View Full Code Here

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

        myPrivateHandlerMatcher.setGetPattern(".*/to/my/private/handler");
        myPrivateHandlerMatcher.setPutPattern(".*/to/my/private/handler");
        handlerManager.addHandler(
                new String[] {Filter.GET, Filter.PUT} , myPrivateHandlerMatcher, myPrivateHandler);

        Resource r = adminRegistry.newResource();
        String originalContent = "original content";
        r.setContent(originalContent.getBytes());

        adminRegistry.put("/to/my/private/handler", r);
        Resource rr = adminRegistry.get("/to/my/private/handler");
View Full Code Here

Examples of org.wso2.carbon.registry.core.Registry.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

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

            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

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

            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

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

                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

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

            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

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

                    log.info("Successfully populated the default Gadgets.");
                } else {
                    log.info("Couldn't find contents at '" + gadgetsDiskLocation +
                            "'. Giving up.");
                }
                registry.put(REGISTRY_SYSTEM_DASHBOARDS_ROOT + "/" + serverName, registry.newResource());
            }

        } catch (Exception e) {
            log.debug("Failed to activate Dashboard Populator for Governance bundle ");
        }
View Full Code Here

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

                if (!scenarioId.equals(SecurityConstants.SCENARIO_DISABLE_SECURITY) &&
                        !scenarioId.equals(SecurityConstants.POLICY_FROM_REG_SCENARIO)) {
                    String resourceUri = SecurityConstants.SECURITY_POLICY + "/" + scenarioId;
                    if (!scenarioId.equals(SecurityConstants.SCENARIO_DISABLE_SECURITY) &&
                            !scenarioId.equals(SecurityConstants.POLICY_FROM_REG_SCENARIO)) {
                        Resource scenarioResource = tenantUserRegistry.newResource();
                        URL resource =
                                       IdentitySTSMgtServiceComponent.getBundleContext().
                                                                      getBundle().
                                                                      getResource(scenarioId +
                                                                                  "-policy.xml");
View Full Code Here

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

    public void testVirtualRoots() throws Exception {

        RealmConfiguration realmConfig = ctx.getRealmService().getBootstrapRealmConfiguration();
        UserRegistry registry1 =
                embeddedRegistryService.getUserRegistry(realmConfig.getAdminUserName(), 0);
        Resource r = registry1.newResource();
        registry1.put("/test", r);

        r = registry1.get("/");
        r.addProperty("name", "value");
        registry1.put("/", r);
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.