Package org.wso2.carbon.registry.core

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


        } catch (RegistryException e) {
           log.error("Error in getting registry for the tenant :" + tenantId ,e);
            throw new BMConfigurationException("Error in getting registry for the tenant :"+tenantId ,e);
        }
        try {
            brokerResource = registry.newResource();
            Map<String, String> propertyMap = brokerConfiguration.getProperties();
            brokerResource.addProperty("name", brokerConfiguration.getName());
            brokerResource.addProperty("type", brokerConfiguration.getType());
            for (Map.Entry<String, String> entry : propertyMap.entrySet()) {
                brokerResource.addProperty(entry.getKey(), entry.getValue());
View Full Code Here


    }

    private void populateConnectionProperties() throws Exception {
        RegistryService registryService = dataHolder.getRegistryService();
        Registry registry = registryService.getConfigSystemRegistry();
        Resource resource = registry.newResource();
        String contextRoot = serverConfigContext.getContextRoot();
        String servicePath = serverConfigContext.getServicePath();
        resource.setProperty("service-path", servicePath);
        resource.setProperty("bundleContext-root", contextRoot);
        String requestIP =
View Full Code Here

    }

    protected void setPermissionUpdateTimestamp() throws RegistryException {
        checkAdminService();
        Registry registry = getGovernanceSystemRegistry();
        Resource resource = registry.newResource();
        resource.setProperty("timestamp", Long.toString(System.currentTimeMillis()));
        registry.put("/repository/components/org.wso2.carbon.user.mgt/updatedTime", resource);
    }

    private void checkAdminService() {
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

            Resource policyResource;
            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,
                        RM_POLICY_ID);
            }
View Full Code Here

        try {
            Resource gadget;
            try {
                gadget = registry.get(location);
            } catch (RegistryException e) {
                gadget = registry.newResource();
            }
            gadget.setContent(content.getBytes());
            registry.put(location, gadget);           
        } catch (Exception e) {
            if (e instanceof RegistryException) {
View Full Code Here

                    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

                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

    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

        RealmConfiguration realmConfig = ctx.getRealmService().getBootstrapRealmConfiguration();
        // first we will fill the user store for tenant 0
        UserRegistry registry1 =
                embeddedRegistryService.getUserRegistry(realmConfig.getAdminUserName(), 0);

        Resource r = registry1.newResource();
        registry1.put("/test2", r);

        UserRealm userRealm1 = registry1.getUserRealm();
        UserStoreManager userStoreManager1;
        try {
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.