use of org.neo4j.server.rest.repr.IndexDefinitionRepresentation in project neo4j by neo4j.
the class DatabaseActions method getSchemaIndexes.
public ListRepresentation getSchemaIndexes() {
Iterable<IndexDefinition> definitions = graphDb.schema().getIndexes();
Iterable<IndexDefinitionRepresentation> representations = map(new Function<IndexDefinition, IndexDefinitionRepresentation>() {
@Override
public IndexDefinitionRepresentation apply(IndexDefinition definition) {
return new IndexDefinitionRepresentation(definition, graphDb.schema().getIndexState(definition), graphDb.schema().getIndexPopulationProgress(definition));
}
}, definitions);
return new ListRepresentation(RepresentationType.INDEX_DEFINITION, representations);
}
use of org.neo4j.server.rest.repr.IndexDefinitionRepresentation in project neo4j by neo4j.
the class TransactionWrappedDatabaseActions method createSchemaIndex.
@Override
public IndexDefinitionRepresentation createSchemaIndex(String labelName, Iterable<String> propertyKey) {
try (Transaction transaction = graph.beginTx()) {
IndexDefinitionRepresentation indexDefinitionRepresentation = super.createSchemaIndex(labelName, propertyKey);
transaction.success();
return indexDefinitionRepresentation;
}
}
use of org.neo4j.server.rest.repr.IndexDefinitionRepresentation in project neo4j by neo4j.
the class DatabaseActions method getSchemaIndexes.
public ListRepresentation getSchemaIndexes(String labelName) {
Iterable<IndexDefinition> definitions = graphDb.schema().getIndexes(label(labelName));
Iterable<IndexDefinitionRepresentation> representations = map(new Function<IndexDefinition, IndexDefinitionRepresentation>() {
@Override
public IndexDefinitionRepresentation apply(IndexDefinition definition) {
return new IndexDefinitionRepresentation(definition, graphDb.schema().getIndexState(definition), graphDb.schema().getIndexPopulationProgress(definition));
}
}, definitions);
return new ListRepresentation(RepresentationType.INDEX_DEFINITION, representations);
}
Aggregations