Skip to content

Commit 9e0f57b

Browse files
committed
change code for new UI
1 parent 3570322 commit 9e0f57b

52 files changed

Lines changed: 468 additions & 515 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/computing/LibvirtComputingResource.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,11 @@
156156
import com.cloud.agent.resource.virtualnetwork.VirtualRoutingResource;
157157
import com.cloud.exception.InternalErrorException;
158158
import com.cloud.host.Host.Type;
159-
import com.cloud.hypervisor.Hypervisor;
159+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
160160
import com.cloud.network.NetworkEnums.RouterPrivateIpStrategy;
161161
import com.cloud.resource.ServerResource;
162162
import com.cloud.resource.ServerResourceBase;
163163
import com.cloud.storage.Storage;
164-
import com.cloud.storage.Storage.StorageResourceType;
165164
import com.cloud.storage.StorageLayer;
166165
import com.cloud.storage.StoragePoolVO;
167166
import com.cloud.storage.Volume;
@@ -2557,7 +2556,7 @@ private Map<String, String> getVersionStrings() {
25572556

25582557
final List<Object> info = getHostInfo();
25592558

2560-
final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), Hypervisor.Type.KVM, RouterPrivateIpStrategy.HostLocal, changes);
2559+
final StartupRoutingCommand cmd = new StartupRoutingCommand((Integer)info.get(0), (Long)info.get(1), (Long)info.get(2), (Long)info.get(4), (String)info.get(3), HypervisorType.KVM, RouterPrivateIpStrategy.HostLocal, changes);
25612560
fillNetworkInformation(cmd);
25622561
cmd.getHostDetails().putAll(getVersionStrings());
25632562
cmd.setPool(_pool);

api/src/com/cloud/host/Host.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
import java.util.Date;
2121

2222
import com.cloud.host.Status;
23-
import com.cloud.hypervisor.Hypervisor;
24-
import com.cloud.hypervisor.Hypervisor.Type;
23+
import com.cloud.hypervisor.Hypervisor.HypervisorType;;
2524

2625

2726
/**
@@ -135,7 +134,7 @@ public static String[] toStrings(Host.Type... types) {
135134
/**
136135
* @return type of hypervisor
137136
*/
138-
Hypervisor.Type getHypervisorType();
137+
HypervisorType getHypervisorType();
139138

140139
/**
141140
* @return disconnection date

api/src/com/cloud/hypervisor/Hypervisor.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ public static enum HypervisorType {
2828
VirtualBox,
2929
Parralels,
3030
Any; /*If you don't care about the hypervisor type*/
31-
}
32-
33-
public static HypervisorType getType(String hypervisor) {
34-
if (hypervisor == null) {
35-
return HypervisorType.None;
36-
}
37-
38-
if (hypervisor.equalsIgnoreCase("Xen")) {
39-
return HypervisorType.Xen;
40-
} else if (hypervisor.equalsIgnoreCase("XenServer")) {
41-
return HypervisorType.XenServer;
42-
} else if (hypervisor.equalsIgnoreCase("KVM")) {
43-
return HypervisorType.KVM;
44-
} else if (hypervisor.equalsIgnoreCase("VmWare")) {
45-
return HypervisorType.VmWare;
46-
} else if (hypervisor.equalsIgnoreCase("VirtualBox")) {
47-
return HypervisorType.VirtualBox;
48-
} else if (hypervisor.equalsIgnoreCase("Parralels")) {
49-
return HypervisorType.Parralels;
50-
} else if (hypervisor.equalsIgnoreCase("Any")) {
51-
return HypervisorType.Any;
52-
} else {
53-
return HypervisorType.None;
31+
32+
public static HypervisorType getType(String hypervisor) {
33+
if (hypervisor == null) {
34+
return HypervisorType.None;
35+
}
36+
37+
if (hypervisor.equalsIgnoreCase("Xen")) {
38+
return HypervisorType.Xen;
39+
} else if (hypervisor.equalsIgnoreCase("XenServer")) {
40+
return HypervisorType.XenServer;
41+
} else if (hypervisor.equalsIgnoreCase("KVM")) {
42+
return HypervisorType.KVM;
43+
} else if (hypervisor.equalsIgnoreCase("VmWare")) {
44+
return HypervisorType.VmWare;
45+
} else if (hypervisor.equalsIgnoreCase("VirtualBox")) {
46+
return HypervisorType.VirtualBox;
47+
} else if (hypervisor.equalsIgnoreCase("Parralels")) {
48+
return HypervisorType.Parralels;
49+
} else if (hypervisor.equalsIgnoreCase("Any")) {
50+
return HypervisorType.Any;
51+
} else {
52+
return HypervisorType.None;
53+
}
5454
}
5555
}
5656
}

