use of org.bf2.cos.fleet.manager.model.ConnectorNamespace in project cos-fleetshard by bf2fc6cc711aee1a0c2a.
the class SyncTestSupport method namespace.
public static ConnectorNamespace namespace(String id, String name, Consumer<ConnectorNamespace> consumer) {
ConnectorNamespace answer = new ConnectorNamespace().id(id).name(name);
consumer.accept(answer);
if (answer.getStatus() == null) {
answer.setStatus(new ConnectorNamespaceStatus1());
}
if (answer.getStatus().getConnectorsDeployed() == null) {
answer.getStatus().setConnectorsDeployed(0);
}
return answer;
}
use of org.bf2.cos.fleet.manager.model.ConnectorNamespace 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