Examples of VersionedPath


Examples of org.wso2.carbon.registry.core.utils.VersionedPath

        long snapshotID =
                resourceVersionDAO.createSnapshot(pathId, resourceName, versionsInputStream);
        // Associations can be created only once we have created the snapshot, since we need to know
        // the snapshotID.
        if (snapshotID != -1) {
            VersionedPath versionedPath = new VersionedPath();
            versionedPath.setVersion(snapshotID);
            versionedPath.setPath(resourceImpl.getPath());
            associationDAO.copyAssociations(resourceImpl.getPath(), versionedPath.toString());
        }
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

     *
     * @throws RegistryException if the operation failed.
     */
    public void restoreVersion(ResourcePath resourcePath) throws RegistryException {

        VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
        if (versionedPath.getVersion() == -1) {
            String msg = "Failed to restore resource. " +
                    versionedPath + " is not a valid version path.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        String versionedResourcePath = versionedPath.getPath();
        long snapshotID = versionedPath.getVersion();


        ResourceIDImpl resourceID = resourceDAO.getResourceID(versionedResourcePath);
        if (!AuthorizationUtils.authorize(versionedResourcePath, ActionConstants.PUT)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

            return (mediaType != null && (invert != this.mediaType.equals(mediaType)));
        }

        Resource resource = requestContext.getResource();
        if (resource == null) {
            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                resource = requestContext.getRepository().
                        get(requestContext.getResourcePath().getPath());
                requestContext.setResource(resource);
            }
        }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

                parentPath = RegistryUtils.
                        getParentPath(requestContext.getResourcePath().getPath());
                requestContext.setParentPath(parentPath);
            }

            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                Resource parentResource = requestContext.getRepository().get(parentPath);
                if (parentResource != null) {
                    if (parentResource instanceof Collection) {
                        parentCollection = (Collection) parentResource;
                        requestContext.setParentCollection(parentCollection);
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

                parentPath = RegistryUtils.
                        getParentPath(requestContext.getResourcePath().getPath());
                requestContext.setParentPath(parentPath);
            }

            VersionedPath versionedPath =
                    RegistryUtils.getVersionedPath(requestContext.getResourcePath());

            if (versionedPath.getVersion() == -1) {
                parentCollection = (Collection) requestContext.getRepository().get(parentPath);
                requestContext.setParentCollection(parentCollection);
            }
        }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

        }

        commentsDAO.copyComments(oldResource, newResource);
        tagsDAO.copyTags(oldResource, newResource);
        ratingsDAO.copyRatings(oldResource, newResource);
        VersionedPath versionedPath = new VersionedPath();
        versionedPath.setVersion(snapshotID);
        versionedPath.setPath(oldResource.getPath());
        associationDAO.removeAllAssociations(newResource.getPath());
        associationDAO.copyAssociations(versionedPath.toString(), newResource.getPath());

        // finally return the resource path
        return resourcePath;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

                if (resource == null) {
                    resource = context.getResource();
                }

                if (resource == null) {
                    VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
                    if (versionedPath.getVersion() == -1) {
                        resource = repository.get(resourcePath.getPath());
                    } else {
                        resource = versionRepository.get(versionedPath);
                    }
                }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

            beginTransaction();

            ResourcePath resourcePath = new ResourcePath(path);
            Resource resource;

            VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
            if (versionedPath.getVersion() == -1) {
                resource = repository.getMetaData(resourcePath.getPath());
            } else {
                resource = versionRepository.getMetaData(versionedPath);
            }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

            beginTransaction();

            Collection collection;

            ResourcePath resourcePath = new ResourcePath(path);
            VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);
            if (versionedPath.getVersion() == -1) {
                collection = repository.get(resourcePath.getPath(), start, pageSize);
            } else {
                collection = versionRepository.get(versionedPath, start, pageSize);
            }
View Full Code Here

Examples of org.wso2.carbon.registry.core.utils.VersionedPath

            boolean output = registryContext.getHandlerManager().resourceExists(context);

            if (!context.isSimulation()) {
                if (!context.isProcessingComplete()) {

                    VersionedPath versionedPath = RegistryUtils.getVersionedPath(resourcePath);

                    output = (versionedPath.getVersion() == -1) ?
                            repository.resourceExists(resourcePath.getPath()) :
                            versionRepository.resourceExists(versionedPath);
                }

                // transaction successfully finished
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.