use of org.bf2.cos.fleet.manager.model.ConnectorNamespaceList in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class SyncTestSupport method namespaceList.
public static ObjectNode namespaceList(ConnectorNamespace... namespaces) {
var items = new ConnectorNamespaceList();
items.page(1);
items.size(namespaces.length);
items.total(namespaces.length);
for (ConnectorNamespace namespace : namespaces) {
items.addItemsItem(namespace);
}
return Serialization.jsonMapper().convertValue(items, ObjectNode.class);
}
use of org.bf2.cos.fleet.manager.model.ConnectorNamespaceList in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class FleetManagerClient method getNamespaces.
public void getNamespaces(long gv, Consumer<Collection<ConnectorNamespace>> consumer) {
RestClientHelper.run(() -> {
LOGGER.debug("polling namespaces with gv: {}", gv);
final AtomicInteger counter = new AtomicInteger();
final List<ConnectorNamespace> items = new ArrayList<>();
for (int i = 1; i < Integer.MAX_VALUE; i++) {
ConnectorNamespaceList list = controlPlane.getConnectorNamespaces(config.cluster().id(), Integer.toString(i), null, gv);
if (list == null || list.getItems() == null || list.getItems().isEmpty()) {
LOGGER.info("No namespace for cluster {}", config.cluster().id());
break;
}
items.addAll(list.getItems());
consumer.accept(items);
if (counter.addAndGet(items.size()) >= list.getTotal()) {
break;
}
}
});
}
Aggregations