api/src/com/cloud/offering/ServiceOffering.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,4 @@ public interface ServiceOffering {
6666
* @return whether or not the service offering requires local storage
6767
*/
6868
boolean getUseLocalStorage();
69-
70-
public String gethypervisorType();
7169
}

build/developer.xml

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,8 @@
160160
<available file="${setup.db.dir}/override/server-setup.xml" />
161161
</condition>
162162

163-
<condition property="kvm.templates.file" value="override/templates.kvm.sql" else="templates.kvm.sql">
164-
<available file="${setup.db.dir}/override/templates.kvm.sql" />
165-
</condition>
166-
167-
<condition property="xenserver.templates.file" value="override/templates.xenserver.sql" else="templates.xenserver.sql">
168-
<available file="${setup.db.dir}/override/templates.xenserver.sql" />
169-
</condition>
170-
171-
<condition property="vmware.templates.file" value="override/templates.vmware.sql" else="templates.vmware.sql">
172-
<available file="${setup.db.dir}/override/templates.vmware.sql" />
173-
</condition>
174-
175-
<condition property="templates.file.intermediate" value="${kvm.templates.file}" else="${xenserver.templates.file}" >
176-
<isset property="KVM"/>
177-
</condition>
178-
179-
<condition property="templates.file" value="${vmware.templates.file}" else="${templates.file.intermediate}" >
180-
<isset property="vmware"/>
163+
<condition property="templates.file" value="override/templates.sql" else="templates.sql" >
164+
<available file="${setup.db.dir}/override/templates.sql" />
181165
</condition>
182166

183167
<echo message="deploydb ${server-setup.file} ${templates.file} ${DBROOTPW}" />

core/src/com/cloud/agent/api/StartupRoutingCommand.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Map;
2121

2222
import com.cloud.hypervisor.Hypervisor;
23-
import com.cloud.hypervisor.Hypervisor.Type;
23+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2424
import com.cloud.network.NetworkEnums.RouterPrivateIpStrategy;
2525
import com.cloud.vm.State;
2626

