Package org.jboss.dna.graph.request

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


     */
    @Override
    public void process( CreateNodeRequest request ) {
        ProjectedRequest projected = federatedRequest.getFirstProjectedRequest();
        assert !projected.hasNext();
        Request projectedRequest = projected.getRequest();
        // Check the error first ...
        if (checkErrorOrCancel(request, projectedRequest)) return;

        // No error, so project the results back to the federated repository ...
        Location sourceLocation = null;
View Full Code Here


        while (projected != null) {
            // The projected request should either be a DeleteChildrenRequest (if the node being deleted is
            // at the top of a projection and therefore required to exist) or a DeleteBranchRequest (in all
            // other cases)...
            Location actual = null;
            Request sourceRequest = projected.getRequest();
            if (sourceRequest instanceof DeleteBranchRequest) {
                DeleteBranchRequest source = (DeleteBranchRequest)projected.getRequest();
                actual = source.getActualLocationOfNode();
            } else {
                DeleteChildrenRequest source = (DeleteChildrenRequest)projected.getRequest();
View Full Code Here

        ProjectedRequest projected = federatedRequest.getFirstProjectedRequest();
        // Go through the projected requests, and look for the top-most node ...
        Location highest = null;
        while (projected != null) {
            // The projected request should a DeleteChildrenRequest ...
            Request sourceRequest = projected.getRequest();
            DeleteChildrenRequest source = (DeleteChildrenRequest)projected.getRequest();
            Location actual = source.getActualLocationOfNode();
            if (checkErrorOrCancel(request, sourceRequest)) return;
            if (!projected.isSameLocation() && projected.getProjection() != null) {
                actual = projectToFederated(request.at(), projected.getProjection(), actual, request);
View Full Code Here

                        }
                    }
                    if (next == null) {
                        throw new NoSuchElementException();
                    }
                    Request result = next;
                    next = null;
                    return result;
                }

                public void remove() {
View Full Code Here

         *
         * @see org.jboss.dna.graph.Graph.Executable#execute()
         */
        public Results execute() {
            executed = true;
            Request request = requestQueue.pop();
            if (request == null) {
                return new BatchResults();
            }
            Graph.this.execute(request);
            if (request instanceof CompositeRequest) {
View Full Code Here

    }

    public void assertCreateNode( Iterator<Request> iterator,
                                  String path,
                                  String... properties ) {
        Request nextCommand = iterator.next();
        assertThat(nextCommand, is(instanceOf(CreateNodeRequest.class)));
        CreateNodeRequest createNode = (CreateNodeRequest)nextCommand;
        Path expectedPath = context.getValueFactories().getPathFactory().create(path);
        Path parentPath = createNode.under().getPath();
        assertThat(parentPath, is(expectedPath.getParent()));
View Full Code Here

    }

    public void assertCreateProperties( Iterator<Request> iterator,
                                        String path,
                                        String... properties ) {
        Request nextCommand = iterator.next();

        if (nextCommand instanceof UpdatePropertiesRequest) {
            assertUpdateProperties((UpdatePropertiesRequest)nextCommand, path, properties);
        } else if (nextCommand instanceof SetPropertyRequest) {
            assertSetProperty((SetPropertyRequest)nextCommand, path, properties);
        } else {
            fail("Invalid next request type: " + nextCommand.getClass().getName());
        }

    }
View Full Code Here

        this.children.put(location, Arrays.asList(children));
    }

    protected void assertNextRequestIsMove( Location from,
                                            Location to ) {
        Request request = executedRequests.poll();
        assertThat(request, is(instanceOf(MoveBranchRequest.class)));
        MoveBranchRequest move = (MoveBranchRequest)request;
        assertThat(move.from(), is(from));
        assertThat(move.into(), is(to));
    }
View Full Code Here

    }

    protected void assertNextRequestIsCopy( String fromWorkspace,
                                            Location from,
                                            Location to ) {
        Request request = executedRequests.poll();
        assertThat(request, is(instanceOf(CopyBranchRequest.class)));
        CopyBranchRequest copy = (CopyBranchRequest)request;
        assertThat(copy.fromWorkspace(), is(fromWorkspace));
        assertThat(copy.from(), is(from));
        assertThat(copy.into(), is(to));
View Full Code Here

        assertThat(copy.from(), is(from));
        assertThat(copy.into(), is(to));
    }

    protected void assertNextRequestIsDelete( Location at ) {
        Request request = executedRequests.poll();
        assertThat(request, is(instanceOf(DeleteBranchRequest.class)));
        DeleteBranchRequest delete = (DeleteBranchRequest)request;
        assertThat(delete.at(), is(at));
    }
View Full Code Here

TOP

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

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.