Package org.neo4j.rest.graphdb.entity

Examples of org.neo4j.rest.graphdb.entity.RestNode


        final String startData = (String) path.get("start");
        final String endData = (String) path.get("end");
        final Integer length = (Integer) path.get("length");
        RestRelationship lastRelationship = lastRelationshipData == null ? null : new RestRelationship(lastRelationshipData, restApi);
        return new SimplePath(
                new RestNode(startData,restApi),
                new RestNode(endData,restApi),
                lastRelationship,
                length,
                new IterableWrapper<Node, String>(nodesData) {
                    @Override
                    protected Node underlyingObjectToObject(String data) {
                        return new RestNode(data,restApi);
                    }
                },
                new IterableWrapper<Relationship, String>(relationshipsData) {
                    @Override
                    protected Relationship underlyingObjectToObject(String data) {
View Full Code Here


    public RestNode getNodeById(long id) {
        RestOperations.RestOperation nodeRequest = restRequest.get("node/" + id);
        RestOperations.RestOperation labelsRequest = restRequest.get("node/" + id+"/labels");
        try {
            Map<Long, Object> results = executeBatchRequest();
            RestNode node = (RestNode) results.get(nodeRequest.getBatchId());
            List<String> labels = (List<String>) results.get(labelsRequest.getBatchId());
            node.setLabels(labels);
            return node;
        } catch(RestResultException rre) {
            if (rre.getMessage().contains("NodeNotFoundException")) throw new NotFoundException("Node not found: "+id);
            else throw rre;
        }
View Full Code Here

TOP

Related Classes of org.neo4j.rest.graphdb.entity.RestNode

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.