Package org.jboss.dna.graph.request

Examples of org.jboss.dna.graph.request.InvalidWorkspaceException


            MapNode root = workspace.getRoot();
            request.setActualRootLocation(Location.create(pathFactory.createRootPath(), root.getUuid()));
            recordChange(request);
        } else {
            String msg = GraphI18n.workspaceDoesNotExistInRepository.text(request.workspaceName(), repository.getSourceName());
            request.setError(new InvalidWorkspaceException(msg));
        }
    }
View Full Code Here


        if (original == null) {
            switch (request.cloneConflictBehavior()) {
                case DO_NOT_CLONE:
                    String msg = GraphI18n.workspaceDoesNotExistInRepository.text(nameOfWorkspaceToBeCloned,
                                                                                  repository.getSourceName());
                    request.setError(new InvalidWorkspaceException(msg));
                    return;
                case SKIP_CLONE:
                    target = repository.createWorkspace(context, targetWorkspaceName, request.targetConflictBehavior());
                    if (target == null) {
                        msg = GraphI18n.workspaceAlreadyExistsInRepository.text(targetWorkspaceName, repository.getSourceName());
                        request.setError(new InvalidWorkspaceException(msg));
                    } else {
                        MapNode root = target.getRoot();
                        request.setActualRootLocation(Location.create(pathFactory.createRootPath(), root.getUuid()));
                        request.setActualWorkspaceName(target.getName());
                    }
                    return;
            }
        }
        assert original != null;
        target = repository.createWorkspace(context,
                                            targetWorkspaceName,
                                            request.targetConflictBehavior(),
                                            nameOfWorkspaceToBeCloned);
        if (target == null) {
            // Since the original was there, the only reason the target wasn't created was because the workspace already existed
            // ...
            String msg = GraphI18n.workspaceAlreadyExistsInRepository.text(targetWorkspaceName, repository.getSourceName());
            request.setError(new InvalidWorkspaceException(msg));
        } else {
            MapNode root = target.getRoot();
            request.setActualRootLocation(Location.create(pathFactory.createRootPath(), root.getUuid()));
            request.setActualWorkspaceName(target.getName());
            recordChange(request);
View Full Code Here

                                         String workspaceName ) {
        // Get the workspace for this request ...
        MapWorkspace workspace = repository.getWorkspace(workspaceName);
        if (workspace == null) {
            String msg = GraphI18n.workspaceDoesNotExistInRepository.text(workspaceName, repository.getSourceName());
            request.setError(new InvalidWorkspaceException(msg));
        }
        return workspace;
    }
View Full Code Here

        // Stub the FederatedRepository ...
        stub(repository.getSourceName()).toReturn(sourceName);
        stub(repository.getWorkspace(workspaceName)).toReturn(workspace);
        stub(repository.getExecutor()).toReturn(executor);
        stub(repository.getConnectionFactory()).toReturn(connectionFactory);
        stub(repository.getWorkspace(nonExistantWorkspaceName)).toThrow(new InvalidWorkspaceException());

        // Stub the FederatedWorkspace ...
        stub(workspace.getName()).toReturn(workspaceName);
        // workspace.project(context,location) needs to be stubbed ...
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.request.InvalidWorkspaceException

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.