Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Resource.discard()


                    for (Association association : associations) {
                        Resource resource = configRegistry.get(association.getDestinationPath());
                        String transportProtocol = resource
                                .getProperty(RegistryResources.Transports.PROTOCOL_NAME);
                        axisService.addExposedTransport(transportProtocol);
                        resource.discard();
                    }
                }
            }
            // Activate/Deactivate service
            String serviceState = service.getProperty(RegistryResources.ServiceProperties.ACTIVE);
View Full Code Here


            configRegistry.beginTransaction();
            if (configRegistry.resourceExists(serviceResourcePath)) {
                Resource serviceResource = configRegistry.get(serviceResourcePath);
                serviceResource.setProperty(propertyName, propertyValue);
                configRegistry.put(serviceResourcePath, serviceResource);
                serviceResource.discard();
            }
            configRegistry.commitTransaction();
            if (log.isDebugEnabled()) {
                log.debug("Successfully set " + propertyName + " property for " +
                        service.getName() + "service");
View Full Code Here

                serviceParamResource
                        .addProperty(RegistryResources.ParameterProperties.VALUE, paramValue);
                serviceParamResource.setContent("<parameter name=\"" + paramName
                        + "\">" + paramValue + "</parameter>");
                configRegistry.put(serviceParamResourcePath, serviceParamResource);
                serviceParamResource.discard();
            } else {
                serviceParamResource = configRegistry.get(serviceParamResourcePath);
                returnValue = serviceParamResource
                        .getProperty(RegistryResources.ParameterProperties.VALUE);
            }
View Full Code Here

            if (transportResource != null) {
                configRegistry.removeAssociation(serviceResource.getPath(),
                        transportResource.getPath(),
                        RegistryResources.Associations.EXPOSED_TRANSPORTS);
                transportResource.discard();
            }

            List<String> exposedTrps = axisService.getExposedTransports();
            for (String transport : exposedTrps) {
                transportResource =
View Full Code Here

                    throw new CarbonException("The configuration resource for " + transport +
                            " transport does not exist");
                }
                configRegistry.addAssociation(serviceResource.getPath(), transportResource
                        .getPath(), RegistryResources.Associations.EXPOSED_TRANSPORTS);
                transportResource.discard();
            }

            serviceResource.setProperty(RegistryResources.ServiceProperties
                    .EXPOSED_ON_ALL_TANSPORTS, String.valueOf(false));
            configRegistry.put(serviceResource.getPath(), serviceResource);
View Full Code Here

                    .getProperty(RegistryResources.SecurityManagement.PROP_PASSWORD);
            String password = new String(cryptoUtil.base64DecodeAndDecrypt(encryptedPassword));
            ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
            keyStore.load(stream, password.toCharArray());
            KeyStoreBean keyStoreBean = new KeyStoreBean(keyStore, resource.getLastModified());
            resource.discard();

            if(loadedKeyStores.containsKey(keyStoreName)){
                loadedKeyStores.replace(keyStoreName, keyStoreBean);
            } else{
                loadedKeyStores.put(keyStoreName, keyStoreBean);
View Full Code Here

            }

            // Update the operation resource in configRegistry
            configRegistry.put(serviceResourcePath + RegistryResources.ServiceProperties.OPERATIONS
                    + axisOperation.getName().getLocalPart(), operationResource);
            operationResource.discard();
        }

        // Get binding policies
        Map endPointMap = axisService.getEndpoints();
View Full Code Here

                }

                // Update binding operation resource in configRegistry
                configRegistry.put(PersistenceUtils.getBindingOperationPath(serviceResourcePath,
                        currentOperation), bindingOperationResource);
                bindingOperationResource.discard();
            }
        }
        return policyResources;
    }
View Full Code Here

        outputStream.close();

        resource.setContent(outputStream.toByteArray());

        registry.put(path, resource);
        resource.discard();
        updateKeyStoreCache(name, new KeyStoreBean(keyStore, new Date()));
    }

    /**
     * Load the primary key store, this is allowed only for the super tenant
View Full Code Here

            Resource resource = configRegistry.get(resourcePath);
            resource.setProperty(RegistryResources.ServiceProperties.POLICY_UUID, policyId);

            // Update the service resource in configRegistry
            configRegistry.put(resourcePath, resource);
            resource.discard();
        }
    }

    /**
     * Add the given Policy as a resource to the given policy list if it doesn't already exist
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.