CLOUDSTACK-10365: Change the "getXXX" boolean method names to "isXXX" (#2847)

These boolean-return methods are named as "getXXX".
Other boolean-return methods are named as "isXXX".
Considering there methods will return boolean values, it should be more clear and consistent to rename them as "isXXX".
(rebase #2602 and #2816)
This commit is contained in:
Kui LIU 2018-09-22 17:20:48 +02:00 committed by dahn
parent 9c14059d9e
commit d53fc94485
77 changed files with 239 additions and 239 deletions

View File

@ -201,7 +201,7 @@ public final class S3TO implements ClientOptions, DataStoreTO {
return DataStoreRole.Image; return DataStoreRole.Image;
} }
public boolean getEnableRRS() { public boolean isEnableRRS() {
return enableRRS; return enableRRS;
} }

View File

@ -57,13 +57,13 @@ public interface DiskOffering extends InfrastructureEntity, Identity, InternalId
String getUniqueName(); String getUniqueName();
boolean getUseLocalStorage(); boolean isUseLocalStorage();
Long getDomainId(); Long getDomainId();
String getName(); String getName();
boolean getSystemUse(); boolean isSystemUse();
String getDisplayText(); String getDisplayText();

View File

@ -82,11 +82,11 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
*/ */
Integer getMulticastRateMbps(); Integer getMulticastRateMbps();
boolean getForVpc(); boolean isForVpc();
TrafficType getTrafficType(); TrafficType getTrafficType();
boolean getSpecifyVlan(); boolean isSpecifyVlan();
String getTags(); String getTags();
@ -106,39 +106,39 @@ public interface NetworkOffering extends InfrastructureEntity, InternalIdentity,
Long getServiceOfferingId(); Long getServiceOfferingId();
boolean getDedicatedLB(); boolean isDedicatedLB();
boolean getSharedSourceNat(); boolean isSharedSourceNat();
boolean getRedundantRouter(); boolean isRedundantRouter();
boolean isConserveMode(); boolean isConserveMode();
boolean getElasticIp(); boolean isElasticIp();
boolean getAssociatePublicIP(); boolean isAssociatePublicIP();
boolean getElasticLb(); boolean isElasticLb();
boolean getSpecifyIpRanges(); boolean isSpecifyIpRanges();
boolean isInline(); boolean isInline();
boolean getIsPersistent(); boolean isPersistent();
boolean getInternalLb(); boolean isInternalLb();
boolean getPublicLb(); boolean isPublicLb();
boolean getEgressDefaultPolicy(); boolean isEgressDefaultPolicy();
Integer getConcurrentConnections(); Integer getConcurrentConnections();
boolean isKeepAliveEnabled(); boolean isKeepAliveEnabled();
boolean getSupportsStrechedL2(); boolean isSupportingStrechedL2();
boolean getSupportsPublicAccess(); boolean isSupportingPublicAccess();
String getServicePackage(); String getServicePackage();
} }

View File

@ -56,7 +56,7 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int
* @return is this a system service offering * @return is this a system service offering
*/ */
@Override @Override
boolean getSystemUse(); boolean isSystemUse();
/** /**
* @return # of cpu. * @return # of cpu.
@ -76,7 +76,7 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int
/** /**
* @return Does this service plan offer HA? * @return Does this service plan offer HA?
*/ */
boolean getOfferHA(); boolean isOfferHA();
/** /**
* @return Does this service plan offer VM to use CPU resources beyond the service offering limits? * @return Does this service plan offer VM to use CPU resources beyond the service offering limits?
@ -86,7 +86,7 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int
/** /**
* @return Does this service plan support Volatile VM that is, discard VM's root disk and create a new one on reboot? * @return Does this service plan support Volatile VM that is, discard VM's root disk and create a new one on reboot?
*/ */
boolean getVolatileVm(); boolean isVolatileVm();
/** /**
* @return the rate in megabits per sec to which a VM's network interface is throttled to * @return the rate in megabits per sec to which a VM's network interface is throttled to
@ -102,7 +102,7 @@ public interface ServiceOffering extends DiskOffering, InfrastructureEntity, Int
* @return whether or not the service offering requires local storage * @return whether or not the service offering requires local storage
*/ */
@Override @Override
boolean getUseLocalStorage(); boolean isUseLocalStorage();
@Override @Override
Long getDomainId(); Long getDomainId();

View File

@ -33,5 +33,5 @@ public interface GuestOS extends InternalIdentity, Identity {
Date getRemoved(); Date getRemoved();
boolean getIsUserDefined(); boolean isUserDefined();
} }

View File

@ -101,9 +101,9 @@ public interface VirtualMachineTemplate extends ControlledEntity, Identity, Inte
String getDisplayText(); String getDisplayText();
boolean getEnablePassword(); boolean isEnablePassword();
boolean getEnableSshKey(); boolean isEnableSshKey();
boolean isCrossZones(); boolean isCrossZones();

View File

@ -68,7 +68,7 @@ public class DiskProfile {
offering.getId(), offering.getId(),
vol.getSize(), vol.getSize(),
offering.getTagsArray(), offering.getTagsArray(),
offering.getUseLocalStorage(), offering.isUseLocalStorage(),
offering.isCustomized(), offering.isCustomized(),
null); null);
this.hyperType = hyperType; this.hyperType = hyperType;

View File

@ -238,7 +238,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId()); DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId());
if (zone.getNetworkType() == NetworkType.Basic && offering.getElasticIp() && offering.getElasticLb()) { if (zone.getNetworkType() == NetworkType.Basic && offering.isElasticIp() && offering.isElasticLb()) {
// Since the basic zone network is owned by 'Root' domain, domain access checkers will fail for the // Since the basic zone network is owned by 'Root' domain, domain access checkers will fail for the
// accounts in non-root domains while acquiring public IP. So add an exception for the 'Basic' zone // accounts in non-root domains while acquiring public IP. So add an exception for the 'Basic' zone
// shared network with EIP/ELB service. // shared network with EIP/ELB service.

View File

@ -107,7 +107,7 @@ public class ResizeVolumeCmd extends BaseAsyncCmd {
return size; return size;
} }
public boolean getShrinkOk() { public boolean isShrinkOk() {
return shrinkOk; return shrinkOk;
} }

View File

@ -184,7 +184,7 @@ public class S3TemplateDownloader extends ManagedContextRunnable implements Temp
PutObjectRequest putObjectRequest = new PutObjectRequest(s3TO.getBucketName(), s3Key, inputStream, objectMetadata); PutObjectRequest putObjectRequest = new PutObjectRequest(s3TO.getBucketName(), s3Key, inputStream, objectMetadata);
// If reduced redundancy is enabled, set it. // If reduced redundancy is enabled, set it.
if (s3TO.getEnableRRS()) { if (s3TO.isEnableRRS()) {
putObjectRequest.withStorageClass(StorageClass.ReducedRedundancy); putObjectRequest.withStorageClass(StorageClass.ReducedRedundancy);
} }

View File

@ -3214,14 +3214,14 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
// Check that the service offering being upgraded to has the same storage pool preference as the VM's current service // Check that the service offering being upgraded to has the same storage pool preference as the VM's current service
// offering // offering
if (currentServiceOffering.getUseLocalStorage() != newServiceOffering.getUseLocalStorage()) { if (currentServiceOffering.isUseLocalStorage() != newServiceOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() + throw new InvalidParameterValueException("Unable to upgrade virtual machine " + vmInstance.toString() +
", cannot switch between local storage and shared storage service offerings. Current offering " + "useLocalStorage=" + ", cannot switch between local storage and shared storage service offerings. Current offering " + "useLocalStorage=" +
currentServiceOffering.getUseLocalStorage() + ", target offering useLocalStorage=" + newServiceOffering.getUseLocalStorage()); currentServiceOffering.isUseLocalStorage() + ", target offering useLocalStorage=" + newServiceOffering.isUseLocalStorage());
} }
// if vm is a system vm, check if it is a system service offering, if yes return with error as it cannot be used for user vms // if vm is a system vm, check if it is a system service offering, if yes return with error as it cannot be used for user vms
if (currentServiceOffering.getSystemUse() != newServiceOffering.getSystemUse()) { if (currentServiceOffering.isSystemUse() != newServiceOffering.isSystemUse()) {
throw new InvalidParameterValueException("isSystem property is different for current service offering and new service offering"); throw new InvalidParameterValueException("isSystem property is different for current service offering and new service offering");
} }
@ -3245,7 +3245,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
final VMInstanceVO vmForUpdate = _vmDao.createForUpdate(); final VMInstanceVO vmForUpdate = _vmDao.createForUpdate();
vmForUpdate.setServiceOfferingId(serviceOfferingId); vmForUpdate.setServiceOfferingId(serviceOfferingId);
final ServiceOffering newSvcOff = _entityMgr.findById(ServiceOffering.class, serviceOfferingId); final ServiceOffering newSvcOff = _entityMgr.findById(ServiceOffering.class, serviceOfferingId);
vmForUpdate.setHaEnabled(newSvcOff.getOfferHA()); vmForUpdate.setHaEnabled(newSvcOff.isOfferHA());
vmForUpdate.setLimitCpuUse(newSvcOff.getLimitCpuUse()); vmForUpdate.setLimitCpuUse(newSvcOff.getLimitCpuUse());
vmForUpdate.setServiceOfferingId(newSvcOff.getId()); vmForUpdate.setServiceOfferingId(newSvcOff.getId());
return _vmDao.update(vmId, vmForUpdate); return _vmDao.update(vmId, vmForUpdate);

View File

