protected void network(Instance instance) { List<Nic> nics = getObjectManager().children(instance, Nic.class); for (Nic nic : nics) { if (nic.getRemoved() == null && !nic.getState().equals(CommonStatesConstants.REMOVED)) { deactivate(nic, null); } } for (Port port : getObjectManager().children(instance, Port.class)) { if (port.getRemoved() == null && !port.getState().equals(CommonStatesConstants.REMOVED)) { deactivate(port, null); } } for (InstanceLink link : getObjectManager().children(instance, InstanceLink.class, InstanceLinkConstants.FIELD_INSTANCE_ID)) { if (link.getRemoved() == null && !link.getState().equals(CommonStatesConstants.REMOVED)) { deactivate(link, null); } } }
/** * {@inheritDoc} */ @Override public void from(io.cattle.platform.core.model.Nic from) { setId(from.getId()); setName(from.getName()); setAccountId(from.getAccountId()); setKind(from.getKind()); setUuid(from.getUuid()); setDescription(from.getDescription()); setState(from.getState()); setCreated(from.getCreated()); setRemoved(from.getRemoved()); setRemoveTime(from.getRemoveTime()); setData(from.getData()); setInstanceId(from.getInstanceId()); setNetworkId(from.getNetworkId()); setDeviceNumber(from.getDeviceNumber()); setMacAddress(from.getMacAddress()); }