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

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

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

Network.getCluster介绍

暂无

代码示例

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

public LogicalNetworkModel(Network network,
    NetworkAttachment networkAttachment,
    HostSetupNetworksModel setupModel) {
  super(setupModel);
  this.network = network;
  this.networkAttachment = networkAttachment;
  management = network.getCluster() != null && network.getCluster().isManagement();
}

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

/**
 * Returns the cluster's display network
 */
public static Network getDisplayNetwork(Collection<Network> clusterNetworks) {
  return clusterNetworks.stream().filter(n -> n.getCluster().isDisplay()).findFirst().orElse(null);
}

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

@Override
  public Network mapRow(ResultSet rs, int rowNum) throws SQLException {
    Network entity = super.mapRow(rs, rowNum);
    entity.setCluster(new NetworkCluster());
    entity.getCluster().setDisplay((Boolean) rs.getObject("is_display"));
    entity.getCluster().setRequired(rs.getBoolean("required"));
    entity.getCluster().setStatus(NetworkStatus.forValue(rs.getInt("status")));
    entity.getCluster().setMigration(rs.getBoolean("migration"));
    entity.getCluster().setManagement(rs.getBoolean("management"));
    entity.getCluster().setGluster(rs.getBoolean("is_gluster"));
    entity.getCluster().setDefaultRoute(rs.getBoolean("default_route"));
    return entity;
  }
}

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

@Override
public NetworkStatus getStatus() {
  return getNetwork().getCluster() == null ? null : getNetwork().getCluster().getStatus();
}

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

@Override
  public boolean isRequiredNetworkAffected(NetworkItemModel<?> op1, NetworkItemModel<?> op2) {
    final LogicalNetworkModel logicalNetworkModel = (LogicalNetworkModel) op1;
    return logicalNetworkModel.getNetwork().getCluster().isRequired();
  }
},

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

private static boolean isDisplayNetwork(LogicalNetworkModel logicalNetworkModel) {
    return logicalNetworkModel.getNetwork().getCluster().isDisplay();
  }
}

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

public boolean isRequired() {
  return getEntity().getCluster().isRequired();
}

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

public void setRequired(boolean required) {
  getEntity().getCluster().setRequired(required);
}

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

public boolean isMigrationNetwork() {
  return getEntity().getCluster().isMigration();
}

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

public void setGlusterNetwork(boolean glusterNetwork) {
  getEntity().getCluster().setGluster(glusterNetwork);
}

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

public void setDefaultRouteNetwork(boolean defaultRouteNetwork) {
  getEntity().getCluster().setDefaultRoute(defaultRouteNetwork);
}

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

public boolean isDisplayNetwork() {
  return getEntity().getCluster().isDisplay();
}

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

public boolean isManagement() {
  return getEntity().getCluster().isManagement();
}

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

public boolean isGlusterNetwork() {
  return getEntity().getCluster().isGluster();
}

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

public boolean isDefaultRouteNetwork() {
  return getEntity().getCluster().isDefaultRoute();
}

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

public ClusterNetworkModel(Network network) {
  setEntity(network);
  if (network.getCluster() == null) {
    originalNetworkCluster = null;
    attached = false;
    // Init with default values
    getEntity().setCluster(new NetworkCluster(false));
  } else {
    originalNetworkCluster = (NetworkCluster) Cloner.clone(network.getCluster());
  }
}

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

public void setAsDisplay() {
  final Network network = (Network) Cloner.clone(getSelectedItem());
  network.getCluster().setDisplay(true);
  final NetworkClusterParameters networkClusterParameters = new NetworkClusterParameters(network.getCluster());
  Frontend.getInstance().runAction(ActionType.UpdateNetworkOnCluster, networkClusterParameters);
}

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

private void updateActionAvailability() {
  Network network = getSelectedItem();
  // CanRemove = SelectedItems != null && SelectedItems.Count > 0;
  getSetAsDisplayCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() == 1
      && network != null && !network.getCluster().isDisplay()
      && network.getCluster().getStatus() != NetworkStatus.NON_OPERATIONAL);
  updateActionAvailabilitySyncAllNetworks();
}

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

@Override
public Network update(Network incoming) {
  org.ovirt.engine.core.common.businessentities.network.Network network = map(incoming, map(get()));
  network.getCluster().setNetworkId(network.getId());
  network.getCluster().setClusterId(cluster.getCluster().getId());
  performAction(ActionType.UpdateNetworkOnCluster,
         new NetworkClusterParameters(network.getCluster()));
  return get();
}

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

static org.ovirt.engine.core.common.businessentities.network.Network setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.network.Network entity,
    boolean isDisplay,
    boolean isMigration,
    boolean isRequired,
    boolean isDefaultRoute,
    int index) {
  NetworkCluster networkCluster = new NetworkCluster();
  networkCluster.setDisplay(isDisplay);
  networkCluster.setMigration(isMigration);
  networkCluster.setRequired(isRequired);
  networkCluster.setDefaultRoute(isDefaultRoute);
  when(entity.getCluster()).thenReturn(networkCluster);
  return setUpEntityExpectations(entity, index);
 }

相关文章