Package org.wso2.carbon.registry.core.exceptions

Examples of org.wso2.carbon.registry.core.exceptions.RegistryException


                        if (requestContext.isSimulation()) {
                            return;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here


        if (!oldResourcePath.isCurrentVersion()) {
            String msg = "Failed to rename the resource " + oldResourcePath +
                    ". Given path refers to an archived version of the resource.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        String oldPath = RegistryUtils.getPureResourcePath(oldResourcePath.getPath());

        if (!newName.startsWith(RegistryConstants.PATH_SEPARATOR)) {
View Full Code Here

                        if (requestContext.isSimulation()) {
                            return null;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here

        if (!oldResourcePath.isCurrentVersion()) {
            String msg = "Failed to copy the resource " + oldResourcePath +
                    ". Given path refers to an archived version of the resource.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        // we are implementing move as copying the resource to the new path and deleting the old
        // resource. therefore, the moved resource will be treated as a new resource (i.e without
        // a version history. but the resource at old path (which is deleted) has its version
View Full Code Here

                        if (requestContext.isSimulation()) {
                            return null;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here

        if (!sourceResourcePath.isCurrentVersion() || !targetResourcePath.isCurrentVersion()) {
            String msg = "Failed to copy the resource " + sourceResourcePath + " to path " +
                    targetResourcePath + ". Both paths should refer to current versions.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        String sourcePath = sourceResourcePath.getPath();
        String targetPath = targetResourcePath.getPath();

        sourcePath = RegistryUtils.getPureResourcePath(sourcePath);
        targetPath = RegistryUtils.getPureResourcePath(targetPath);

        if (sourcePath.equals(targetPath)) {
            // nothing special to do..
            return targetPath;
        } else if (sourcePath.indexOf(targetPath) == 0) {
            // if the target path is a part of the source path, we can't continue
            String msg = "Failed to copy the resource " + sourceResourcePath + " to path " +
                    targetResourcePath + ". The target path is a part of the source path.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        ResourceImpl sourceResource = (ResourceImpl) get(sourcePath);
        if (sourceResource instanceof CollectionImpl) {
            resourceDAO.fillChildren((CollectionImpl) sourceResource, 0, -1);
View Full Code Here

                        if (requestContext.isSimulation()) {
                            return null;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here

                        if (requestContext.isSimulation()) {
                            return null;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here

        ResourceIDImpl assumedResourceID = resourceDAO.getResourceID(path, false);
        if (assumedResourceID != null && resourceDAO.resourceExists(assumedResourceID)) {
            String msg = "Failed to add new Collection " + path + "There already exist " +
                    "non collection resource.";
            log.error(msg);
            throw new RegistryException(msg);
        }

        String parentPath = RegistryUtils.getParentPath(path);
        ResourceIDImpl parentResourceID = null;
        if (parentPath != null) {
            parentResourceID = resourceDAO.getResourceID(parentPath, true);
            if (parentResourceID == null || !resourceDAO.resourceExists(parentResourceID)) {
                addEmptyCollection(parentPath);
                if (parentResourceID == null) {
                    // since this is a collection there is no much performance hit here
                    parentResourceID = resourceDAO.getResourceID(parentPath, true);
                }
            } else if (!AuthorizationUtils.authorize(
                    parentPath, ActionConstants.PUT)) {
                String msg = "Failed to add new resource. User " +
                        CurrentSession.getUser() + " does not have authorization to " +
                        "update the collection " + parentPath + ".";
                log.error(msg);
                throw new RegistryException(msg);
            }
        } else if (!path.equals(RegistryConstants.ROOT_PATH)) {
            return;
        }

        if (!AuthorizationUtils.authorize(
                path, ActionConstants.PUT)) {
            String msg = "Failed to add new resource. User " +
                    CurrentSession.getUser() + " does not have authorization to " +
                    "add the collection at" + path + ".";
            log.error(msg);
            throw new RegistryException(msg);
        }


        CollectionImpl collection = new CollectionImpl();
        RegistryContext registryContext = null;
View Full Code Here

                        if (requestContext.isSimulation()) {
                            return null;
                        }
                        // We will be concatenating the incoming exception's message so that it will
                        // be carried forward, and displayed at the client-side.
                        throw new RegistryException(
                                "An exception occurred while executing handler chain. " +
                                        e.getMessage(), e);
                    }
                    if (isProcessingComplete(requestContext)) {
                        break;
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.exceptions.RegistryException

Copyright © 2018 www.massapicom. 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.