use of com.cloudant.client.api.views.ViewRequestBuilder in project sw360 by eclipse.
the class DatabaseRepositoryCloudantClient method queryForIds.
public Collection<? extends String> queryForIds(String queryName, ComplexKey startKeys, ComplexKey endKeys) {
ViewRequestBuilder query = connector.createQuery(type, queryName);
UnpaginatedRequestBuilder reqBuilder = query.newRequest(Key.Type.COMPLEX, Object.class).startKey(startKeys).endKey(endKeys);
return queryForIds(reqBuilder);
}
use of com.cloudant.client.api.views.ViewRequestBuilder in project sw360 by eclipse.
the class DatabaseRepositoryCloudantClient method queryView.
public List<T> queryView(String viewName, String key) {
ViewRequestBuilder query = connector.createQuery(type, viewName);
UnpaginatedRequestBuilder reqBuild = query.newRequest(Key.Type.STRING, Object.class).keys(key).includeDocs(true);
return queryView(reqBuild);
}
use of com.cloudant.client.api.views.ViewRequestBuilder in project sw360 by eclipse.
the class DatabaseRepositoryCloudantClient method queryForIdsAsComplexValue.
public Set<String> queryForIdsAsComplexValue(String queryName, String... keys) {
ViewRequestBuilder query = connector.createQuery(type, queryName);
UnpaginatedRequestBuilder reqBuild = query.newRequest(Key.Type.STRING, Object.class).keys(keys);
return queryForIds(reqBuild);
}
use of com.cloudant.client.api.views.ViewRequestBuilder in project sw360 by eclipse.
the class DatabaseRepositoryCloudantClient method queryForIdsAsComplexValues.
public Set<String> queryForIdsAsComplexValues(String queryName, Map<String, Set<String>> keys) {
Set<String[]> complexKeys = keys.entrySet().stream().map(DatabaseRepositoryCloudantClient::createComplexKeys).flatMap(Collection::stream).collect(Collectors.toSet());
ViewRequestBuilder query = connector.createQuery(type, queryName);
Key.ComplexKey[] complexKys = new Key.ComplexKey[complexKeys.size()];
int index = 0;
for (String[] keyArr : complexKeys) {
Key.ComplexKey key = Key.complex(keyArr);
complexKys[index++] = key;
}
UnpaginatedRequestBuilder reqBuild = query.newRequest(Key.Type.COMPLEX, Object.class).keys(complexKys);
return queryForIds(reqBuild);
}
use of com.cloudant.client.api.views.ViewRequestBuilder in project sw360 by eclipse.
the class DatabaseRepositoryCloudantClient method queryForIds.
public Set<String> queryForIds(String queryName, String startKey, String endKey) {
ViewRequestBuilder query = connector.createQuery(type, queryName);
UnpaginatedRequestBuilder req = query.newRequest(Key.Type.STRING, Object.class).startKey(startKey).endKey(endKey);
return queryForIds(req);
}
Aggregations