Package org.wso2.carbon.registry.core

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


                if (versionResource != null) {
                    versionPath.setUpdater(versionResource.getLastUpdaterUserName());
                    Calendar versionLastModified = Calendar.getInstance();
                    versionLastModified.setTime(versionResource.getLastModified());
                    versionPath.setUpdatedOn(versionLastModified);
                    versionResource.discard();
                }

                versionPaths.add(versionPath);
            }
View Full Code Here


                    Calendar createdDateTime = Calendar.getInstance();
                    createdDateTime.setTime(child.getCreatedTime());
                    resourceData.setCreatedOn(createdDateTime);
                    CommonUtil.populateAverageStars(resourceData);

                    child.discard();

                    resourceDataList[i] = resourceData;

                } catch (AuthorizationFailedException e) {
                    // do not show unauthorized resource in search results.
View Full Code Here

      if (registry.resourceExists(serviceResourcePath)) {
        Resource serviceResource = registry.get(serviceResourcePath);
        serviceResource.setProperty(RegistryResources.ServiceGroupProperties.HASH_VALUE,
            hash);
        registry.put(serviceResourcePath, serviceResource);
        serviceResource.discard();
      }
      if (transactionStarted) {
        registry.commitTransaction();
      }
    } catch (Throwable e) {
View Full Code Here

                //*****************************//
                long putEnd = System.nanoTime();
                long putTime = putEnd - putStart;
                System.out.println("CSV," + threadName + "," + "put," + putTime / 1000000);
                //System.out.println("~~~~~end put~~~~~");
                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();

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

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


                long getStart = System.nanoTime();
                //*****************************//
                Resource r2 = registry.get(basePath + i);
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();

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

            resource.setMediaType(mediaType);
            resource.setDescription(description);
            resource.setContent(content);

            userRegistry.put(resourcePath, resource);
            resource.discard();

        } catch (RegistryException e) {
            String msg = "Failed to add resource with text based content to path " +
                    resourcePath + ". " + ((e.getCause() instanceof SQLException) ?
                    "" : e.getMessage());
View Full Code Here

                }
                metadataResource.setProperty(RegistryConstants.SYMLINK_PROPERTY_NAME, symlinkLocation);
            }

            userRegistry.importResource(resourcePath, fetchURL, metadataResource);
            metadataResource.discard();

        } catch (RegistryException e) {
            String msg = "Failed to import resource from the URL " + fetchURL + " to path " +
                    resourcePath + ". " + ((e.getCause() instanceof SQLException) ?
                    "" : e.getMessage());
View Full Code Here

            bean.setPutAllowed(putAllowed);
        }

        bean.setVersionView(!resourcePath.isCurrentVersion());
        bean.setContentPath(resourcePath.getCompletePath());
        resource.discard();
       
        return bean;
    }

    private static String[] getCollectionTypes() {
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.