Examples of newCollection()


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

            // Set queue properties
            Collection queue = null;
            String queueID = CommonsUtil.getQueueID(queueName);

            if (!registry.resourceExists(queueID)) { // Create queue
                queue = registry.newCollection();

                queue.setProperty(OWNER, owner);
                queue.setProperty(NAME, queueName);
                queue.setProperty(CREATED_TIME, ConverterUtil.convertToString(
                        Calendar.getInstance()));
View Full Code Here

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

            // Add new subscription and set properties
            Collection subscription = null;
            String subscriptionID = CommonsUtil.getSubscriptionID(topic, subscriptionName);

            if (!registry.resourceExists(subscriptionID)) {
                subscription = registry.newCollection();
            } else {
                subscription = (Collection)registry.get(subscriptionID);
            }

            subscription.setProperty(OWNER, owner);
View Full Code Here

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

        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

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

        try {
            UserRegistry userRegistry = Utils.getUserRegistry();
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH)) {
                userRegistry.put(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH,
                                 userRegistry.newCollection());
            }
        } catch (RegistryException e) {
            throw new MessageBoxException("Can not access the user registry ", e);
        }
    }
View Full Code Here

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

        // here we need to store the message boxes with the user
        try {
            UserRegistry userRegistry = Utils.getUserRegistry();
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH)) {
                userRegistry.put(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH,
                                 userRegistry.newCollection());
            }
            Collection collection = userRegistry.newCollection();
            collection.setProperty(MessageBoxConstants.MB_PROPERYY_VISIBILITY_TIMEOUT,
                                   String.valueOf(visibilityTimeout));
View Full Code Here

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

            UserRegistry userRegistry = Utils.getUserRegistry();
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH)) {
                userRegistry.put(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH,
                                 userRegistry.newCollection());
            }
            Collection collection = userRegistry.newCollection();
            collection.setProperty(MessageBoxConstants.MB_PROPERYY_VISIBILITY_TIMEOUT,
                                   String.valueOf(visibilityTimeout));

            collection.setProperty(MessageBoxConstants.SQS_QUEUE_ATTRIBUTE_CREATED_TIMESTAMP,
                                   Long.toString(System.currentTimeMillis()));
View Full Code Here

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

            UserRegistry userRegistry =
                    MessageBoxServiceValueHolder.getInstance().getRegistryService().getGovernanceSystemRegistry(
                            SuperTenantCarbonContext.getCurrentContext(configurationContext).getTenantId());
            if (!userRegistry.resourceExists(MessageBoxConstants.MB_MESSAGE_BOX_STORAGE_PATH)) {
                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());
            }
View Full Code Here

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

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

        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

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

            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
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.