Package org.wso2.carbon.registry.core

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


                    String transportProtocol = resource.getProperty(RegistryResources.Transports.PROTOCOL_NAME);
                    if(transportProtocol.equals("https")){
                        httpsEnabled = true;
                        break;
                    }
                    resource.discard();
                }
               
                if (httpsEnabled ||Boolean.valueOf(serviceResource.getProperty(RegistryResources.ServiceProperties.EXPOSED_ON_ALL_TANSPORTS))) {
                    keyStore = keyStoreManager.getPrimaryKeyStore();
                }
View Full Code Here


        Resource resource = configRegistry.newResource();
        resource.setContent(element.toString());
        resource.setProperty(RegistryResources.Transports.PROTOCOL_NAME, name);
        resource.setProperty(RegistryResources.Transports.IS_ENABLED, String.valueOf(enabled));
        configRegistry.put(path, resource);
        resource.discard();
    }

    public OMElement getTransportElement(String name, boolean listener) throws Exception {
        Resource resource = getTransportResource(configRegistry, name, listener);
View Full Code Here

    public OMElement getTransportElement(String name, boolean listener) throws Exception {
        Resource resource = getTransportResource(configRegistry, name, listener);

        if (resource != null) {
            ByteArrayInputStream in = new ByteArrayInputStream((byte[]) resource.getContent());
            resource.discard();
            StAXOMBuilder builder = new StAXOMBuilder(in);
            return builder.getDocumentElement();
        }
        return null;
    }
View Full Code Here

        Resource resource = getTransportResource(configRegistry, name, listener);
        if (resource != null) {
            resource.setProperty(RegistryResources.Transports.IS_ENABLED, String.valueOf(enabled));
            configRegistry.put(resource.getPath(), resource);
            resource.discard();
        }
    }

    public void updateEnabledTransports(
            java.util.Collection<TransportInDescription> listeners,
View Full Code Here

                        writer.flush();
                    }
                }
            }

            resource.discard();

        } catch (RegistryException e) {
            String msg = "Failed to get resource content. " + e.getMessage();
            log.error(msg, e);
            response.setStatus(500);
View Full Code Here

                Resource paramResource = registry.newResource();
                paramResource.setContent(parameter.getParameterElement().toString());
                paramResource.addProperty(RegistryResources.NAME, parameter.getName());
                registry.put(servicePath + RegistryResources.PARAMETERS
                        + parameter.getName(), paramResource);
                paramResource.discard();
            }
        }
        if (!transactionStarted) {
            registry.commitTransaction();
        }
View Full Code Here

                        writer.flush();
                    }
                }
            }

            resource.discard();

        } catch (RegistryException e) {
            String msg = "Failed to get resource content. " + e.getMessage();
            log.error(msg, e);
            response.setStatus(500);
View Full Code Here

                registry.put(basePath + i + "/s1/a1", r1);
                //*****************************//
                long putEnd = System.nanoTime();
                long putTime = putEnd - putStart;
                System.out.println("CSV," + threadName + "," + "put," + putTime / 1000000);
                r1.discard();

                long queryStart = System.nanoTime();
                //*****************************//
                Map<String, String> params = new HashMap<String, String>();
                params.put("1", "%production%");
View Full Code Here

                String content = "this is the content of first test resource.";
                r.setContent(content.getBytes());
                r.setProperty("p1", "v1");
                r.setProperty("p2", "v2");
                registry.put(rPath, r);
                r.discard();
                Thread.yield();

                // read and update the resource

                registry.resourceExists(rPath);
View Full Code Here

                Resource rr = registry.get(rPath);
                String content2 = "this is the modified content.";
                rr.setContent(content2);
                rr.setProperty("p1", "vvv1");
                registry.put(rPath, rr);
                rr.discard();
                Thread.yield();


                // copy the resource
                String pathToCopy = basePath + "/copy/r" + i;
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.