Package io.lumify.web.clientapi.model

Examples of io.lumify.web.clientapi.model.ClientApiVertexFindPathResponse


        Vertex destVertex = this.graph.getVertex(findPath.getDestVertexId(), authorizations);
        checkNotNull(destVertex, "Could not find destination vertex: " + findPath.getDestVertexId());
        int hops = findPath.getHops();
        String workspaceId = findPath.getWorkspaceId();

        ClientApiVertexFindPathResponse results = new ClientApiVertexFindPathResponse();
        ProgressCallback progressCallback = new ProgressCallback() {
            @Override
            public void progress(double progressPercent, String message) {
                longRunningProcessRepository.reportProgress(longRunningProcessQueueItem, progressPercent, message);
            }
        };
        Iterable<Path> paths = graph.findPaths(sourceVertex, destVertex, hops, progressCallback, authorizations);
        for (Path path : paths) {
            List<ClientApiElement> clientApiElementPath = ClientApiConverter.toClientApi(graph.getVerticesInOrder(path, authorizations), workspaceId, authorizations);
            List<ClientApiVertex> clientApiVertexPath = new ArrayList<ClientApiVertex>();
            for (ClientApiElement e : clientApiElementPath) {
                clientApiVertexPath.add((ClientApiVertex) e);
            }
            results.getPaths().add(clientApiVertexPath);
        }

        String resultsString = ClientApiConverter.clientApiToString(results);
        JSONObject resultsJson = new JSONObject(resultsString);
        longRunningProcessQueueItem.put("results", resultsJson);
        longRunningProcessQueueItem.put("resultsCount", results.getPaths().size());
    }
View Full Code Here

TOP

Related Classes of io.lumify.web.clientapi.model.ClientApiVertexFindPathResponse

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.