public class GrpcClient extends Object implements AutoCloseable
This class is a light abstraction layer over gRPC - it understands how the sequence of calls should execute and how to translate gRPC objects into Java objects and back.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commit() |
static GrpcClient |
create(GrpcConceptConverter conceptConverter,
GraknGrpc.GraknStub stub) |
Iterator<Object> |
execQuery(Query<?> query) |
Stream<? extends Concept> |
getAttributesByValue(Object value) |
Optional<Concept> |
getConcept(ConceptId id) |
Optional<Concept> |
getSchemaConcept(Label label) |
boolean |
isClosed() |
GrpcGrakn.TxResponse |
next(GrpcIterator.IteratorId iteratorId) |
void |
open(GrpcGrakn.TxRequest openRequest) |
Concept |
putAttributeType(Label label,
AttributeType.DataType<?> dataType) |
Concept |
putEntityType(Label label) |
Concept |
putRelationshipType(Label label) |
Concept |
putRole(Label label) |
Concept |
putRule(Label label,
Pattern when,
Pattern then) |
<T> T |
runConceptMethod(ConceptId id,
ConceptMethod<T> conceptMethod) |
public static GrpcClient create(GrpcConceptConverter conceptConverter, GraknGrpc.GraknStub stub)
public void open(GrpcGrakn.TxRequest openRequest)
public void commit()
public GrpcGrakn.TxResponse next(GrpcIterator.IteratorId iteratorId)
@Nullable public <T> T runConceptMethod(ConceptId id, ConceptMethod<T> conceptMethod)
public Concept putAttributeType(Label label, AttributeType.DataType<?> dataType)
public void close()
close in interface AutoCloseablepublic boolean isClosed()
Copyright © 2018 Grakn Labs Ltd. All rights reserved.