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

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


            String dashboardConfigFile = dashboardDiskRoot + File.separator + "dashboard.xml";
            String gadgetsDiskLocation = dashboardDiskRoot + File.separator + "gadgets";

            // Check whether the system dasboard is already available if not populate
            Registry registry = DashboardPopulatorContext.getRegistry();
            if (!registry.resourceExists(REGISTRY_SYSTEM_DASHBOARDS_ROOT)) {

                // Creating an OMElement from file
                File dashboardConfigXml = new File(dashboardConfigFile);

                if (dashboardConfigXml.exists()) {
View Full Code Here


        try {
            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                registry.beginTransaction();
            }
            if (!registry.resourceExists(SecurityConstants.KEY_STORES)) {
                Collection kstores = registry.newCollection();
                registry.put(SecurityConstants.KEY_STORES, kstores);

                Resource primResource = registry.newResource();
                if (!registry.resourceExists(RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE)) {
View Full Code Here

            if (serverName.length() > 0) {
                gadgetsPath = SYSTEM_GADGETS_PATH + "/" + serverPrefix;
            }*/

            if (!registry.resourceExists(REGISTRY_SYSTEM_DASHBOARDS_ROOT + "/" + serverName)) {
                // Creating an OMElement from file
                File dashboardConfigXml = new File(dashboardConfigFile);

                if (dashboardConfigXml.exists()) {
                    FileReader dashboardConfigXmlReader = new FileReader(dashboardConfigXml);
View Full Code Here

        String keyStoreLocation = SecurityConstants.KEY_STORES + "/" + keyStoreName;
        boolean isKeyStoreExisting = false;
        try {
            UserRegistry govRegistry = IdentityProviderServiceComponent.getRegistryService().
                    getGovernanceSystemRegistry();
            if(govRegistry.resourceExists(keyStoreLocation)){
                isKeyStoreExisting = true;
            }
        } catch (RegistryException e) {
            String errorMsg = "Error when checking the existence of " + keyStorePath + " in the Governance" +
                              "Registry.";
View Full Code Here

        int tenantId = ((UserRegistry)registry).getTenantId();
        UserRegistry govRegistry = SecurityServiceHolder.getRegistryService().
                getGovernanceSystemRegistry(tenantId);
        try {
            KeyStoreManager keyMan = KeyStoreManager.getInstance(govRegistry);
            if (govRegistry.resourceExists(SecurityConstants.KEY_STORES)) {
                Collection collection = (Collection) govRegistry.get(SecurityConstants.KEY_STORES);
                String[] ks = collection.getChildren();

                for (int i = 0; i < ks.length; i++) {
View Full Code Here

            if (log.isTraceEnabled()) {
                log.trace("Creating system collections used in WSO2 Registry server.");
            }

            if (!systemRegistry.resourceExists("/system")) {

                try {
                    boolean inTransaction = Transaction.isStarted();
                    if (!inTransaction) {
                        systemRegistry.beginTransaction();
View Full Code Here

            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

        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

                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

            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

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.