more changes

This commit is contained in:
Alex Huang 2010-12-04 17:29:31 -08:00
parent 16cccf4f59
commit cf032b7a3a
3 changed files with 8 additions and 4 deletions

View File

@ -135,8 +135,8 @@ public class CreateNetworkCmd extends BaseCmd {
return displayText;
}
public Boolean getIsShared() {
return false;
public boolean getIsShared() {
return isShared == null ? false : isShared;
}
/////////////////////////////////////////////////////

View File

@ -36,6 +36,7 @@ import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.GenericSearchBuilder;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Func;
import com.cloud.utils.db.SearchCriteria.Op;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
@ -63,16 +64,16 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, String> implem
VlanDbIdSearchUnallocated = createSearchBuilder();
VlanDbIdSearchUnallocated.and("allocated", VlanDbIdSearchUnallocated.entity().getAllocatedTime(), SearchCriteria.Op.NULL);
VlanDbIdSearchUnallocated.and("vlanDbId", VlanDbIdSearchUnallocated.entity().getVlanId(), SearchCriteria.Op.EQ);
// VlanDbIdSearchUnallocated.addRetrieve("ipAddress",
// VlanDbIdSearchUnallocated.entity().getAddress());
VlanDbIdSearchUnallocated.done();
AllIpCount = createSearchBuilder(Integer.class);
AllIpCount.select(null, Func.COUNT, AllIpCount.entity().getAddress());
AllIpCount.and("dc", AllIpCount.entity().getDataCenterId(), Op.EQ);
AllIpCount.and("vlan", AllIpCount.entity().getVlanId(), Op.EQ);
AllIpCount.done();
AllocatedIpCount = createSearchBuilder(Integer.class);
AllocatedIpCount.select(null, Func.COUNT, AllocatedIpCount.entity().getAddress());
AllocatedIpCount.and("dc", AllocatedIpCount.entity().getDataCenterId(), Op.EQ);
AllocatedIpCount.and("vlan", AllocatedIpCount.entity().getVlanId(), Op.EQ);
AllocatedIpCount.and("allocated", AllocatedIpCount.entity().getAllocatedTime(), Op.NNULL);

View File

@ -1,4 +1,6 @@
SET foreign_key_checks = 0;
use cloud;
DROP VIEW IF EXISTS `cloud`.`port_forwarding_rules_view`;
DROP TABLE IF EXISTS `cloud`.`configuration`;
DROP TABLE IF EXISTS `cloud`.`ip_forwarding`;
@ -610,6 +612,7 @@ CREATE TABLE `cloud`.`user_ip_address` (
`allocated` datetime NULL COMMENT 'Date this ip was allocated to someone',
`vlan_db_id` bigint unsigned NOT NULL,
`one_to_one_nat` int(1) unsigned NOT NULL default '0',
`state` char(32) NOT NULL default 'Free' COMMENT 'state of the ip address',
PRIMARY KEY (`public_ip_address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;