Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Platform


        }
        if (!enabled.booleanValue()) {
            return command;
        }

        final Platform platform = command.context().platform();
        final long startTime = platform.currentTimeMillis();
        final long nanoTime = platform.nanoTime();
        final String name = command.getClass().getSimpleName();
        CallStack stack = CallStack.push(name, startTime, nanoTime);
        command.getClientData().put("metrics.callStack", stack);
        return command;
    }
View Full Code Here


        CallStack stack = (CallStack) command.getClientData().get("metrics.callStack");
        if (stack == null || command.context().repository() == null) {
            return (T) retVal;
        }

        final Platform platform = command.context().platform();
        long endTime = platform.nanoTime();
        boolean success = exception == null;
        stack = CallStack.pop(endTime, success);
        long ellapsed = stack.getEllapsedNanos();

        double millis = endTime * toMillisFactor;
 
View Full Code Here

        try {
            workingDirectory = mockWorkingDirTempFolder.getRoot();
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        Platform testPlatform = new TestPlatform(workingDirectory);
        return Guice.createInjector(
                Modules.override(new GeogigModule()).with(new MongoTestStorageModule(),
                        new TestModule(testPlatform))).getInstance(Context.class);
    }
View Full Code Here

        try {
            workingDirectory = mockWorkingDirTempFolder.getRoot();
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        Platform testPlatform = new TestPlatform(workingDirectory);
        return Guice.createInjector(
                Modules.override(new GeogigModule()).with(new MongoTestStorageModule(),
                        new TestModule(testPlatform))).getInstance(Context.class);
    }
View Full Code Here

        setUpInternal();
    }

    protected Context createInjector() {
        Platform testPlatform = createPlatform();
        GlobalContextBuilder.builder = new TestContextBuilder(testPlatform);
        return GlobalContextBuilder.builder.build();
    }
View Full Code Here

        GlobalContextBuilder.builder = new TestContextBuilder(testPlatform);
        return GlobalContextBuilder.builder.build();
    }

    protected Platform createPlatform() {
        Platform testPlatform = new TestPlatform(envHome);
        return testPlatform;
    }
View Full Code Here

        try {
            workingDirectory = mockWorkingDirTempFolder.getRoot();
        } catch (Exception e) {
            throw Throwables.propagate(e);
        }
        Platform testPlatform = new TestPlatform(workingDirectory);
        return Guice.createInjector(
                Modules.override(new GeogigModule()).with(new JETestStorageModule(),
                        new TestModule(testPlatform))).getInstance(Context.class);
    }
View Full Code Here

        return decoder;
    }

    static GeoGIG loadGeoGIG(String repo) {
        Platform platform = new DefaultPlatform();
        platform.setWorkingDir(new File(repo));
        Context inj = GlobalContextBuilder.builder.build();
        GeoGIG geogig = new GeoGIG(inj, platform.pwd());

        if (geogig.command(ResolveGeogigDir.class).call().isPresent()) {
            geogig.getRepository();
            return geogig;
        }
View Full Code Here

        FileBackedOutputStream out = new FileBackedOutputStream(4096);
        try {
            // pass it a BufferedOutputStream 'cause it doesn't buffer the internal FileOutputStream
            ConsoleReader console = new ConsoleReader(in, new BufferedOutputStream(out),
                    new UnsupportedTerminal());
            Platform platform = geogig.getPlatform();

            GeogigCLI geogigCLI = new GeogigCLI(geogig, console);
            geogigCLI.setPlatform(platform);
            geogigCLI.disableProgressListener();
View Full Code Here

            throw new CommandFailedException("Unable to start server", e);
        }
    }

    GeoGIG loadGeoGIG(String repo, GeogigCLI cli) {
        Platform platform = new DefaultPlatform();
        platform.setWorkingDir(new File(repo));

        GeoGIG geogig = new GeoGIG(cli.getGeogigInjector(), platform.pwd());
        if (geogig.command(ResolveGeogigDir.class).call().isPresent()) {
            geogig.getRepository();
        }

        return geogig;
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.Platform

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.