Examples of resourceExists()


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

            for (Iterator<Map.Entry<String, String>> ite = map.entrySet().iterator(); ite.hasNext();) {
                Map.Entry<String, String> entry = ite.next();
                String resourcePath = entry.getKey();
                String displayName = entry.getValue();

                if (registry.resourceExists(resourcePath)) {
                    Resource resource = registry.get(resourcePath);
                    if (resource.getProperty(UserMgtConstants.DISPLAY_NAME) == null) {
                        resource.setProperty(UserMgtConstants.DISPLAY_NAME, displayName);
                        registry.put(resourcePath, resource);
                    }
View Full Code Here

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

        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());

            //create the topic storage path if it does not exists
            if (!userRegistry.resourceExists(this.topicStoragePath)) {
                userRegistry.put(this.topicStoragePath, userRegistry.newCollection());
            }
            //allow permissions to root topic
            //put the permissions to the user store. here we create the resource name from
            //the topic storage path of the registry.
View Full Code Here

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

                userRealm.getAuthorizationManager().authorizeRole(
                        role, this.topicStoragePath, EventBrokerConstants.EB_PERMISSION_PUBLISH);

            }
            // we need to create the index here only it is not exists.
            if (!userRegistry.resourceExists(this.indexStoragePath)) {
                userRegistry.put(this.indexStoragePath, userRegistry.newResource());
            }

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

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

            userRegistry.put(resourcePath, resource);

            // add the subscription index
            String fullPath = this.indexStoragePath;
            Resource topicIndexResource;
            if(userRegistry.resourceExists(fullPath)){
                topicIndexResource = userRegistry.get(fullPath);
                topicIndexResource.addProperty(subscription.getId(), subscription.getTopicName());
            }else{
               topicIndexResource = userRegistry.newResource();
               topicIndexResource.addProperty(subscription.getId(), subscription.getTopicName());               
View Full Code Here

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

        List<Subscription> subscriptions = new ArrayList<Subscription>();

        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());
            if (userRegistry.resourceExists(this.indexStoragePath)) {
                Resource topicIndexResource = userRegistry.get(this.indexStoragePath);
                Properties savedSubscriptions = topicIndexResource.getProperties();

                Resource subscriptionResource = null;
                Subscription subscription = null;
View Full Code Here

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

    public void unSubscribe(String subscriptionID) throws EventBrokerException {
        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());
            String fullPath = this.indexStoragePath;
            if (userRegistry.resourceExists(fullPath)) {
                Resource topicIndexResource = userRegistry.get(fullPath);

                String topicName = topicIndexResource.getProperty(subscriptionID);
                // delete the subscriptions resource
                // if the registry is read only there can be situations where the the subscriptions
View Full Code Here

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

        try {
            UserRegistry userRegistry =
                    this.registryService.getGovernanceSystemRegistry(EventBrokerHolder.getInstance().getTenantId());
            String subscriptionID = null;
            if (userRegistry.resourceExists(topicResourcePath)) {
                Collection subscriptions = (Collection) userRegistry.get(topicResourcePath);
                String[] subscriptionPaths = (String[]) subscriptions.getContent();
                for (String subscriptionPath : subscriptionPaths) {
                    Resource resource = userRegistry.get(subscriptionPath);
                    Subscription subscription = JavaUtil.getSubscription(resource);
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.