/** * Switch this graph to use another existing workspace in the same source. * * @param workspaceName the name of the existing workspace that this graph should begin using, or null if the graph should use * the "default" workspace in the source (if there is one) * @return the workspace; never null * @throws InvalidWorkspaceException if the workspace with the supplied name does not exist, or if null is supplied as the * workspace name but the source does not have a default workspace */ public Workspace useWorkspace( String workspaceName ) { VerifyWorkspaceRequest request = requests.verifyWorkspace(workspaceName); return setWorkspace(request.getActualWorkspaceName(), request.getActualLocationOfRoot()); }
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.VerifyWorkspaceRequest) */ @Override public void process( VerifyWorkspaceRequest request ) { record(request); // Need to add this loopback in so we can use this with JCR layer test cases request.setActualWorkspaceName(request.getActualWorkspaceName() == null ? DEFAULT_WORKSPACE_NAME : request.getActualWorkspaceName()); request.setActualRootLocation(request.getActualLocationOfRoot() == null ? defaultWorkspaceRoot : request.getActualLocationOfRoot()); }
/** * {@inheritDoc} * * @see org.modeshape.graph.request.processor.RequestProcessor#process(org.modeshape.graph.request.VerifyWorkspaceRequest) */ @Override public void process( VerifyWorkspaceRequest request ) { record(request); // Need to add this loopback in so we can use this with JCR layer test cases request.setActualWorkspaceName(request.getActualWorkspaceName() == null ? DEFAULT_WORKSPACE_NAME : request.getActualWorkspaceName()); request.setActualRootLocation(request.getActualLocationOfRoot() == null ? defaultWorkspaceRoot : request.getActualLocationOfRoot()); }