Skip to content

Commit b250b98

Browse files
author
Alex Huang
committed
changes
1 parent d202ce4 commit b250b98

101 files changed

Lines changed: 561 additions & 504 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/src/com/cloud/agent/resource/storage/IscsiMountPreparer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
import com.cloud.resource.DiskPreparer;
2929
import com.cloud.storage.Volume;
3030
import com.cloud.storage.VolumeVO;
31-
import com.cloud.storage.VirtualMachineTemplate.BootloaderType;
3231
import com.cloud.storage.Volume.VolumeType;
32+
import com.cloud.template.VirtualMachineTemplate.BootloaderType;
3333
import com.cloud.utils.NumbersUtil;
3434
import com.cloud.utils.script.Script;
3535

api/src/com/cloud/deploy/DataCenterDeployment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
*/
1818
package com.cloud.deploy;
1919

20-
public class DataCenterDeployment implements DeploymentStrategy {
20+
public class DataCenterDeployment implements DeploymentPlan {
2121
long _dcId;
2222
public DataCenterDeployment(long dataCenterId) {
2323
_dcId = dataCenterId;
2424
}
2525

26+
@Override
2627
public long getDataCenterId() {
2728
return _dcId;
2829
}

api/src/com/cloud/deploy/DeploymentStrategy.java renamed to api/src/com/cloud/deploy/DeploymentPlan.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
* Describes how a VM should be deployed.
2222
*
2323
*/
24-
public interface DeploymentStrategy {
24+
public interface DeploymentPlan {
25+
public long getDataCenterId();
2526

2627
}

api/src/com/cloud/storage/Volume.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@
1717
*/
1818
package com.cloud.storage;
1919

20+
import com.cloud.domain.PartOf;
21+
import com.cloud.template.BasedOn;
22+
import com.cloud.user.OwnedBy;
2023

21-
public interface Volume {
24+
25+
public interface Volume extends PartOf, OwnedBy, BasedOn {
2226
enum VolumeType {UNKNOWN, ROOT, SWAP, DATADISK};
2327

2428
enum MirrorState {NOT_MIRRORED, ACTIVE, DEFUNCT};
@@ -38,16 +42,6 @@ enum State {
3842
*/
3943
String getName();
4044

41-
/**
42-
* @return owner's account id
43-
*/
44-
long getAccountId();
45-
46-
/**
47-
* @return id of the owning account's domain
48-
*/
49-
long getDomainId();
50-
5145
/**
5246
* @return total size of the partition
5347
*/

core/src/com/cloud/storage/VirtualMachineTemplate.java renamed to api/src/com/cloud/template/VirtualMachineTemplate.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*
1717
*/
18-
package com.cloud.storage;
18+
package com.cloud.template;
1919

20-
import com.cloud.async.AsyncInstanceCreateStatus;
2120
import com.cloud.storage.Storage.FileSystem;
2221

23-
public interface VirtualMachineTemplate {
22+
public interface VirtualMachineTemplate {
2423

2524
public static enum BootloaderType { PyGrub, HVM, External };
2625

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,22 @@
2020

2121
import java.util.Date;
2222

23-
public interface Account {
23+
import com.cloud.domain.PartOf;
24+
25+
public interface Account extends PartOf {
26+
public enum Type {
27+
Normal,
28+
Admin,
29+
DomainAdmin,
30+
CustomerCare
31+
}
32+
33+
public enum State {
34+
Disabled,
35+
Enabled,
36+
Locked
37+
}
38+
2439
public static final short ACCOUNT_TYPE_NORMAL = 0;
2540
public static final short ACCOUNT_TYPE_ADMIN = 1;
2641
public static final short ACCOUNT_TYPE_DOMAIN_ADMIN = 2;
@@ -32,14 +47,12 @@ public interface Account {
3247

3348
public static final long ACCOUNT_ID_SYSTEM = 1;
3449

35-
public Long getId();
50+
public long getId();
3651
public String getAccountName();
3752
public void setAccountName(String accountId);
3853
public short getType();
39-
public void setType(short type);
4054
public String getState();
4155
public void setState(String state);
42-
public Long getDomainId();
43-
public void setDomainId(Long domainId);
56+
public long getDomainId();
4457
public Date getRemoved();
4558
}

api/src/com/cloud/uservm/UserVm.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
*/
1818
package com.cloud.uservm;
1919

20+
import com.cloud.domain.PartOf;
21+
import com.cloud.user.OwnedBy;
2022
import com.cloud.vm.VirtualMachine;
2123

2224
/**
2325
* This represents one running virtual machine instance.
2426
*/
25-
public interface UserVm extends VirtualMachine {
27+
public interface UserVm extends VirtualMachine, OwnedBy, PartOf {
2628

2729
/**
2830
* @return service offering id
@@ -39,11 +41,6 @@ public interface UserVm extends VirtualMachine {
3941
*/
4042
String getVnet();
4143

42-
/**
43-
* @return the account this vm instance belongs to.
44-
*/
45-
long getAccountId();
46-
4744
/**
4845
* @return the domain this vm instance belongs to.
4946
*/

api/src/com/cloud/vm/NetworkCharacteristics.java

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,34 @@
99
public class NetworkCharacteristics {
1010
long id;
1111
BroadcastDomainType type;
12-
String ip4Address;
13-
String netmask;
14-
String gateway;
12+
String cidr;
1513
Mode mode;
16-
String[] dns;
14+
long vmId;
1715

1816
public BroadcastDomainType getType() {
1917
return type;
2018
}
2119

22-
public String[] getDns() {
23-
return dns;
24-
}
25-
26-
public String getIp4Address() {
27-
return ip4Address;
28-
}
29-
30-
public String getNetmask() {
31-
return netmask;
32-
}
33-
34-
public String getGateway() {
35-
return gateway;
36-
}
37-
3820
public Mode getMode() {
3921
return mode;
4022
}
4123

4224
public long getNetworkId() {
4325
return id;
4426
}
27+
28+
public long getVirtualMachineId() {
29+
return vmId;
30+
}
4531

4632
public NetworkCharacteristics() {
4733
}
4834

49-
public NetworkCharacteristics(long id, BroadcastDomainType type, String ip4Address, String netmask, String gateway, Mode mode, String[] dns) {
35+
public NetworkCharacteristics(long id, BroadcastDomainType type, String cidr, Mode mode, long vmId) {
5036
this.id = id;
5137
this.type = type;
52-
this.ip4Address = ip4Address;
53-
this.netmask = netmask;
54-
this.gateway = gateway;
38+
this.cidr = cidr;
5539
this.mode = mode;
56-
this.dns = dns;
40+
this.vmId = vmId;
5741
}
5842
}

core/src/com/cloud/agent/api/to/NetworkTO.java renamed to api/src/com/cloud/vm/NetworkTO.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
*
1717
*/
18-
package com.cloud.agent.api.to;
18+
package com.cloud.vm;
1919

2020
/**
2121
* Transfer object to transfer network settings.
2222
*/
2323
public class NetworkTO {
24+
private String uuid;
2425
private String ip;
2526
private String netmask;
2627
private String gateway;

api/src/com/cloud/vm/Nic.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
*/
2424
public interface Nic {
2525
enum State {
26+
Allocated,
2627
AcquireIp,
2728
IpAcquired,
2829
}
@@ -47,4 +48,6 @@ enum State {
4748
* @return the vm instance id that this nic belongs to.
4849
*/
4950
long getInstanceId();
51+
52+
long getDeviceId();
5053
}

0 commit comments

Comments
 (0)