@Override public boolean updateState(final State currentState, final Event event, final State nextState, final Network vo, final Object data) { // TODO: ensure this update is correct final TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); final NetworkVO networkVo = (NetworkVO)vo; networkVo.setState(nextState); super.update(networkVo.getId(), networkVo); txn.commit(); return true; }
@Override public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) { // Check of the isolation type of the related physical network is VLAN PhysicalNetworkVO physnet = _physicalNetworkDao.findById(plan.getPhysicalNetworkId()); DataCenter dc = _dcDao.findById(plan.getDataCenterId()); if (!canHandle(offering, dc.getNetworkType(), physnet)) { s_logger.debug("Refusing to design this network"); return null; } s_logger.debug("Physical isolation type is VCS, asking GuestNetworkGuru to design this network"); NetworkVO networkObject = (NetworkVO)super.design(offering, plan, userSpecified, owner); if (networkObject == null) { return null; } // Override the broadcast domain type networkObject.setBroadcastDomainType(BroadcastDomainType.Vcs); networkObject.setState(State.Allocated); return networkObject; }
@Override public Network design(final NetworkOffering offering, final DeploymentPlan plan, final Network userSpecified, final Account owner) { // Check of the isolation type of the related physical network is supported final PhysicalNetworkVO physnet = physicalNetworkDao.findById(plan.getPhysicalNetworkId()); final DataCenter dc = _dcDao.findById(plan.getDataCenterId()); if (!canHandle(offering, dc.getNetworkType(), physnet)) { s_logger.debug("Refusing to design this network"); return null; } final List<NiciraNvpDeviceVO> devices = niciraNvpDao.listByPhysicalNetwork(physnet.getId()); if (devices.isEmpty()) { s_logger.error("No NiciraNvp Controller on physical network " + physnet.getName()); return null; } s_logger.debug("Nicira Nvp " + devices.get(0).getUuid() + " found on physical network " + physnet.getId()); s_logger.debug("Physical isolation type is supported, asking GuestNetworkGuru to design this network"); final NetworkVO networkObject = (NetworkVO) super.design(offering, plan, userSpecified, owner); if (networkObject == null) { return null; } networkObject.setBroadcastDomainType(BroadcastDomainType.Lswitch); if (offering.getGuestType().equals(GuestType.Shared)){ networkObject.setState(State.Allocated); } return networkObject; }
@Override public Network design(NetworkOffering offering, DeploymentPlan plan, Network userSpecified, Account owner) { if (_networkModel.areServicesSupportedByNetworkOffering(offering.getId(), Network.Service.Connectivity)) { return null; } NetworkVO config = (NetworkVO)super.design(offering, plan, userSpecified, owner); if (config == null) { return null; } else if (_networkModel.networkIsConfiguredForExternalNetworking(plan.getDataCenterId(), config.getId())) { /* In order to revert userSpecified network setup */ config.setState(State.Allocated); } return config; }
network.setDns1(zone.getDns1()); network.setDns2(zone.getDns2()); network.setState(State.Implemented); _networkDao.persist(network, false, getServicesAndProvidersForNetwork(networkOfferingId)); id++;
final DataCenterVO zone = _dcDao.findById(networkFinal.getDataCenterId()); if (isSharedNetworkOfferingWithServices(networkFinal.getNetworkOfferingId()) && zone.getNetworkType() == NetworkType.Advanced) { networkFinal.setState(Network.State.Setup); } else { try { stateTransitTo(networkFinal, Event.OperationSucceeded); } catch (final NoTransitionException e) { networkFinal.setState(Network.State.Allocated); networkFinal.setRestartRequired(false); stateTransitTo(networkFinal, Event.OperationFailed); } catch (final NoTransitionException e) { networkFinal.setState(Network.State.Implemented); _networksDao.update(networkFinal.getId(), networkFinal);
network.setState(Network.State.Implementing); } else { stateTransitTo(network, Event.ImplementNetwork); network.setState(Network.State.Implemented); } else { stateTransitTo(network, Event.OperationSucceeded); try { if (isSharedNetworkWithServices(network)) { network.setState(Network.State.Shutdown); _networksDao.update(networkId, network); } else {
copiedNetwork.setDisplayNetwork(false); copiedNetwork.setBroadcastUri(network.getBroadcastUri()); copiedNetwork.setState(network.getState()); _networksDao.update(networkCopyId, copiedNetwork);
saveNetworkDetail(networkId, NuageVspManager.NETWORK_METADATA_VSD_MANAGED, "true"); forUpdate.setState(State.Allocated); _networkDao.update(networkId, forUpdate);
network.setState(State.Setup);
implemented.setGateway(config.getGateway()); implemented.setCidr(config.getCidr()); implemented.setState(State.Implemented); } else { implemented.setGateway(NetUtils.long2Ip(newCidrAddress + 1)); implemented.setCidr(NetUtils.long2Ip(newCidrAddress) + "/" + cidrSize); implemented.setState(State.Implemented);
network.setBroadcastUri(designedNetwork.getBroadcastUri()); network.setNetworkOfferingId(designedNetwork.getNetworkOfferingId()); network.setState(designedNetwork.getState()); network.setPhysicalNetworkId(designedNetwork.getPhysicalNetworkId()); network.setRedundant(designedNetwork.isRedundant());
network.setState(State.Setup);
physicalNetworkId, network.getAclType(), network.getSpecifyIpRanges(), network.getVpcId(), offering.isRedundantRouter(), network.getExternalId()); implemented.setUuid(network.getUuid()); implemented.setState(State.Allocated); if (network.getGateway() != null) { implemented.setGateway(network.getGateway());
config.setState(State.Setup);