本文整理了Java中org.ovirt.engine.core.common.businessentities.network.Network.setMtu()
方法的一些代码示例,展示了Network.setMtu()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.setMtu()
方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.network.Network
类名称:Network
方法名:setMtu
暂无
代码示例来源:origin: oVirt/ovirt-engine
@Override
public T mapRow(ResultSet rs, int rowNum) throws SQLException {
T entity = createNetworkEntity();
entity.setId(getGuidDefaultEmpty(rs, "id"));
entity.setName(rs.getString("name"));
entity.setVdsmName(rs.getString("vdsm_name"));
entity.setDescription(rs.getString("description"));
entity.setComment(rs.getString("free_text_comment"));
entity.setType((Integer) rs.getObject("type"));
entity.setAddr(rs.getString("addr"));
entity.setSubnet(rs.getString("subnet"));
entity.setGateway(rs.getString("gateway"));
entity.setVlanId((Integer) rs.getObject("vlan_id"));
entity.setStp(rs.getBoolean("stp"));
entity.setDataCenterId(getGuidDefaultEmpty(rs, "storage_pool_id"));
entity.setMtu(rs.getInt("mtu"));
entity.setVmNetwork(rs.getBoolean("vm_network"));
Guid providerId = getGuid(rs, "provider_network_provider_id");
if (providerId != null) {
entity.setProvidedBy(new ProviderNetwork(
providerId,
rs.getString("provider_network_external_id"),
getGuid(rs, "provider_physical_network_id")));
}
entity.setQosId(getGuid(rs, "qos_id"));
entity.setLabel(rs.getString("label"));
Guid dnsResolverConfigurationId = getGuid(rs, "dns_resolver_configuration_id");
entity.setDnsResolverConfiguration(dnsResolverConfigurationDao.get(dnsResolverConfigurationId));
return entity;
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testIsNetworkInSyncWhenMtuDifferent() {
iface.setMtu(1);
network.setMtu(2);
assertThat(createTestedInstance().isNetworkInSync(), is(false));
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testIsNetworkInSyncWhenMtuSameViaDefault() {
NetworkInSyncWithVdsNetworkInterface testedInstanceWithSameNonQosValues =
createTestedInstanceWithSameNonQosValues();
iface.setMtu(DEFAULT_MTU_VALUE);
network.setMtu(VALUE_DENOTING_THAT_MTU_SHOULD_BE_SET_TO_DEFAULT_VALUE);
assertThat(testedInstanceWithSameNonQosValues.isNetworkInSync(), is(true));
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testIsNetworkInSyncWhenVlanIdDifferent() {
iface.setMtu(1);
network.setMtu(1);
iface.setVlanId(1);
network.setVlanId(2);
assertThat(createTestedInstance().isNetworkInSync(), is(false));
}
代码示例来源:origin: oVirt/ovirt-engine
private LogicalNetworkModel createUnmanagedNetworkModel(String networkName, VdsNetworkInterface nic) {
Network unmanagedNetwork = new Network();
unmanagedNetwork.setName(networkName);
unmanagedNetwork.setVlanId(nic.getVlanId());
unmanagedNetwork.setMtu(nic.getMtu());
unmanagedNetwork.setVmNetwork(nic.isBridged());
LogicalNetworkModel networkModel = new LogicalNetworkModel(unmanagedNetwork, null, this);
return networkModel;
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testIsNetworkInSyncWhenBridgedFlagDifferent() {
iface.setMtu(1);
network.setMtu(1);
iface.setVlanId(1);
network.setVlanId(1);
iface.setBridged(true);
network.setVmNetwork(false);
assertThat(createTestedInstance().isNetworkInSync(), is(false));
}
代码示例来源:origin: oVirt/ovirt-engine
private NetworkInSyncWithVdsNetworkInterface createTestedInstanceWithSameNonQosValues(boolean isDefaultRouteNetwork) {
iface.setMtu(1);
network.setMtu(1);
iface.setVlanId(1);
network.setVlanId(1);
iface.setBridged(true);
network.setVmNetwork(true);
return createTestedInstance(isDefaultRouteNetwork, sampleDnsResolverConfiguration);
}
代码示例来源:origin: oVirt/ovirt-engine
public void flush() {
network.setDataCenterId(getSelectedDc().getId());
network.setName(getName().getEntity());
network.setStp(getIsStpEnabled().getEntity());
network.setDescription(getDescription().getEntity());
network.setComment(getComment().getEntity());
network.setVmNetwork(getIsVmNetwork().getEntity());
String label = getNetworkLabel().getSelectedItem();
network.setLabel(StringHelper.isNotNullOrEmpty(label) ? label : null);
network.setDefaultMtu();
if (getMtu().getIsChangable()) {
network.setMtu(Integer.parseInt(getMtu().getEntity().toString()));
}
network.setDnsResolverConfiguration(getDnsConfigurationModel().flush());
network.setVlanId(null);
if (getHasVLanTag().getEntity() && !getExternal().getEntity()) {
network.setVlanId(Integer.parseInt(getVLanTag().getEntity().toString()));
}
for (VnicProfileModel profileModel : getProfiles().getItems()) {
profileModel.flush();
}
if (getQos().getIsChangable()) {
HostNetworkQos qos = getQos().getSelectedItem();
network.setQosId(qos == EMPTY_HOST_NETWORK_QOS ? null : qos.getId());
}
}
代码示例来源:origin: oVirt/ovirt-engine
entity.setMtu(model.getMtu());
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!