use of org.ovirt.engine.core.bll.network.predicate.NetworkNotInSyncPredicate in project ovirt-engine by oVirt.
the class SyncAllHostNetworksCommand method generateSyncAllHostNetworksParameters.
private PersistentHostSetupNetworksParameters generateSyncAllHostNetworksParameters() {
PersistentHostSetupNetworksParameters parameters = new PersistentHostSetupNetworksParameters(getVdsId());
QueryReturnValue returnValue = runInternalQuery(QueryType.GetNetworkAttachmentsByHostId, new IdQueryParameters(getVdsId()));
List<NetworkAttachment> networkAttachments = returnValue.getReturnValue();
List<NetworkAttachment> unSyncNetworkAttachments = networkAttachments.stream().filter(new NetworkNotInSyncPredicate()).collect(Collectors.toList());
for (NetworkAttachment networkAttachment : unSyncNetworkAttachments) {
networkAttachment.setOverrideConfiguration(true);
}
parameters.setNetworkAttachments(unSyncNetworkAttachments);
parameters.setSequence(parameters.getSequence() + 1);
parameters.setTotal(parameters.getTotal() + 1);
return parameters;
}
Aggregations