public ReportedConfigurations getReportedConfigurations() { NetworkAttachment networkAttachment = getNetworkAttachment(); return networkAttachment == null ? null : networkAttachment.getReportedConfigurations(); }
private void initValues() { if (networkAttachment == null) { return; } boolean newAttachment = networkAttachment.getId() == null; // If the 'ReportedConfigurations' of the attachment is 'null' it means the attachment wasn't reported from the // engine (all the attachments reported from the engine have // 'ReportedConfigurations'). So it means this network is for sure in sync, since the ui already modified it and // created new instance of the attachment for it (an out-of-sync network cannot be modified). boolean attachmentNotReportedByTheEngine = networkAttachment.getReportedConfigurations() == null; boolean syncedNetwork = attachmentNotReportedByTheEngine || networkAttachment.getReportedConfigurations().isNetworkInSync(); boolean syncRequestedByUser = !syncedNetwork && Boolean.TRUE.equals(getIsToSync().getEntity()); if (newAttachment || syncedNetwork || syncRequestedByUser) { syncWith(new InterfacePropertiesAccessor.FromNetworkAttachmentForModel(networkAttachment, networkQos, nic)); } else { syncWith(new InterfacePropertiesAccessor.FromNic(nic, reportedDnsResolverConfiguration)); } }
public NetworkAttachment(NetworkAttachment networkAttachment) { id = networkAttachment.getId(); nicId = networkAttachment.getNicId(); nicName = networkAttachment.getNicName(); networkId = networkAttachment.getNetworkId(); networkName = networkAttachment.getNetworkName(); ipConfiguration = networkAttachment.getIpConfiguration(); properties = networkAttachment.getProperties(); overrideConfiguration = networkAttachment.isOverrideConfiguration(); reportedConfigurations = networkAttachment.getReportedConfigurations(); }
if (entity.getReportedConfigurations() != null) { model.setInSync(entity.getReportedConfigurations().isNetworkInSync()); model.setReportedConfigurations(ReportedConfigurationsMapper.map(entity.getReportedConfigurations(), null));