Skip to content

Commit

Permalink
* restApi now has methods to return a plugin or a service for remote…
Browse files Browse the repository at this point in the history
… invocation
  • Loading branch information
Klemens Burchardi committed Oct 20, 2011
1 parent 3c117c5 commit ecac440
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/main/java/org/neo4j/rest/graphdb/RestAPI.java
Expand Up @@ -36,11 +36,10 @@
import org.neo4j.rest.graphdb.entity.RestEntity;
import org.neo4j.rest.graphdb.entity.RestNode;
import org.neo4j.rest.graphdb.entity.RestRelationship;
import org.neo4j.rest.graphdb.index.IndexInfo;
import org.neo4j.rest.graphdb.index.RestIndex;
import org.neo4j.rest.graphdb.index.RestIndexManager;
import org.neo4j.rest.graphdb.index.RetrievedIndexInfo;
import org.neo4j.rest.graphdb.index.SimpleIndexHits;
import org.neo4j.rest.graphdb.index.*;
import org.neo4j.rest.graphdb.services.PluginInvocation;
import org.neo4j.rest.graphdb.services.RestInvocationHandler;
import org.neo4j.rest.graphdb.services.ServiceInvocation;
import org.neo4j.rest.graphdb.traversal.RestTraversal;
import org.neo4j.rest.graphdb.util.JsonHelper;

Expand Down Expand Up @@ -321,6 +320,13 @@ public <T> void addToIndex( T entity, RestIndex index, String key, Object value
if (result.getStatus()!=201) throw new RuntimeException(String.format("Error adding element %d %s %s to index %s", restEntity.getId(), key, value, index.getIndexName()));
}



public <T> T getPlugin(Class<T> type){
return RestInvocationHandler.getInvocationProxy(type, this, new PluginInvocation(this, type));
}

public <T> T getService(Class<T> type, String baseUri){
return RestInvocationHandler.getInvocationProxy(type, this, new ServiceInvocation(this, type, baseUri));
}

}

0 comments on commit ecac440

Please sign in to comment.