Examples of CollectionImpl


Examples of org.wso2.carbon.registry.core.CollectionImpl

                return;
            }
            if (log.isTraceEnabled()) {
                log.trace("Creating the '" + servicePath + "' collection of the Registry.");
            }
            CollectionImpl systemCollection = (CollectionImpl) registry.newCollection();
            String systemDescription = "Collection which contains all the Service information";
            systemCollection.setDescription(systemDescription);
            registry.put(servicePath, systemCollection);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        String mountPath = RegistryConstants.LOCAL_REPOSITORY_BASE_PATH +
                RegistryConstants.SYSTEM_MOUNT_PATH;
        if (!systemRegistry.resourceExists(mountPath)) {
            return;
        }
        CollectionImpl mountCollection = (CollectionImpl) systemRegistry.get(mountPath);
        String[] mountPoints = mountCollection.getChildren();
        Resource mountPoint;
        for (String mountPointString : mountPoints) {
            if (!systemRegistry.resourceExists(mountPointString)) {
                log.warn("Unable to add mount. The mount point " + mountPointString +
                        " was not found.");
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        if (resourceID == null) {
            return null;
        }
        ResourceImpl resourceImpl;
        if (resourceID.isCollection()) {
            resourceImpl = new CollectionImpl();
        } else {
            resourceImpl = new ResourceImpl();
        }
        if (versioned) {
            resourceImpl.setVersionNumber(resourceDAO.getVersion(resourceID));
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

     * @throws RegistryException if the operation failed.
     */
    public Collection get(String path, int start, int pageLen) throws RegistryException {
        String purePath = RegistryUtils.getPureResourcePath(path);

        CollectionImpl resource = (CollectionImpl) resourceDAO.getResourceMetaData(purePath);
        if (resource == null) {
            return null;
        }

        if (!AuthorizationUtils.authorize(purePath, ActionConstants.GET)) {
            String msg = "User " + CurrentSession.getUser() + " is not authorized to " +
                    "read the resource " + purePath + ".";
            log.warn(msg);
            throw new AuthorizationFailedException(msg);
        }
        resourceDAO.fillResource(resource, start, pageLen);
        resource.setDataAccessManager(dataAccessManager);
        resource.setUserName(CurrentSession.getUser());
        resource.setTenantId(CurrentSession.getTenantId());
        resource.setUserRealm(CurrentSession.getUserRealm());

        return resource;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

            ResourceImpl oldResourceImpl = new ResourceImpl(resourceID.getPath(), oldResourceDO);
            versionRepository.createSnapshot(oldResourceImpl, false, false);
        } else {
            ResourceImpl oldResourceImpl;
            if (resourceID.isCollection()) {
                oldResourceImpl = new CollectionImpl(resourceID.getPath(), oldResourceDO);
            } else {
                oldResourceImpl = new ResourceImpl(resourceID.getPath(), oldResourceDO);
            }
            // just delete the resource and content
            // delete the old entry from the resource table
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

    public void deleteNode(ResourceIDImpl resourceID,
                              ResourceDO resourceDO,
                              boolean keepAuthorization) throws RegistryException {
        ResourceImpl resourceImpl;
        if (resourceID.isCollection()) {
            resourceImpl = new CollectionImpl(resourceID.getPath(), resourceDO);
        } else {
            resourceImpl = new ResourceImpl(resourceID.getPath(), resourceDO);
        }

        // now do the versioning as delete is considered as a change, where
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

    // Method to remove a resource, which is used when moving resources.
    private void removeIndividual(ResourceIDImpl resourceID, ResourceDO resourceDO)
            throws RegistryException {
        ResourceImpl resource;
        if (resourceID.isCollection()) {
            resource = new CollectionImpl(resourceID.getPath(), resourceDO);
        } else {
            resource = new ResourceImpl(resourceID.getPath(), resourceDO);
        }
        // we are always creating versions for resources (files), if the resource has changed.
        if (!(resource instanceof Collection) && this.versionOnChange &&
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        put(targetPath, targetResource);


        if (sourceResource instanceof CollectionImpl) {
            // copy all the children recursively
            CollectionImpl collection = (CollectionImpl) sourceResource;

            for (String childSourcePath : collection.getChildren()) {
                String childResourceName = RegistryUtils.getResourceName(childSourcePath);
                String childTargetPath =
                        targetPath + RegistryConstants.PATH_SEPARATOR + childResourceName;

View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        resourceDAO.update(resource);

        ResourceImpl oldResourceImpl;
        if (oldResourceDO.getName() == null) {
            // this is a collection
            oldResourceImpl = new CollectionImpl(resourceID.getPath(), oldResourceDO);
        } else {
            oldResourceImpl = new ResourceImpl(resourceID.getPath(), oldResourceDO);
        }
        // copying old required attributes to the new version
        commentsDAO.copyComments(oldResourceImpl, resource);
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

            log.error(msg);
            throw new RegistryException(msg);
        }


        CollectionImpl collection = new CollectionImpl();
        RegistryContext registryContext = null;
        if (CurrentSession.getUserRegistry() != null) {
            registryContext = CurrentSession.getUserRegistry().getRegistryContext();
        }
        if (registryContext == null) {
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.