Package org.wso2.carbon.registry.core

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


                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

//
                // versioning operations
                String[] versions = registry.getVersions(rPath);
                if (versions.length > 0) {
                    Resource rVersion = registry.get(versions[0]);
                    rVersion.discard();
                    registry.restoreVersion(versions[0]);
                }
                Thread.yield();

                registry.delete(rPath);
View Full Code Here

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

                long getStart = System.nanoTime();
                //*****************************//
                Resource r2 = registry.get(basePath + i);
                //*****************************//
 
View Full Code Here

                //*****************************//
                long getEnd = System.nanoTime();
                long getTime = getEnd - getStart;
                System.out.println("CSV,"+threadName+","+"get,"+getTime/1000000);

                r2.discard();

                long deleteStart = System.nanoTime();
                //*****************************//
                registry.delete(basePath + i);
                //*****************************//
 
View Full Code Here

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

                long getStart = System.nanoTime();
                //*****************************//
 
View Full Code Here

                Resource r2 = registry.get(basePath + i);
                //*****************************//
                long getEnd = System.nanoTime();
                long getTime = getEnd - getStart;
                System.out.println("CSV,"+threadName+","+"get,"+getTime/1000000);
                r2.discard();

               
                long deleteStart = System.nanoTime();
                //*****************************//
                registry.delete(basePath + i);
View Full Code Here

        resource.addProperty(RegistryConstants.REGISTRY_LINK_RESTORATION,
                path + RegistryConstants.URL_SEPARATOR + target +
                        RegistryConstants.URL_SEPARATOR + targetSubPath +
                        RegistryConstants.URL_SEPARATOR + CurrentSession.getUser());
        registry.put(path, resource);
        resource.discard();
    }

    // Sets-up the mounts for this instance.
    private void setupMounts(RegistryService registryService, int tenantId) {
        try {
View Full Code Here

        Resource policyResource = registry.get(policyPath);
        byte[] content = (byte[]) policyResource.getContent();
        if (content == null || content.length == 0) {
            return null;
        }
        policyResource.discard();

        ByteArrayInputStream in = new ByteArrayInputStream(content);
        Policy policy = getPolicy(in);
        if (policy != null && !policy.isEmpty()) {
            for (PolicyInfo pi : proxy.getPolicies()) {
View Full Code Here

                    new String((byte[]) resource2.getContent()));

            resource.discard();
            res1.discard();
            resource1.discard();
            resource2.discard();
            Thread.sleep(100);
        }
    }
}
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.