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

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


                userRegistry.put(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH,
                                 userRegistry.newCollection());
            }
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_QUEUE_STORAGE_PATH)) {
                userRegistry.put(MessageBoxConstants.MB_QUEUE_STORAGE_PATH,
                                 userRegistry.newCollection());
            }
        } catch (RegistryException e) {
            log.error("Error in setting message box storage path in tenant", e);
        }
    }
View Full Code Here


        try {
            UserRegistry userRegistry = Utils.getUserRegistry();

            //create the topic storage path if it does not exists
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_QUEUE_STORAGE_PATH)) {
                userRegistry.put(MessageBoxConstants.MB_QUEUE_STORAGE_PATH, userRegistry.newCollection());
            }

        } catch (RegistryException e) {
            throw new MessageBoxException("Can not access the registry", e);
        }
View Full Code Here

            String ownerName = CarbonContext.getCurrentContext().getUsername();

            //we add the queue only if it does not exits. if the topic exists then
            //we don't do any thing.
            if (!userRegistry.resourceExists(resourcePath)) {
                Collection collection = userRegistry.newCollection();
                collection.setProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_CREATED_TIME,
                                       ConverterUtil.convertToString(Calendar.getInstance()));
                collection.setProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_UPDATED_TIME,
                                       ConverterUtil.convertToString(Calendar.getInstance()));
                collection.setProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_CREATED_FROM,
View Full Code Here

        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());
            if (!userRegistry.resourceExists(topicStoragePath)) {
                userRegistry.put(topicStoragePath,
                                 userRegistry.newCollection());
            }
            Resource root = userRegistry.get(this.topicStoragePath);
            TopicNode rootTopic = new TopicNode("/", "/");
            buildTopicTree(rootTopic, (Collection) root, userRegistry);
            return rootTopic;
View Full Code Here

            String resourcePath = getResourcePath(topicName);

            //we add the topic only if it does not exits. if the topic exists then
            //we don't do any thing.
            if (!userRegistry.resourceExists(resourcePath)) {
                Collection collection = userRegistry.newCollection();
                userRegistry.put(resourcePath, collection);

                // Grant this user (owner) rights to update permission on newly created topic
                UserRealm userRealm = CarbonContext.getCurrentContext().getUserRealm();
View Full Code Here

        //TODO Needs to clearly identify the required data to put as registry resources and Followings are Sample resources which must be modified or removed
        String resourcePath = IdentityRegistryResources.ENTITLEMENT_POLICY_RESOURCES;
        try {
            UserRegistry registry = registryService.getGovernanceSystemRegistry(MultitenantConstants.
                    SUPER_TENANT_ID);
            Collection policyResourceCollection = registry.newCollection();
            registry.put(resourcePath, policyResourceCollection);
            if(!registry.resourceExists(resourcePath + "ruleCombiningAlgorithms")){

                Resource ruleCombiningAlgorithm  = registry.newResource();
                String ruleCombiningAlgorithms =
View Full Code Here

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

        UserRealm adminRealm = adminRegistry.getUserRealm();

        Resource r1 = adminRegistry.newCollection();

        String r2Content = "R1";
        Resource r2 = adminRegistry.newResource();
        r2.setContent(r2Content.getBytes());
View Full Code Here

        for (PermissionConfig permissionConfig : permissionConfigs) {
            String path = permissionConfig.getPath();
            String name = permissionConfig.getName();
            if (active) {
                if (!systemConfigRegistry.resourceExists(path)) {
                    Collection collection = systemConfigRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    systemConfigRegistry.put(path, collection);
                }
            } else {
                if (systemConfigRegistry.resourceExists(path)) {
View Full Code Here

        for (PermissionConfig permissionConfig : permissionConfigs) {
            String path = permissionConfig.getPath();
            String name = permissionConfig.getName();
            if (active) {
                if (!configRegistry.resourceExists(path)) {
                    Collection collection = configRegistry.newCollection();
                    collection.setProperty(UserMgtConstants.DISPLAY_NAME, name);
                    configRegistry.put(path, collection);
                }
            } else {
                if (configRegistry.resourceExists(path)) {
View Full Code Here

        // check if the resource is available, else create it
        if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
            synchronized (RegistryManager.class) {
                try {
                    if (!tenantGovRegistry.resourceExists(STRATOS_MANAGER_REOSURCE)) {
                        tenantGovRegistry.put(STRATOS_MANAGER_REOSURCE, tenantGovRegistry.newCollection());
                    }
                } catch (RegistryException e) {
                    String errorMsg = "Failed to create the registry resource " + STRATOS_MANAGER_REOSURCE;
                    log.error(errorMsg, e);
                    throw e;
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.