@ -690,10 +690,10 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
@Override @Override
public void doInTransactionWithoutResult(final TransactionStatus status) { public void doInTransactionWithoutResult(final TransactionStatus status) {
final NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(), relatedFile, name, displayText, predefined final NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(), relatedFile, name, displayText, predefined
.getNetworkDomain(), offering.getGuestType(), plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.getSpecifyIpRanges(), .getNetworkDomain(), offering.getGuestType(), plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.isSpecifyIpRanges(),
vpcId, offering.getRedundantRouter(), predefined.getExternalId()); vpcId, offering.isRedundantRouter(), predefined.getExternalId());
vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled); vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled);
vo.setStrechedL2Network(offering.getSupportsStrechedL2()); vo.setStrechedL2Network(offering.isSupportingStrechedL2());
final NetworkVO networkPersisted = _networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated, final NetworkVO networkPersisted = _networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated,
finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId())); finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId()));
networks.add(networkPersisted); networks.add(networkPersisted);
@ -1110,7 +1110,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
// 2) network has sourceNat service // 2) network has sourceNat service
// 3) network offering does not support a shared source NAT rule // 3) network offering does not support a shared source NAT rule
final boolean sharedSourceNat = offering.getSharedSourceNat(); final boolean sharedSourceNat = offering.isSharedSourceNat();
final DataCenter zone = _dcDao.findById(network.getDataCenterId()); final DataCenter zone = _dcDao.findById(network.getDataCenterId());
if (!sharedSourceNat && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat) if (!sharedSourceNat && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.SourceNat)
@ -1220,7 +1220,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) && _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall)
&& (network.getGuestType() == Network.GuestType.Isolated || network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced)) { && (network.getGuestType() == Network.GuestType.Isolated || network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced)) {
// add default egress rule to accept the traffic // add default egress rule to accept the traffic
_firewallMgr.applyDefaultEgressFirewallRule(network.getId(), offering.getEgressDefaultPolicy(), true); _firewallMgr.applyDefaultEgressFirewallRule(network.getId(), offering.isEgressDefaultPolicy(), true);
} }
if (!_firewallMgr.applyFirewallRules(firewallEgressRulesToApply, false, caller)) { if (!_firewallMgr.applyFirewallRules(firewallEgressRulesToApply, false, caller)) {
s_logger.warn("Failed to reapply firewall Egress rule(s) as a part of network id=" + networkId + " restart"); s_logger.warn("Failed to reapply firewall Egress rule(s) as a part of network id=" + networkId + " restart");
@ -2171,7 +2171,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
} }
//don't allow eip/elb networks in Advance zone //don't allow eip/elb networks in Advance zone
if (ntwkOff.getElasticIp() || ntwkOff.getElasticLb()) { if (ntwkOff.isElasticIp() || ntwkOff.isElasticLb()) {
throw new InvalidParameterValueException("Elastic IP and Elastic LB services are supported in zone of type " + NetworkType.Basic); throw new InvalidParameterValueException("Elastic IP and Elastic LB services are supported in zone of type " + NetworkType.Basic);
} }
} }
@ -2183,7 +2183,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
//TODO(VXLAN): Support VNI specified //TODO(VXLAN): Support VNI specified
// VlanId can be specified only when network offering supports it // VlanId can be specified only when network offering supports it
final boolean vlanSpecified = vlanId != null; final boolean vlanSpecified = vlanId != null;
if (vlanSpecified != ntwkOff.getSpecifyVlan()) { if (vlanSpecified != ntwkOff.isSpecifyVlan()) {
if (vlanSpecified) { if (vlanSpecified) {
throw new InvalidParameterValueException("Can't specify vlan; corresponding offering says specifyVlan=false"); throw new InvalidParameterValueException("Can't specify vlan; corresponding offering says specifyVlan=false");
} else { } else {

View File

@ -225,7 +225,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
// Find a destination storage pool with the specified criteria // Find a destination storage pool with the specified criteria
DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId()); DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId());
DiskProfile dskCh = new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSize(), diskOffering.getTagsArray(), DiskProfile dskCh = new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSize(), diskOffering.getTagsArray(),
diskOffering.getUseLocalStorage(), diskOffering.isRecreatable(), null); diskOffering.isUseLocalStorage(), diskOffering.isRecreatable(), null);
dskCh.setHyperType(dataDiskHyperType); dskCh.setHyperType(dataDiskHyperType);
storageMgr.setDiskProfileThrottling(dskCh, null, diskOffering); storageMgr.setDiskProfileThrottling(dskCh, null, diskOffering);
@ -469,11 +469,11 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
throw new CloudRuntimeException("Template " + template.getName() + " has not been completely downloaded to zone " + dc.getId()); throw new CloudRuntimeException("Template " + template.getName() + " has not been completely downloaded to zone " + dc.getId());
} }
return new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), ss.getSize(), diskOffering.getTagsArray(), diskOffering.getUseLocalStorage(), return new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), ss.getSize(), diskOffering.getTagsArray(), diskOffering.isUseLocalStorage(),
diskOffering.isRecreatable(), Storage.ImageFormat.ISO != template.getFormat() ? template.getId() : null); diskOffering.isRecreatable(), Storage.ImageFormat.ISO != template.getFormat() ? template.getId() : null);
} else { } else {
return new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSize(), diskOffering.getTagsArray(), return new DiskProfile(volume.getId(), volume.getVolumeType(), volume.getName(), diskOffering.getId(), diskOffering.getDiskSize(), diskOffering.getTagsArray(),
diskOffering.getUseLocalStorage(), diskOffering.isRecreatable(), null); diskOffering.isUseLocalStorage(), diskOffering.isRecreatable(), null);
} }
} }
@ -648,7 +648,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
} }
protected DiskProfile toDiskProfile(Volume vol, DiskOffering offering) { protected DiskProfile toDiskProfile(Volume vol, DiskOffering offering) {
return new DiskProfile(vol.getId(), vol.getVolumeType(), vol.getName(), offering.getId(), vol.getSize(), offering.getTagsArray(), offering.getUseLocalStorage(), offering.isRecreatable(), return new DiskProfile(vol.getId(), vol.getVolumeType(), vol.getName(), offering.getId(), vol.getSize(), offering.getTagsArray(), offering.isUseLocalStorage(), offering.isRecreatable(),
vol.getTemplateId()); vol.getTemplateId());
} }
@ -1174,7 +1174,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol); s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol);
} }
DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, vol.getDiskOfferingId()); DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, vol.getDiskOfferingId());
if (diskOffering.getUseLocalStorage()) { if (diskOffering.isUseLocalStorage()) {
// Currently migration of local volume is not supported so bail out // Currently migration of local volume is not supported so bail out
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner"); s_logger.debug("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");

View File

@ -213,10 +213,10 @@ public class VirtualMachineManagerImplTest {
ServiceOfferingVO mockCurrentServiceOffering = mock(ServiceOfferingVO.class); ServiceOfferingVO mockCurrentServiceOffering = mock(ServiceOfferingVO.class);
when(serviceOfferingDaoMock.findByIdIncludingRemoved(anyLong(), anyLong())).thenReturn(mockCurrentServiceOffering); when(serviceOfferingDaoMock.findByIdIncludingRemoved(anyLong(), anyLong())).thenReturn(mockCurrentServiceOffering);
when(mockCurrentServiceOffering.getUseLocalStorage()).thenReturn(true); when(mockCurrentServiceOffering.isUseLocalStorage()).thenReturn(true);
when(serviceOfferingMock.getUseLocalStorage()).thenReturn(true); when(serviceOfferingMock.isUseLocalStorage()).thenReturn(true);
when(mockCurrentServiceOffering.getSystemUse()).thenReturn(true); when(mockCurrentServiceOffering.isSystemUse()).thenReturn(true);
when(serviceOfferingMock.getSystemUse()).thenReturn(true); when(serviceOfferingMock.isSystemUse()).thenReturn(true);
when(mockCurrentServiceOffering.getTags()).thenReturn("x,y"); when(mockCurrentServiceOffering.getTags()).thenReturn("x,y");
when(serviceOfferingMock.getTags()).thenReturn("z,x,y"); when(serviceOfferingMock.getTags()).thenReturn("z,x,y");

View File

@ -119,7 +119,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long>implements Ne
AllFieldsSearch.and("redundant", AllFieldsSearch.entity().isRedundant(), Op.EQ); AllFieldsSearch.and("redundant", AllFieldsSearch.entity().isRedundant(), Op.EQ);
final SearchBuilder<NetworkOfferingVO> join1 = _ntwkOffDao.createSearchBuilder(); final SearchBuilder<NetworkOfferingVO> join1 = _ntwkOffDao.createSearchBuilder();
join1.and("isSystem", join1.entity().isSystemOnly(), Op.EQ); join1.and("isSystem", join1.entity().isSystemOnly(), Op.EQ);
join1.and("isRedundant", join1.entity().getRedundantRouter(), Op.EQ); join1.and("isRedundant", join1.entity().isRedundantRouter(), Op.EQ);
AllFieldsSearch.join("offerings", join1, AllFieldsSearch.entity().getNetworkOfferingId(), join1.entity().getId(), JoinBuilder.JoinType.INNER); AllFieldsSearch.join("offerings", join1, AllFieldsSearch.entity().getNetworkOfferingId(), join1.entity().getId(), JoinBuilder.JoinType.INNER);
AllFieldsSearch.done(); AllFieldsSearch.done();
@ -196,7 +196,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long>implements Ne
NetworksRegularUserCanCreateSearch.join("accounts", join4, NetworksRegularUserCanCreateSearch.entity().getId(), join4.entity().getNetworkId(), NetworksRegularUserCanCreateSearch.join("accounts", join4, NetworksRegularUserCanCreateSearch.entity().getId(), join4.entity().getNetworkId(),
JoinBuilder.JoinType.INNER); JoinBuilder.JoinType.INNER);
final SearchBuilder<NetworkOfferingVO> join5 = _ntwkOffDao.createSearchBuilder(); final SearchBuilder<NetworkOfferingVO> join5 = _ntwkOffDao.createSearchBuilder();
join5.and("specifyVlan", join5.entity().getSpecifyVlan(), Op.EQ); join5.and("specifyVlan", join5.entity().isSpecifyVlan(), Op.EQ);
NetworksRegularUserCanCreateSearch.join("ntwkOff", join5, NetworksRegularUserCanCreateSearch.entity().getNetworkOfferingId(), join5.entity().getId(), NetworksRegularUserCanCreateSearch.join("ntwkOff", join5, NetworksRegularUserCanCreateSearch.entity().getNetworkOfferingId(), join5.entity().getId(),
JoinBuilder.JoinType.INNER); JoinBuilder.JoinType.INNER);
NetworksRegularUserCanCreateSearch.done(); NetworksRegularUserCanCreateSearch.done();
@ -242,7 +242,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long>implements Ne
join7.and("check", join7.entity().isCheckForGc(), Op.EQ); join7.and("check", join7.entity().isCheckForGc(), Op.EQ);
GarbageCollectedSearch.join("ntwkOpGC", join7, GarbageCollectedSearch.entity().getId(), join7.entity().getId(), JoinBuilder.JoinType.INNER); GarbageCollectedSearch.join("ntwkOpGC", join7, GarbageCollectedSearch.entity().getId(), join7.entity().getId(), JoinBuilder.JoinType.INNER);
final SearchBuilder<NetworkOfferingVO> join8 = _ntwkOffDao.createSearchBuilder(); final SearchBuilder<NetworkOfferingVO> join8 = _ntwkOffDao.createSearchBuilder();
join8.and("isPersistent", join8.entity().getIsPersistent(), Op.EQ); join8.and("isPersistent", join8.entity().isPersistent(), Op.EQ);
GarbageCollectedSearch.join("ntwkOffGC", join8, GarbageCollectedSearch.entity().getNetworkOfferingId(), join8.entity().getId(), JoinBuilder.JoinType.INNER); GarbageCollectedSearch.join("ntwkOffGC", join8, GarbageCollectedSearch.entity().getNetworkOfferingId(), join8.entity().getId(), JoinBuilder.JoinType.INNER);
GarbageCollectedSearch.done(); GarbageCollectedSearch.done();

View File

@ -97,7 +97,7 @@ public class PrivateIpVO implements InternalIdentity {
return vpcId; return vpcId;
} }
public boolean getSourceNat() { public boolean isSourceNat() {
return sourceNat; return sourceNat;
} }

View File

@ -172,7 +172,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getForVpc() { public boolean isForVpc() {
return forVpc; return forVpc;
} }
@ -249,7 +249,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getSpecifyVlan() { public boolean isSpecifyVlan() {
return specifyVlan; return specifyVlan;
} }
@ -292,7 +292,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getDedicatedLB() { public boolean isDedicatedLB() {
return dedicatedLB; return dedicatedLB;
} }
@ -301,7 +301,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getSharedSourceNat() { public boolean isSharedSourceNat() {
return sharedSourceNat; return sharedSourceNat;
} }
@ -310,7 +310,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getRedundantRouter() { public boolean isRedundantRouter() {
return redundantRouter; return redundantRouter;
} }
@ -319,7 +319,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getEgressDefaultPolicy() { public boolean isEgressDefaultPolicy() {
return egressdefaultpolicy; return egressdefaultpolicy;
} }
@ -456,22 +456,22 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getElasticIp() { public boolean isElasticIp() {
return elasticIp; return elasticIp;
} }
@Override @Override
public boolean getAssociatePublicIP() { public boolean isAssociatePublicIP() {
return eipAssociatePublicIp; return eipAssociatePublicIp;
} }
@Override @Override
public boolean getElasticLb() { public boolean isElasticLb() {
return elasticLb; return elasticLb;
} }
@Override @Override
public boolean getSpecifyIpRanges() { public boolean isSpecifyIpRanges() {
return specifyIpRanges; return specifyIpRanges;
} }
@ -485,17 +485,17 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getIsPersistent() { public boolean isPersistent() {
return isPersistent; return isPersistent;
} }
@Override @Override
public boolean getInternalLb() { public boolean isInternalLb() {
return internalLb; return internalLb;
} }
@Override @Override
public boolean getPublicLb() { public boolean isPublicLb() {
return publicLb; return publicLb;
} }
@ -517,7 +517,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getSupportsStrechedL2() { public boolean isSupportingStrechedL2() {
return supportsStrechedL2; return supportsStrechedL2;
} }
@ -526,7 +526,7 @@ public class NetworkOfferingVO implements NetworkOffering {
} }
@Override @Override
public boolean getSupportsPublicAccess() { public boolean isSupportingPublicAccess() {
return supportsPublicAccess; return supportsPublicAccess;
} }

View File

@ -162,7 +162,7 @@ public class NetworkOfferingDaoImpl extends GenericDaoBase<NetworkOfferingVO, Lo
sc.addAnd("state", SearchCriteria.Op.EQ, NetworkOffering.State.Enabled); sc.addAnd("state", SearchCriteria.Op.EQ, NetworkOffering.State.Enabled);
//specify Vlan should be the same //specify Vlan should be the same
sc.addAnd("specifyVlan", SearchCriteria.Op.EQ, originalOffering.getSpecifyVlan()); sc.addAnd("specifyVlan", SearchCriteria.Op.EQ, originalOffering.isSpecifyVlan());
return customSearch(sc, null); return customSearch(sc, null);
} }

View File

@ -173,8 +173,8 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
false, false,
offering.getTags(), offering.getTags(),
offering.isRecreatable(), offering.isRecreatable(),
offering.getUseLocalStorage(), offering.isUseLocalStorage(),
offering.getSystemUse(), offering.isSystemUse(),
true, true,
offering.isCustomizedIops()== null ? false:offering.isCustomizedIops(), offering.isCustomizedIops()== null ? false:offering.isCustomizedIops(),
offering.getDomainId(), offering.getDomainId(),
@ -185,15 +185,15 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
speed = offering.getSpeed(); speed = offering.getSpeed();
rateMbps = offering.getRateMbps(); rateMbps = offering.getRateMbps();
multicastRateMbps = offering.getMulticastRateMbps(); multicastRateMbps = offering.getMulticastRateMbps();
offerHA = offering.getOfferHA(); offerHA = offering.isOfferHA();
limitCpuUse = offering.getLimitCpuUse(); limitCpuUse = offering.getLimitCpuUse();
volatileVm = offering.getVolatileVm(); volatileVm = offering.isVolatileVm();
hostTag = offering.getHostTag(); hostTag = offering.getHostTag();
vmType = offering.getSystemVmType(); vmType = offering.getSystemVmType();
} }
@Override @Override
public boolean getOfferHA() { public boolean isOfferHA() {
return offerHA; return offerHA;
} }
@ -296,7 +296,7 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
} }
@Override @Override
public boolean getVolatileVm() { public boolean isVolatileVm() {
return volatileVm; return volatileVm;
} }

View File

@ -60,7 +60,7 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
UniqueNameSearch = createSearchBuilder(); UniqueNameSearch = createSearchBuilder();
UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ); UniqueNameSearch.and("name", UniqueNameSearch.entity().getUniqueName(), SearchCriteria.Op.EQ);
UniqueNameSearch.and("system", UniqueNameSearch.entity().getSystemUse(), SearchCriteria.Op.EQ); UniqueNameSearch.and("system", UniqueNameSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);
UniqueNameSearch.done(); UniqueNameSearch.done();
ServiceOfferingsByDomainIdSearch = createSearchBuilder(); ServiceOfferingsByDomainIdSearch = createSearchBuilder();
@ -69,14 +69,14 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
SystemServiceOffering = createSearchBuilder(); SystemServiceOffering = createSearchBuilder();
SystemServiceOffering.and("domainId", SystemServiceOffering.entity().getDomainId(), SearchCriteria.Op.EQ); SystemServiceOffering.and("domainId", SystemServiceOffering.entity().getDomainId(), SearchCriteria.Op.EQ);
SystemServiceOffering.and("system", SystemServiceOffering.entity().getSystemUse(), SearchCriteria.Op.EQ); SystemServiceOffering.and("system", SystemServiceOffering.entity().isSystemUse(), SearchCriteria.Op.EQ);
SystemServiceOffering.and("vm_type", SystemServiceOffering.entity().getSpeed(), SearchCriteria.Op.EQ); SystemServiceOffering.and("vm_type", SystemServiceOffering.entity().getSpeed(), SearchCriteria.Op.EQ);
SystemServiceOffering.and("removed", SystemServiceOffering.entity().getRemoved(), SearchCriteria.Op.NULL); SystemServiceOffering.and("removed", SystemServiceOffering.entity().getRemoved(), SearchCriteria.Op.NULL);
SystemServiceOffering.done(); SystemServiceOffering.done();
PublicServiceOfferingSearch = createSearchBuilder(); PublicServiceOfferingSearch = createSearchBuilder();
PublicServiceOfferingSearch.and("domainId", PublicServiceOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL); PublicServiceOfferingSearch.and("domainId", PublicServiceOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL);
PublicServiceOfferingSearch.and("system", PublicServiceOfferingSearch.entity().getSystemUse(), SearchCriteria.Op.EQ); PublicServiceOfferingSearch.and("system", PublicServiceOfferingSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);
PublicServiceOfferingSearch.and("removed", PublicServiceOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL); PublicServiceOfferingSearch.and("removed", PublicServiceOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
PublicServiceOfferingSearch.done(); PublicServiceOfferingSearch.done();
@ -111,7 +111,7 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
update(vo.getId(), vo); update(vo.getId(), vo);
} }
if (!vo.getUniqueName().endsWith("-Local")) { if (!vo.getUniqueName().endsWith("-Local")) {
if (vo.getUseLocalStorage()) { if (vo.isUseLocalStorage()) {
vo.setUniqueName(vo.getUniqueName() + "-Local"); vo.setUniqueName(vo.getUniqueName() + "-Local");
vo.setName(vo.getName() + " - Local Storage"); vo.setName(vo.getName() + " - Local Storage");
update(vo.getId(), vo); update(vo.getId(), vo);
@ -260,7 +260,7 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
} }
boolean useLocal = true; boolean useLocal = true;
if (offering.getUseLocalStorage()) { // if 1st one is already local then 2nd needs to be shared if (offering.isUseLocalStorage()) { // if 1st one is already local then 2nd needs to be shared
useLocal = false; useLocal = false;
} }

View File

@ -299,7 +299,7 @@ public class DiskOfferingVO implements DiskOffering {
} }
@Override @Override
public boolean getUseLocalStorage() { public boolean isUseLocalStorage() {
return useLocalStorage; return useLocalStorage;
} }
@ -332,7 +332,7 @@ public class DiskOfferingVO implements DiskOffering {
} }
@Override @Override
public boolean getSystemUse() { public boolean isSystemUse() {
return systemUse; return systemUse;
} }

