Package org.jboss.dna.graph.request

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


     *
     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CloneBranchRequest)
     */
    @Override
    public void process( CloneBranchRequest request ) {
        CloneBranchRequest source = (CloneBranchRequest)federatedRequest.getFirstProjectedRequest().getRequest();
        if (checkErrorOrCancel(request, source)) return;
        request.setActualLocations(source.getActualLocationBefore(), source.getActualLocationAfter());
        request.setRemovedNodes(source.getRemovedNodes());
    }
View Full Code Here


    public void process( CloneBranchRequest request ) {
        ProjectedRequest projected = federatedRequest.getFirstProjectedRequest();
        // Check the projection first ...
        if (checkErrorOrCancel(request, federatedRequest)) return;

        CloneBranchRequest source = (CloneBranchRequest)projected.getRequest();
        if (checkErrorOrCancel(request, source)) return;
        Location locationBefore = source.getActualLocationBefore();
        Location locationAfter = source.getActualLocationBefore();
        locationBefore = projectToFederated(request.from(), projected.getProjection(), locationBefore, request);
        locationAfter = projectToFederated(request.into(), projected.getSecondProjection(), locationAfter, request);
        request.setActualLocations(locationBefore, locationAfter);
        if (source.removeExisting()) {
            Set<Location> removed = new HashSet<Location>();
            for (Location location : request.getRemovedNodes()) {
                removed.add(projectToFederated(projected.getSecondProjection(), location, request));
            }
            request.setRemovedNodes(Collections.unmodifiableSet(removed));
View Full Code Here

        ProxyNode intoProxy = projectedIntoNode.asProxy();
        assert fromProxy.projection().getSourceName().equals(intoProxy.projection().getSourceName());
        boolean sameLocation = fromProxy.isSameLocationAsOriginal() && intoProxy.isSameLocationAsOriginal();

        // Create the pushed-down request ...
        CloneBranchRequest pushDown = new CloneBranchRequest(fromProxy.location(), fromProxy.workspaceName(),
                                                             intoProxy.location(), intoProxy.workspaceName(),
                                                             request.desiredName(), request.desiredSegment(),
                                                             request.removeExisting());
        // Create the federated request ...
        FederatedRequest federatedRequest = new FederatedRequest(request);
View Full Code Here

        }
        // Now execute these two operations ...
        Results results = batch.execute();

        // Find the copy request to get the actual location of the copy ...
        CloneBranchRequest request = (CloneBranchRequest)results.getRequests().get(0);
        Location locationOfCopy = request.getActualLocationAfter();

        // Remove from the session all of the nodes that were removed as part of this clone ...
        Set<Path> removedAlready = new HashSet<Path>();
        for (Location removed : request.getRemovedNodes()) {
            Path path = removed.getPath();
            if (isBelow(path, removedAlready)) {
                // This node is below a node we've already removed, so skip it ...
                continue;
            }
View Full Code Here

                originalDetails.addEventType(ChangeType.NODE_REMOVED);

                // the new location is a new node event
                details.addEventType(ChangeType.NODE_ADDED);
            } else if (change instanceof CloneBranchRequest) {
                CloneBranchRequest cloneRequest = (CloneBranchRequest)change;

                // create event details for any nodes that were removed
                for (Location removed : cloneRequest.getRemovedNodes()) {
                    NetChangeDetails removedDetails = findDetailsByLocation(workspace, removed, detailsByLocationByWorkspace);
                    removedDetails.addEventType(ChangeType.NODE_REMOVED);
                }

                // create event details for new node
View Full Code Here

        }
        // Now execute these two operations ...
        Results results = batch.execute();

        // Find the copy request to get the actual location of the copy ...
        CloneBranchRequest request = (CloneBranchRequest)results.getRequests().get(0);
        Location locationOfCopy = request.getActualLocationAfter();

        // Remove from the session all of the nodes that were removed as part of this clone ...
        for (Location removed : request.getRemovedNodes()) {
            Node<Payload, PropertyPayload> removedNode = findNodeWith(removed.getPath(), false);
            if (removedNode != null) removedNode.remove(false);
        }

        // Find the parent node in the session ...
View Full Code Here

        ProxyNode intoProxy = projectedIntoNode.asProxy();
        assert fromProxy.projection().getSourceName().equals(intoProxy.projection().getSourceName());
        boolean sameLocation = fromProxy.isSameLocationAsOriginal() && intoProxy.isSameLocationAsOriginal();

        // Create the pushed-down request ...
        CloneBranchRequest pushDown = new CloneBranchRequest(fromProxy.location(), fromProxy.workspaceName(),
                                                             intoProxy.location(), intoProxy.workspaceName(),
                                                             request.desiredName(), request.desiredSegment(),
                                                             request.removeExisting());
        // Create the federated request ...
        FederatedRequest federatedRequest = new FederatedRequest(request);
View Full Code Here

     */
    @Override
    public void process( CloneBranchRequest request ) {
        ProjectedRequest projected = federatedRequest.getFirstProjectedRequest();
        assert !projected.hasNext();
        CloneBranchRequest source = (CloneBranchRequest)projected.getRequest();
        if (checkErrorOrCancel(request, source)) return;
        Location locationBefore = source.getActualLocationBefore();
        Location locationAfter = source.getActualLocationBefore();
        locationBefore = projectToFederated(request.from(), projected.getProjection(), locationBefore, request);
        locationAfter = projectToFederated(request.into(), projected.getSecondProjection(), locationAfter, request);
        request.setActualLocations(locationBefore, locationAfter);
        if (source.removeExisting()) {
            Set<Location> removed = new HashSet<Location>();
            for (Location location : request.getRemovedNodes()) {
                removed.add(projectToFederated(projected.getSecondProjection(), location, request));
            }
            request.setRemovedNodes(Collections.unmodifiableSet(removed));
View Full Code Here

     *
     * @see org.jboss.dna.graph.request.processor.RequestProcessor#process(org.jboss.dna.graph.request.CloneBranchRequest)
     */
    @Override
    public void process( CloneBranchRequest request ) {
        CloneBranchRequest source = (CloneBranchRequest)federatedRequest.getFirstProjectedRequest().getRequest();
        if (checkErrorOrCancel(request, source)) return;
        request.setActualLocations(source.getActualLocationBefore(), source.getActualLocationAfter());
        request.setRemovedNodes(source.getRemovedNodes());
    }
View Full Code Here

TOP

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

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.