Package org.jboss.dna.graph

Examples of org.jboss.dna.graph.Location


     */
    @Override
    public void process( VerifyWorkspaceRequest request ) {
        ProjectedRequest projectedRequest = federatedRequest.getFirstProjectedRequest();

        Location actualLocation = Location.create(getExecutionContext().getValueFactories().getPathFactory().createRootPath());
        while (projectedRequest != null) {
            VerifyNodeExistsRequest readFromSource = (VerifyNodeExistsRequest)projectedRequest.getRequest();
            if (readFromSource.hasError()) {
                request.setError(readFromSource.getError());
                return;
            }
            request.setError(null);
            if (readFromSource.isCancelled()) {
                request.cancel();
                return;
            }

            Location sourceLocation = readFromSource.getActualLocationOfNode();
            if (sourceLocation.hasIdProperties()) {
                // Accumulate the identification properties ...
                for (Property propertyInSource : sourceLocation.getIdProperties()) {
                    Name name = propertyInSource.getName();
                    Property existing = actualLocation.getIdProperty(name);
                    if (existing != null) {
                        // Merge the property values ...
                        propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
View Full Code Here


     * @see java.lang.Iterable#iterator()
     */
    public Iterator<Location> iterator() {
        final LinkedList<Location> queue = new LinkedList<Location>();
        if (getActualLocationOfNode() != null) {
            Location actual = getActualLocationOfNode();
            if (actual != null) queue.addFirst(getActualLocationOfNode());
        }
        return new Iterator<Location>() {
            public boolean hasNext() {
                return queue.peek() != null;
            }

            public Location next() {
                // Add the children of the next node to the queue ...
                Location next = queue.poll();
                if (next == null) throw new NoSuchElementException();
                List<Location> children = getChildren(next);
                if (children != null && children.size() > 0) {
                    // We should only add the children if they are nodes in the branch, so check the first one...
                    Location firstChild = children.get(0);
                    if (includes(firstChild)) queue.addAll(0, children);
                }
                return next;
            }

View Full Code Here

     */
    public void addChild( Path pathToChild,
                          Property firstIdProperty,
                          Property... remainingIdProperties ) {
        checkNotFrozen();
        Location child = Location.create(pathToChild, firstIdProperty, remainingIdProperties);
        this.children.add(child);
    }
View Full Code Here

     * @see #addChild(Path, Property, Property...)
     */
    public void addChild( Path pathToChild,
                          Property idProperty ) {
        checkNotFrozen();
        Location child = Location.create(pathToChild, idProperty);
        this.children.add(child);
    }
View Full Code Here

                if (props != null) request.setProperties(node, props.values());
            }
        } else if (source instanceof ReadNodeRequest) {
            ReadNodeRequest readSource = (ReadNodeRequest)source;
            request.setActualLocationOfNode(readSource.getActualLocationOfNode());
            Location parent = readSource.getActualLocationOfNode();
            request.setChildren(parent, readSource.getChildren());
            request.setProperties(parent, readSource.getPropertiesByName().values());
        }
        request.setCachePolicy(getDefaultCachePolicy());
        setCacheableInfo(request, source.getCachePolicy());
View Full Code Here

        if (requiresUpdate && projection.isReadOnly()) return null;
        PlaceholderNode placeholder = isPlaceholder(location);
        if (placeholder != null) return placeholder;

        Path path = location.getPath();
        Location locationInSource = location;
        if (path != null) {
            if (path.size() == offsetSize) {
                // Make sure the path is the same ...
                if (path.equals(offset)) {
                    locationInSource = location.with(context.getValueFactories().getPathFactory().createRootPath());
View Full Code Here

     */
    public void addDeletedChild( Path pathToChild,
                                 Property firstIdProperty,
                                 Property... remainingIdProperties ) {
        checkNotFrozen();
        Location child = Location.create(pathToChild, firstIdProperty, remainingIdProperties);
        this.actualChildrenDeleted.add(child);
    }
View Full Code Here

     * @see #addDeletedChild(Path, Property, Property...)
     */
    public void addDeletedChild( Path pathToChild,
                                 Property idProperty ) {
        checkNotFrozen();
        Location child = Location.create(pathToChild, idProperty);
        this.actualChildrenDeleted.add(child);
    }
View Full Code Here

            if (requiresUpdate && projection.isReadOnly()) continue;
            // Project the federated repository path into the paths as they would exist in the source ...
            Set<Path> pathsInSource = projection.getPathsInSource(path, pathFactory);
            for (Path pathInSource : pathsInSource) {
                // Create a ProxyNode for this projection ...
                Location locationInSource = Location.create(pathInSource);
                boolean samePath = pathInSource.equals(path);
                ProxyNode proxy = new ProxyNode(projection, locationInSource, location, samePath);
                if (result == null) {
                    result = proxy;
                } else {
View Full Code Here

        if (branchIter.hasNext()) {
            // Didn't make it all the way down to the top of the branch, but it is a placeholder ...
            return isPlaceholder(location);
        }
        // Otherwise it is within the brach ...
        Location locationInSource = location;
        if (!branchSourceUsesSamePath) {
            // The source uses a different path ...
            if (federIter.hasNext()) {
                Path subpath = federatedPath.subpath(branchFederatedPath.size());
                Path sourcePath = context.getValueFactories().getPathFactory().create(branchSourcePath, subpath);
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.