You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2014/01/17 23:40:48 UTC
[46/50] [abbrv] Merge branch 'master' into rbac.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/UserIpv6AddressVO.java
index d3cc95a,3098a68..2d6e860
--- a/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java
+++ b/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java
@@@ -27,10 -27,7 +27,9 @@@ import javax.persistence.GeneratedValue
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
- import javax.persistence.Transient;
+import org.apache.cloudstack.acl.AclEntityType;
+
import com.cloud.utils.db.GenericDao;
@Entity
@@@ -78,118 -75,113 +77,118 @@@ public class UserIpv6AddressVO implemen
@Column(name = GenericDao.CREATED_COLUMN)
Date created;
- protected UserIpv6AddressVO() {
- this.uuid = UUID.randomUUID().toString();
- }
-
- public UserIpv6AddressVO(String address, long dataCenterId, String macAddress, long vlanDbId) {
- this.address = address;
- this.dataCenterId = dataCenterId;
- this.vlanId = vlanDbId;
- this.state = State.Free;
- this.setMacAddress(macAddress);
- this.uuid = UUID.randomUUID().toString();
- }
-
-
- @Override
- public long getAccountId() {
- return accountId;
- }
-
- @Override
- public long getDomainId() {
- return domainId;
- }
-
- @Override
- public String getUuid() {
- return uuid;
- }
-
- @Override
- public long getId() {
- return id;
- }
-
- @Override
- public long getDataCenterId() {
- return dataCenterId;
- }
-
- @Override
- public String getAddress() {
- return address;
- }
-
- @Override
- public long getVlanId() {
- return vlanId;
- }
-
- @Override
- public State getState() {
- return state;
- }
-
- @Override
- public Long getNetworkId() {
- return networkId;
- }
-
- @Override
- public Long getSourceNetworkId() {
- return sourceNetworkId;
- }
-
- @Override
- public Long getPhysicalNetworkId() {
- return physicalNetworkId;
- }
-
- @Override
- public void setState(State state) {
- this.state = state;
- }
-
- public String getMacAddress() {
- return macAddress;
- }
-
- public void setMacAddress(String macAddress) {
- this.macAddress = macAddress;
- }
-
- public void setSourceNetworkId(Long sourceNetworkId) {
- this.sourceNetworkId = sourceNetworkId;
- }
-
- public void setNetworkId(Long networkId) {
- this.networkId = networkId;
- }
-
- public void setPhysicalNetworkId(Long physicalNetworkId) {
- this.physicalNetworkId = physicalNetworkId;
- }
-
- public void setDomainId(Long domainId) {
- this.domainId = domainId;
- }
-
- public void setAccountId(Long accountId) {
- this.accountId = accountId;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
+ protected UserIpv6AddressVO() {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
+ }
+
+ public UserIpv6AddressVO(String address, long dataCenterId, String macAddress, long vlanDbId) {
+ this.address = address;
+ this.dataCenterId = dataCenterId;
- this.vlanId = vlanDbId;
- this.state = State.Free;
- this.setMacAddress(macAddress);
- this.uuid = UUID.randomUUID().toString();
++ vlanId = vlanDbId;
++ state = State.Free;
++ setMacAddress(macAddress);
++ uuid = UUID.randomUUID().toString();
+ }
+
+ @Override
+ public long getAccountId() {
+ return accountId;
+ }
+
+ @Override
+ public long getDomainId() {
+ return domainId;
+ }
+
+ @Override
+ public String getUuid() {
+ return uuid;
+ }
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public long getDataCenterId() {
+ return dataCenterId;
+ }
+
+ @Override
+ public String getAddress() {
+ return address;
+ }
+
+ @Override
+ public long getVlanId() {
+ return vlanId;
+ }
+
+ @Override
+ public State getState() {
+ return state;
+ }
+
+ @Override
+ public Long getNetworkId() {
+ return networkId;
+ }
+
+ @Override
+ public Long getSourceNetworkId() {
+ return sourceNetworkId;
+ }
+
+ @Override
+ public Long getPhysicalNetworkId() {
+ return physicalNetworkId;
+ }
+
+ @Override
+ public void setState(State state) {
+ this.state = state;
+ }
+
+ @Override
+ public String getMacAddress() {
+ return macAddress;
+ }
+
+ public void setMacAddress(String macAddress) {
+ this.macAddress = macAddress;
+ }
+
+ public void setSourceNetworkId(Long sourceNetworkId) {
+ this.sourceNetworkId = sourceNetworkId;
+ }
+
+ public void setNetworkId(Long networkId) {
+ this.networkId = networkId;
+ }
+
+ public void setPhysicalNetworkId(Long physicalNetworkId) {
+ this.physicalNetworkId = physicalNetworkId;
+ }
+
+ public void setDomainId(Long domainId) {
+ this.domainId = domainId;
+ }
+
+ public void setAccountId(Long accountId) {
+ this.accountId = accountId;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.UserIpv6Address;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/VpnUserVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/VpnUserVO.java
index f54a13b,07b6326..a150898
--- a/engine/schema/src/com/cloud/network/VpnUserVO.java
+++ b/engine/schema/src/com/cloud/network/VpnUserVO.java
@@@ -27,7 -27,6 +27,8 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.utils.db.Encrypt;
@Entity
@@@ -59,16 -58,16 +60,16 @@@ public class VpnUserVO implements VpnUs
private String uuid;
public VpnUserVO() {
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public VpnUserVO(long accountId, long domainId, String userName, String password) {
this.accountId = accountId;
this.domainId = domainId;
-- this.username = userName;
++ username = userName;
this.password = password;
-- this.state = State.Add;
-- this.uuid = UUID.randomUUID().toString();
++ state = State.Add;
++ uuid = UUID.randomUUID().toString();
}
@Override
@@@ -87,7 -86,7 +88,7 @@@
}
public void setUsername(String userName) {
-- this.username = userName;
++ username = userName;
}
@Override
@@@ -121,7 -119,7 +121,7 @@@
@Override
public String getUuid() {
-- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
index f42364a,b69907c..1da0129
--- a/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
+++ b/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
@@@ -27,12 -27,13 +27,14 @@@ import javax.persistence.Id
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
-
- import com.cloud.utils.db.GenericDao;
+ import javax.persistence.Temporal;
+ import javax.persistence.TemporalType;
+import org.apache.cloudstack.acl.AclEntityType;
import org.apache.cloudstack.api.InternalIdentity;
+ import com.cloud.utils.db.GenericDao;
+
@Entity
@Table(name = "autoscale_policies")
@Inheritance(strategy = InheritanceType.JOINED)
@@@ -70,8 -75,9 +76,9 @@@ public class AutoScalePolicyVO implemen
public AutoScalePolicyVO() {
}
- public AutoScalePolicyVO(long domainId, long accountId, int duration, int quietTime, String action) {
- this.uuid = UUID.randomUUID().toString();
+ public AutoScalePolicyVO(long domainId, long accountId, int duration,
+ int quietTime, Date lastQuiteTime, String action) {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
this.domainId = domainId;
this.accountId = accountId;
this.duration = duration;
@@@ -134,8 -147,7 +148,13 @@@
this.quietTime = quietTime;
}
++
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.AutoScalePolicy;
+ }
++
+ public void setLastQuiteTime(Date lastQuiteTime) {
+ this.lastQuiteTime = lastQuiteTime;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
index 9a8c238,d8612b0..27d00af
--- a/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
+++ b/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
@@@ -27,12 -27,13 +27,14 @@@ import javax.persistence.Id
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
-
- import com.cloud.utils.db.GenericDao;
+ import javax.persistence.Temporal;
+ import javax.persistence.TemporalType;
+import org.apache.cloudstack.acl.AclEntityType;
import org.apache.cloudstack.api.InternalIdentity;
+ import com.cloud.utils.db.GenericDao;
+
@Entity
@Table(name = "autoscale_vmgroups")
@Inheritance(strategy = InheritanceType.JOINED)
@@@ -85,9 -90,12 +91,12 @@@ public class AutoScaleVmGroupVO impleme
public AutoScaleVmGroupVO() {
}
- public AutoScaleVmGroupVO(long lbRuleId, long zoneId, long domainId, long accountId, int minMembers, int maxMembers, int memberPort, int interval, long profileId, String state) {
- this.uuid = UUID.randomUUID().toString();
- this.loadBalancerId = lbRuleId;
+ public AutoScaleVmGroupVO(long lbRuleId, long zoneId, long domainId,
+ long accountId, int minMembers, int maxMembers, int memberPort,
+ int interval, Date lastInterval, long profileId, String state) {
+
- this.uuid = UUID.randomUUID().toString();
- this.loadBalancerId = lbRuleId;
++ uuid = UUID.randomUUID().toString();
++ loadBalancerId = lbRuleId;
this.minMembers = minMembers;
this.maxMembers = maxMembers;
this.memberPort = memberPort;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java
index 9b048b9,ec643b0..e5db2c9
--- a/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java
+++ b/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java
@@@ -33,8 -33,9 +33,10 @@@ import javax.persistence.Inheritance
import javax.persistence.InheritanceType;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
import org.apache.cloudstack.api.Identity;
+ import org.apache.cloudstack.api.InternalIdentity;
+
import com.cloud.utils.Pair;
import com.cloud.utils.db.GenericDao;
import com.cloud.utils.net.NetUtils;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/as/ConditionVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/as/ConditionVO.java
index e57bef0,8d7e776..292a90a
--- a/engine/schema/src/com/cloud/network/as/ConditionVO.java
+++ b/engine/schema/src/com/cloud/network/as/ConditionVO.java
@@@ -29,11 -29,11 +29,12 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
import org.apache.cloudstack.api.Identity;
- import com.cloud.utils.db.GenericDao;
import org.apache.cloudstack.api.InternalIdentity;
+ import com.cloud.utils.db.GenericDao;
+
@Entity
@Table(name = "conditions")
public class ConditionVO implements Condition, Identity, InternalIdentity {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/IPAddressVO.java
index a4c2267,d71a90f..76a2ba9
--- a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java
@@@ -41,154 -39,153 +41,153 @@@ import com.cloud.utils.net.Ip
*
*/
@Entity
- @Table(name=("user_ip_address"))
+ @Table(name = ("user_ip_address"))
public class IPAddressVO implements IpAddress {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
long id;
- @Column(name="account_id")
- private Long allocatedToAccountId = null;
+ @Column(name = "account_id")
+ private Long allocatedToAccountId = null;
- @Column(name="domain_id")
+ @Column(name = "domain_id")
private Long allocatedInDomainId = null;
- @Id
- @Column(name="public_ip_address")
- @Enumerated(value=EnumType.STRING)
- private Ip address = null;
+ @Id
+ @Column(name = "public_ip_address")
+ @Enumerated(value = EnumType.STRING)
+ private Ip address = null;
- @Column(name="data_center_id", updatable=false)
- private long dataCenterId;
+ @Column(name = "data_center_id", updatable = false)
+ private long dataCenterId;
- @Column(name="source_nat")
- private boolean sourceNat;
+ @Column(name = "source_nat")
+ private boolean sourceNat;
- @Column(name="allocated")
- @Temporal(value=TemporalType.TIMESTAMP)
- private Date allocatedTime;
+ @Column(name = "allocated")
+ @Temporal(value = TemporalType.TIMESTAMP)
+ private Date allocatedTime;
- @Column(name="vlan_db_id")
- private long vlanId;
+ @Column(name = "vlan_db_id")
+ private long vlanId;
- @Column(name="one_to_one_nat")
- private boolean oneToOneNat;
+ @Column(name = "one_to_one_nat")
+ private boolean oneToOneNat;
- @Column(name="vm_id")
+ @Column(name = "vm_id")
private Long associatedWithVmId;
- @Column(name="state")
- private State state;
+ @Column(name = "state")
+ private State state;
- @Column(name="mac_address")
- private long macAddress;
+ @Column(name = "mac_address")
+ private long macAddress;
- @Column(name="source_network_id")
+ @Column(name = "source_network_id")
private Long sourceNetworkId;
- @Column(name="network_id")
- private Long associatedWithNetworkId;
+ @Column(name = "network_id")
+ private Long associatedWithNetworkId;
- @Column(name="uuid")
- private String uuid;
+ @Column(name = "uuid")
+ private String uuid;
- @Column(name="physical_network_id")
+ @Column(name = "physical_network_id")
private Long physicalNetworkId;
- @Column(name="is_system")
+ @Column(name = "is_system")
private boolean system;
- @Column(name="account_id")
- @Transient
- private Long accountId = null;
+ @Column(name = "account_id")
+ @Transient
+ private Long accountId = null;
- @Transient
- @Column(name="domain_id")
+ @Transient
+ @Column(name = "domain_id")
private Long domainId = null;
- @Column(name="vpc_id")
+ @Column(name = "vpc_id")
private Long vpcId;
- @Column(name="dnat_vmip")
+ @Column(name = "dnat_vmip")
private String vmIp;
- @Column(name="is_portable")
+ @Column(name = "is_portable")
private boolean portable = false;
- protected IPAddressVO() {
- this.uuid = UUID.randomUUID().toString();
- }
+ protected IPAddressVO() {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
+ }
- @Override
+ @Override
public boolean readyToUse() {
- return state == State.Allocated;
- }
-
- public IPAddressVO(Ip address, long dataCenterId, long macAddress, long vlanDbId, boolean sourceNat) {
- this.address = address;
- this.dataCenterId = dataCenterId;
- this.vlanId = vlanDbId;
- this.sourceNat = sourceNat;
- this.allocatedInDomainId = null;
- this.allocatedToAccountId = null;
- this.allocatedTime = null;
- this.state = State.Free;
- this.macAddress = macAddress;
- this.uuid = UUID.randomUUID().toString();
- }
-
- public IPAddressVO(Ip address, long dataCenterId, Long networkId, Long vpcId, long physicalNetworkId, long sourceNetworkId,
- long vlanDbId, boolean portable) {
+ return state == State.Allocated;
+ }
+
+ public IPAddressVO(Ip address, long dataCenterId, long macAddress, long vlanDbId, boolean sourceNat) {
this.address = address;
this.dataCenterId = dataCenterId;
- this.associatedWithNetworkId = networkId;
- this.vlanId = vlanDbId;
++ vlanId = vlanDbId;
+ this.sourceNat = sourceNat;
- this.allocatedInDomainId = null;
- this.allocatedToAccountId = null;
- this.allocatedTime = null;
- this.state = State.Free;
++ allocatedInDomainId = null;
++ allocatedToAccountId = null;
++ allocatedTime = null;
++ state = State.Free;
+ this.macAddress = macAddress;
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
+ }
+
+ public IPAddressVO(Ip address, long dataCenterId, Long networkId, Long vpcId, long physicalNetworkId, long sourceNetworkId, long vlanDbId, boolean portable) {
+ this.address = address;
+ this.dataCenterId = dataCenterId;
- this.associatedWithNetworkId = networkId;
++ associatedWithNetworkId = networkId;
this.vpcId = vpcId;
this.physicalNetworkId = physicalNetworkId;
this.sourceNetworkId = sourceNetworkId;
-- this.vlanId = vlanDbId;
++ vlanId = vlanDbId;
this.portable = portable;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public long getMacAddress() {
- return macAddress;
- }
+ return macAddress;
+ }
- @Override
+ @Override
public long getDataCenterId() {
- return dataCenterId;
- }
+ return dataCenterId;
+ }
public void setDataCenterId(long dcId) {
-- this.dataCenterId = dcId;
++ dataCenterId = dcId;
}
- @Override
+ @Override
public Ip getAddress() {
- return address;
- }
+ return address;
+ }
- @Override
+ @Override
public Long getAllocatedToAccountId() {
- return allocatedToAccountId;
- }
+ return allocatedToAccountId;
+ }
@Override
public Long getAllocatedInDomainId() {
return allocatedInDomainId;
}
- @Override
- public Long getAssociatedWithNetworkId() {
- return associatedWithNetworkId;
- }
+ @Override
+ public Long getAssociatedWithNetworkId() {
+ return associatedWithNetworkId;
+ }
- public void setAssociatedWithNetworkId(Long networkId) {
- this.associatedWithNetworkId = networkId;
- }
+ public void setAssociatedWithNetworkId(Long networkId) {
- this.associatedWithNetworkId = networkId;
++ associatedWithNetworkId = networkId;
+ }
- @Override
+ @Override
public Long getAssociatedWithVmId() {
return associatedWithVmId;
}
@@@ -197,49 -194,49 +196,49 @@@
this.associatedWithVmId = associatedWithVmId;
}
- @Override
+ @Override
public Date getAllocatedTime() {
- return allocatedTime;
- }
+ return allocatedTime;
+ }
public void setAllocatedToAccountId(Long accountId) {
- this.allocatedToAccountId = accountId;
- }
- this.allocatedToAccountId = accountId;
++ allocatedToAccountId = accountId;
+ }
public void setAllocatedInDomainId(Long domainId) {
-- this.allocatedInDomainId = domainId;
++ allocatedInDomainId = domainId;
}
public void setSourceNat(boolean sourceNat) {
- this.sourceNat = sourceNat;
- }
+ this.sourceNat = sourceNat;
+ }
- @Override
+ @Override
public boolean isSourceNat() {
- return sourceNat;
- }
+ return sourceNat;
+ }
public void setAllocatedTime(Date allocated) {
- this.allocatedTime = allocated;
- }
- this.allocatedTime = allocated;
++ allocatedTime = allocated;
+ }
- @Override
+ @Override
public long getVlanId() {
- return this.vlanId;
- }
- return this.vlanId;
++ return vlanId;
+ }
public void setVlanId(long vlanDbId) {
- this.vlanId = vlanDbId;
- }
- this.vlanId = vlanDbId;
++ vlanId = vlanDbId;
+ }
- @Override
+ @Override
public boolean isOneToOneNat() {
- return oneToOneNat;
- }
+ return oneToOneNat;
+ }
public void setOneToOneNat(boolean oneToOneNat) {
- this.oneToOneNat = oneToOneNat;
- }
+ this.oneToOneNat = oneToOneNat;
+ }
@Override
public long getDomainId() {
@@@ -280,7 -278,7 +280,7 @@@
@Override
public String getUuid() {
- return this.uuid;
- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
@@@ -296,13 -295,13 +297,13 @@@
}
@Override
- public boolean getSystem() {
- return system;
- }
+ public boolean getSystem() {
+ return system;
+ }
- public void setSystem(boolean isSystem) {
- this.system = isSystem;
- }
+ public void setSystem(boolean isSystem) {
- this.system = isSystem;
++ system = isSystem;
+ }
@Override
public boolean isPortable() {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
index 0000000,1d7ef14..d7cb864
mode 000000,100644..100644
--- a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
+++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java
@@@ -1,0 -1,121 +1,129 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.network.dao;
+
+ import java.util.UUID;
+
+ import javax.persistence.Column;
+ import javax.persistence.Entity;
+ import javax.persistence.GeneratedValue;
+ import javax.persistence.GenerationType;
+ import javax.persistence.Id;
+ import javax.persistence.Table;
+
++import org.apache.cloudstack.acl.AclEntityType;
++
+ import com.cloud.network.MonitoringService;
+
+ @Entity
+ @Table(name = "monitoring_services")
+ public class MonitoringServiceVO implements MonitoringService {
+
+ public MonitoringServiceVO(String service, String processname, String serviceName, String servicePath, String pidFile, boolean defaultService) {
+ this.service = service;
+ this.processname = processname;
- this.servicename = serviceName;
++ servicename = serviceName;
+ this.servicePath = servicePath;
- this.servicePidFile = pidFile;
++ servicePidFile = pidFile;
+ this.defaultService = defaultService;
+
+ }
+
+ protected MonitoringServiceVO() {
+ }
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ long id;
+
+ @Column(name = "service")
+ String service;
+
+ @Column(name = "process_name", updatable = false)
+ String processname;
+
+ @Column(name = "service_name", updatable = false)
+ String servicename;
+
+ @Column(name = "service_path", updatable = false)
+ private String servicePath;
+
+ @Column(name = "pidFile", updatable = false)
+ private String servicePidFile;
+
+ @Column(name = "isDefault")
+ private boolean defaultService;
+
+ @Column(name = "uuid")
+ String uuid = UUID.randomUUID().toString();
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public String getService() {
- return this.service;
++ return service;
+ }
+
+ @Override
+ public String getServiceName() {
- return this.servicename; //To change body of implemented methods use File | Settings | File Templates.
++ return servicename; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public String getPidFile() {
- return this.servicePidFile;
++ return servicePidFile;
+
+ }
+
+ @Override
+ public String getServicePath() {
- return this.servicePidFile;
++ return servicePidFile;
+ }
+
+ @Override
+ public String getUuid() {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public long getAccountId() {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ @Override
+ public long getDomainId() {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isDefaultService() {
+ return defaultService;
+ }
+
+ public String getProcessname() {
+ return processname;
+ }
++
++ @Override
++ public AclEntityType getEntityType() {
++ return AclEntityType.MonitorService;
++ }
++
+ }
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/NetworkVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/NetworkVO.java
index 1ca7a93,f3776df..cc5535a
--- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java
@@@ -168,7 -167,7 +168,7 @@@ public class NetworkVO implements Netwo
Long networkACLId;
public NetworkVO() {
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
/**
@@@ -194,28 -193,42 +194,42 @@@
} else {
this.state = state;
}
-- this.id = -1;
- this.uuid = UUID.randomUUID().toString();
- }
-
- public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId,
- long related, String name, String displayText, String networkDomain, GuestType guestType, long dcId,
- Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
- this(id, that.getTrafficType(), that.getMode(), that.getBroadcastDomainType(), offeringId, domainId, accountId,
- related, name, displayText, networkDomain, guestType, dcId, physicalNetworkId, aclType, specifyIpRanges, vpcId);
- this.gateway = that.getGateway();
- this.cidr = that.getCidr();
- this.networkCidr = that.getNetworkCidr();
- this.broadcastUri = that.getBroadcastUri();
- this.broadcastDomainType = that.getBroadcastDomainType();
- this.uuid = UUID.randomUUID().toString();
++ id = -1;
++ uuid = UUID.randomUUID().toString();
+ }
+
+ public NetworkVO(long id, Network that, long offeringId, String guruName, long domainId, long accountId, long related, String name, String displayText,
+ String networkDomain, GuestType guestType, long dcId, Long physicalNetworkId, ACLType aclType, boolean specifyIpRanges, Long vpcId) {
+ this(id,
+ that.getTrafficType(),
+ that.getMode(),
+ that.getBroadcastDomainType(),
+ offeringId,
+ domainId,
+ accountId,
+ related,
+ name,
+ displayText,
+ networkDomain,
+ guestType,
+ dcId,
+ physicalNetworkId,
+ aclType,
+ specifyIpRanges,
+ vpcId);
- this.gateway = that.getGateway();
- this.cidr = that.getCidr();
- this.networkCidr = that.getNetworkCidr();
- this.broadcastUri = that.getBroadcastUri();
- this.broadcastDomainType = that.getBroadcastDomainType();
++ gateway = that.getGateway();
++ cidr = that.getCidr();
++ networkCidr = that.getNetworkCidr();
++ broadcastUri = that.getBroadcastUri();
++ broadcastDomainType = that.getBroadcastDomainType();
this.guruName = guruName;
-- this.state = that.getState();
++ state = that.getState();
if (state == null) {
state = State.Allocated;
}
- this.uuid = UUID.randomUUID().toString();
- this.ip6Gateway = that.getIp6Gateway();
- this.ip6Cidr = that.getIp6Cidr();
- this.uuid = UUID.randomUUID().toString();
- this.ip6Gateway = that.getIp6Gateway();
- this.ip6Cidr = that.getIp6Cidr();
++ uuid = UUID.randomUUID().toString();
++ ip6Gateway = that.getIp6Gateway();
++ ip6Cidr = that.getIp6Cidr();
}
/**
@@@ -247,7 -260,7 +261,7 @@@
this.displayText = displayText;
this.aclType = aclType;
this.networkDomain = networkDomain;
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
this.guestType = guestType;
this.specifyIpRanges = specifyIpRanges;
this.vpcId = vpcId;
@@@ -420,7 -436,7 +437,7 @@@
}
public void setDns1(String dns) {
-- this.dns1 = dns;
++ dns1 = dns;
}
public String getDns2() {
@@@ -428,7 -444,7 +445,7 @@@
}
public void setDns2(String dns) {
-- this.dns2 = dns;
++ dns2 = dns;
}
@Override
@@@ -476,19 -492,19 +493,19 @@@
return false;
}
NetworkVO that = (NetworkVO)obj;
-- if (this.trafficType != that.trafficType) {
++ if (trafficType != that.trafficType) {
return false;
}
-- if ((this.cidr == null && that.cidr != null) || (this.cidr != null && that.cidr == null)) {
++ if ((cidr == null && that.cidr != null) || (cidr != null && that.cidr == null)) {
return false;
}
-- if (this.cidr == null && that.cidr == null) {
++ if (cidr == null && that.cidr == null) {
return true;
}
-- return NetUtils.isNetworkAWithinNetworkB(this.cidr, that.cidr);
++ return NetUtils.isNetworkAWithinNetworkB(cidr, that.cidr);
}
@Override
@@@ -498,8 -514,9 +515,9 @@@
return buf.toString();
}
+ @Override
public String getUuid() {
- return this.uuid;
- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
index 349f4bd,54ae9b2..678ea4a
--- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
+++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java
@@@ -68,19 -66,19 +68,19 @@@ public class RemoteAccessVpnVO implemen
private Long vpcId;
public RemoteAccessVpnVO() {
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
- public RemoteAccessVpnVO(long accountId, long domainId, Long networkId, long publicIpId, Long vpcId, String localIp, String ipRange, String presharedKey) {
+ public RemoteAccessVpnVO(long accountId, long domainId, Long networkId, long publicIpId, Long vpcId, String localIp, String ipRange, String presharedKey) {
this.accountId = accountId;
-- this.serverAddressId = publicIpId;
++ serverAddressId = publicIpId;
this.ipRange = ipRange;
-- this.ipsecPresharedKey = presharedKey;
++ ipsecPresharedKey = presharedKey;
this.localIp = localIp;
this.domainId = domainId;
this.networkId = networkId;
-- this.state = State.Added;
-- this.uuid = UUID.randomUUID().toString();
++ state = State.Added;
++ uuid = UUID.randomUUID().toString();
this.vpcId = vpcId;
}
@@@ -147,12 -145,7 +147,12 @@@
}
@Override
- public Long getVpcId() {
- return vpcId;
- }
+ public Long getVpcId() {
+ return vpcId;
+ }
+
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.RemoteAccessVpn;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
index 6a87b62,c922855..ab04eea
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java
@@@ -26,31 -26,28 +26,31 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
++import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.network.Site2SiteCustomerGateway;
import com.cloud.utils.db.Encrypt;
import com.cloud.utils.db.GenericDao;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.api.InternalIdentity;
+
@Entity
- @Table(name=("s2s_customer_gateway"))
+ @Table(name = ("s2s_customer_gateway"))
public class Site2SiteCustomerGatewayVO implements Site2SiteCustomerGateway {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
private long id;
- @Column(name="uuid")
+ @Column(name = "uuid")
private String uuid;
- @Column(name="name")
+ @Column(name = "name")
private String name;
- @Column(name="gateway_ip")
+ @Column(name = "gateway_ip")
private String gatewayIp;
- @Column(name="guest_cidr_list")
+ @Column(name = "guest_cidr_list")
private String guestCidrList;
@Encrypt
@@@ -94,7 -92,7 +95,7 @@@
this.ikeLifetime = ikeLifetime;
this.espLifetime = espLifetime;
this.dpd = dpd;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
this.accountId = accountId;
this.domainId = domainId;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
index ba73b95,96a4c2d..e3e0433
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java
@@@ -28,56 -28,55 +28,57 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
++import org.apache.cloudstack.acl.AclEntityType;
+ import org.apache.cloudstack.api.InternalIdentity;
+
import com.cloud.network.Site2SiteVpnConnection;
- import com.cloud.network.Site2SiteVpnConnection.State;
import com.cloud.utils.db.GenericDao;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.api.InternalIdentity;
+
@Entity
- @Table(name=("s2s_vpn_connection"))
+ @Table(name = ("s2s_vpn_connection"))
public class Site2SiteVpnConnectionVO implements Site2SiteVpnConnection, InternalIdentity {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
private long id;
- @Column(name="uuid")
- private String uuid;
+ @Column(name = "uuid")
+ private String uuid;
- @Column(name="vpn_gateway_id")
+ @Column(name = "vpn_gateway_id")
private long vpnGatewayId;
- @Column(name="customer_gateway_id")
+ @Column(name = "customer_gateway_id")
private long customerGatewayId;
- @Column(name="state")
- @Enumerated(value=EnumType.STRING)
+ @Column(name = "state")
+ @Enumerated(value = EnumType.STRING)
private State state;
- @Column(name="domain_id")
+ @Column(name = "domain_id")
private Long domainId;
- @Column(name="account_id")
+ @Column(name = "account_id")
private Long accountId;
- @Column(name=GenericDao.CREATED_COLUMN)
+ @Column(name = GenericDao.CREATED_COLUMN)
private Date created;
- @Column(name=GenericDao.REMOVED_COLUMN)
+ @Column(name = GenericDao.REMOVED_COLUMN)
private Date removed;
- @Column(name="passive")
+ @Column(name = "passive")
private boolean passive;
- public Site2SiteVpnConnectionVO() { }
+ public Site2SiteVpnConnectionVO() {
+ }
public Site2SiteVpnConnectionVO(long accountId, long domainId, long vpnGatewayId, long customerGatewayId, boolean passive) {
-- this.uuid = UUID.randomUUID().toString();
-- this.setVpnGatewayId(vpnGatewayId);
-- this.setCustomerGatewayId(customerGatewayId);
-- this.setState(State.Pending);
++ uuid = UUID.randomUUID().toString();
++ setVpnGatewayId(vpnGatewayId);
++ setCustomerGatewayId(customerGatewayId);
++ setState(State.Pending);
this.accountId = accountId;
this.domainId = domainId;
this.passive = passive;
@@@ -147,16 -147,12 +149,17 @@@
return accountId;
}
- public boolean isPassive() {
- return passive;
- }
+ @Override
+ public boolean isPassive() {
+ return passive;
+ }
- public void setPassive(boolean passive) {
- this.passive = passive;
- }
+ public void setPassive(boolean passive) {
+ this.passive = passive;
+ }
+
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.Site2SiteVpnConnection;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
index 69b129e,3a16bcd..626572e
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java
@@@ -26,44 -26,42 +26,45 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
++import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.network.Site2SiteVpnGateway;
import com.cloud.utils.db.GenericDao;
- import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.api.InternalIdentity;
+
@Entity
- @Table(name=("s2s_vpn_gateway"))
+ @Table(name = ("s2s_vpn_gateway"))
public class Site2SiteVpnGatewayVO implements Site2SiteVpnGateway {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
private long id;
- @Column(name="uuid")
- private String uuid;
+ @Column(name = "uuid")
+ private String uuid;
- @Column(name="addr_id")
+ @Column(name = "addr_id")
private long addrId;
- @Column(name="vpc_id")
+ @Column(name = "vpc_id")
private long vpcId;
- @Column(name="domain_id")
+ @Column(name = "domain_id")
private Long domainId;
- @Column(name="account_id")
+ @Column(name = "account_id")
private Long accountId;
- @Column(name=GenericDao.REMOVED_COLUMN)
+ @Column(name = GenericDao.REMOVED_COLUMN)
private Date removed;
- public Site2SiteVpnGatewayVO() { }
+ public Site2SiteVpnGatewayVO() {
+ }
public Site2SiteVpnGatewayVO(long accountId, long domainId, long addrId, long vpcId) {
-- this.uuid = UUID.randomUUID().toString();
-- this.setAddrId(addrId);
-- this.setVpcId(vpcId);
++ uuid = UUID.randomUUID().toString();
++ setAddrId(addrId);
++ setVpcId(vpcId);
this.accountId = accountId;
this.domainId = domainId;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/dao/SslCertVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/dao/SslCertVO.java
index 0000000,7d73f49..52123a1
mode 000000,100644..100644
--- a/engine/schema/src/com/cloud/network/dao/SslCertVO.java
+++ b/engine/schema/src/com/cloud/network/dao/SslCertVO.java
@@@ -1,0 -1,123 +1,131 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+ package com.cloud.network.dao;
+
+ import java.util.UUID;
+
+ import javax.persistence.Column;
+ import javax.persistence.Entity;
+ import javax.persistence.Id;
+ import javax.persistence.Table;
+
++import org.apache.cloudstack.acl.AclEntityType;
++
+ import com.cloud.network.lb.SslCert;
+ import com.cloud.utils.db.Encrypt;
+
+ @Entity
+ @Table(name = "sslcerts")
+ public class SslCertVO implements SslCert {
+
+ @Id
+ @Column(name = "id")
+ private Long id;
+
+ @Column(name = "uuid")
+ private String uuid;
+
+ @Column(name = "certificate", length = 16384)
+ private String certificate;
+
+ @Column(name = "chain", length = 2097152)
+ private String chain;
+
+ @Encrypt
+ @Column(name = "key", length = 16384)
+ private String key;
+
+ @Encrypt
+ @Column(name = "password")
+ private String password;
+
+ @Column(name = "account_id")
+ private Long accountId;
+
+ @Column(name = "domain_id")
+ long domainId;
+
+ @Column(name = "fingerprint")
+ String fingerPrint;
+
+ public SslCertVO() {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
+ }
+
+ public SslCertVO(String cert, String key, String password, String chain, Long accountId, Long domainId, String fingerPrint) {
- this.certificate = cert;
++ certificate = cert;
+ this.key = key;
+ this.chain = chain;
+ this.password = password;
+ this.accountId = accountId;
+ this.domainId = domainId;
+ this.fingerPrint = fingerPrint;
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
+ }
+
+ // Getters
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public String getUuid() {
+ return uuid;
+ }
+
+ @Override
+ public String getCertificate() {
+ return certificate;
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public String getChain() {
+ return chain;
+ }
+
+ @Override
+ public long getAccountId() {
+ return accountId;
+ }
+
+ @Override
+ public String getPassword() {
+ return password;
+ }
+
+ @Override
+ public long getDomainId() {
+ return domainId;
+ }
+
+ @Override
+ public String getFingerPrint() {
+ return fingerPrint;
+ }
++
++ @Override
++ public AclEntityType getEntityType() {
++ return AclEntityType.SSLCert;
++ }
++
+ }
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/rules/FirewallRuleVO.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/security/SecurityGroupVO.java
index a4214f4,df8427c..d2e0bde
--- a/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java
+++ b/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java
@@@ -25,10 -25,6 +25,8 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.api.Identity;
- import org.apache.cloudstack.api.InternalIdentity;
+
@Entity
@Table(name = ("security_group"))
public class SecurityGroupVO implements SecurityGroup {
@@@ -53,7 -49,7 +51,7 @@@
private String uuid;
public SecurityGroupVO() {
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public SecurityGroupVO(String name, String description, long domainId, long accountId) {
@@@ -61,7 -57,7 +59,7 @@@
this.description = description;
this.domainId = domainId;
this.accountId = accountId;
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
@Override
@@@ -91,15 -87,10 +89,15 @@@
@Override
public String getUuid() {
- return this.uuid;
- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
- this.uuid = uuid;
+ this.uuid = uuid;
}
+
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.SecurityGroup;
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java
index b7c4991,08e3965..b0e1123
--- a/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java
+++ b/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java
@@@ -28,34 -28,30 +28,32 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
- import org.apache.cloudstack.api.Identity;
- import com.cloud.utils.db.GenericDao;
- import org.apache.cloudstack.api.InternalIdentity;
+
+ import com.cloud.utils.db.GenericDao;
@Entity
- @Table(name="static_routes")
+ @Table(name = "static_routes")
public class StaticRouteVO implements StaticRoute {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
long id;
- @Column(name="uuid")
+ @Column(name = "uuid")
String uuid;
- @Column(name="vpc_gateway_id", updatable=false)
+ @Column(name = "vpc_gateway_id", updatable = false)
long vpcGatewayId;
- @Column(name="cidr")
+ @Column(name = "cidr")
private String cidr;
- @Enumerated(value=EnumType.STRING)
- @Column(name="state")
+ @Enumerated(value = EnumType.STRING)
+ @Column(name = "state")
State state;
- @Column(name="vpc_id")
+ @Column(name = "vpc_id")
private Long vpcId;
@Column(name = "account_id")
@@@ -64,11 -60,11 +62,11 @@@
@Column(name = "domain_id")
long domainId;
- @Column(name=GenericDao.CREATED_COLUMN)
+ @Column(name = GenericDao.CREATED_COLUMN)
Date created;
- protected StaticRouteVO(){
- this.uuid = UUID.randomUUID().toString();
+ protected StaticRouteVO() {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
/**
@@@ -82,11 -78,11 +80,11 @@@
super();
this.vpcGatewayId = vpcGatewayId;
this.cidr = cidr;
-- this.state = State.Staged;
++ state = State.Staged;
this.vpcId = vpcId;
this.accountId = accountId;
this.domainId = domainId;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
@Override
@@@ -111,7 -107,7 +109,7 @@@
@Override
public String getUuid() {
-- return this.uuid;
++ return uuid;
}
@Override
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java
index 9288375,5f15660..f0a0e9c
--- a/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java
+++ b/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java
@@@ -28,13 -28,10 +28,12 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
+
import com.cloud.utils.db.GenericDao;
-
@Entity
- @Table(name="vpc_gateways")
+ @Table(name = "vpc_gateways")
public class VpcGatewayVO implements VpcGateway {
@Id
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/network/vpc/VpcVO.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/projects/ProjectInvitationVO.java
index aee3bd9,6136862..faa33d1
--- a/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java
+++ b/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java
@@@ -28,7 -28,6 +28,8 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.utils.db.GenericDao;
@Entity
@@@ -65,16 -64,16 +66,16 @@@ public class ProjectInvitationVO implem
private String uuid;
protected ProjectInvitationVO() {
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public ProjectInvitationVO(long projectId, Long accountId, Long domainId, String email, String token) {
-- this.forAccountId = accountId;
-- this.inDomainId = domainId;
++ forAccountId = accountId;
++ inDomainId = domainId;
this.projectId = projectId;
this.email = email;
this.token = token;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
@Override
@@@ -130,7 -129,7 +131,7 @@@
@Override
public String getUuid() {
-- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/storage/SnapshotVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/SnapshotVO.java
index eeb1ebb,8521636..3925708
--- a/engine/schema/src/com/cloud/storage/SnapshotVO.java
+++ b/engine/schema/src/com/cloud/storage/SnapshotVO.java
@@@ -16,16 -16,22 +16,24 @@@
// under the License.
package com.cloud.storage;
- import com.cloud.hypervisor.Hypervisor.HypervisorType;
- import com.cloud.utils.db.GenericDao;
- import com.google.gson.annotations.Expose;
+ import java.util.Date;
+ import java.util.UUID;
- import javax.persistence.*;
+ import javax.persistence.Column;
+ import javax.persistence.Entity;
+ import javax.persistence.EnumType;
+ import javax.persistence.Enumerated;
+ import javax.persistence.GeneratedValue;
+ import javax.persistence.GenerationType;
+ import javax.persistence.Id;
+ import javax.persistence.Table;
+
+ import com.google.gson.annotations.Expose;
+import org.apache.cloudstack.acl.AclEntityType;
+
- import java.util.Date;
- import java.util.UUID;
+ import com.cloud.hypervisor.Hypervisor.HypervisorType;
+ import com.cloud.utils.db.GenericDao;
@Entity
@Table(name = "snapshots")
@@@ -87,12 -93,12 +95,12 @@@ public class SnapshotVO implements Snap
String uuid;
public SnapshotVO() {
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
- public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String name,
- short snapshotType, String typeDescription, long size, HypervisorType hypervisorType) {
- this.dataCenterId = dcId;
+ public SnapshotVO(long dcId, long accountId, long domainId, Long volumeId, Long diskOfferingId, String name, short snapshotType, String typeDescription, long size,
+ HypervisorType hypervisorType) {
- this.dataCenterId = dcId;
++ dataCenterId = dcId;
this.accountId = accountId;
this.domainId = domainId;
this.volumeId = volumeId;
@@@ -101,10 -107,10 +109,10 @@@
this.snapshotType = snapshotType;
this.typeDescription = typeDescription;
this.size = size;
-- this.state = State.Allocated;
++ state = State.Allocated;
this.hypervisorType = hypervisorType;
-- this.version = "2.2";
-- this.uuid = UUID.randomUUID().toString();
++ version = "2.2";
++ uuid = UUID.randomUUID().toString();
}
@Override
@@@ -223,7 -229,7 +231,7 @@@
@Override
public String getUuid() {
-- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/storage/VMTemplateVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/VMTemplateVO.java
index 418f0d1,da93735..1e19937
--- a/engine/schema/src/com/cloud/storage/VMTemplateVO.java
+++ b/engine/schema/src/com/cloud/storage/VMTemplateVO.java
@@@ -165,13 -162,29 +164,29 @@@ public class VMTemplateVO implements Vi
/**
* Proper constructor for a new vm template.
*/
- public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured,
- boolean isExtractable, TemplateType type, String url, boolean requiresHvm, int bits, long accountId,
- String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable,
+ public VMTemplateVO(long id, String name, ImageFormat format, boolean isPublic, boolean featured, boolean isExtractable, TemplateType type, String url,
+ boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId, boolean bootable,
HypervisorType hyperType, Map<String, String> details) {
- this(id, generateUniqueName(id, accountId, name), name, format, isPublic, featured, isExtractable, type, url,
- null, requiresHvm, bits, accountId, cksum, displayText, enablePassword, guestOSId, bootable, hyperType,
+ this(id,
+ generateUniqueName(id, accountId, name),
+ name,
+ format,
+ isPublic,
+ featured,
+ isExtractable,
+ type,
+ url,
+ null,
+ requiresHvm,
+ bits,
+ accountId,
+ cksum,
+ displayText,
+ enablePassword,
+ guestOSId,
+ bootable,
+ hyperType,
- details);
+ details);
uuid = UUID.randomUUID().toString();
}
@@@ -188,13 -216,12 +218,12 @@@
state = State.Active;
}
-
- public static VMTemplateVO createPreHostIso(Long id, String uniqueName, String name, ImageFormat format,
- boolean isPublic, boolean featured, TemplateType type, String url, Date created, boolean requiresHvm,
- int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId,
+ public static VMTemplateVO createPreHostIso(Long id, String uniqueName, String name, ImageFormat format, boolean isPublic, boolean featured, TemplateType type,
+ String url, Date created, boolean requiresHvm, int bits, long accountId, String cksum, String displayText, boolean enablePassword, long guestOSId,
- boolean bootable, HypervisorType hyperType) {
+ boolean bootable, HypervisorType hyperType) {
- VMTemplateVO template = new VMTemplateVO(id, uniqueName, name, format, isPublic, featured, type, url, created,
- requiresHvm, bits, accountId, cksum, displayText, enablePassword, guestOSId, bootable, hyperType);
+ VMTemplateVO template =
+ new VMTemplateVO(id, uniqueName, name, format, isPublic, featured, type, url, created, requiresHvm, bits, accountId, cksum, displayText, enablePassword,
+ guestOSId, bootable, hyperType);
return template;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/storage/VolumeVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/storage/VolumeVO.java
index 9a05d5d,901e07c..69c9fa5
--- a/engine/schema/src/com/cloud/storage/VolumeVO.java
+++ b/engine/schema/src/com/cloud/storage/VolumeVO.java
@@@ -162,28 -159,27 +161,27 @@@ public class VolumeVO implements Volum
// @Column(name="reservation")
String reservationId;
+ @Column(name = "hv_ss_reserve")
+ Integer hypervisorSnapshotReserve;
+
// Real Constructor
- public VolumeVO(Type type, String name, long dcId, long domainId,
- long accountId, long diskOfferingId, long size,
- Long minIops, Long maxIops, String iScsiName) {
- this.volumeType = type;
+ public VolumeVO(Type type, String name, long dcId, long domainId, long accountId, long diskOfferingId, long size, Long minIops, Long maxIops, String iScsiName) {
- this.volumeType = type;
++ volumeType = type;
this.name = name;
-- this.dataCenterId = dcId;
++ dataCenterId = dcId;
this.accountId = accountId;
this.domainId = domainId;
this.size = size;
this.minIops = minIops;
this.maxIops = maxIops;
-- this._iScsiName = iScsiName;
++ _iScsiName = iScsiName;
this.diskOfferingId = diskOfferingId;
-- this.state = State.Allocated;
-- this.uuid = UUID.randomUUID().toString();
++ state = State.Allocated;
++ uuid = UUID.randomUUID().toString();
}
- public VolumeVO(String name, long dcId, Long podId, long accountId,
- long domainId, Long instanceId, String folder, String path,
- long size, Long minIops, Long maxIops, String iScsiName,
- Volume.Type vType) {
+ public VolumeVO(String name, long dcId, Long podId, long accountId, long domainId, Long instanceId, String folder, String path, long size, Long minIops,
+ Long maxIops, String iScsiName, Volume.Type vType) {
this.name = name;
this.accountId = accountId;
this.domainId = domainId;
@@@ -193,18 -189,16 +191,16 @@@
this.size = size;
this.minIops = minIops;
this.maxIops = maxIops;
-- this._iScsiName = iScsiName;
++ _iScsiName = iScsiName;
this.podId = podId;
-- this.dataCenterId = dcId;
-- this.volumeType = vType;
-- this.state = Volume.State.Allocated;
-- this.recreatable = false;
-- this.uuid = UUID.randomUUID().toString();
++ dataCenterId = dcId;
++ volumeType = vType;
++ state = Volume.State.Allocated;
++ recreatable = false;
++ uuid = UUID.randomUUID().toString();
}
- public VolumeVO(String name, long dcId, long podId, long accountId,
- long domainId, Long instanceId, String folder, String path,
- long size, Volume.Type vType) {
+ public VolumeVO(String name, long dcId, long podId, long accountId, long domainId, Long instanceId, String folder, String path, long size, Volume.Type vType) {
this.name = name;
this.accountId = accountId;
this.domainId = domainId;
@@@ -212,50 -206,60 +208,60 @@@
this.folder = folder;
this.path = path;
this.size = size;
-- this.minIops = null;
-- this.maxIops = null;
-- this._iScsiName = null;
++ minIops = null;
++ maxIops = null;
++ _iScsiName = null;
this.podId = podId;
-- this.dataCenterId = dcId;
-- this.volumeType = vType;
-- this.state = Volume.State.Allocated;
-- this.recreatable = false;
-- this.uuid = UUID.randomUUID().toString();
++ dataCenterId = dcId;
++ volumeType = vType;
++ state = Volume.State.Allocated;
++ recreatable = false;
++ uuid = UUID.randomUUID().toString();
}
// Copy Constructor
public VolumeVO(Volume that) {
- this(that.getName(), that.getDataCenterId(), that.getPodId(), that.getAccountId(), that.getDomainId(), that.getInstanceId(),
- that.getFolder(), that.getPath(), that.getSize(), that.getMinIops(), that.getMaxIops(),
- that.get_iScsiName(), that.getVolumeType());
- this.recreatable = that.isRecreatable();
- this.state = that.getState();
- this.size = that.getSize();
- this.minIops = that.getMinIops();
- this.maxIops = that.getMaxIops();
- this._iScsiName = that.get_iScsiName();
- this.diskOfferingId = that.getDiskOfferingId();
- this.poolId = that.getPoolId();
- this.attached = that.getAttached();
- this.chainInfo = that.getChainInfo();
- this.templateId = that.getTemplateId();
- this.deviceId = that.getDeviceId();
- this.format = that.getFormat();
- this.uuid = UUID.randomUUID().toString();
+ this(that.getName(),
+ that.getDataCenterId(),
+ that.getPodId(),
+ that.getAccountId(),
+ that.getDomainId(),
+ that.getInstanceId(),
+ that.getFolder(),
+ that.getPath(),
+ that.getSize(),
+ that.getMinIops(),
+ that.getMaxIops(),
+ that.get_iScsiName(),
+ that.getVolumeType());
- this.recreatable = that.isRecreatable();
- this.state = that.getState();
- this.size = that.getSize();
- this.minIops = that.getMinIops();
- this.maxIops = that.getMaxIops();
- this._iScsiName = that.get_iScsiName();
- this.diskOfferingId = that.getDiskOfferingId();
- this.poolId = that.getPoolId();
- this.attached = that.getAttached();
- this.chainInfo = that.getChainInfo();
- this.templateId = that.getTemplateId();
- this.deviceId = that.getDeviceId();
- this.format = that.getFormat();
- this.uuid = UUID.randomUUID().toString();
++ recreatable = that.isRecreatable();
++ state = that.getState();
++ size = that.getSize();
++ minIops = that.getMinIops();
++ maxIops = that.getMaxIops();
++ _iScsiName = that.get_iScsiName();
++ diskOfferingId = that.getDiskOfferingId();
++ poolId = that.getPoolId();
++ attached = that.getAttached();
++ chainInfo = that.getChainInfo();
++ templateId = that.getTemplateId();
++ deviceId = that.getDeviceId();
++ format = that.getFormat();
++ uuid = UUID.randomUUID().toString();
}
@Override
public long getUpdatedCount() {
-- return this.updatedCount;
++ return updatedCount;
}
@Override
public void incrUpdatedCount() {
-- this.updatedCount++;
++ updatedCount++;
}
public void decrUpdatedCount() {
-- this.updatedCount--;
++ updatedCount--;
}
@Override
@@@ -478,7 -481,7 +483,7 @@@
@Override
public Date getAttached() {
-- return this.attached;
++ return attached;
}
public void setAttached(Date attached) {
@@@ -487,7 -490,7 +492,7 @@@
@Override
public String getChainInfo() {
-- return this.chainInfo;
++ return chainInfo;
}
public void setChainInfo(String chainInfo) {
@@@ -495,11 -498,11 +500,11 @@@
}
public Long getLastPoolId() {
-- return this.lastPoolId;
++ return lastPoolId;
}
public void setLastPoolId(Long poolId) {
-- this.lastPoolId = poolId;
++ lastPoolId = poolId;
}
@Override
@@@ -518,17 -521,17 +523,17 @@@
@Override
public String getReservationId() {
-- return this.reservationId;
++ return reservationId;
}
@Override
public void setReservationId(String reserv) {
-- this.reservationId = reserv;
++ reservationId = reserv;
}
@Override
public String getUuid() {
-- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
@@@ -537,11 -540,11 +542,11 @@@
@Override
public String get_iScsiName() {
- return this._iScsiName;
- return this._iScsiName;
++ return _iScsiName;
}
public void set_iScsiName(String iScsiName) {
- this._iScsiName = iScsiName;
- this._iScsiName = iScsiName;
++ _iScsiName = iScsiName;
}
public boolean isDisplayVolume() {
@@@ -564,12 -568,13 +570,13 @@@
this.vmSnapshotChainSize = vmSnapshotChainSize;
}
- public Long getVmSnapshotChainSize(){
- return this.vmSnapshotChainSize;
+ @Override
+ public Long getVmSnapshotChainSize() {
- return this.vmSnapshotChainSize;
++ return vmSnapshotChainSize;
}
public Long getIsoId() {
-- return this.isoId;
++ return isoId;
}
public void setIsoId(Long isoId) {
@@@ -582,8 -587,12 +589,18 @@@
this.state = state;
}
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.Volume;
+ }
++
+ public void setHypervisorSnapshotReserve(Integer hypervisorSnapshotReserve) {
+ this.hypervisorSnapshotReserve = hypervisorSnapshotReserve;
+ }
+
+ @Override
+ public Integer getHypervisorSnapshotReserve() {
+ return hypervisorSnapshotReserve;
++
+ }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/tags/ResourceTagVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/tags/ResourceTagVO.java
index 19851c4,ca790bd..add8f50
--- a/engine/schema/src/com/cloud/tags/ResourceTagVO.java
+++ b/engine/schema/src/com/cloud/tags/ResourceTagVO.java
@@@ -27,50 -27,47 +27,50 @@@ import javax.persistence.GenerationType
import javax.persistence.Id;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.server.ResourceTag;
+
@Entity
- @Table(name="resource_tags")
+ @Table(name = "resource_tags")
public class ResourceTagVO implements ResourceTag {
@Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
private long id;
- @Column(name="uuid")
+ @Column(name = "uuid")
private String uuid;
- @Column(name="key")
+ @Column(name = "key")
private String key;
- @Column(name="value")
+ @Column(name = "value")
String value;
- @Column(name="domain_id")
+ @Column(name = "domain_id")
long domainId;
- @Column(name="account_id")
+ @Column(name = "account_id")
long accountId;
- @Column(name="resource_id")
+ @Column(name = "resource_id")
long resourceId;
- @Column(name="resource_uuid")
+ @Column(name = "resource_uuid")
private String resourceUuid;
- @Column(name="resource_type")
- @Enumerated(value=EnumType.STRING)
+ @Column(name = "resource_type")
+ @Enumerated(value = EnumType.STRING)
private ResourceObjectType resourceType;
- @Column(name="customer")
+ @Column(name = "customer")
String customer;
-
- protected ResourceTagVO(){
- this.uuid = UUID.randomUUID().toString();
+ protected ResourceTagVO() {
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
/**
@@@ -92,7 -88,7 +91,7 @@@
this.accountId = accountId;
this.resourceId = resourceId;
this.resourceType = resourceType;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
this.customer = customer;
this.resourceUuid = resourceUuid;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
index 0000000,8ee1db7..c9be8a7
mode 000000,100644..100644
--- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
+++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java
@@@ -1,0 -1,69 +1,118 @@@
+ // Licensed to the Apache Software Foundation (ASF) under one
+ // or more contributor license agreements. See the NOTICE file
+ // distributed with this work for additional information
+ // regarding copyright ownership. The ASF licenses this file
+ // to you under the Apache License, Version 2.0 (the
+ // "License"); you may not use this file except in compliance
+ // with the License. You may obtain a copy of the License at
+ //
+ // http://www.apache.org/licenses/LICENSE-2.0
+ //
+ // Unless required by applicable law or agreed to in writing,
+ // software distributed under the License is distributed on an
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ // KIND, either express or implied. See the License for the
+ // specific language governing permissions and limitations
+ // under the License.
+
+ package com.cloud.upgrade.dao;
+
+ import java.io.File;
+ import java.sql.Connection;
++import java.sql.PreparedStatement;
++import java.sql.ResultSet;
++import java.sql.SQLException;
+
+ import org.apache.log4j.Logger;
+
+ import com.cloud.utils.exception.CloudRuntimeException;
+ import com.cloud.utils.script.Script;
+
+ public class Upgrade430to440 implements DbUpgrade {
+ final static Logger s_logger = Logger.getLogger(Upgrade430to440.class);
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.3.0", "4.4.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.4.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public File[] getPrepareScripts() {
+ String script = Script.findScript("", "db/schema-430to440.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-4310to440.sql");
+ }
+
+ return new File[] {new File(script)};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
++ populateACLGroupAccountMap(conn);
++ }
++
++ // populate acl_group_account_map table for existing accounts
++ private void populateACLGroupAccountMap(Connection conn) {
++ PreparedStatement acctInsert = null;
++ PreparedStatement acctQuery = null;
++ ResultSet rs = null;
++
++ s_logger.debug("Populating acl_group_account_map table for existing accounts...");
++ try {
++ acctInsert = conn
++ .prepareStatement("INSERT INTO `cloud`.`acl_group_account_map` (group_id, account_id, created) values(?, ?, Now())");
++ acctQuery = conn
++ .prepareStatement("select id, type from `cloud`.`account` where removed is null");
++ rs = acctQuery.executeQuery();
++
++ while (rs.next()) {
++ Long acct_id = rs.getLong("id");
++ short type = rs.getShort("type");
++
++ // insert entry in acl_group_account_map table
++ acctInsert.setLong(1, type + 1);
++ acctInsert.setLong(2, acct_id);
++ acctInsert.executeUpdate();
++ }
++ } catch (SQLException e) {
++ String msg = "Unable to populate acl_group_account_map for existing accounts." + e.getMessage();
++ s_logger.error(msg);
++ throw new CloudRuntimeException(msg, e);
++ } finally {
++ try {
++ if (rs != null) {
++ rs.close();
++ }
++
++ if (acctInsert != null) {
++ acctInsert.close();
++ }
++ if (acctQuery != null) {
++ acctQuery.close();
++ }
++ } catch (SQLException e) {
++ }
++ }
++ s_logger.debug("Completed populate acl_group_account_map for existing accounts.");
+ }
+
+ @Override
+ public File[] getCleanupScripts() {
+ String script = Script.findScript("", "db/schema-430to440-cleanup.sql");
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find db/schema-430to440-cleanup.sql");
+ }
+
+ return new File[] {new File(script)};
+ }
+ }
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/user/AccountVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/user/AccountVO.java
index 2a0bbde,7fa9fe2..3a29ecd
--- a/engine/schema/src/com/cloud/user/AccountVO.java
+++ b/engine/schema/src/com/cloud/user/AccountVO.java
@@@ -72,12 -70,12 +72,12 @@@ public class AccountVO implements Accou
boolean isDefault;
public AccountVO() {
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public AccountVO(long id) {
this.id = id;
- this.uuid = UUID.randomUUID().toString();
- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
public AccountVO(String accountName, long domainId, String networkDomain, short type, String uuid) {
@@@ -85,7 -83,7 +85,7 @@@
this.domainId = domainId;
this.networkDomain = networkDomain;
this.type = type;
-- this.state = State.enabled;
++ state = State.enabled;
this.uuid = uuid;
}
@@@ -177,7 -175,7 +177,7 @@@
@Override
public String getUuid() {
- return this.uuid;
- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/user/SSHKeyPairVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/user/SSHKeyPairVO.java
index 26df45f,9fb035d..d30060c
--- a/engine/schema/src/com/cloud/user/SSHKeyPairVO.java
+++ b/engine/schema/src/com/cloud/user/SSHKeyPairVO.java
@@@ -27,99 -24,94 +24,101 @@@ import javax.persistence.Id
import javax.persistence.Table;
import javax.persistence.Transient;
++import org.apache.cloudstack.acl.AclEntityType;
++
@Entity
- @Table(name="ssh_keypairs")
+ @Table(name = "ssh_keypairs")
public class SSHKeyPairVO implements SSHKeyPair {
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id = null;
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private Long id = null;
- @Column(name="account_id")
- private long accountId;
+ @Column(name = "account_id")
+ private long accountId;
- @Column(name="domain_id")
+ @Column(name = "domain_id")
private long domainId;
- @Column(name="keypair_name")
+ @Column(name = "keypair_name")
private String name;
- @Column(name="fingerprint")
+ @Column(name = "fingerprint")
private String fingerprint;
- @Column(name="public_key", length=5120)
+ @Column(name = "public_key", length = 5120)
private String publicKey;
@Transient
private String privateKey;
- @Override
- public long getId() {
- return id;
- }
-
- @Override
- public long getAccountId() {
- return accountId;
- }
-
- @Override
- public long getDomainId() {
- return domainId;
- }
-
- @Override
- public String getFingerprint() {
- return fingerprint;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getPublicKey() {
- return publicKey;
- }
-
- @Override
- public String getPrivateKey() {
- return privateKey;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public void setAccountId(long accountId) {
- this.accountId = accountId;
- }
-
- public void setDomainId(long domainId) {
- this.domainId = domainId;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setFingerprint(String fingerprint) {
- this.fingerprint = fingerprint;
- }
-
- public void setPublicKey(String publicKey) {
- this.publicKey = publicKey;
- }
-
- public void setPrivateKey(String privateKey) {
- this.privateKey = privateKey;
- }
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public long getAccountId() {
+ return accountId;
+ }
+
+ @Override
+ public long getDomainId() {
+ return domainId;
+ }
+
+ @Override
+ public String getFingerprint() {
+ return fingerprint;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getPublicKey() {
+ return publicKey;
+ }
+
+ @Override
+ public String getPrivateKey() {
+ return privateKey;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public void setAccountId(long accountId) {
+ this.accountId = accountId;
+ }
+
+ public void setDomainId(long domainId) {
+ this.domainId = domainId;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setFingerprint(String fingerprint) {
+ this.fingerprint = fingerprint;
+ }
+
+ public void setPublicKey(String publicKey) {
+ this.publicKey = publicKey;
+ }
+
+ public void setPrivateKey(String privateKey) {
+ this.privateKey = privateKey;
+ }
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.SSHKeyPair;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/929fbaba/engine/schema/src/com/cloud/vm/InstanceGroupVO.java
----------------------------------------------------------------------
diff --cc engine/schema/src/com/cloud/vm/InstanceGroupVO.java
index e9e2c8f,1089017..9a5a7ba
--- a/engine/schema/src/com/cloud/vm/InstanceGroupVO.java
+++ b/engine/schema/src/com/cloud/vm/InstanceGroupVO.java
@@@ -28,7 -28,6 +28,8 @@@ import javax.persistence.PrimaryKeyJoin
import javax.persistence.SecondaryTable;
import javax.persistence.Table;
+import org.apache.cloudstack.acl.AclEntityType;
++
import com.cloud.utils.db.GenericDao;
@Entity
@@@ -65,7 -63,7 +65,7 @@@ public class InstanceGroupVO implement
public InstanceGroupVO(String name, long accountId) {
this.name = name;
this.accountId = accountId;
-- this.uuid = UUID.randomUUID().toString();
++ uuid = UUID.randomUUID().toString();
}
protected InstanceGroupVO() {
@@@ -105,20 -105,15 +107,20 @@@
@Override
public String getUuid() {
- return this.uuid;
- return this.uuid;
++ return uuid;
}
public void setUuid(String uuid) {
- this.uuid = uuid;
+ this.uuid = uuid;
}
- @Override
- public Short getAccountType() {
- return accountType;
- }
+ @Override
+ public Short getAccountType() {
+ return accountType;
+ }
+
+ @Override
+ public AclEntityType getEntityType() {
+ return AclEntityType.InstanceGroup;
+ }
}