use of org.kie.workbench.common.services.refactoring.backend.server.query.response.ResponseBuilder in project kie-wb-common by kiegroup.
the class RefactoringQueryServiceImpl method query.
@Override
public List<RefactoringPageRow> query(final String queryName, final Set<ValueIndexTerm> queryTerms) {
PortablePreconditions.checkNotNull("queryName", queryName);
PortablePreconditions.checkNotNull("queryTerms", queryTerms);
final NamedQuery namedQuery = namedQueries.findNamedQuery(queryName);
// Validate provided terms against those required for the named query
namedQuery.validateTerms(queryTerms);
final Query query = namedQuery.toQuery(queryTerms);
final Sort sort = namedQuery.getSortOrder();
final List<KObject> kObjects = search(query, sort, () -> (0), // start index of docs to get
(numHits) -> (numHits), false);
if (!kObjects.isEmpty()) {
final ResponseBuilder responseBuilder = namedQuery.getResponseBuilder();
return responseBuilder.buildResponse(kObjects);
} else {
return Collections.emptyList();
}
}
use of org.kie.workbench.common.services.refactoring.backend.server.query.response.ResponseBuilder in project kie-wb-common by kiegroup.
the class AssetsUsageServiceImplTest method getQueries.
protected Set<NamedQuery> getQueries() {
return new HashSet<NamedQuery>() {
{
add(new FindResourcePartReferencesQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindAllChangeImpactQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
}
};
}
use of org.kie.workbench.common.services.refactoring.backend.server.query.response.ResponseBuilder in project kie-wb-common by kiegroup.
the class FindResourceReferencesQueryValidIndexTermsTest method getQueries.
protected Set<NamedQuery> getQueries() {
return new HashSet<NamedQuery>() {
{
add(new FindResourceReferencesQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindAllChangeImpactQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
}
};
}
use of org.kie.workbench.common.services.refactoring.backend.server.query.response.ResponseBuilder in project kie-wb-common by kiegroup.
the class FormDefinitionIndexerTest method getQueries.
protected Set<NamedQuery> getQueries() {
return new HashSet<NamedQuery>() {
{
add(new FindResourcesQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindAllChangeImpactQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindFormDefinitionIdsQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new FindFormDefinitionIdsQuery.FindFormDefinitionIdsResponseBuilder(ioService());
}
});
}
};
}
use of org.kie.workbench.common.services.refactoring.backend.server.query.response.ResponseBuilder in project kie-wb-common by kiegroup.
the class BpmnFileIndexerTest method getQueries.
protected Set<NamedQuery> getQueries() {
return new HashSet<NamedQuery>() {
{
add(new FindResourcesQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindAllChangeImpactQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new DefaultResponseBuilder(ioService());
}
});
add(new FindBpmnProcessIdsQuery() {
@Override
public ResponseBuilder getResponseBuilder() {
return new FindBpmnProcessIdsQuery.BpmnProcessIdsResponseBuilder(ioService());
}
});
}
};
}
Aggregations