Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.Location


            int firstLocationIndex = getColumns().getColumnCount();
            if (locationCount == 1) {
                // We can determine duplicates faster/cheaper using a single Set<Location> ...
                Set<Location> found = new HashSet<Location>();
                while (iter.hasNext()) {
                    Location location = (Location)iter.next()[firstLocationIndex];
                    if (!found.add(location)) {
                        // Was already found, so remove this tuple from the results ...
                        iter.remove();
                    }
                }
View Full Code Here


    private static ValueSelector selectPath( ProcessingComponent component,
                                             String selectorName ) {
        final int index = component.getColumns().getLocationIndex(selectorName);
        return new ValueSelector() {
            public Object evaluate( Object[] tuple ) {
                Location location = (Location)tuple[index];
                return location != null ? location.getPath() : null;
            }
        };
    }
View Full Code Here

                                           JoinCondition condition ) {
        if (condition instanceof SameNodeJoinCondition) {
            return new Joinable() {
                public boolean evaluate( Object locationA,
                                         Object locationB ) {
                    Location location1 = (Location)locationA;
                    Location location2 = (Location)locationB;
                    return location1.isSame(location2);
                }
            };
        } else if (condition instanceof EquiJoinCondition) {
            return new Joinable() {
View Full Code Here

        PathNode newParent = newWorkspace.getNode(newParentPath);
        Set<Location> removedExistingNodes = new HashSet<Location>();
        Name desiredName = request.desiredName();
        PathNode newNode = newWorkspace.copyNode(getExecutionContext(), node, workspace, newParent, desiredName, true);

        Location oldLocation = Location.create(node.getPath(), node.getUuid());
        Location newLocation = Location.create(newNode.getPath(), newNode.getUuid());
        request.setActualLocations(oldLocation, newLocation);
        request.setRemovedNodes(Collections.unmodifiableSet(removedExistingNodes));
        recordChange(request);
    }
View Full Code Here

        // Look up the new parent, which must exist ...
        Path newParentPath = request.into().getPath();
        Name desiredName = request.desiredName();
        PathNode newParent = newWorkspace.getNode(newParentPath);
        PathNode newNode = newWorkspace.copyNode(getExecutionContext(), node, workspace, newParent, desiredName, true);
        Location oldLocation = Location.create(node.getPath(), node.getUuid());
        Location newLocation = Location.create(newNode.getPath(), newNode.getUuid());
        request.setActualLocations(oldLocation, newLocation);
        recordChange(request);
    }
View Full Code Here

                } // otherwise, we found it and we're setting any properties below
                break;
        }
        assert node != null;

        Location actualLocation = Location.create(node.getPath(), node.getUuid());
        request.setActualLocationOfNode(actualLocation);
        recordChange(request);

    }
View Full Code Here

        WritablePathWorkspace newWorkspace = (WritablePathWorkspace)workspace;

        node = newWorkspace.moveNode(getExecutionContext(), node, request.desiredName(), newWorkspace, newParent, beforeNode);
        assert node.getPath().getParent().equals(newParent.getPath());

        Location oldLocation = Location.create(request.from().getPath());
        Location newLocation = Location.create(node.getPath(), node.getUuid());
        request.setActualLocations(oldLocation, newLocation);
        recordChange(request);

    }
View Full Code Here

        if (node == null) {
            assert request.hasError();
            return;
        }

        Location actualLocation = getActualLocation(request.of(), node);
        assert actualLocation != null;
        Path path = actualLocation.getPath();
        // Get the names of the children ...
        List<MapNode> children = node.getChildren();
        for (MapNode child : children) {
            Segment childName = child.getName();
            Path childPath = pathFactory.create(path, childName);
View Full Code Here

        MapNode node = getTargetNode(workspace, request, request.at());
        if (node == null) return;

        workspace.lockNode(node, request.lockScope(), request.lockTimeoutInMillis());

        Location actualLocation = getActualLocation(request.at(), node);
        request.setActualLocation(actualLocation);
        recordChange(request);
    }
View Full Code Here

        MapNode node = getTargetNode(workspace, request, request.at());
        if (node == null) return;

        workspace.unlockNode(node);

        Location actualLocation = getActualLocation(request.at(), node);
        request.setActualLocation(actualLocation);
        recordChange(request);
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.Location

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.