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

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

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

Network.getDataCenterId介绍

暂无

代码示例

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

@JsonIgnore
@Override
public Guid getStoragePoolId() {
  return getDataCenterId();
}

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

public org.ovirt.engine.core.common.businessentities.network.Network lookupNetwork(Guid id, String name, String dataCenterId) {
  for (org.ovirt.engine.core.common.businessentities.network.Network entity : getBackendCollection(queryType, getQueryParameters())) {
    if ((id != null && id.equals(entity.getId())) ||
      (name != null && name.equals(entity.getName()))
      && (entity.getDataCenterId()!=null) && entity.getDataCenterId().toString().equals(dataCenterId)) {
      return entity;
    }
  }
  return null;
}

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

@Override
  public ActionParametersBase getParameters(Network incoming, org.ovirt.engine.core.common.businessentities.network.Network entity) {
    org.ovirt.engine.core.common.businessentities.network.Network updated = getMapper(modelType, org.ovirt.engine.core.common.businessentities.network.Network.class).map(incoming, entity);
    return new AddNetworkStoragePoolParameters(entity.getDataCenterId(), updated);
  }
}

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

@Override
  public ActionParametersBase getParameters(
      Network incoming,
      org.ovirt.engine.core.common.businessentities.network.Network entity) {
    org.ovirt.engine.core.common.businessentities.network.Network updated = getMapper(
      Network.class,
      org.ovirt.engine.core.common.businessentities.network.Network.class
    ).map(incoming, entity);
    return new AddNetworkStoragePoolParameters(entity.getDataCenterId(), updated);
  }
}

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

static org.ovirt.engine.core.common.businessentities.network.Network setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.Network entity, int index) {
  when(entity.getId()).thenReturn(GUIDS[index]);
  when(entity.getName()).thenReturn(NAMES[index]);
  when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]);
  when(entity.getDataCenterId()).thenReturn(GUIDS[1]);
  return entity;
}

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

private void verifyDataCenterNetworks(List<Network> result) {
  assertNotNull(result);
  assertFalse(result.isEmpty());
  for (Network net : result) {
    assertEquals(FixturesTool.DATA_CENTER, net.getDataCenterId());
  }
}

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

@Override
protected AddNetworkStoragePoolParameters getAddParameters(Network network,
    org.ovirt.engine.core.common.businessentities.network.Network entity) {
  if (namedDataCenter(network)) {
    entity.setDataCenterId(getDataCenterId(network));
  }
  AddNetworkStoragePoolParameters parameters =
      new AddNetworkStoragePoolParameters(entity.getDataCenterId(), entity);
  if (network != null && network.isSetProfileRequired()) {
    parameters.setVnicProfileRequired(network.isProfileRequired());
  }
  return parameters;
}

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

@Override
protected AddNetworkStoragePoolParameters getAddParameters(
    Network network,
    org.ovirt.engine.core.common.businessentities.network.Network entity) {
  if (namedDataCenter(network)) {
    entity.setDataCenterId(getDataCenterId(network));
  }
  AddNetworkStoragePoolParameters parameters =
    new AddNetworkStoragePoolParameters(entity.getDataCenterId(), entity);
  if (network != null && network.isSetProfileRequired()) {
    parameters.setVnicProfileRequired(network.isProfileRequired());
  }
  return parameters;
}

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

private void initDcList(final NetworkModel networkModel) {
  // Get all data centers
  AsyncDataProvider.getInstance().getDataCenterList(new AsyncQuery<>(dataCenters -> {
    networkModel.getDataCenters().setItems(dataCenters);
    if (networkModel instanceof EditNetworkModel) {
      StoragePool currentDc =
          findDc(networkModel.getNetwork().getDataCenterId(), dataCenters);
      networkModel.getDataCenters().setSelectedItem(currentDc);
    } else {
      networkModel.getDataCenters().setSelectedItem(Linq.firstOrNull(dataCenters));
    }
  }));
}

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

model.setDescription(entity.getDescription());
model.setComment(entity.getComment());
if (entity.getDataCenterId() != null) {
  DataCenter dataCenter = new DataCenter();
  dataCenter.setId(entity.getDataCenterId().toString());
  model.setDataCenter(dataCenter);

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

@Override
public String toString() {
  return ToStringBuilder.forInstance(this)
      .append("id", getId())
      .append("description", getDescription())
      .append("comment", getComment())
      .append("vdsmName", getVdsmName())
      .append("subnet", getSubnet())
      .append("gateway", getGateway())
      .append("type", getType())
      .append("vlanId", getVlanId())
      .append("stp", getStp())
      .append("dataCenterId", getDataCenterId())
      .append("mtu", getMtu())
      .append("vmNetwork", isVmNetwork())
      .append("cluster", getCluster())
      .append("providedBy", getProvidedBy())
      .append("label", getLabel())
      .append("qosId", getQosId())
      .append("dnsResolverConfiguration", dnsResolverConfiguration)
      .build();
}

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

private static Network cloneNetwork(Network instance) {
  Network obj = new Network();
  obj.setAddr(instance.getAddr());
  obj.setDescription(instance.getDescription());
  obj.setComment(instance.getComment());
  obj.setId(instance.getId());
  obj.setName(instance.getName());
  obj.setVdsmName(instance.getVdsmName());
  obj.setSubnet(instance.getSubnet());
  obj.setGateway(instance.getGateway());
  obj.setType(instance.getType());
  obj.setVlanId(instance.getVlanId());
  obj.setStp(instance.getStp());
  obj.setDataCenterId(instance.getDataCenterId());
  obj.setMtu(instance.getMtu());
  obj.setVmNetwork(instance.isVmNetwork());
  if (instance.getCluster() !=null){
    obj.setCluster(cloneNetworkCluster(instance.getCluster()));
  }
  if (instance.getProvidedBy() != null) {
    obj.setProvidedBy(cloneProviderNetwork(instance.getProvidedBy()));
  }
  return obj;
}

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

@Override
protected MapSqlParameterSource createFullParametersMapper(Network network) {
  return getCustomMapSqlParameterSource()
      .addValue("addr", network.getAddr())
      .addValue("description", network.getDescription())
      .addValue("free_text_comment", network.getComment())
      .addValue("id", network.getId())
      .addValue("name", network.getName())
      .addValue("vdsm_name", network.getVdsmName())
      .addValue("subnet", network.getSubnet())
      .addValue("gateway", network.getGateway())
      .addValue("type", network.getType())
      .addValue("vlan_id", network.getVlanId())
      .addValue("stp", network.getStp())
      .addValue("storage_pool_id", network.getDataCenterId())
      .addValue("mtu", network.getMtu())
      .addValue("vm_network", network.isVmNetwork())
      .addValue("provider_network_provider_id",
          network.getProvidedBy() == null ? null : network.getProvidedBy().getProviderId())
      .addValue("provider_network_external_id",
          network.getProvidedBy() == null ? null : network.getProvidedBy().getExternalId())
      .addValue("provider_physical_network_id",
          network.getProvidedBy() == null ? null : network.getProvidedBy().getPhysicalNetworkId())
      .addValue("qos_id", network.getQosId())
      .addValue("label", network.getLabel())
      .addValue("dns_resolver_configuration_id", getDnsResolverConfigurationId(network));
}

相关文章