Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Context.command()


            }

            if (ref.get() instanceof SymRef) {
                Optional<Ref> target = geogig.command(RefParse.class).setName(newValue).call();
                if (target.isPresent() && !(target.get() instanceof SymRef)) {
                    ref = geogig.command(UpdateSymRef.class).setDelete(delete).setName(name)
                            .setNewValue(target.get().getName()).call();
                } else {
                    throw new CommandSpecException("Invalid new target: " + newValue);
                }
View Full Code Here


                } else {
                    throw new CommandSpecException("Invalid new target: " + newValue);
                }

            } else {
                Optional<ObjectId> target = geogig.command(RevParse.class).setRefSpec(newValue)
                        .call();
                if (target.isPresent()) {
                    ref = geogig.command(UpdateRef.class).setDelete(delete)
                            .setName(ref.get().getName()).setNewValue(target.get()).call();
                } else {
View Full Code Here

            } else {
                Optional<ObjectId> target = geogig.command(RevParse.class).setRefSpec(newValue)
                        .call();
                if (target.isPresent()) {
                    ref = geogig.command(UpdateRef.class).setDelete(delete)
                            .setName(ref.get().getName()).setNewValue(target.get()).call();
                } else {
                    throw new CommandSpecException("Invalid new value: " + newValue);
                }
            }
View Full Code Here

        }
        final Context geogig = this.getCommandLocator(context);

        RevTree revTree = geogig.workingTree().getTree();

        Optional<NodeRef> nodeRef = geogig.command(FindTreeChild.class).setParent(revTree)
                .setChildPath(NodeRef.parentPath(path)).setIndex(true).call();
        Preconditions.checkArgument(nodeRef.isPresent(), "Invalid reference: %s",
                NodeRef.parentPath(path));

        RevFeatureType revFeatureType = geogig.command(RevObjectParse.class)
View Full Code Here

        Optional<NodeRef> nodeRef = geogig.command(FindTreeChild.class).setParent(revTree)
                .setChildPath(NodeRef.parentPath(path)).setIndex(true).call();
        Preconditions.checkArgument(nodeRef.isPresent(), "Invalid reference: %s",
                NodeRef.parentPath(path));

        RevFeatureType revFeatureType = geogig.command(RevObjectParse.class)
                .setObjectId(nodeRef.get().getMetadataId()).call(RevFeatureType.class).get();

        RevFeature revFeature = geogig.command(RevObjectParse.class).setObjectId(objectId)
                .call(RevFeature.class).get();
View Full Code Here

                NodeRef.parentPath(path));

        RevFeatureType revFeatureType = geogig.command(RevObjectParse.class)
                .setObjectId(nodeRef.get().getMetadataId()).call(RevFeatureType.class).get();

        RevFeature revFeature = geogig.command(RevObjectParse.class).setObjectId(objectId)
                .call(RevFeature.class).get();

        CoordinateReferenceSystem crs = revFeatureType.type().getCoordinateReferenceSystem();
        Envelope bounds = ReferencedEnvelope.create(crs);
View Full Code Here

        }

        NodeRef node = new NodeRef(Node.create(NodeRef.nodeFromPath(path), objectId, ObjectId.NULL,
                TYPE.FEATURE, bounds), NodeRef.parentPath(path), ObjectId.NULL);

        Optional<NodeRef> parentNode = geogig.command(FindTreeChild.class)
                .setParent(geogig.workingTree().getTree()).setChildPath(node.getParentPath())
                .setIndex(true).call();
        RevTreeBuilder treeBuilder = null;
        ObjectId metadataId = ObjectId.NULL;
        if (parentNode.isPresent()) {
View Full Code Here

                .setIndex(true).call();
        RevTreeBuilder treeBuilder = null;
        ObjectId metadataId = ObjectId.NULL;
        if (parentNode.isPresent()) {
            metadataId = parentNode.get().getMetadataId();
            Optional<RevTree> parsed = geogig.command(RevObjectParse.class)
                    .setObjectId(parentNode.get().getNode().getObjectId()).call(RevTree.class);
            checkState(parsed.isPresent(), "Parent tree couldn't be found in the repository.");
            treeBuilder = new RevTreeBuilder(geogig.objectDatabase(), parsed.get());
            treeBuilder.remove(node.getNode().getName());
        } else {
View Full Code Here

            treeBuilder.remove(node.getNode().getName());
        } else {
            treeBuilder = new RevTreeBuilder(geogig.stagingDatabase());
        }
        treeBuilder.put(node.getNode());
        ObjectId newTreeId = geogig
                .command(WriteBack.class)
                .setAncestor(
                        geogig.workingTree().getTree().builder(geogig.stagingDatabase()))
                .setChildPath(node.getParentPath()).setToIndex(true).setTree(treeBuilder.build())
                .setMetadataId(metadataId).call();
View Full Code Here

                        geogig.workingTree().getTree().builder(geogig.stagingDatabase()))
                .setChildPath(node.getParentPath()).setToIndex(true).setTree(treeBuilder.build())
                .setMetadataId(metadataId).call();
        geogig.workingTree().updateWorkHead(newTreeId);

        AddOp command = geogig.command(AddOp.class);

        command.addPattern(path);

        command.call();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.