org.ovirt.engine.core.common.businessentities.network.Network.isExternal()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.ovirt.engine.core.common.businessentities.network.Network.isExternal()方法的一些代码示例,展示了Network.isExternal()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.isExternal()方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.network.Network
类名称:Network
方法名:isExternal

Network.isExternal介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

public boolean isExternal() {
  return getEntity().isExternal();
}

代码示例来源:origin: oVirt/ovirt-engine

private static boolean noValidOperationForFirstOperand(NetworkItemModel<?> op1) {
  // no valid operation for external networks or networks attached via label
  if (op1 instanceof LogicalNetworkModel) {
    LogicalNetworkModel network = (LogicalNetworkModel) op1;
    if (network.getNetwork().isExternal() || network.isAttachedViaLabel()) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: oVirt/ovirt-engine

public boolean isTunnelled() {
  return isExternal() && getProvidedBy().getPhysicalNetworkId()==null;
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
protected void selectPhysicalDatacenterNetwork() {
  final Network network = getNetwork();
  if (network.isExternal() && network.getProvidedBy().isSetPhysicalNetworkId()) {
    getDatacenterPhysicalNetwork().getItems()
        .stream()
        .filter(net -> Objects.equals(net.getId(), network.getProvidedBy().getPhysicalNetworkId()))
        .findAny()
        .ifPresent(this.getDatacenterPhysicalNetwork()::setSelectedItem);
  }
}

代码示例来源:origin: oVirt/ovirt-engine

private void initNetworkModels() {
  Map<String, LogicalNetworkModel> networkModels = new HashMap<>();
  Map<Guid, NetworkAttachment> networkAttachmentByNetworkId = mapNetworkAttachmentsByNetworkId();
  for (Network network : allNetworks) {
    NetworkAttachment attachment = networkAttachmentByNetworkId.get(network.getId());
    LogicalNetworkModel networkModel = new LogicalNetworkModel(network, attachment, this);
    networkModels.put(network.getName(), networkModel);
    if (networkModel.isManagement()) {
      managementNetworkModel = networkModel;
    }
    if (!network.isExternal()) {
      String label = network.getLabel();
      if (label != null) {
        // The network model is candidate to be drawn as part of the label.
        // This doesn't yet consider whether it actually exists on the interface.
        networkLabelModelByLabel.get(label).getNetworks().add(networkModel);
      }
    }
  }
  setNetworks(networkModels);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public boolean test(Provider<?> provider) {
  return network.isExternal() && provider.getId().equals(network.getProvidedBy().getProviderId());
}

代码示例来源:origin: oVirt/ovirt-engine

private void initPhysicalNetworkList() {
  Frontend.getInstance()
      .runQuery(QueryType.GetAllNetworks,
          new IdQueryParameters(getSelectedDc().getId()),
          new AsyncQuery<QueryReturnValue>(result -> {
            List<Network> networks = result.getReturnValue();
            if (networks != null) {
              getDatacenterPhysicalNetwork().setItems(networks.stream()
                  .filter(network -> !network.isExternal())
                  .collect(Collectors.toList()));
              selectPhysicalDatacenterNetwork();
            }
          }));
}

代码示例来源:origin: oVirt/ovirt-engine

public void onRemove() {
  ArrayList<ActionParametersBase> pb = new ArrayList<>();
  for (Object a : sourceListModel.getSelectedItems()) {
    Network network = (Network) a;
    if (network.isExternal()) {
      pb.add(new RemoveNetworkParameters(network.getId(), getForce().getEntity()));
    } else {
      pb.add(new RemoveNetworkParameters(network.getId()));
    }
  }
  Frontend.getInstance().runMultipleAction(ActionType.RemoveNetwork, pb);
  sourceListModel.setConfirmWindow(null);
}

代码示例来源:origin: oVirt/ovirt-engine

private boolean hasDefinedSubnet() {
    return getExternal().getEntity() && getCreateSubnet().getEntity() && getNetwork().isExternal();
  }
}

代码示例来源:origin: oVirt/ovirt-engine

private boolean isConnectedToPhysicalNetwork() {
  final Network network = getNetwork();
  return network.isExternal() && (network.getProvidedBy().isSetPhysicalNetworkId()
      || StringHelper.isNotNullOrEmpty(network.getProvidedBy().getCustomPhysicalNetworkName()));
}

代码示例来源:origin: oVirt/ovirt-engine

private void updateDescriptionForExternalNetwork(Network network, VnicProfileView vnicProfileView) {
    if (network.isExternal()) {
      UIConstants constants = ConstantsManager.getInstance().getConstants();
      String description = vnicProfileView.getDescription();
      vnicProfileView.setDescription(
          description != null ?
              description + constants.externalNetworkInfo() :
              constants.externalNetworkInfo());
    }
  }
}

代码示例来源:origin: oVirt/ovirt-engine

protected boolean selectedNetworkExternal() {
  VnicProfileView profile = getProfile().getSelectedItem();
  Network network = null;
  if (profile != null && profile.getId() != null) {
    network = getProfileBehavior().findNetworkById(profile.getId());
  }
  return network != null && network.isExternal();
}

代码示例来源:origin: oVirt/ovirt-engine

if (network.isExternal()) {
  externalProviderIds.add(network.getProvidedBy().getProviderId());

代码示例来源:origin: oVirt/ovirt-engine

private void performProfilesActions(Guid networkGuid) {
  List<VnicProfileModel> profileModels = (List<VnicProfileModel>) getProfiles().getItems();
  if (profileModels.isEmpty() || !getProfiles().getIsAvailable()) {
    return;
  }
  networkGuid = networkGuid == null ? getNetwork().getId() : networkGuid;
  ArrayList<ActionParametersBase> paramlist = new ArrayList<>();
  for (VnicProfileModel profileModel : profileModels) {
    if (!StringHelper.isNullOrEmpty(profileModel.getProfile().getName())) {
      VnicProfile vnicProfile = profileModel.getProfile();
      vnicProfile.setNetworkId(networkGuid);
      AddVnicProfileParameters parameters =
          new AddVnicProfileParameters(vnicProfile, !getNetwork().isExternal());
      parameters.setPublicUse(profileModel.getPublicUse().getEntity());
      paramlist.add(parameters);
    }
  }
  Frontend.getInstance().runMultipleActions(ActionType.AddVnicProfile,
      paramlist,
      (IFrontendActionAsyncCallback) null); // cast is required to avoid overload ambiguity
}

代码示例来源:origin: oVirt/ovirt-engine

private void updateProperties() {
  Network extendedNetwork = getEntity();
  setName(extendedNetwork.getName());
  setId(extendedNetwork.getId());
  setDescription(extendedNetwork.getDescription());
  setVmNetwork(extendedNetwork.isVmNetwork());
  setVlan(extendedNetwork.getVlanId());
  setMtu(extendedNetwork.getMtu());
  setVdsmName(extendedNetwork.getVdsmName());
  if (extendedNetwork.isExternal()) {
    setExternalId(extendedNetwork.getProvidedBy().getExternalId());
  } else {
    setExternalId(null);
  }
}

代码示例来源:origin: oVirt/ovirt-engine

private void checkAndMapNetwork() {
  if (getNetwork().isExternal()) {
    startProgress();
    Frontend.getInstance()
        .runQuery(QueryType.GetExternalNetworkById,
            new IdQueryParameters(getNetwork().getId()),
            new AsyncQuery<QueryReturnValue>(result -> {
              Network network = result.getReturnValue();
              if (network != null) {
                getNetwork().setProvidedBy(network.getProvidedBy());
                initEnablePortSecurity();
                if (!getNetwork().getProvidedBy().isSetPhysicalNetworkId()) {
                  initPhysnetAttachmentParameters();
                }
              }
              stopProgress();
            }, true));
  } else {
    getPortSecuritySelector().setSelectedItem(PortSecuritySelectorValue.UNDEFINED);
  }
}

代码示例来源:origin: oVirt/ovirt-engine

if (entity.isExternal()) {
  OpenStackNetworkProvider externalProvider = new OpenStackNetworkProvider();
  externalProvider.setId(entity.getProvidedBy().getProviderId().toString());

代码示例来源:origin: oVirt/ovirt-engine

private void init() {
  setTitle(ConstantsManager.getInstance().getConstants().editLogicalNetworkTitle());
  setHelpTag(HelpTag.edit_logical_network);
  setHashName("edit_logical_network"); //$NON-NLS-1$
  getName().setEntity(getNetwork().getName());
  getDescription().setEntity(getNetwork().getDescription());
  getComment().setEntity(getNetwork().getComment());
  getIsStpEnabled().setEntity(getNetwork().getStp());
  getConnectedToPhysicalNetwork().setEntity(isConnectedToPhysicalNetwork());
  initMtu();
  initIsVm();
  getExternal().setEntity(getNetwork().isExternal());
  getExternal().setIsChangeable(false);
  if (isConnectedToPhysicalNetwork()) {
    if (getNetwork().getProvidedBy().isSetPhysicalNetworkId()) {
      getUsePhysicalNetworkFromDatacenter().setEntity(true);
    }
  } else {
    getNetworkLabel().setSelectedItem(getNetwork().getLabel());
    getHasVLanTag().setEntity(getNetwork().getVlanId() != null);
    getVLanTag().setEntity(getNetwork().getVlanId());
  }
  toggleProfilesAvailability();
}

代码示例来源:origin: oVirt/ovirt-engine

boolean passthroughAndPortMirroringAllowed = network == null || !network.isExternal();

相关文章