Package org.locationtech.geogig.web.api

Examples of org.locationtech.geogig.web.api.CommandResponse$ErrorLiteral


        final RevCommit last = lastCommit;
        final int total = totalCommits;
        final int added = addedFeatures;
        final int modified = modifiedFeatures;
        final int removed = removedFeatures;
        context.setResponseContent(new CommandResponse() {
            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start(true);
                out.writeStatistics(stats, first, last, total, authors, added, modified, removed);
                out.finish();
View Full Code Here


        final Context geogig = this.getCommandLocator(context);

        final Iterator<NodeRef> iter = geogig.command(LsTreeOp.class).setReference(ref)
                .setStrategy(lsStrategy).call();

        context.setResponseContent(new CommandResponse() {

            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start(true);
                out.writeLsTreeResponse(iter, verbose);
View Full Code Here

        }
        final GeoGIG geogig = context.getGeoGIG();

        final GeogigTransaction transaction = geogig.command(TransactionBegin.class).call();

        context.setResponseContent(new CommandResponse() {

            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start();
                out.writeTransactionId(transaction.getTransactionId());
View Full Code Here

            final RevCommit commitToWrite = commit;
            final ObjectId parentId = commit.parentN(0).or(ObjectId.NULL);
            final Iterator<DiffEntry> diff = geogig.command(DiffOp.class).setOldVersion(parentId)
                    .setNewVersion(commit.getId()).call();

            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeCommitResponse(commitToWrite, diff);
                    out.finish();
View Full Code Here

        merge.setMessage(mergeMessage.or("Merged revert of " + featurePath));

        try {
            final MergeReport report = merge.call();

            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeMergeResponse(Optional.fromNullable(report.getMergeCommit()), report
                            .getReport().get(), geogig, report.getOurs(), report.getPairs().get(0)
                            .getTheirs(), report.getPairs().get(0).getAncestor());
                    out.finish();
                }
            });
        } catch (Exception e) {
            final RevCommit ours = context.getGeoGIG().getRepository()
                    .getCommit(currHead.get().getObjectId());
            final RevCommit theirs = context.getGeoGIG().getRepository().getCommit(mapped.getId());
            final Optional<ObjectId> ancestor = geogig.command(FindCommonAncestor.class)
                    .setLeft(ours).setRight(theirs).call();
            context.setResponseContent(new CommandResponse() {
                final MergeScenarioReport report = geogig.command(ReportMergeScenarioOp.class)
                        .setMergeIntoCommit(ours).setToMergeCommit(theirs).call();

                @Override
                public void write(ResponseWriter out) throws Exception {
View Full Code Here

            return;
        }

        if (ref.isPresent()) {
            final Ref newRef = ref.get();
            context.setResponseContent(new CommandResponse() {

                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeUpdateRefResponse(newRef);
View Full Code Here

    public void run(CommandContext context) {
        final Context geogig = this.getCommandLocator(context);

        final ImmutableList<ObjectId> updatedObjects = geogig.command(RebuildGraphOp.class).call();

        context.setResponseContent(new CommandResponse() {
            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start();
                out.writeRebuildGraphResponse(updatedObjects, quiet);
                out.finish();
View Full Code Here

        TransactionEnd endTransaction = context.getGeoGIG().command(TransactionEnd.class);
        try {
            final boolean closed = endTransaction.setCancel(cancel)
                    .setTransaction((GeogigTransaction) transaction).call();

            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    if (closed) {
                        out.writeTransactionId(null);
                    } else {
                        out.writeTransactionId(getTransactionId());
                    }
                    out.finish();
                }
            });
        } catch (MergeConflictsException m) {
            final RevCommit ours = context.getGeoGIG().getRepository().getCommit(m.getOurs());
            final RevCommit theirs = context.getGeoGIG().getRepository().getCommit(m.getTheirs());
            final Optional<ObjectId> ancestor = transaction.command(FindCommonAncestor.class)
                    .setLeft(ours).setRight(theirs).call();
            context.setResponseContent(new CommandResponse() {
                final MergeScenarioReport report = transaction.command(ReportMergeScenarioOp.class)
                        .setMergeIntoCommit(ours).setToMergeCommit(theirs).call();

                @Override
                public void write(ResponseWriter out) throws Exception {
View Full Code Here

        final Context geogig = this.getCommandLocator(context);

        final String pathFilter = null;
        final Optional<Ref> currHead = geogig.command(RefParse.class).setName(Ref.HEAD).call();

        context.setResponseContent(new CommandResponse() {
            @Override
            public void write(ResponseWriter writer) throws Exception {
                writer.start();
                if (!currHead.isPresent()) {
                    writer.writeErrors("Repository has no HEAD.");
View Full Code Here

        }

        final Iterator<RevCommit> historyIterator = history.iterator();
        Iterators.advance(historyIterator, page * elementsPerPage);

        context.setResponseContent(new CommandResponse() {

            @Override
            public void write(ResponseWriter out) throws Exception {
                out.start();
                out.writeCommits(history.iterator(), elementsPerPage, false);
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.web.api.CommandResponse$ErrorLiteral

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.