本文整理汇总了Java中com.cloud.vm.NicVO.setIPv4Address方法的典型用法代码示例。如果您正苦于以下问题:Java NicVO.setIPv4Address方法的具体用法?Java NicVO.setIPv4Address怎么用?Java NicVO.setIPv4Address使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.cloud.vm.NicVO
的用法示例。
在下文中一共展示了NicVO.setIPv4Address方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyProfileToNicForRelease
import com.cloud.vm.NicVO; //导入方法依赖的package包/类
protected void applyProfileToNicForRelease(final NicVO vo, final NicProfile profile) {
vo.setIPv4Gateway(profile.getIPv4Gateway());
vo.setAddressFormat(profile.getFormat());
vo.setIPv4Address(profile.getIPv4Address());
vo.setIPv6Address(profile.getIPv6Address());
vo.setMacAddress(profile.getMacAddress());
if (profile.getReservationStrategy() != null) {
vo.setReservationStrategy(profile.getReservationStrategy());
}
vo.setBroadcastUri(profile.getBroadCastUri());
vo.setIsolationUri(profile.getIsolationUri());
vo.setIPv4Netmask(profile.getIPv4Netmask());
}
示例2: savePlaceholderNic
import com.cloud.vm.NicVO; //导入方法依赖的package包/类
@Override
public NicVO savePlaceholderNic(final Network network, final String ip4Address, final String ip6Address, final Type vmType) {
final NicVO nic = new NicVO(null, null, network.getId(), null);
nic.setIPv4Address(ip4Address);
nic.setIPv6Address(ip6Address);
nic.setReservationStrategy(ReservationStrategy.PlaceHolder);
nic.setState(Nic.State.Reserved);
nic.setVmType(vmType);
return _nicDao.persist(nic);
}
示例3: applyProfileToNic
import com.cloud.vm.NicVO; //导入方法依赖的package包/类
protected Integer applyProfileToNic(final NicVO vo, final NicProfile profile, Integer deviceId) {
if (profile.getDeviceId() != null) {
vo.setDeviceId(profile.getDeviceId());
} else if (deviceId != null) {
vo.setDeviceId(deviceId++);
}
if (profile.getReservationStrategy() != null) {
vo.setReservationStrategy(profile.getReservationStrategy());
}
vo.setDefaultNic(profile.isDefaultNic());
vo.setIPv4Address(profile.getIPv4Address());
vo.setAddressFormat(profile.getFormat());
if (profile.getMacAddress() != null) {
vo.setMacAddress(profile.getMacAddress());
}
vo.setMode(profile.getMode());
vo.setIPv4Netmask(profile.getIPv4Netmask());
vo.setIPv4Gateway(profile.getIPv4Gateway());
if (profile.getBroadCastUri() != null) {
vo.setBroadcastUri(profile.getBroadCastUri());
}
if (profile.getIsolationUri() != null) {
vo.setIsolationUri(profile.getIsolationUri());
}
vo.setState(Nic.State.Allocated);
vo.setIPv6Address(profile.getIPv6Address());
vo.setIPv6Gateway(profile.getIPv6Gateway());
vo.setIPv6Cidr(profile.getIPv6Cidr());
return deviceId;
}