/** * Check if the proposed interface represents a VLAN of the given interface name or is equal to it.<br> * If either of the parameters is null, <code>false</code> is returned. * * @param proposedIface * The interface to check if it's a VLAN of the other interface or it is the other interface. * @param iface * The interface to check for. * * @return <code>true</code> if the proposed interface is a VLAN on the interface or if it is the other interface, * <code>false</code> otherwise. */ public static boolean interfaceBasedOn(VdsNetworkInterface proposedIface, String iface) { return iface != null && proposedIface != null && iface.equals(NetworkCommonUtils.stripVlan(proposedIface)); }
public void createModelsForUnamangedNetworks(Map<String, Set<LogicalNetworkModel>> nicToNetworks) { for (VdsNetworkInterface nic : allExistingNics) { if (shouldCreateUnmanagedNetworkModel(nic)) { LogicalNetworkModel networkModel = createUnmanagedNetworkModel(nic.getNetworkName(), nic); networkModelByName.put(networkModel.getName(), networkModel); String baseNicName = NetworkCommonUtils.stripVlan(nic); if (!nicToNetworks.containsKey(baseNicName)) { nicToNetworks.put(baseNicName, new HashSet<LogicalNetworkModel>()); } nicToNetworks.get(baseNicName).add(networkModel); } } }