View File

@ -113,7 +113,7 @@ public class GuestOSVO implements GuestOS {
} }
@Override @Override
public boolean getIsUserDefined() { public boolean isUserDefined() {
return isUserDefined; return isUserDefined;
} }

View File

@ -284,7 +284,7 @@ public class VMTemplateVO implements VirtualMachineTemplate {
} }
@Override @Override
public boolean getEnablePassword() { public boolean isEnablePassword() {
return enablePassword; return enablePassword;
} }
@ -573,7 +573,7 @@ public class VMTemplateVO implements VirtualMachineTemplate {
} }
@Override @Override
public boolean getEnableSshKey() { public boolean isEnableSshKey() {
return enableSshKey; return enableSshKey;
} }

View File

@ -52,7 +52,7 @@ public class DiskOfferingDaoImpl extends GenericDaoBase<DiskOfferingVO, Long> im
PublicDiskOfferingSearch = createSearchBuilder(); PublicDiskOfferingSearch = createSearchBuilder();
PublicDiskOfferingSearch.and("domainId", PublicDiskOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL); PublicDiskOfferingSearch.and("domainId", PublicDiskOfferingSearch.entity().getDomainId(), SearchCriteria.Op.NULL);
PublicDiskOfferingSearch.and("system", PublicDiskOfferingSearch.entity().getSystemUse(), SearchCriteria.Op.EQ); PublicDiskOfferingSearch.and("system", PublicDiskOfferingSearch.entity().isSystemUse(), SearchCriteria.Op.EQ);
PublicDiskOfferingSearch.and("removed", PublicDiskOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL); PublicDiskOfferingSearch.and("removed", PublicDiskOfferingSearch.entity().getRemoved(), SearchCriteria.Op.NULL);
PublicDiskOfferingSearch.done(); PublicDiskOfferingSearch.done();

View File

@ -403,13 +403,13 @@ public class TemplateObject implements TemplateInfo {
} }
@Override @Override
public boolean getEnablePassword() { public boolean isEnablePassword() {
return imageVO.getEnablePassword(); return imageVO.isEnablePassword();
} }
@Override @Override
public boolean getEnableSshKey() { public boolean isEnableSshKey() {
return imageVO.getEnableSshKey(); return imageVO.isEnableSshKey();
} }
@Override @Override

View File

@ -179,13 +179,13 @@ public class TemplateEntityImpl implements TemplateEntity {
} }
@Override @Override
public boolean getEnablePassword() { public boolean isEnablePassword() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override @Override
public boolean getEnableSshKey() { public boolean isEnableSshKey() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }

View File

@ -133,22 +133,22 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
public ServiceOfferingVO(ServiceOfferingVO offering) { public ServiceOfferingVO(ServiceOfferingVO offering) {
super(offering.getId(), offering.getName(), offering.getDisplayText(), offering.getProvisioningType(), false, offering.getTags(), offering.isRecreatable(), super(offering.getId(), offering.getName(), offering.getDisplayText(), offering.getProvisioningType(), false, offering.getTags(), offering.isRecreatable(),
offering.getUseLocalStorage(), offering.getSystemUse(), true, offering.isCustomizedIops() == null ? false : offering.isCustomizedIops(), offering.getDomainId(), offering.isUseLocalStorage(), offering.isSystemUse(), true, offering.isCustomizedIops() == null ? false : offering.isCustomizedIops(), offering.getDomainId(),
offering.getMinIops(), offering.getMaxIops()); offering.getMinIops(), offering.getMaxIops());
cpu = offering.getCpu(); cpu = offering.getCpu();
ramSize = offering.getRamSize(); ramSize = offering.getRamSize();
speed = offering.getSpeed(); speed = offering.getSpeed();
rateMbps = offering.getRateMbps(); rateMbps = offering.getRateMbps();
multicastRateMbps = offering.getMulticastRateMbps(); multicastRateMbps = offering.getMulticastRateMbps();
offerHA = offering.getOfferHA(); offerHA = offering.isOfferHA();
limitCpuUse = offering.getLimitCpuUse(); limitCpuUse = offering.getLimitCpuUse();
volatileVm = offering.getVolatileVm(); volatileVm = offering.isVolatileVm();
hostTag = offering.getHostTag(); hostTag = offering.getHostTag();
vmType = offering.getSystemVmType(); vmType = offering.getSystemVmType();
} }
@Override @Override
public boolean getOfferHA() { public boolean isOfferHA() {
return offerHA; return offerHA;
} }
@ -251,7 +251,7 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering
} }
@Override @Override
public boolean getVolatileVm() { public boolean isVolatileVm() {
return volatileVm; return volatileVm;
} }

View File

@ -289,7 +289,7 @@ public class LoadBalanceRuleHandler {
ServiceOfferingVO elasticLbVmOffering = _serviceOfferingDao.findDefaultSystemOffering(ServiceOffering.elbVmDefaultOffUniqueName, ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId())); ServiceOfferingVO elasticLbVmOffering = _serviceOfferingDao.findDefaultSystemOffering(ServiceOffering.elbVmDefaultOffUniqueName, ConfigurationManagerImpl.SystemVMUseLocalStorage.valueIn(dest.getDataCenter().getId()));
elbVm = new DomainRouterVO(id, elasticLbVmOffering.getId(), vrProvider.getId(), VirtualMachineName.getSystemVmName(id, _instance, ELB_VM_NAME_PREFIX), elbVm = new DomainRouterVO(id, elasticLbVmOffering.getId(), vrProvider.getId(), VirtualMachineName.getSystemVmName(id, _instance, ELB_VM_NAME_PREFIX),
template.getId(), template.getHypervisorType(), template.getGuestOSId(), owner.getDomainId(), owner.getId(), userId, false, RedundantState.UNKNOWN, template.getId(), template.getHypervisorType(), template.getGuestOSId(), owner.getDomainId(), owner.getId(), userId, false, RedundantState.UNKNOWN,
elasticLbVmOffering.getOfferHA(), false, null); elasticLbVmOffering.isOfferHA(), false, null);
elbVm.setRole(Role.LB); elbVm.setRole(Role.LB);
elbVm = _routerDao.persist(elbVm); elbVm = _routerDao.persist(elbVm);
_itMgr.allocate(elbVm.getInstanceName(), template, elasticLbVmOffering, networks, plan, null); _itMgr.allocate(elbVm.getInstanceName(), template, elasticLbVmOffering, networks, plan, null);

View File

@ -129,7 +129,7 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
} }
NetworkVO network = NetworkVO network =
new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), State.Allocated, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), State.Allocated, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
if (userSpecified.getCidr() != null) { if (userSpecified.getCidr() != null) {
network.setCidr(userSpecified.getCidr()); network.setCidr(userSpecified.getCidr());
network.setGateway(userSpecified.getGateway()); network.setGateway(userSpecified.getGateway());

View File

@ -118,7 +118,7 @@ public class ManagementNetworkGuru extends ContrailGuru {
} }
NetworkVO network = NetworkVO network =
new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), Network.State.Allocated, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), Network.State.Allocated, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
if (_mgmtCidr != null) { if (_mgmtCidr != null) {
network.setCidr(_mgmtCidr); network.setCidr(_mgmtCidr);
network.setGateway(_mgmtGateway); network.setGateway(_mgmtGateway);

View File

@ -182,7 +182,7 @@ public class NiciraNvpGuestNetworkGuru extends GuestNetworkGuru implements Netwo
} }
final NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), final NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(),
State.Allocated, network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); State.Allocated, network.getDataCenterId(), physicalNetworkId, offering.isRedundantRouter());
if (network.getGateway() != null) { if (network.getGateway() != null) {
implemented.setGateway(network.getGateway()); implemented.setGateway(network.getGateway());

View File

@ -469,7 +469,7 @@ public class NiciraNvpGuestNetworkGuruTest {
final NetworkProfile implementednetwork = mock(NetworkProfile.class); final NetworkProfile implementednetwork = mock(NetworkProfile.class);
when(implementednetwork.getId()).thenReturn(NETWORK_ID); when(implementednetwork.getId()).thenReturn(NETWORK_ID);
when(implementednetwork.getBroadcastUri()).thenReturn(new URI("lswitch:aaaa")); when(implementednetwork.getBroadcastUri()).thenReturn(new URI("lswitch:aaaa"));
when(offering.getSpecifyVlan()).thenReturn(false); when(offering.isSpecifyVlan()).thenReturn(false);
guru.shutdown(implementednetwork, offering); guru.shutdown(implementednetwork, offering);
verify(agentmgr, times(1)).easySend(eq(NETWORK_ID), (Command)any()); verify(agentmgr, times(1)).easySend(eq(NETWORK_ID), (Command)any());

View File

@ -481,14 +481,14 @@ public class NuageVspElement extends AdapterBase implements ConnectivityProvider
return false; return false;
} }
if (networkOffering.getSpecifyVlan()) { if (networkOffering.isSpecifyVlan()) {
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("NuageVsp doesn't support VLAN values for networks"); s_logger.debug("NuageVsp doesn't support VLAN values for networks");
} }
return false; return false;
} }
if (network.getVpcId() != null && !networkOffering.getIsPersistent()) { if (network.getVpcId() != null && !networkOffering.isPersistent()) {
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("NuageVsp can't handle VPC tiers which use a network offering which are not persistent"); s_logger.debug("NuageVsp can't handle VPC tiers which use a network offering which are not persistent");
} }

View File

@ -297,7 +297,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru implements Networ
implemented = new NetworkVO(network.getId(), network, network.getNetworkOfferingId(), network.getGuruName(), network.getDomainId(), network.getAccountId(), implemented = new NetworkVO(network.getId(), network, network.getNetworkOfferingId(), network.getGuruName(), network.getDomainId(), network.getAccountId(),
network.getRelated(), network.getName(), network.getDisplayText(), network.getNetworkDomain(), network.getGuestType(), network.getDataCenterId(), network.getRelated(), network.getName(), network.getDisplayText(), network.getNetworkDomain(), network.getGuestType(), network.getDataCenterId(),
physicalNetworkId, network.getAclType(), network.getSpecifyIpRanges(), network.getVpcId(), offering.getRedundantRouter(), network.getExternalId()); physicalNetworkId, network.getAclType(), network.getSpecifyIpRanges(), network.getVpcId(), offering.isRedundantRouter(), network.getExternalId());
implemented.setUuid(network.getUuid()); implemented.setUuid(network.getUuid());
implemented.setState(State.Allocated); implemented.setState(State.Allocated);
if (network.getGateway() != null) { if (network.getGateway() != null) {
@ -652,7 +652,7 @@ public class NuageVspGuestNetworkGuru extends GuestNetworkGuru implements Networ
&& isMyIsolationMethod(physicalNetwork) && isMyIsolationMethod(physicalNetwork)
&& (offering.getGuestType() == GuestType.Isolated || offering.getGuestType() == GuestType.Shared) && (offering.getGuestType() == GuestType.Isolated || offering.getGuestType() == GuestType.Shared)
&& hasRequiredServices(offering)) { && hasRequiredServices(offering)) {
if (_configMgr.isOfferingForVpc(offering) && !offering.getIsPersistent()) { if (_configMgr.isOfferingForVpc(offering) && !offering.isPersistent()) {
if (s_logger.isDebugEnabled()) { if (s_logger.isDebugEnabled()) {
s_logger.debug("NuageVsp can't handle VPC tiers which use a network offering which are not persistent"); s_logger.debug("NuageVsp can't handle VPC tiers which use a network offering which are not persistent");
} }

View File

@ -178,8 +178,8 @@ public class NuageVspEntityBuilder {
} }
NetworkOfferingVO networkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId()); NetworkOfferingVO networkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId());
vspNetworkBuilder.egressDefaultPolicy(networkOffering.getEgressDefaultPolicy()) vspNetworkBuilder.egressDefaultPolicy(networkOffering.isEgressDefaultPolicy())
.publicAccess(networkOffering.getSupportsPublicAccess()); .publicAccess(networkOffering.isSupportingPublicAccess());
Map<String, String> networkDetails = _networkDetailsDao.listDetailsKeyPairs(network.getId(), false); Map<String, String> networkDetails = _networkDetailsDao.listDetailsKeyPairs(network.getId(), false);
@ -381,7 +381,7 @@ public class NuageVspEntityBuilder {
.trafficType(getEnumValue(firewallRule.getTrafficType(), VspAclRule.ACLTrafficType.class)); .trafficType(getEnumValue(firewallRule.getTrafficType(), VspAclRule.ACLTrafficType.class));
NetworkOfferingVO networkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId()); NetworkOfferingVO networkOffering = _networkOfferingDao.findById(network.getNetworkOfferingId());
if (firewallRule.getTrafficType() == FirewallRule.TrafficType.Egress && networkOffering.getEgressDefaultPolicy()) { if (firewallRule.getTrafficType() == FirewallRule.TrafficType.Egress && networkOffering.isEgressDefaultPolicy()) {
vspAclRuleBuilder.deny(); vspAclRuleBuilder.deny();
} else { } else {
vspAclRuleBuilder.allow(); vspAclRuleBuilder.allow();

View File

@ -137,7 +137,7 @@ public class NuageVspElementTest extends NuageTest {
final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class); final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class);
when(ntwkoffer.getId()).thenReturn(NETWORK_ID); when(ntwkoffer.getId()).thenReturn(NETWORK_ID);
when(ntwkoffer.getIsPersistent()).thenReturn(true); when(ntwkoffer.isPersistent()).thenReturn(true);
when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer); when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer);
// Golden path // Golden path
@ -162,7 +162,7 @@ public class NuageVspElementTest extends NuageTest {
assertFalse(_nuageVspElement.canHandle(net, Service.Dhcp)); assertFalse(_nuageVspElement.canHandle(net, Service.Dhcp));
// Can't handle network offerings with specify vlan = true // Can't handle network offerings with specify vlan = true
when(ntwkoffer.getSpecifyVlan()).thenReturn(true); when(ntwkoffer.isSpecifyVlan()).thenReturn(true);
assertFalse(_nuageVspElement.canHandle(net, Service.Connectivity)); assertFalse(_nuageVspElement.canHandle(net, Service.Connectivity));
} }
@ -277,7 +277,7 @@ public class NuageVspElementTest extends NuageTest {
final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class); final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class);
when(ntwkoffer.getId()).thenReturn(NETWORK_ID); when(ntwkoffer.getId()).thenReturn(NETWORK_ID);
when(ntwkoffer.getEgressDefaultPolicy()).thenReturn(true); when(ntwkoffer.isEgressDefaultPolicy()).thenReturn(true);
when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer); when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer);
final HostVO host = mock(HostVO.class); final HostVO host = mock(HostVO.class);
@ -307,7 +307,7 @@ public class NuageVspElementTest extends NuageTest {
final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class); final NetworkOfferingVO ntwkoffer = mock(NetworkOfferingVO.class);
when(ntwkoffer.getId()).thenReturn(NETWORK_ID); when(ntwkoffer.getId()).thenReturn(NETWORK_ID);
when(ntwkoffer.getEgressDefaultPolicy()).thenReturn(true); when(ntwkoffer.isEgressDefaultPolicy()).thenReturn(true);
when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer); when(_networkOfferingDao.findById(NETWORK_ID)).thenReturn(ntwkoffer);
final HostVO host = mock(HostVO.class); final HostVO host = mock(HostVO.class);

