protected boolean canHandle(final Network network, final Service service) { s_logger.debug( "Checking if OvsElement can handle service " + service.getName() + " on network " + network.getDisplayText()); if (network.getBroadcastDomainType() != BroadcastDomainType.Vswitch) { return false; } if (!_networkModel.isProviderForNetwork(getProvider(), network.getId())) { s_logger.debug("OvsElement is not a provider for network " + network.getDisplayText()); return false; } if (!_ntwkSrvcDao.canProviderSupportServiceInNetwork( network.getId(), service, Network.Provider.Ovs)) { s_logger.debug( "OvsElement can't provide the " + service.getName() + " service on network " + network.getDisplayText()); return false; } return true; }
public NetworkProfile(Network network) { this.id = network.getId(); this.uuid = network.getUuid(); this.broadcastUri = network.getBroadcastUri(); this.dataCenterId = network.getDataCenterId(); this.ownerId = network.getAccountId(); this.state = network.getState(); this.name = network.getName(); this.mode = network.getMode(); this.broadcastDomainType = network.getBroadcastDomainType(); this.trafficType = network.getTrafficType(); this.gateway = network.getGateway(); this.cidr = network.getCidr(); this.networkOfferingId = network.getNetworkOfferingId(); this.related = network.getRelated(); this.displayText = network.getDisplayText(); this.reservationId = network.getReservationId(); this.networkDomain = network.getNetworkDomain(); this.domainId = network.getDomainId(); this.guestType = network.getGuestType(); this.physicalNetworkId = network.getPhysicalNetworkId(); this.aclType = network.getAclType(); this.restartRequired = network.isRestartRequired(); this.specifyIpRanges = network.getSpecifyIpRanges(); this.vpcId = network.getVpcId(); }
@Override public boolean implement( final Network network, final NetworkOffering offering, final DeployDestination dest, final ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException { s_logger.debug( "entering OvsElement implement function for network " + network.getDisplayText() + " (state " + network.getState() + ")"); if (!canHandle(network, Service.Connectivity)) { return false; } return true; }