本文整理匯總了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;
}