View File

@ -224,7 +224,7 @@ public class NuageVspGuestNetworkGuruTest extends NuageTest {
@Test @Test
public void testDesign() { public void testDesign() {
final NetworkOffering offering = mockNetworkOffering(false); final NetworkOffering offering = mockNetworkOffering(false);
when(offering.getIsPersistent()).thenReturn(false); when(offering.isPersistent()).thenReturn(false);
final DeploymentPlan plan = mockDeploymentPlan(); final DeploymentPlan plan = mockDeploymentPlan();
final Network network = mock(Network.class); final Network network = mock(Network.class);
@ -383,10 +383,10 @@ public class NuageVspGuestNetworkGuruTest extends NuageTest {
when(offering.getUuid()).thenReturn(OFFERING_UUID); when(offering.getUuid()).thenReturn(OFFERING_UUID);
when(offering.getTrafficType()).thenReturn(TrafficType.Guest); when(offering.getTrafficType()).thenReturn(TrafficType.Guest);
when(offering.getGuestType()).thenReturn(GuestType.Isolated); when(offering.getGuestType()).thenReturn(GuestType.Isolated);
when(offering.getForVpc()).thenReturn(forVpc); when(offering.isForVpc()).thenReturn(forVpc);
when(offering.getIsPersistent()).thenReturn(false); when(offering.isPersistent()).thenReturn(false);
when(offering.getTags()).thenReturn("aaaa"); when(offering.getTags()).thenReturn("aaaa");
when(offering.getEgressDefaultPolicy()).thenReturn(true); when(offering.isEgressDefaultPolicy()).thenReturn(true);
when(_networkOfferingDao.findById(OFFERING_ID)).thenReturn(offering); when(_networkOfferingDao.findById(OFFERING_ID)).thenReturn(offering);

View File

@ -319,7 +319,7 @@ public class NuageVspEntityBuilderTest extends NuageTest {
} }
private void setUpMockedNetworkOffering(NetworkOfferingVO networkOfferingToMock, Network.GuestType guestType) { private void setUpMockedNetworkOffering(NetworkOfferingVO networkOfferingToMock, Network.GuestType guestType) {
when(networkOfferingToMock.getEgressDefaultPolicy()).thenReturn(true); when(networkOfferingToMock.isEgressDefaultPolicy()).thenReturn(true);
when(networkOfferingToMock.getGuestType()).thenReturn(guestType); when(networkOfferingToMock.getGuestType()).thenReturn(guestType);
} }

View File

@ -140,7 +140,7 @@ public class OpendaylightGuestNetworkGuru extends GuestNetworkGuru {
} }
NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, NetworkVO implemented = new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated,
network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); network.getDataCenterId(), physicalNetworkId, offering.isRedundantRouter());
if (network.getGateway() != null) { if (network.getGateway() != null) {
implemented.setGateway(network.getGateway()); implemented.setGateway(network.getGateway());

View File

@ -122,7 +122,7 @@ public class VxlanGuestNetworkGuru extends GuestNetworkGuru {
NetworkVO implemented = NetworkVO implemented =
new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated,
network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); network.getDataCenterId(), physicalNetworkId, offering.isRedundantRouter());
allocateVnet(network, implemented, dcId, physicalNetworkId, context.getReservationId()); allocateVnet(network, implemented, dcId, physicalNetworkId, context.getReservationId());

View File

@ -272,7 +272,7 @@ public class VxlanGuestNetworkGuruTest {
NetworkProfile implementednetwork = mock(NetworkProfile.class); NetworkProfile implementednetwork = mock(NetworkProfile.class);
when(implementednetwork.getId()).thenReturn(42L); when(implementednetwork.getId()).thenReturn(42L);
when(implementednetwork.getBroadcastUri()).thenReturn(new URI("vxlan:12345")); when(implementednetwork.getBroadcastUri()).thenReturn(new URI("vxlan:12345"));
when(offering.getSpecifyVlan()).thenReturn(false); when(offering.isSpecifyVlan()).thenReturn(false);
guru.shutdown(implementednetwork, offering); guru.shutdown(implementednetwork, offering);
verify(implementednetwork, times(1)).setBroadcastUri(null); verify(implementednetwork, times(1)).setBroadcastUri(null);

View File

@ -1391,7 +1391,7 @@ public class ApiResponseHelper implements ResponseGenerator {
* IP allocated for EIP. So return the guest/public IP accordingly. * IP allocated for EIP. So return the guest/public IP accordingly.
* */ * */
NetworkOffering networkOffering = ApiDBUtils.findNetworkOfferingById(network.getNetworkOfferingId()); NetworkOffering networkOffering = ApiDBUtils.findNetworkOfferingById(network.getNetworkOfferingId());
if (networkOffering.getElasticIp()) { if (networkOffering.isElasticIp()) {
IpAddress ip = ApiDBUtils.findIpByAssociatedVmId(vm.getId()); IpAddress ip = ApiDBUtils.findIpByAssociatedVmId(vm.getId());
if (ip != null) { if (ip != null) {
Vlan vlan = ApiDBUtils.findVlanById(ip.getVlanId()); Vlan vlan = ApiDBUtils.findVlanById(ip.getVlanId());
@ -1908,16 +1908,16 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setTags(offering.getTags()); response.setTags(offering.getTags());
response.setTrafficType(offering.getTrafficType().toString()); response.setTrafficType(offering.getTrafficType().toString());
response.setIsDefault(offering.isDefault()); response.setIsDefault(offering.isDefault());
response.setSpecifyVlan(offering.getSpecifyVlan()); response.setSpecifyVlan(offering.isSpecifyVlan());
response.setConserveMode(offering.isConserveMode()); response.setConserveMode(offering.isConserveMode());
response.setSpecifyIpRanges(offering.getSpecifyIpRanges()); response.setSpecifyIpRanges(offering.isSpecifyIpRanges());
response.setAvailability(offering.getAvailability().toString()); response.setAvailability(offering.getAvailability().toString());
response.setIsPersistent(offering.getIsPersistent()); response.setIsPersistent(offering.isPersistent());
response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId())); response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId()));
response.setEgressDefaultPolicy(offering.getEgressDefaultPolicy()); response.setEgressDefaultPolicy(offering.isEgressDefaultPolicy());
response.setConcurrentConnections(offering.getConcurrentConnections()); response.setConcurrentConnections(offering.getConcurrentConnections());
response.setSupportsStrechedL2Subnet(offering.getSupportsStrechedL2()); response.setSupportsStrechedL2Subnet(offering.isSupportingStrechedL2());
response.setSupportsPublicAccess(offering.getSupportsPublicAccess()); response.setSupportsPublicAccess(offering.isSupportingPublicAccess());
Long so = null; Long so = null;
if (offering.getServiceOfferingId() != null) { if (offering.getServiceOfferingId() != null) {
so = offering.getServiceOfferingId(); so = offering.getServiceOfferingId();
@ -1963,12 +1963,12 @@ public class ApiResponseHelper implements ResponseGenerator {
CapabilityResponse lbIsoaltion = new CapabilityResponse(); CapabilityResponse lbIsoaltion = new CapabilityResponse();
lbIsoaltion.setName(Capability.SupportedLBIsolation.getName()); lbIsoaltion.setName(Capability.SupportedLBIsolation.getName());
lbIsoaltion.setValue(offering.getDedicatedLB() ? "dedicated" : "shared"); lbIsoaltion.setValue(offering.isDedicatedLB() ? "dedicated" : "shared");
lbCapResponse.add(lbIsoaltion); lbCapResponse.add(lbIsoaltion);
CapabilityResponse eLb = new CapabilityResponse(); CapabilityResponse eLb = new CapabilityResponse();
eLb.setName(Capability.ElasticLb.getName()); eLb.setName(Capability.ElasticLb.getName());
eLb.setValue(offering.getElasticLb() ? "true" : "false"); eLb.setValue(offering.isElasticLb() ? "true" : "false");
lbCapResponse.add(eLb); lbCapResponse.add(eLb);
CapabilityResponse inline = new CapabilityResponse(); CapabilityResponse inline = new CapabilityResponse();
@ -1981,12 +1981,12 @@ public class ApiResponseHelper implements ResponseGenerator {
List<CapabilityResponse> capabilities = new ArrayList<CapabilityResponse>(); List<CapabilityResponse> capabilities = new ArrayList<CapabilityResponse>();
CapabilityResponse sharedSourceNat = new CapabilityResponse(); CapabilityResponse sharedSourceNat = new CapabilityResponse();
sharedSourceNat.setName(Capability.SupportedSourceNatTypes.getName()); sharedSourceNat.setName(Capability.SupportedSourceNatTypes.getName());
sharedSourceNat.setValue(offering.getSharedSourceNat() ? "perzone" : "peraccount"); sharedSourceNat.setValue(offering.isSharedSourceNat() ? "perzone" : "peraccount");
capabilities.add(sharedSourceNat); capabilities.add(sharedSourceNat);
CapabilityResponse redundantRouter = new CapabilityResponse(); CapabilityResponse redundantRouter = new CapabilityResponse();
redundantRouter.setName(Capability.RedundantRouter.getName()); redundantRouter.setName(Capability.RedundantRouter.getName());
redundantRouter.setValue(offering.getRedundantRouter() ? "true" : "false"); redundantRouter.setValue(offering.isRedundantRouter() ? "true" : "false");
capabilities.add(redundantRouter); capabilities.add(redundantRouter);
svcRsp.setCapabilities(capabilities); svcRsp.setCapabilities(capabilities);
@ -1995,12 +1995,12 @@ public class ApiResponseHelper implements ResponseGenerator {
CapabilityResponse eIp = new CapabilityResponse(); CapabilityResponse eIp = new CapabilityResponse();
eIp.setName(Capability.ElasticIp.getName()); eIp.setName(Capability.ElasticIp.getName());
eIp.setValue(offering.getElasticIp() ? "true" : "false"); eIp.setValue(offering.isElasticIp() ? "true" : "false");
staticNatCapResponse.add(eIp); staticNatCapResponse.add(eIp);
CapabilityResponse associatePublicIp = new CapabilityResponse(); CapabilityResponse associatePublicIp = new CapabilityResponse();
associatePublicIp.setName(Capability.AssociatePublicIP.getName()); associatePublicIp.setName(Capability.AssociatePublicIP.getName());
associatePublicIp.setValue(offering.getAssociatePublicIP() ? "true" : "false"); associatePublicIp.setValue(offering.isAssociatePublicIP() ? "true" : "false");
staticNatCapResponse.add(associatePublicIp); staticNatCapResponse.add(associatePublicIp);
svcRsp.setCapabilities(staticNatCapResponse); svcRsp.setCapabilities(staticNatCapResponse);
@ -2127,7 +2127,7 @@ public class ApiResponseHelper implements ResponseGenerator {
response.setNetworkOfferingConserveMode(networkOffering.isConserveMode()); response.setNetworkOfferingConserveMode(networkOffering.isConserveMode());
response.setIsSystem(networkOffering.isSystemOnly()); response.setIsSystem(networkOffering.isSystemOnly());
response.setNetworkOfferingAvailability(networkOffering.getAvailability().toString()); response.setNetworkOfferingAvailability(networkOffering.getAvailability().toString());
response.setIsPersistent(networkOffering.getIsPersistent()); response.setIsPersistent(networkOffering.isPersistent());
} }
if (network.getAclType() != null) { if (network.getAclType() != null) {
@ -3204,7 +3204,7 @@ public class ApiResponseHelper implements ResponseGenerator {
GuestOSResponse response = new GuestOSResponse(); GuestOSResponse response = new GuestOSResponse();
response.setDescription(guestOS.getDisplayName()); response.setDescription(guestOS.getDisplayName());
response.setId(guestOS.getUuid()); response.setId(guestOS.getUuid());
response.setIsUserDefined(guestOS.getIsUserDefined()); response.setIsUserDefined(guestOS.isUserDefined());
GuestOSCategoryVO category = ApiDBUtils.findGuestOsCategoryById(guestOS.getCategoryId()); GuestOSCategoryVO category = ApiDBUtils.findGuestOsCategoryById(guestOS.getCategoryId());
if (category != null) { if (category != null) {
response.setOsCategoryId(category.getUuid()); response.setOsCategoryId(category.getUuid());

View File

@ -2688,7 +2688,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
sc.addAnd("id", SearchCriteria.Op.NEQ, currentVmOffering.getId()); sc.addAnd("id", SearchCriteria.Op.NEQ, currentVmOffering.getId());
// 1. Only return offerings with the same storage type // 1. Only return offerings with the same storage type
sc.addAnd("useLocalStorage", SearchCriteria.Op.EQ, currentVmOffering.getUseLocalStorage()); sc.addAnd("useLocalStorage", SearchCriteria.Op.EQ, currentVmOffering.isUseLocalStorage());
// 2.In case vm is running return only offerings greater than equal to current offering compute. // 2.In case vm is running return only offerings greater than equal to current offering compute.
if (vmInstance.getState() == VirtualMachine.State.Running) { if (vmInstance.getState() == VirtualMachine.State.Running) {

View File

@ -5105,7 +5105,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
@Override @Override
public boolean isOfferingForVpc(final NetworkOffering offering) { public boolean isOfferingForVpc(final NetworkOffering offering) {
return offering.getForVpc(); return offering.isForVpc();
} }
@DB @DB

View File

@ -773,7 +773,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
} }
ConsoleProxyVO proxy = ConsoleProxyVO proxy =
new ConsoleProxyVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId, new ConsoleProxyVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId,
systemAcct.getDomainId(), systemAcct.getId(), _accountMgr.getSystemUser().getId(), 0, serviceOffering.getOfferHA()); systemAcct.getDomainId(), systemAcct.getId(), _accountMgr.getSystemUser().getId(), 0, serviceOffering.isOfferHA());
proxy.setDynamicallyScalable(template.isDynamicallyScalable()); proxy.setDynamicallyScalable(template.isDynamicallyScalable());
proxy = _consoleProxyDao.persist(proxy); proxy = _consoleProxyDao.persist(proxy);
try { try {
@ -1315,7 +1315,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
} }
} }
if (_serviceOffering == null || !_serviceOffering.getSystemUse()) { if (_serviceOffering == null || !_serviceOffering.isSystemUse()) {
int ramSize = NumbersUtil.parseInt(_configDao.getValue("console.ram.size"), DEFAULT_PROXY_VM_RAMSIZE); int ramSize = NumbersUtil.parseInt(_configDao.getValue("console.ram.size"), DEFAULT_PROXY_VM_RAMSIZE);
int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("console.cpu.mhz"), DEFAULT_PROXY_VM_CPUMHZ); int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("console.cpu.mhz"), DEFAULT_PROXY_VM_CPUMHZ);
List<ServiceOfferingVO> offerings = _offeringDao.createSystemServiceOfferings("System Offering For Console Proxy", List<ServiceOfferingVO> offerings = _offeringDao.createSystemServiceOfferings("System Offering For Console Proxy",

View File

@ -1206,7 +1206,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId()); DiskOfferingVO diskOffering = _diskOfferingDao.findById(toBeCreated.getDiskOfferingId());
if (diskOffering != null) { if (diskOffering != null) {
if (diskOffering.getUseLocalStorage()) { if (diskOffering.isUseLocalStorage()) {
requiresLocal = true; requiresLocal = true;
} else { } else {
requiresShared = true; requiresShared = true;
@ -1448,7 +1448,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
s_logger.debug("System VMs will use " + (useLocalStorage ? "local" : "shared") + " storage for zone id=" + plan.getDataCenterId()); s_logger.debug("System VMs will use " + (useLocalStorage ? "local" : "shared") + " storage for zone id=" + plan.getDataCenterId());
} }
} else { } else {
useLocalStorage = diskOffering.getUseLocalStorage(); useLocalStorage = diskOffering.isUseLocalStorage();
// TODO: this is a hacking fix for the problem of deploy // TODO: this is a hacking fix for the problem of deploy
// ISO-based VM on local storage // ISO-based VM on local storage
@ -1457,7 +1457,7 @@ StateListener<State, VirtualMachine.Event, VirtualMachine> {
// actually // actually
// saved in service offering, override the flag from service // saved in service offering, override the flag from service
// offering when it is a ROOT disk // offering when it is a ROOT disk
if (!useLocalStorage && vmProfile.getServiceOffering().getUseLocalStorage()) { if (!useLocalStorage && vmProfile.getServiceOffering().isUseLocalStorage()) {
if (toBeCreated.getVolumeType() == Volume.Type.ROOT) { if (toBeCreated.getVolumeType() == Volume.Type.ROOT) {
useLocalStorage = true; useLocalStorage = true;
} }

View File

@ -266,7 +266,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
for (VMInstanceVO vm : reorderedVMList) { for (VMInstanceVO vm : reorderedVMList) {
ServiceOfferingVO vmOffering = _serviceOfferingDao.findById(vm.getServiceOfferingId()); ServiceOfferingVO vmOffering = _serviceOfferingDao.findById(vm.getServiceOfferingId());
if (vmOffering.getUseLocalStorage()) { if (vmOffering.isUseLocalStorage()) {
if (s_logger.isDebugEnabled()){ if (s_logger.isDebugEnabled()){
s_logger.debug("Skipping HA on vm " + vm + ", because it uses local storage. Its fate is tied to the host."); s_logger.debug("Skipping HA on vm " + vm + ", because it uses local storage. Its fate is tied to the host.");
} }

View File

@ -463,7 +463,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
Account account = _accountDao.findByIdIncludingRemoved(network.getAccountId()); Account account = _accountDao.findByIdIncludingRemoved(network.getAccountId());
NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
boolean sharedSourceNat = offering.getSharedSourceNat(); boolean sharedSourceNat = offering.isSharedSourceNat();
IPAddressVO sourceNatIp = null; IPAddressVO sourceNatIp = null;
if (!sharedSourceNat) { if (!sharedSourceNat) {
@ -582,7 +582,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
List<FirewallRuleTO> rulesTO = new ArrayList<FirewallRuleTO>(); List<FirewallRuleTO> rulesTO = new ArrayList<FirewallRuleTO>();
NetworkVO networkVO = _networkDao.findById(network.getId()); NetworkVO networkVO = _networkDao.findById(network.getId());
NetworkOfferingVO offering = _networkOfferingDao.findById(networkVO.getNetworkOfferingId()); NetworkOfferingVO offering = _networkOfferingDao.findById(networkVO.getNetworkOfferingId());
Boolean defaultEgressPolicy = offering.getEgressDefaultPolicy(); Boolean defaultEgressPolicy = offering.isEgressDefaultPolicy();
for (FirewallRule rule : rules) { for (FirewallRule rule : rules) {
if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) { if (rule.getSourceCidrList() == null && (rule.getPurpose() == Purpose.Firewall || rule.getPurpose() == Purpose.NetworkACL)) {

View File

@ -445,7 +445,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
try { try {
if (deviceMapLock.lock(120)) { if (deviceMapLock.lock(120)) {
try { try {
final boolean dedicatedLB = offering.getDedicatedLB(); // does network offering supports a dedicated load balancer? final boolean dedicatedLB = offering.isDedicatedLB(); // does network offering supports a dedicated load balancer?
try { try {
lbDevice = Transaction.execute(new TransactionCallbackWithException<ExternalLoadBalancerDeviceVO, InsufficientCapacityException>() { lbDevice = Transaction.execute(new TransactionCallbackWithException<ExternalLoadBalancerDeviceVO, InsufficientCapacityException>() {
@ -532,7 +532,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
String privateIf = createLbAnswer.getPrivateInterface(); String privateIf = createLbAnswer.getPrivateInterface();
// we have provisioned load balancer so add the appliance as cloudstack provisioned external load balancer // we have provisioned load balancer so add the appliance as cloudstack provisioned external load balancer
String dedicatedLb = offering.getDedicatedLB() ? "true" : "false"; String dedicatedLb = offering.isDedicatedLB() ? "true" : "false";
String capacity = Long.toString(lbProviderDevice.getCapacity()); String capacity = Long.toString(lbProviderDevice.getCapacity());
// acquire a public IP to associate with lb appliance (used as subnet IP to make the appliance part of private network) // acquire a public IP to associate with lb appliance (used as subnet IP to make the appliance part of private network)

View File

@ -1379,7 +1379,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
} }
NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); NetworkOffering offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
boolean sharedSourceNat = offering.getSharedSourceNat(); boolean sharedSourceNat = offering.isSharedSourceNat();
boolean isSourceNat = false; boolean isSourceNat = false;
if (!sharedSourceNat) { if (!sharedSourceNat) {
if (getExistingSourceNatInNetwork(owner.getId(), networkId) == null) { if (getExistingSourceNatInNetwork(owner.getId(), networkId) == null) {
@ -1737,7 +1737,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
Network guestNetwork = pair.third(); Network guestNetwork = pair.third();
// if the network offering has persistent set to true, implement the network // if the network offering has persistent set to true, implement the network
if (createNetwork && requiredOfferings.get(0).getIsPersistent()) { if (createNetwork && requiredOfferings.get(0).isPersistent()) {
DataCenter zone = _dcDao.findById(zoneId); DataCenter zone = _dcDao.findById(zoneId);
DeployDestination dest = new DeployDestination(zone, null, null, null); DeployDestination dest = new DeployDestination(zone, null, null, null);
Account callerAccount = CallContext.current().getCallingAccount(); Account callerAccount = CallContext.current().getCallingAccount();
@ -1959,7 +1959,7 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
Network guestNetwork = _networksDao.findById(networkId); Network guestNetwork = _networksDao.findById(networkId);
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering off = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
IpAddress ip = null; IpAddress ip = null;
if ((off.getElasticLb() && forElasticLb) || (off.getElasticIp() && forElasticIp)) { if ((off.isElasticLb() && forElasticLb) || (off.isElasticIp() && forElasticIp)) {
try { try {
s_logger.debug("Allocating system IP address for load balancer rule..."); s_logger.debug("Allocating system IP address for load balancer rule...");

View File

@ -2337,7 +2337,7 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel, Confi
if (network != null) { if (network != null) {
NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
return offering.getEgressDefaultPolicy(); return offering.isEgressDefaultPolicy();
} else { } else {
InvalidParameterValueException ex = new InvalidParameterValueException("network with network id does not exist"); InvalidParameterValueException ex = new InvalidParameterValueException("network with network id does not exist");
throw ex; throw ex;

View File

@ -950,7 +950,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
Network guestNetwork = getNetwork(networkId); Network guestNetwork = getNetwork(networkId);
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
Long vmId = ipVO.getAssociatedWithVmId(); Long vmId = ipVO.getAssociatedWithVmId();
if (offering.getElasticIp() && vmId != null) { if (offering.isElasticIp() && vmId != null) {
_rulesMgr.getSystemIpAndEnableStaticNatForVm(_userVmDao.findById(vmId), true); _rulesMgr.getSystemIpAndEnableStaticNatForVm(_userVmDao.findById(vmId), true);
return true; return true;
} }
@ -1255,7 +1255,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
} }
// Don't allow to specify vlan if the caller is not ROOT admin // Don't allow to specify vlan if the caller is not ROOT admin
if (!_accountMgr.isRootAdmin(caller.getId()) && (ntwkOff.getSpecifyVlan() || vlanId != null || bypassVlanOverlapCheck)) { if (!_accountMgr.isRootAdmin(caller.getId()) && (ntwkOff.isSpecifyVlan() || vlanId != null || bypassVlanOverlapCheck)) {
throw new InvalidParameterValueException("Only ROOT admin is allowed to specify vlanId or bypass vlan overlap check"); throw new InvalidParameterValueException("Only ROOT admin is allowed to specify vlanId or bypass vlan overlap check");
} }
@ -1309,7 +1309,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
} }
// Can add vlan range only to the network which allows it // Can add vlan range only to the network which allows it
if (createVlan && !ntwkOff.getSpecifyIpRanges()) { if (createVlan && !ntwkOff.isSpecifyIpRanges()) {
throwInvalidIdException("Network offering with specified id doesn't support adding multiple ip ranges", ntwkOff.getUuid(), "networkOfferingId"); throwInvalidIdException("Network offering with specified id doesn't support adding multiple ip ranges", ntwkOff.getUuid(), "networkOfferingId");
} }
@ -1318,7 +1318,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
createVlan, externalId); createVlan, externalId);
// if the network offering has persistent set to true, implement the network // if the network offering has persistent set to true, implement the network
if (ntwkOff.getIsPersistent()) { if (ntwkOff.isPersistent()) {
try { try {
if (network.getState() == Network.State.Setup) { if (network.getState() == Network.State.Setup) {
s_logger.debug("Network id=" + network.getId() + " is already provisioned"); s_logger.debug("Network id=" + network.getId() + " is already provisioned");
@ -1398,7 +1398,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
if (_configMgr.isOfferingForVpc(ntwkOff)) { if (_configMgr.isOfferingForVpc(ntwkOff)) {
throw new InvalidParameterValueException("Network offering can be used for VPC networks only"); throw new InvalidParameterValueException("Network offering can be used for VPC networks only");
} }
if (ntwkOff.getInternalLb()) { if (ntwkOff.isInternalLb()) {
throw new InvalidParameterValueException("Internal Lb can be enabled on vpc networks only"); throw new InvalidParameterValueException("Internal Lb can be enabled on vpc networks only");
} }
@ -2107,7 +2107,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
networkOfferingChanged = true; networkOfferingChanged = true;
//Setting the new network's isReduntant to the new network offering's RedundantRouter. //Setting the new network's isReduntant to the new network offering's RedundantRouter.
network.setRedundant(_networkOfferingDao.findById(networkOfferingId).getRedundantRouter()); network.setRedundant(_networkOfferingDao.findById(networkOfferingId).isRedundantRouter());
} }
} }
@ -2238,8 +2238,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
// 1) Shutdown all the elements and cleanup all the rules. Don't allow to shutdown network in intermediate // 1) Shutdown all the elements and cleanup all the rules. Don't allow to shutdown network in intermediate
// states - Shutdown and Implementing // states - Shutdown and Implementing
int resourceCount=1; int resourceCount=1;
if (updateInSequence && restartNetwork && _networkOfferingDao.findById(network.getNetworkOfferingId()).getRedundantRouter() if (updateInSequence && restartNetwork && _networkOfferingDao.findById(network.getNetworkOfferingId()).isRedundantRouter()
&& (networkOfferingId==null || _networkOfferingDao.findById(networkOfferingId).getRedundantRouter()) && network.getVpcId()==null) { && (networkOfferingId==null || _networkOfferingDao.findById(networkOfferingId).isRedundantRouter()) && network.getVpcId()==null) {
_networkMgr.canUpdateInSequence(network, forced); _networkMgr.canUpdateInSequence(network, forced);
NetworkDetailVO networkDetail =new NetworkDetailVO(network.getId(),Network.updatingInSequence,"true",true); NetworkDetailVO networkDetail =new NetworkDetailVO(network.getId(),Network.updatingInSequence,"true",true);
_networkDetailsDao.persist(networkDetail); _networkDetailsDao.persist(networkDetail);
@ -2377,7 +2377,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
// 4) if network has been upgraded from a non persistent ntwk offering to a persistent ntwk offering, // 4) if network has been upgraded from a non persistent ntwk offering to a persistent ntwk offering,
// implement the network if its not already // implement the network if its not already
if (networkOfferingChanged && !oldNtwkOff.getIsPersistent() && networkOffering.getIsPersistent()) { if (networkOfferingChanged && !oldNtwkOff.isPersistent() && networkOffering.isPersistent()) {
if (network.getState() == Network.State.Allocated) { if (network.getState() == Network.State.Allocated) {
try { try {
DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null); DeployDestination dest = new DeployDestination(_dcDao.findById(network.getDataCenterId()), null, null, null);
@ -2491,7 +2491,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
DataCenter zone = _dcDao.findById(network.getDataCenterId()); DataCenter zone = _dcDao.findById(network.getDataCenterId());
NetworkVO networkInOldPhysNet = _networksDao.findById(networkIdInOldPhysicalNet); NetworkVO networkInOldPhysNet = _networksDao.findById(networkIdInOldPhysicalNet);
boolean shouldImplement = (newNtwkOff.getIsPersistent() boolean shouldImplement = (newNtwkOff.isPersistent()
|| networkInOldPhysNet.getState() == Network.State.Implemented) || networkInOldPhysNet.getState() == Network.State.Implemented)
&& networkInNewPhysicalNet.getState() != Network.State.Implemented; && networkInNewPhysicalNet.getState() != Network.State.Implemented;
@ -2759,7 +2759,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
} }
// specify ipRanges should be the same // specify ipRanges should be the same
if (oldNetworkOffering.getSpecifyIpRanges() != newNetworkOffering.getSpecifyIpRanges()) { if (oldNetworkOffering.isSpecifyIpRanges() != newNetworkOffering.isSpecifyIpRanges()) {
s_logger.debug("Network offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different values for specifyIpRangess, can't upgrade"); s_logger.debug("Network offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different values for specifyIpRangess, can't upgrade");
return false; return false;
} }
@ -2781,7 +2781,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
//can't update from internal LB to public LB //can't update from internal LB to public LB
if (areServicesSupportedByNetworkOffering(oldNetworkOfferingId, Service.Lb) && areServicesSupportedByNetworkOffering(newNetworkOfferingId, Service.Lb)) { if (areServicesSupportedByNetworkOffering(oldNetworkOfferingId, Service.Lb) && areServicesSupportedByNetworkOffering(newNetworkOfferingId, Service.Lb)) {
if (oldNetworkOffering.getPublicLb() != newNetworkOffering.getPublicLb() || oldNetworkOffering.getInternalLb() != newNetworkOffering.getInternalLb()) { if (oldNetworkOffering.isPublicLb() != newNetworkOffering.isPublicLb() || oldNetworkOffering.isInternalLb() != newNetworkOffering.isInternalLb()) {
throw new InvalidParameterValueException("Original and new offerings support different types of LB - Internal vs Public," + " can't upgrade"); throw new InvalidParameterValueException("Original and new offerings support different types of LB - Internal vs Public," + " can't upgrade");
} }
} }
@ -2813,7 +2813,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
} }
// specify vlan should be the same // specify vlan should be the same
if (oldNetworkOffering.getSpecifyVlan() != newNetworkOffering.getSpecifyVlan()) { if (oldNetworkOffering.isSpecifyVlan() != newNetworkOffering.isSpecifyVlan()) {
s_logger.debug("Network offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different values for specifyVlan, can't upgrade"); s_logger.debug("Network offerings " + newNetworkOfferingId + " and " + oldNetworkOfferingId + " have different values for specifyVlan, can't upgrade");
return false; return false;
} }

View File

@ -1314,7 +1314,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
} }
if (!zone.isLocalStorageEnabled()) { if (!zone.isLocalStorageEnabled()) {
if (serviceOffering.getUseLocalStorage()) { if (serviceOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Zone is not configured to use local storage but service offering " + serviceOffering.getName() + " uses it"); throw new InvalidParameterValueException("Zone is not configured to use local storage but service offering " + serviceOffering.getName() + " uses it");
} }
} }

View File

@ -231,7 +231,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor, RedundantResource, DnsServ
final List<DomainRouterVO> routers = routerDeploymentDefinition.deployVirtualRouter(); final List<DomainRouterVO> routers = routerDeploymentDefinition.deployVirtualRouter();
int expectedRouters = 1; int expectedRouters = 1;
if (offering.getRedundantRouter() || network.isRollingRestart()) { if (offering.isRedundantRouter() || network.isRollingRestart()) {
expectedRouters = 2; expectedRouters = 2;
} }
if (routers == null || routers.size() < expectedRouters) { if (routers == null || routers.size() < expectedRouters) {

View File

@ -97,7 +97,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
NetworkVO config = NetworkVO config =
new NetworkVO(offering.getTrafficType(), Mode.Static, BroadcastDomainType.LinkLocal, offering.getId(), Network.State.Setup, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Static, BroadcastDomainType.LinkLocal, offering.getId(), Network.State.Setup, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
config.setCidr(_cidr); config.setCidr(_cidr);
config.setGateway(_gateway); config.setGateway(_gateway);

View File

@ -179,7 +179,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
NetworkVO config = NetworkVO config =
new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Vlan, offering.getId(), state, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Vlan, offering.getId(), state, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
if (userSpecified != null) { if (userSpecified != null) {
if ((userSpecified.getCidr() == null && userSpecified.getGateway() != null) || (userSpecified.getCidr() != null && userSpecified.getGateway() == null)) { if ((userSpecified.getCidr() == null && userSpecified.getGateway() != null) || (userSpecified.getCidr() != null && userSpecified.getGateway() == null)) {

View File

@ -135,7 +135,7 @@ public class ExternalGuestNetworkGuru extends GuestNetworkGuru {
DataCenter zone = dest.getDataCenter(); DataCenter zone = dest.getDataCenter();
NetworkVO implemented = NetworkVO implemented =
new NetworkVO(config.getTrafficType(), config.getMode(), config.getBroadcastDomainType(), config.getNetworkOfferingId(), State.Allocated, new NetworkVO(config.getTrafficType(), config.getMode(), config.getBroadcastDomainType(), config.getNetworkOfferingId(), State.Allocated,
config.getDataCenterId(), config.getPhysicalNetworkId(), offering.getRedundantRouter()); config.getDataCenterId(), config.getPhysicalNetworkId(), offering.isRedundantRouter());
// Get a vlan tag // Get a vlan tag
int vlanTag; int vlanTag;

View File

@ -191,7 +191,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
final NetworkVO network = final NetworkVO network =
new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Vlan, offering.getId(), State.Allocated, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Vlan, offering.getId(), State.Allocated, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
if (userSpecified != null) { if (userSpecified != null) {
if (userSpecified.getCidr() == null && userSpecified.getGateway() != null || userSpecified.getCidr() != null && userSpecified.getGateway() == null) { if (userSpecified.getCidr() == null && userSpecified.getGateway() != null || userSpecified.getCidr() != null && userSpecified.getGateway() == null) {
throw new InvalidParameterValueException("cidr and gateway must be specified together."); throw new InvalidParameterValueException("cidr and gateway must be specified together.");
@ -211,7 +211,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
} }
} }
if (offering.getSpecifyVlan()) { if (offering.isSpecifyVlan()) {
network.setBroadcastUri(userSpecified.getBroadcastUri()); network.setBroadcastUri(userSpecified.getBroadcastUri());
network.setState(State.Setup); network.setState(State.Setup);
} }
@ -315,7 +315,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
final NetworkVO implemented = final NetworkVO implemented =
new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated, new NetworkVO(network.getTrafficType(), network.getMode(), network.getBroadcastDomainType(), network.getNetworkOfferingId(), State.Allocated,
network.getDataCenterId(), physicalNetworkId, offering.getRedundantRouter()); network.getDataCenterId(), physicalNetworkId, offering.isRedundantRouter());
allocateVnet(network, implemented, dcId, physicalNetworkId, context.getReservationId()); allocateVnet(network, implemented, dcId, physicalNetworkId, context.getReservationId());
@ -430,7 +430,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
return; // Nothing to do here if the uri is null already return; // Nothing to do here if the uri is null already
} }
if ((profile.getBroadcastDomainType() == BroadcastDomainType.Vlan || profile.getBroadcastDomainType() == BroadcastDomainType.Vxlan) && !offering.getSpecifyVlan()) { if ((profile.getBroadcastDomainType() == BroadcastDomainType.Vlan || profile.getBroadcastDomainType() == BroadcastDomainType.Vxlan) && !offering.isSpecifyVlan()) {
s_logger.debug("Releasing vnet for the network id=" + profile.getId()); s_logger.debug("Releasing vnet for the network id=" + profile.getId());
_dcDao.releaseVnet(BroadcastDomainType.getValue(profile.getBroadcastUri()), profile.getDataCenterId(), profile.getPhysicalNetworkId(), profile.getAccountId(), _dcDao.releaseVnet(BroadcastDomainType.getValue(profile.getBroadcastUri()), profile.getDataCenterId(), profile.getPhysicalNetworkId(), profile.getAccountId(),
profile.getReservationId()); profile.getReservationId());

View File

@ -85,7 +85,7 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
NetworkVO config = NetworkVO config =
new NetworkVO(type, Mode.Static, BroadcastDomainType.Native, offering.getId(), Network.State.Setup, plan.getDataCenterId(), new NetworkVO(type, Mode.Static, BroadcastDomainType.Native, offering.getId(), Network.State.Setup, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
return config; return config;
} }

View File

@ -111,7 +111,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
} }
NetworkVO network = NetworkVO network =
new NetworkVO(offering.getTrafficType(), Mode.Static, broadcastType, offering.getId(), State.Allocated, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Static, broadcastType, offering.getId(), State.Allocated, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
if (userSpecified != null) { if (userSpecified != null) {
if ((userSpecified.getCidr() == null && userSpecified.getGateway() != null) || (userSpecified.getCidr() != null && userSpecified.getGateway() == null)) { if ((userSpecified.getCidr() == null && userSpecified.getGateway() != null) || (userSpecified.getCidr() != null && userSpecified.getGateway() == null)) {
throw new InvalidParameterValueException("cidr and gateway must be specified together."); throw new InvalidParameterValueException("cidr and gateway must be specified together.");
@ -124,7 +124,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
throw new InvalidParameterValueException("Can't design network " + network + "; netmask/gateway must be passed in"); throw new InvalidParameterValueException("Can't design network " + network + "; netmask/gateway must be passed in");
} }
if (offering.getSpecifyVlan()) { if (offering.isSpecifyVlan()) {
network.setBroadcastUri(userSpecified.getBroadcastUri()); network.setBroadcastUri(userSpecified.getBroadcastUri());
network.setState(State.Setup); network.setState(State.Setup);
} }

View File

@ -101,7 +101,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
if (offering.getTrafficType() == TrafficType.Public) { if (offering.getTrafficType() == TrafficType.Public) {
NetworkVO ntwk = NetworkVO ntwk =
new NetworkVO(offering.getTrafficType(), Mode.Static, network.getBroadcastDomainType(), offering.getId(), State.Setup, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Static, network.getBroadcastDomainType(), offering.getId(), State.Setup, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
return ntwk; return ntwk;
} else { } else {
return null; return null;

View File

@ -89,7 +89,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
NetworkVO config = NetworkVO config =
new NetworkVO(offering.getTrafficType(), Mode.Static, BroadcastDomainType.Native, offering.getId(), Network.State.Setup, plan.getDataCenterId(), new NetworkVO(offering.getTrafficType(), Mode.Static, BroadcastDomainType.Native, offering.getId(), Network.State.Setup, plan.getDataCenterId(),
plan.getPhysicalNetworkId(), offering.getRedundantRouter()); plan.getPhysicalNetworkId(), offering.isRedundantRouter());
return config; return config;
} }

View File

@ -1601,7 +1601,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
if (result == null) { if (result == null) {
IpAddress systemIp = null; IpAddress systemIp = null;
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
if (off.getElasticLb() && ipVO == null && network.getVpcId() == null) { if (off.isElasticLb() && ipVO == null && network.getVpcId() == null) {
systemIp = _ipAddrMgr.assignSystemIp(networkId, lbOwner, true, false); systemIp = _ipAddrMgr.assignSystemIp(networkId, lbOwner, true, false);
if (systemIp != null) { if (systemIp != null) {
ipVO = _ipAddressDao.findById(systemIp.getId()); ipVO = _ipAddressDao.findById(systemIp.getId());
@ -2507,11 +2507,11 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
//2) Check if the Scheme is supported\ //2) Check if the Scheme is supported\
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
if (scheme == Scheme.Public) { if (scheme == Scheme.Public) {
if (!off.getPublicLb()) { if (!off.isPublicLb()) {
throw new InvalidParameterValueException("Scheme " + scheme + " is not supported by the network offering " + off); throw new InvalidParameterValueException("Scheme " + scheme + " is not supported by the network offering " + off);
} }
} else { } else {
if (!off.getInternalLb()) { if (!off.isInternalLb()) {
throw new InvalidParameterValueException("Scheme " + scheme + " is not supported by the network offering " + off); throw new InvalidParameterValueException("Scheme " + scheme + " is not supported by the network offering " + off);
} }
} }

View File

@ -406,7 +406,7 @@ public class CommandSetupHelper {
} else if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) { } else if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) {
final NetworkVO network = _networkDao.findById(guestNetworkId); final NetworkVO network = _networkDao.findById(guestNetworkId);
final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
defaultEgressPolicy = offering.getEgressDefaultPolicy(); defaultEgressPolicy = offering.isEgressDefaultPolicy();
assert rule.getSourceIpAddressId() == null : "ipAddressId should be null for egress firewall rule. "; assert rule.getSourceIpAddressId() == null : "ipAddressId should be null for egress firewall rule. ";
final FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, "", Purpose.Firewall, traffictype, defaultEgressPolicy); final FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, "", Purpose.Firewall, traffictype, defaultEgressPolicy);
rulesTO.add(ruleTO); rulesTO.add(ruleTO);
@ -450,7 +450,7 @@ public class CommandSetupHelper {
} else if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) { } else if (rule.getTrafficType() == FirewallRule.TrafficType.Egress) {
final NetworkVO network = _networkDao.findById(guestNetworkId); final NetworkVO network = _networkDao.findById(guestNetworkId);
final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
defaultEgressPolicy = offering.getEgressDefaultPolicy(); defaultEgressPolicy = offering.isEgressDefaultPolicy();
assert rule.getSourceIpAddressId() == null : "ipAddressId should be null for egress firewall rule. "; assert rule.getSourceIpAddressId() == null : "ipAddressId should be null for egress firewall rule. ";
final FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, "", Purpose.Firewall, traffictype, defaultEgressPolicy); final FirewallRuleTO ruleTO = new FirewallRuleTO(rule, null, "", Purpose.Firewall, traffictype, defaultEgressPolicy);
rulesTO.add(ruleTO); rulesTO.add(ruleTO);
@ -1066,7 +1066,7 @@ public class CommandSetupHelper {
} }
final NetworkOffering offering = _networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId()); final NetworkOffering offering = _networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId());
if (offering.getRedundantRouter()) { if (offering.isRedundantRouter()) {
return findGatewayIp(userVmId); return findGatewayIp(userVmId);
} }

View File

@ -479,7 +479,7 @@ public class NetworkHelperImpl implements NetworkHelper {
continue; continue;
} }
final boolean offerHA = routerOffering.getOfferHA(); final boolean offerHA = routerOffering.isOfferHA();
// routerDeploymentDefinition.getVpc().getId() ==> do not use // routerDeploymentDefinition.getVpc().getId() ==> do not use
// VPC because it is not a VPC offering. // VPC because it is not a VPC offering.

View File

@ -376,7 +376,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
// check if it is a system service offering, if yes return with error as // check if it is a system service offering, if yes return with error as
// it cannot be used for user vms // it cannot be used for user vms
if (!newServiceOffering.getSystemUse()) { if (!newServiceOffering.isSystemUse()) {
throw new InvalidParameterValueException("Cannot upgrade router vm to a non system service offering " + serviceOfferingId); throw new InvalidParameterValueException("Cannot upgrade router vm to a non system service offering " + serviceOfferingId);
} }
@ -392,9 +392,9 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
// Check that the service offering being upgraded to has the same // Check that the service offering being upgraded to has the same
// storage pool preference as the VM's current service // storage pool preference as the VM's current service
// offering // offering
if (currentServiceOffering.getUseLocalStorage() != newServiceOffering.getUseLocalStorage()) { if (currentServiceOffering.isUseLocalStorage() != newServiceOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Can't upgrade, due to new local storage status : " + newServiceOffering.getUseLocalStorage() + " is different from " throw new InvalidParameterValueException("Can't upgrade, due to new local storage status : " + newServiceOffering.isUseLocalStorage() + " is different from "
+ "curruent local storage status: " + currentServiceOffering.getUseLocalStorage()); + "curruent local storage status: " + currentServiceOffering.isUseLocalStorage());
} }
router.setServiceOfferingId(serviceOfferingId); router.setServiceOfferingId(serviceOfferingId);
@ -1670,7 +1670,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
final NetworkOffering offering = _networkOfferingDao.findById(_networkDao.findById(guestNetworkId).getNetworkOfferingId()); final NetworkOffering offering = _networkOfferingDao.findById(_networkDao.findById(guestNetworkId).getNetworkOfferingId());
// service monitoring is currently not added in RVR // service monitoring is currently not added in RVR
if (!offering.getRedundantRouter()) { if (!offering.isRedundantRouter()) {
final String serviceMonitringSet = _configDao.getValue(Config.EnableServiceMonitoring.key()); final String serviceMonitringSet = _configDao.getValue(Config.EnableServiceMonitoring.key());
if (serviceMonitringSet != null && serviceMonitringSet.equalsIgnoreCase("true")) { if (serviceMonitringSet != null && serviceMonitringSet.equalsIgnoreCase("true")) {
@ -1947,7 +1947,7 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
private void createDefaultEgressFirewallRule(final List<FirewallRule> rules, final long networkId) { private void createDefaultEgressFirewallRule(final List<FirewallRule> rules, final long networkId) {
final NetworkVO network = _networkDao.findById(networkId); final NetworkVO network = _networkDao.findById(networkId);
final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId()); final NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
final Boolean defaultEgressPolicy = offering.getEgressDefaultPolicy(); final Boolean defaultEgressPolicy = offering.isEgressDefaultPolicy();
// The default on the router is set to Deny all. So, if the default configuration in the offering is set to true (Allow), we change the Egress here // The default on the router is set to Deny all. So, if the default configuration in the offering is set to true (Allow), we change the Egress here
if (defaultEgressPolicy) { if (defaultEgressPolicy) {

View File

@ -391,7 +391,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
Network network = _networkModel.getNetwork(networkId); Network network = _networkModel.getNetwork(networkId);
NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); NetworkOffering off = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
if (off.getElasticIp()) { if (off.isElasticIp()) {
throw new InvalidParameterValueException("Can't create ip forwarding rules for the network where elasticIP service is enabled"); throw new InvalidParameterValueException("Can't create ip forwarding rules for the network where elasticIP service is enabled");
} }
@ -653,7 +653,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
if (networkId != null) { if (networkId != null) {
Network guestNetwork = _networkModel.getNetwork(networkId); Network guestNetwork = _networkModel.getNetwork(networkId);
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
if (offering.getElasticIp()) { if (offering.isElasticIp()) {
reassignStaticNat = true; reassignStaticNat = true;
} }
} }
@ -1235,8 +1235,8 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
// re-enable it on the new one enable static nat takes care of that // re-enable it on the new one enable static nat takes care of that
Network guestNetwork = _networkModel.getNetwork(ipAddress.getAssociatedWithNetworkId()); Network guestNetwork = _networkModel.getNetwork(ipAddress.getAssociatedWithNetworkId());
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
if (offering.getElasticIp()) { if (offering.isElasticIp()) {
if (offering.getAssociatePublicIP()) { if (offering.isAssociatePublicIP()) {
getSystemIpAndEnableStaticNatForVm(_vmDao.findById(vmId), true); getSystemIpAndEnableStaticNatForVm(_vmDao.findById(vmId), true);
return true; return true;
} }
@ -1434,10 +1434,10 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
for (Nic nic : nics) { for (Nic nic : nics) {
Network guestNetwork = _networkModel.getNetwork(nic.getNetworkId()); Network guestNetwork = _networkModel.getNetwork(nic.getNetworkId());
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
if (offering.getElasticIp()) { if (offering.isElasticIp()) {
boolean isSystemVM = (vm.getType() == Type.ConsoleProxy || vm.getType() == Type.SecondaryStorageVm); boolean isSystemVM = (vm.getType() == Type.ConsoleProxy || vm.getType() == Type.SecondaryStorageVm);
// for user VM's associate public IP only if offering is marked to associate a public IP by default on start of VM // for user VM's associate public IP only if offering is marked to associate a public IP by default on start of VM
if (!isSystemVM && !offering.getAssociatePublicIP()) { if (!isSystemVM && !offering.isAssociatePublicIP()) {
continue; continue;
} }
// check if there is already static nat enabled // check if there is already static nat enabled

View File

@ -41,7 +41,7 @@ public class PrivateIpAddress implements PrivateIp {
this.netmask = netmask; this.netmask = netmask;
this.macAddress = macAddress; this.macAddress = macAddress;
this.networkId = privateIp.getNetworkId(); this.networkId = privateIp.getNetworkId();
this.sourceNat = privateIp.getSourceNat(); this.sourceNat = privateIp.isSourceNat();
} }
@Override @Override

View File

@ -1262,7 +1262,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
// 4) Only one network in the VPC can support public LB inside the VPC. // 4) Only one network in the VPC can support public LB inside the VPC.
// Internal LB can be supported on multiple VPC tiers // Internal LB can be supported on multiple VPC tiers
if (_ntwkModel.areServicesSupportedByNetworkOffering(guestNtwkOff.getId(), Service.Lb) && guestNtwkOff.getPublicLb()) { if (_ntwkModel.areServicesSupportedByNetworkOffering(guestNtwkOff.getId(), Service.Lb) && guestNtwkOff.isPublicLb()) {
final List<? extends Network> networks = getVpcNetworks(vpc.getId()); final List<? extends Network> networks = getVpcNetworks(vpc.getId());
for (final Network network : networks) { for (final Network network : networks) {
if (networkId != null && network.getId() == networkId.longValue()) { if (networkId != null && network.getId() == networkId.longValue()) {
@ -1272,7 +1272,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
final NetworkOffering otherOff = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); final NetworkOffering otherOff = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId());
// throw only if networks have different offerings with // throw only if networks have different offerings with
// public lb support // public lb support
if (_ntwkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb) && otherOff.getPublicLb() && guestNtwkOff.getId() != otherOff.getId()) { if (_ntwkModel.areServicesSupportedInNetwork(network.getId(), Service.Lb) && otherOff.isPublicLb() && guestNtwkOff.getId() != otherOff.getId()) {
throw new InvalidParameterValueException("Public LB service is already supported " + "by network " + network + " in VPC " + vpc); throw new InvalidParameterValueException("Public LB service is already supported " + "by network " + network + " in VPC " + vpc);
} }
} }
@ -1319,7 +1319,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
} }
// 5) If Netscaler is LB provider make sure it is in dedicated mode // 5) If Netscaler is LB provider make sure it is in dedicated mode
if (providers.contains(Provider.Netscaler) && !guestNtwkOff.getDedicatedLB()) { if (providers.contains(Provider.Netscaler) && !guestNtwkOff.isDedicatedLB()) {
throw new InvalidParameterValueException("Netscaler only with Dedicated LB can belong to VPC"); throw new InvalidParameterValueException("Netscaler only with Dedicated LB can belong to VPC");
} }
return; return;

View File

@ -1234,7 +1234,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio
if (broadcastDomainType != null) { if (broadcastDomainType != null) {
NetworkVO network = NetworkVO network =
new NetworkVO(id, trafficType, mode, broadcastDomainType, networkOfferingId, domainId, accountId, related, null, null, networkDomain, new NetworkVO(id, trafficType, mode, broadcastDomainType, networkOfferingId, domainId, accountId, related, null, null, networkDomain,
Network.GuestType.Shared, zoneId, null, null, specifyIpRanges, null, offering.getRedundantRouter()); Network.GuestType.Shared, zoneId, null, null, specifyIpRanges, null, offering.isRedundantRouter());
network.setGuruName(guruNames.get(network.getTrafficType())); network.setGuruName(guruNames.get(network.getTrafficType()));
network.setDns1(zone.getDns1()); network.setDns1(zone.getDns1());
network.setDns2(zone.getDns2()); network.setDns2(zone.getDns2());

View File

@ -2180,7 +2180,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS"); throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS");
} }
if (!guestOsHandle.getIsUserDefined()) { if (!guestOsHandle.isUserDefined()) {
throw new InvalidParameterValueException("Unable to modify system defined guest OS"); throw new InvalidParameterValueException("Unable to modify system defined guest OS");
} }
@ -2222,7 +2222,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS"); throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS");
} }
if (!guestOs.getIsUserDefined()) { if (!guestOs.isUserDefined()) {
throw new InvalidParameterValueException("Unable to remove system defined guest OS"); throw new InvalidParameterValueException("Unable to remove system defined guest OS");
} }

View File

@ -2421,7 +2421,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
return diskOffering.getBytesReadRate(); return diskOffering.getBytesReadRate();
} else { } else {
Long bytesReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesReadRate.key())); Long bytesReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesReadRate.key()));
if ((bytesReadRate > 0) && ((offering == null) || (!offering.getSystemUse()))) { if ((bytesReadRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
return bytesReadRate; return bytesReadRate;
} }
} }
@ -2437,7 +2437,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
return diskOffering.getBytesWriteRate(); return diskOffering.getBytesWriteRate();
} else { } else {
Long bytesWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesWriteRate.key())); Long bytesWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingBytesWriteRate.key()));
if ((bytesWriteRate > 0) && ((offering == null) || (!offering.getSystemUse()))) { if ((bytesWriteRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
return bytesWriteRate; return bytesWriteRate;
} }
} }
@ -2453,7 +2453,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
return diskOffering.getIopsReadRate(); return diskOffering.getIopsReadRate();
} else { } else {
Long iopsReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsReadRate.key())); Long iopsReadRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsReadRate.key()));
if ((iopsReadRate > 0) && ((offering == null) || (!offering.getSystemUse()))) { if ((iopsReadRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
return iopsReadRate; return iopsReadRate;
} }
} }
@ -2469,7 +2469,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
return diskOffering.getIopsWriteRate(); return diskOffering.getIopsWriteRate();
} else { } else {
Long iopsWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsWriteRate.key())); Long iopsWriteRate = Long.parseLong(_configDao.getValue(Config.VmDiskThrottlingIopsWriteRate.key()));
if ((iopsWriteRate > 0) && ((offering == null) || (!offering.getSystemUse()))) { if ((iopsWriteRate > 0) && ((offering == null) || (!offering.isSystemUse()))) {
return iopsWriteRate; return iopsWriteRate;
} }
} }

View File

@ -712,7 +712,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
// If local storage is disabled then creation of volume with local disk // If local storage is disabled then creation of volume with local disk
// offering not allowed // offering not allowed
if (!zone.isLocalStorageEnabled() && diskOffering.getUseLocalStorage()) { if (!zone.isLocalStorageEnabled() && diskOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Zone is not configured to use local storage but volume's disk offering " + diskOffering.getName() + " uses it"); throw new InvalidParameterValueException("Zone is not configured to use local storage but volume's disk offering " + diskOffering.getName() + " uses it");
} }
@ -853,7 +853,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
Long newMinIops; Long newMinIops;
Long newMaxIops; Long newMaxIops;
Integer newHypervisorSnapshotReserve; Integer newHypervisorSnapshotReserve;
boolean shrinkOk = cmd.getShrinkOk(); boolean shrinkOk = cmd.isShrinkOk();
VolumeVO volume = _volsDao.findById(cmd.getEntityId()); VolumeVO volume = _volsDao.findById(cmd.getEntityId());
if (volume == null) { if (volume == null) {
@ -1540,7 +1540,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
DataCenterVO dataCenter = _dcDao.findById(volumeToAttach.getDataCenterId()); DataCenterVO dataCenter = _dcDao.findById(volumeToAttach.getDataCenterId());
if (!dataCenter.isLocalStorageEnabled()) { if (!dataCenter.isLocalStorageEnabled()) {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(volumeToAttach.getDiskOfferingId()); DiskOfferingVO diskOffering = _diskOfferingDao.findById(volumeToAttach.getDiskOfferingId());
if (diskOffering.getUseLocalStorage()) { if (diskOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Zone is not configured to use local storage but volume's disk offering " + diskOffering.getName() + " uses it"); throw new InvalidParameterValueException("Zone is not configured to use local storage but volume's disk offering " + diskOffering.getName() + " uses it");
} }
} }
@ -2185,7 +2185,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
if (newDiskOffering == null) { if (newDiskOffering == null) {
return; return;
} }
if ((destPool.isShared() && newDiskOffering.getUseLocalStorage()) || destPool.isLocal() && newDiskOffering.isShared()) { if ((destPool.isShared() && newDiskOffering.isUseLocalStorage()) || destPool.isLocal() && newDiskOffering.isShared()) {
throw new InvalidParameterValueException("You cannot move the volume to a shared storage and assing a disk offering for local storage and vice versa."); throw new InvalidParameterValueException("You cannot move the volume to a shared storage and assing a disk offering for local storage and vice versa.");
} }
if (!doesTargetStorageSupportNewDiskOffering(destPool, newDiskOffering)) { if (!doesTargetStorageSupportNewDiskOffering(destPool, newDiskOffering)) {

View File

@ -666,7 +666,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
_vmDao.loadDetails(userVm); _vmDao.loadDetails(userVm);
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(userVm.getTemplateId()); VMTemplateVO template = _templateDao.findByIdIncludingRemoved(userVm.getTemplateId());
if (template == null || !template.getEnablePassword()) { if (template == null || !template.isEnablePassword()) {
throw new InvalidParameterValueException("Fail to reset password for the virtual machine, the template is not password enabled"); throw new InvalidParameterValueException("Fail to reset password for the virtual machine, the template is not password enabled");
} }
@ -706,7 +706,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
} }
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmInstance.getTemplateId()); VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmInstance.getTemplateId());
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
Nic defaultNic = _networkModel.getDefaultNic(vmId); Nic defaultNic = _networkModel.getDefaultNic(vmId);
if (defaultNic == null) { if (defaultNic == null) {
s_logger.error("Unable to reset password for vm " + vmInstance + " as the instance doesn't have default nic"); s_logger.error("Unable to reset password for vm " + vmInstance + " as the instance doesn't have default nic");
@ -797,7 +797,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
_accountMgr.checkAccess(caller, null, true, userVm); _accountMgr.checkAccess(caller, null, true, userVm);
String password = null; String password = null;
String sshPublicKey = s.getPublicKey(); String sshPublicKey = s.getPublicKey();
if (template != null && template.getEnablePassword()) { if (template != null && template.isEnablePassword()) {
password = _mgr.generateRandomPassword(); password = _mgr.generateRandomPassword();
} }
@ -826,7 +826,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance);
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
vmProfile.setParameter(VirtualMachineProfile.Param.VmPassword, password); vmProfile.setParameter(VirtualMachineProfile.Param.VmPassword, password);
} }
@ -844,7 +844,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
final UserVmVO userVm = _vmDao.findById(vmId); final UserVmVO userVm = _vmDao.findById(vmId);
_vmDao.loadDetails(userVm); _vmDao.loadDetails(userVm);
userVm.setDetail("SSH.PublicKey", sshPublicKey); userVm.setDetail("SSH.PublicKey", sshPublicKey);
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
userVm.setPassword(password); userVm.setPassword(password);
//update the encrypted password in vm_details table too //update the encrypted password in vm_details table too
encryptAndStorePassword(userVm, password); encryptAndStorePassword(userVm, password);
@ -2528,7 +2528,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
} }
ServiceOffering offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); ServiceOffering offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
if (!offering.getOfferHA() && ha) { if (!offering.isOfferHA() && ha) {
throw new InvalidParameterValueException("Can't enable ha for the vm as it's created from the Service offering having HA disabled"); throw new InvalidParameterValueException("Can't enable ha for the vm as it's created from the Service offering having HA disabled");
} }
@ -2711,7 +2711,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
long serviceOfferingId = vmInstance.getServiceOfferingId(); long serviceOfferingId = vmInstance.getServiceOfferingId();
ServiceOfferingVO offering = _serviceOfferingDao.findById(vmInstance.getId(), serviceOfferingId); ServiceOfferingVO offering = _serviceOfferingDao.findById(vmInstance.getId(), serviceOfferingId);
if (offering != null && offering.getRemoved() == null) { if (offering != null && offering.getRemoved() == null) {
if (offering.getVolatileVm()) { if (offering.isVolatileVm()) {
return restoreVMInternal(caller, vmInstance, null); return restoreVMInternal(caller, vmInstance, null);
} }
} else { } else {
@ -3536,7 +3536,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("Unable to deploy VM as SSH keypair is provided while deploying the VM, but there is no support for " + Network.Service.UserData.getName() + " service in the default network " + network.getId()); throw new InvalidParameterValueException("Unable to deploy VM as SSH keypair is provided while deploying the VM, but there is no support for " + Network.Service.UserData.getName() + " service in the default network " + network.getId());
} }
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
throw new InvalidParameterValueException("Unable to deploy VM as template " + template.getId() + " is password enabled, but there is no support for " + Network.Service.UserData.getName() + " service in the default network " + network.getId()); throw new InvalidParameterValueException("Unable to deploy VM as template " + template.getId() + " is password enabled, but there is no support for " + Network.Service.UserData.getName() + " service in the default network " + network.getId());
} }
} }
@ -3691,7 +3691,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
return Transaction.execute(new TransactionCallbackWithException<UserVmVO, InsufficientCapacityException>() { return Transaction.execute(new TransactionCallbackWithException<UserVmVO, InsufficientCapacityException>() {
@Override @Override
public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCapacityException { public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCapacityException {
UserVmVO vm = new UserVmVO(id, instanceName, displayName, template.getId(), hypervisorType, template.getGuestOSId(), offering.getOfferHA(), UserVmVO vm = new UserVmVO(id, instanceName, displayName, template.getId(), hypervisorType, template.getGuestOSId(), offering.isOfferHA(),
offering.getLimitCpuUse(), owner.getDomainId(), owner.getId(), userId, offering.getId(), userData, hostName, diskOfferingId); offering.getLimitCpuUse(), owner.getDomainId(), owner.getId(), userId, offering.getId(), userData, hostName, diskOfferingId);
vm.setUuid(uuidName); vm.setUuid(uuidName);
vm.setDynamicallyScalable(template.isDynamicallyScalable()); vm.setDynamicallyScalable(template.isDynamicallyScalable());
@ -4091,7 +4091,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
// Check that the password was passed in and is valid // Check that the password was passed in and is valid
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId()); VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId());
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
// this value is not being sent to the backend; need only for api // this value is not being sent to the backend; need only for api
// display purposes // display purposes
vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword)); vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword));
@ -4362,7 +4362,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
long networkId = ip.getAssociatedWithNetworkId(); long networkId = ip.getAssociatedWithNetworkId();
Network guestNetwork = _networkDao.findById(networkId); Network guestNetwork = _networkDao.findById(networkId);
NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId()); NetworkOffering offering = _entityMgr.findById(NetworkOffering.class, guestNetwork.getNetworkOfferingId());
assert (offering.getAssociatePublicIP() == true) : "User VM should not have system owned public IP associated with it when offering configured not to associate public IP."; assert (offering.isAssociatePublicIP() == true) : "User VM should not have system owned public IP associated with it when offering configured not to associate public IP.";
_rulesMgr.disableStaticNat(ip.getId(), ctx.getCallingAccount(), ctx.getCallingUserId(), true); _rulesMgr.disableStaticNat(ip.getId(), ctx.getCallingAccount(), ctx.getCallingUserId(), true);
} catch (Exception ex) { } catch (Exception ex) {
s_logger.warn("Failed to disable static nat and release system ip " + ip + " as a part of vm " + profile.getVirtualMachine() + " stop due to exception ", ex); s_logger.warn("Failed to disable static nat and release system ip " + ip + " as a part of vm " + profile.getVirtualMachine() + " stop due to exception ", ex);
@ -4458,7 +4458,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId()); template = _templateDao.findByIdIncludingRemoved(vm.getTemplateId());
String password = "saved_password"; String password = "saved_password";
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
if (vm.getDetail("password") != null) { if (vm.getDetail("password") != null) {
password = DBEncryptionUtil.decrypt(vm.getDetail("password")); password = DBEncryptionUtil.decrypt(vm.getDetail("password"));
} else { } else {
@ -4500,7 +4500,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
if (vm != null && vm.isUpdateParameters()) { if (vm != null && vm.isUpdateParameters()) {
// this value is not being sent to the backend; need only for api // this value is not being sent to the backend; need only for api
// display purposes // display purposes
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword)); vm.setPassword((String)vmParamPair.second().get(VirtualMachineProfile.Param.VmPassword));
vm.setUpdateParameters(false); vm.setUpdateParameters(false);
if (vm.getDetail("password") != null) { if (vm.getDetail("password") != null) {
@ -4797,10 +4797,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
} }
if (!zone.isLocalStorageEnabled()) { if (!zone.isLocalStorageEnabled()) {
if (serviceOffering.getUseLocalStorage()) { if (serviceOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Zone is not configured to use local storage but service offering " + serviceOffering.getName() + " uses it"); throw new InvalidParameterValueException("Zone is not configured to use local storage but service offering " + serviceOffering.getName() + " uses it");
} }
if (diskOffering != null && diskOffering.getUseLocalStorage()) { if (diskOffering != null && diskOffering.isUseLocalStorage()) {
throw new InvalidParameterValueException("Zone is not configured to use local storage but disk offering " + diskOffering.getName() + " uses it"); throw new InvalidParameterValueException("Zone is not configured to use local storage but disk offering " + diskOffering.getName() + " uses it");
} }
} }
@ -4991,7 +4991,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
List<VolumeVO> volumes = _volsDao.findByInstance(vm.getId()); List<VolumeVO> volumes = _volsDao.findByInstance(vm.getId());
for (VolumeVO vol : volumes) { for (VolumeVO vol : volumes) {
DiskOfferingVO diskOffering = _diskOfferingDao.findById(vol.getDiskOfferingId()); DiskOfferingVO diskOffering = _diskOfferingDao.findById(vol.getDiskOfferingId());
if (diskOffering.getUseLocalStorage()) { if (diskOffering.isUseLocalStorage()) {
usesLocalStorage = true; usesLocalStorage = true;
break; break;
} }
@ -5934,7 +5934,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
null, physicalNetwork, zone.getId(), ACLType.Account, null, null, null, physicalNetwork, zone.getId(), ACLType.Account, null, null,
null, null, true, null, null); null, null, true, null, null);
// if the network offering has persistent set to true, implement the network // if the network offering has persistent set to true, implement the network
if (requiredOfferings.get(0).getIsPersistent()) { if (requiredOfferings.get(0).isPersistent()) {
DeployDestination dest = new DeployDestination(zone, null, null, null); DeployDestination dest = new DeployDestination(zone, null, null, null);
UserVO callerUser = _userDao.findById(CallContext.current().getCallingUserId()); UserVO callerUser = _userDao.findById(CallContext.current().getCallingUserId());
Journal journal = new Journal.LogJournal("Implementing " + newNetwork, s_logger); Journal journal = new Journal.LogJournal("Implementing " + newNetwork, s_logger);
@ -6159,7 +6159,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
Map<VirtualMachineProfile.Param, Object> params = null; Map<VirtualMachineProfile.Param, Object> params = null;
String password = null; String password = null;
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
password = _mgr.generateRandomPassword(); password = _mgr.generateRandomPassword();
boolean result = resetVMPasswordInternal(vmId, password); boolean result = resetVMPasswordInternal(vmId, password);
if (!result) { if (!result) {
@ -6175,7 +6175,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
} }
_itMgr.start(vm.getUuid(), params); _itMgr.start(vm.getUuid(), params);
vm = _vmDao.findById(vmId); vm = _vmDao.findById(vmId);
if (template.getEnablePassword()) { if (template.isEnablePassword()) {
// this value is not being sent to the backend; need only for api // this value is not being sent to the backend; need only for api
// display purposes // display purposes
vm.setPassword(password); vm.setPassword(password);

View File

@ -216,7 +216,7 @@ public class BasicNetworkVisitor extends NetworkTopologyVisitor {
final NicVO nicVo = sshkey.getNicVo(); final NicVO nicVo = sshkey.getNicVo();
final VMTemplateVO template = sshkey.getTemplate(); final VMTemplateVO template = sshkey.getTemplate();
if (template != null && template.getEnablePassword()) { if (template != null && template.isEnablePassword()) {
_commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands); _commandSetupHelper.createPasswordCommand(router, profile, nicVo, commands);
} }

View File

@ -559,7 +559,7 @@ public class VolumeApiServiceImplTest {
@Test(expected = InvalidParameterValueException.class) @Test(expected = InvalidParameterValueException.class)
public void validateConditionsToReplaceDiskOfferingOfVolumeTestTargetPoolSharedDiskOfferingLocal() { public void validateConditionsToReplaceDiskOfferingOfVolumeTestTargetPoolSharedDiskOfferingLocal() {
Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK); Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK);
Mockito.when(newDiskOfferingMock.getUseLocalStorage()).thenReturn(true); Mockito.when(newDiskOfferingMock.isUseLocalStorage()).thenReturn(true);
Mockito.when(storagePoolMock.isShared()).thenReturn(true); Mockito.when(storagePoolMock.isShared()).thenReturn(true);
volumeApiServiceImpl.validateConditionsToReplaceDiskOfferingOfVolume(volumeVoMock, newDiskOfferingMock, storagePoolMock); volumeApiServiceImpl.validateConditionsToReplaceDiskOfferingOfVolume(volumeVoMock, newDiskOfferingMock, storagePoolMock);
@ -578,7 +578,7 @@ public class VolumeApiServiceImplTest {
public void validateConditionsToReplaceDiskOfferingOfVolumeTestTagsDoNotMatch() { public void validateConditionsToReplaceDiskOfferingOfVolumeTestTagsDoNotMatch() {
Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK); Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK);
Mockito.when(newDiskOfferingMock.getUseLocalStorage()).thenReturn(false); Mockito.when(newDiskOfferingMock.isUseLocalStorage()).thenReturn(false);
Mockito.when(storagePoolMock.isShared()).thenReturn(true); Mockito.when(storagePoolMock.isShared()).thenReturn(true);
Mockito.when(newDiskOfferingMock.isShared()).thenReturn(true); Mockito.when(newDiskOfferingMock.isShared()).thenReturn(true);
@ -595,7 +595,7 @@ public class VolumeApiServiceImplTest {
public void validateConditionsToReplaceDiskOfferingOfVolumeTestEverythingWorking() { public void validateConditionsToReplaceDiskOfferingOfVolumeTestEverythingWorking() {
Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK); Mockito.when(volumeVoMock.getVolumeType()).thenReturn(Type.DATADISK);
Mockito.when(newDiskOfferingMock.getUseLocalStorage()).thenReturn(false); Mockito.when(newDiskOfferingMock.isUseLocalStorage()).thenReturn(false);
Mockito.when(storagePoolMock.isShared()).thenReturn(true); Mockito.when(storagePoolMock.isShared()).thenReturn(true);
Mockito.when(newDiskOfferingMock.isShared()).thenReturn(true); Mockito.when(newDiskOfferingMock.isShared()).thenReturn(true);
@ -609,7 +609,7 @@ public class VolumeApiServiceImplTest {
InOrder inOrder = Mockito.inOrder(volumeVoMock, newDiskOfferingMock, storagePoolMock, volumeApiServiceImpl); InOrder inOrder = Mockito.inOrder(volumeVoMock, newDiskOfferingMock, storagePoolMock, volumeApiServiceImpl);
inOrder.verify(storagePoolMock).isShared(); inOrder.verify(storagePoolMock).isShared();
inOrder.verify(newDiskOfferingMock).getUseLocalStorage(); inOrder.verify(newDiskOfferingMock).isUseLocalStorage();
inOrder.verify(storagePoolMock).isLocal(); inOrder.verify(storagePoolMock).isLocal();
inOrder.verify(newDiskOfferingMock, times(0)).isShared(); inOrder.verify(newDiskOfferingMock, times(0)).isShared();
inOrder.verify(volumeApiServiceImpl).getStoragePoolTags(storagePoolMock); inOrder.verify(volumeApiServiceImpl).getStoragePoolTags(storagePoolMock);

View File

@ -653,7 +653,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
} }
SecondaryStorageVmVO secStorageVm = SecondaryStorageVmVO secStorageVm =
new SecondaryStorageVmVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId, new SecondaryStorageVmVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId,
systemAcct.getDomainId(), systemAcct.getId(), _accountMgr.getSystemUser().getId(), role, serviceOffering.getOfferHA()); systemAcct.getDomainId(), systemAcct.getId(), _accountMgr.getSystemUser().getId(), role, serviceOffering.isOfferHA());
secStorageVm.setDynamicallyScalable(template.isDynamicallyScalable()); secStorageVm.setDynamicallyScalable(template.isDynamicallyScalable());
secStorageVm = _secStorageVmDao.persist(secStorageVm); secStorageVm = _secStorageVmDao.persist(secStorageVm);
try { try {
@ -950,7 +950,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
} }
} }
if (_serviceOffering == null || !_serviceOffering.getSystemUse()) { if (_serviceOffering == null || !_serviceOffering.isSystemUse()) {
int ramSize = NumbersUtil.parseInt(_configDao.getValue("ssvm.ram.size"), DEFAULT_SS_VM_RAMSIZE); int ramSize = NumbersUtil.parseInt(_configDao.getValue("ssvm.ram.size"), DEFAULT_SS_VM_RAMSIZE);
int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("ssvm.cpu.mhz"), DEFAULT_SS_VM_CPUMHZ); int cpuFreq = NumbersUtil.parseInt(_configDao.getValue("ssvm.cpu.mhz"), DEFAULT_SS_VM_CPUMHZ);
List<ServiceOfferingVO> offerings = _offeringDao.createSystemServiceOfferings("System Offering For Secondary Storage VM", List<ServiceOfferingVO> offerings = _offeringDao.createSystemServiceOfferings("System Offering For Secondary Storage VM",