@@ -32,7 +32,7 @@ public class StartupRoutingCommand extends StartupCommand {
3232
Map<String, State> vms;
3333
String caps;
3434
String pool;
35-
Hypervisor.Type hypervisorType;
35+
HypervisorType hypervisorType;
3636
Map<String, String> hostDetails; //stuff like host os, cpu capabilities
3737

3838
public StartupRoutingCommand() {
@@ -47,7 +47,7 @@ public StartupRoutingCommand(int cpus,
4747
long memory,
4848
long dom0MinMemory,
4949
String caps,
50-
Hypervisor.Type hypervisorType,
50+
HypervisorType hypervisorType,
5151
RouterPrivateIpStrategy privIpStrategy,
5252
Map<String, State> vms) {
5353
this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType, vms);
@@ -59,7 +59,7 @@ public StartupRoutingCommand(int cpus,
5959
long memory,
6060
long dom0MinMemory,
6161
final String caps,
62-
final Hypervisor.Type hypervisorType,
62+
final HypervisorType hypervisorType,
6363

6464
final Map<String, String> hostDetails,
6565
Map<String, State> vms) {
@@ -75,7 +75,7 @@ public StartupRoutingCommand(int cpus,
7575
}
7676

7777
public StartupRoutingCommand(int cpus2, long speed2, long memory2,
78-
long dom0MinMemory2, String caps2, Hypervisor.Type hypervisorType2,
78+
long dom0MinMemory2, String caps2, HypervisorType hypervisorType2,
7979
Map<String, State> vms2) {
8080
this(cpus2, speed2, memory2, dom0MinMemory2, caps2, hypervisorType2, new HashMap<String,String>(), vms2);
8181
}
@@ -136,11 +136,11 @@ public void setPool(String pool) {
136136
this.pool = pool;
137137
}
138138

139-
public Hypervisor.Type getHypervisorType() {
139+
public HypervisorType getHypervisorType() {
140140
return hypervisorType;
141141
}
142142

143-
public void setHypervisorType(Hypervisor.Type hypervisorType) {
143+
public void setHypervisorType(HypervisorType hypervisorType) {
144144
this.hypervisorType = hypervisorType;
145145
}
146146

core/src/com/cloud/dc/ClusterVO.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
import javax.persistence.Id;
2525
import javax.persistence.Table;
2626

27-
import com.cloud.hypervisor.Hypervisor;
28-
import com.cloud.org.Cluster;
27+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2928
import com.cloud.utils.NumbersUtil;
3029

3130
@Entity
@@ -75,14 +74,6 @@ public long getPodId() {
7574
return podId;
7675
}
7776

78-
public String getHypervisorType() {
79-
return hypervisorType;
80-
}
81-
82-
public void setHypervisorType(String hy) {
83-
hypervisorType = hy;
84-
}
85-
8677
public ClusterVO(long clusterId) {
8778
this.id = clusterId;
8879
}
@@ -101,8 +92,8 @@ public boolean equals(Object obj) {
10192
return this.id == that.id;
10293
}
10394

104-
public Hypervisor.Type getHypervisorType() {
105-
return Hypervisor.getType(hypervisorType);
95+
public HypervisorType getHypervisorType() {
96+
return HypervisorType.getType(hypervisorType);
10697
}
10798

10899
public void setHypervisorType(String hy) {

core/src/com/cloud/host/HostVO.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import javax.persistence.TemporalType;
3737
import javax.persistence.Transient;
3838

39-
import com.cloud.hypervisor.Hypervisor;
39+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
4040
import com.cloud.storage.Storage.StoragePoolType;
4141
import com.cloud.utils.db.GenericDao;
4242

@@ -108,7 +108,7 @@ public class HostVO implements Host {
108108

109109
@Column(name="hypervisor_type", updatable = true, nullable=false)
110110
@Enumerated(value=EnumType.STRING)
111-
private Hypervisor.Type hypervisorType;
111+
private HypervisorType hypervisorType;
112112

113113
@Column(name="proxy_port")
114114
private Integer proxyPort;
@@ -617,12 +617,12 @@ public String toString() {
617617
return new StringBuilder(type.toString()).append("-").append(Long.toString(id)).append("-").append(name).toString();
618618
}
619619

620-
public void setHypervisorType(Hypervisor.Type hypervisorType) {
620+
public void setHypervisorType(HypervisorType hypervisorType) {
621621
this.hypervisorType = hypervisorType;
622622
}
623623

624624
@Override
625-
public Hypervisor.Type getHypervisorType() {
625+
public HypervisorType getHypervisorType() {
626626
return hypervisorType;
627627
}
628628
}

core/src/com/cloud/hypervisor/kvm/resource/KvmDummyResourceBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public Type getType() {
3131

3232
@Override
3333
public StartupCommand[] initialize() {
34-
StartupRoutingCommand cmd = new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.Type.KVM, new HashMap<String, String>(), new HashMap<String, State>());
34+
StartupRoutingCommand cmd = new StartupRoutingCommand(0, 0, 0, 0, null, Hypervisor.HypervisorType.KVM, new HashMap<String, String>(), new HashMap<String, State>());
3535
cmd.setDataCenter(_zoneId);
3636
cmd.setPod(_podId);
3737
cmd.setCluster(_clusterId);

core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
import com.cloud.agent.api.to.VolumeTO;
152152
import com.cloud.exception.InternalErrorException;
153153
import com.cloud.host.Host.Type;
154-
import com.cloud.hypervisor.Hypervisor;
154+
import com.cloud.hypervisor.Hypervisor.HypervisorType;
155155
import com.cloud.network.Network.BroadcastDomainType;
156156
import com.cloud.network.Network.TrafficType;
157157
import com.cloud.resource.ServerResource;
@@ -4190,7 +4190,7 @@ public StartupCommand[] initialize() throws IllegalArgumentException{
41904190
changes = sync();
41914191
}
41924192

4193-
cmd.setHypervisorType(Hypervisor.Type.XenServer);
4193+
cmd.setHypervisorType(HypervisorType.XenServer);
41944194
cmd.setChanges(changes);
41954195
cmd.setCluster(_cluster);
41964196

0 commit comments

Comments
 (0)