You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2015/12/06 20:17:23 UTC
[1/4] git commit: updated refs/heads/master to 638f1cf
Repository: cloudstack
Updated Branches:
refs/heads/master afe113092 -> 638f1cf09
CLOUDSTACK-9047 use 'State's only with context
there are more types called 'State'
(or to be called so but now 'state')
So remove imports and prepend their enclosing class/context to them.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/586c3251
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/586c3251
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/586c3251
Branch: refs/heads/master
Commit: 586c325167347eb1a2e7debb66d9b610b18807c5
Parents: ea7c2d9
Author: Daan Hoogland <da...@onecht.net>
Authored: Mon Nov 9 10:42:23 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Nov 16 13:41:12 2015 +0000
----------------------------------------------------------------------
.../orchestration/NetworkOrchestrator.java | 3 +-
.../network/router/CommandSetupHelper.java | 5 +--
.../VirtualNetworkApplianceManagerImpl.java | 45 ++++++++++----------
3 files changed, 25 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/586c3251/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index e60e346..f2c6fc3 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -97,7 +97,6 @@ import com.cloud.host.Status;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.network.IpAddress;
-import com.cloud.network.IpAddress.State;
import com.cloud.network.IpAddressManager;
import com.cloud.network.Network;
import com.cloud.network.Network.Capability;
@@ -2921,7 +2920,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
List<PublicIp> publicIpsToRelease = new ArrayList<PublicIp>();
if (userIps != null && !userIps.isEmpty()) {
for (IPAddressVO userIp : userIps) {
- userIp.setState(State.Releasing);
+ userIp.setState(IpAddress.State.Releasing);
PublicIp publicIp = PublicIp.createFromAddrAndVlan(userIp, _vlanDao.findById(userIp.getVlanId()));
publicIpsToRelease.add(publicIp);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/586c3251/server/src/com/cloud/network/router/CommandSetupHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java
index 1818dbd..67c52e3 100644
--- a/server/src/com/cloud/network/router/CommandSetupHelper.java
+++ b/server/src/com/cloud/network/router/CommandSetupHelper.java
@@ -122,7 +122,6 @@ import com.cloud.vm.NicProfile;
import com.cloud.vm.NicVO;
import com.cloud.vm.UserVmVO;
import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.VirtualMachineManager;
import com.cloud.vm.VirtualMachineProfile;
import com.cloud.vm.dao.DomainRouterDao;
@@ -598,7 +597,7 @@ public class CommandSetupHelper {
}
public void createVmDataCommandForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) {
- final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, State.Running, State.Migrating, State.Stopping);
+ final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping);
final DataCenterVO dc = _dcDao.findById(router.getDataCenterId());
for (final UserVmVO vm : vms) {
boolean createVmData = true;
@@ -617,7 +616,7 @@ public class CommandSetupHelper {
}
public void createDhcpEntryCommandsForVMs(final DomainRouterVO router, final Commands cmds, final long guestNetworkId) {
- final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, State.Running, State.Migrating, State.Stopping);
+ final List<UserVmVO> vms = _userVmDao.listByNetworkIdAndStates(guestNetworkId, VirtualMachine.State.Running, VirtualMachine.State.Migrating, VirtualMachine.State.Stopping);
final DataCenterVO dc = _dcDao.findById(router.getDataCenterId());
for (final UserVmVO vm : vms) {
boolean createDhcp = true;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/586c3251/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index f0e5f09..d291936 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -232,7 +232,6 @@ import com.cloud.vm.NicVO;
import com.cloud.vm.ReservationContext;
import com.cloud.vm.ReservationContextImpl;
import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachine.State;
import com.cloud.vm.VirtualMachineGuru;
import com.cloud.vm.VirtualMachineManager;
import com.cloud.vm.VirtualMachineProfile;
@@ -251,7 +250,7 @@ import com.cloud.vm.dao.VMInstanceDao;
*/
@Local(value = { VirtualNetworkApplianceManager.class, VirtualNetworkApplianceService.class })
public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements VirtualNetworkApplianceManager, VirtualNetworkApplianceService, VirtualMachineGuru, Listener,
-Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
+Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualMachine> {
private static final Logger s_logger = Logger.getLogger(VirtualNetworkApplianceManagerImpl.class);
@Inject
@@ -444,7 +443,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
}
// Check that the router is stopped
- if (!router.getState().equals(State.Stopped)) {
+ if (!router.getState().equals(VirtualMachine.State.Stopped)) {
s_logger.warn("Unable to upgrade router " + router.toString() + " in state " + router.getState());
throw new InvalidParameterValueException("Unable to upgrade router " + router.toString() + " in state " + router.getState()
+ "; make sure the router is stopped and not in an error state before upgrading.");
@@ -544,7 +543,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
_accountMgr.checkAccess(caller, null, true, router);
// Can reboot domain router only in Running state
- if (router == null || router.getState() != State.Running) {
+ if (router == null || router.getState() != VirtualMachine.State.Running) {
s_logger.warn("Unable to reboot, virtual router is not in the right state " + router.getState());
throw new ResourceUnavailableException("Unable to reboot domR, it is not in right state " + router.getState(), DataCenter.class, router.getDataCenterId());
}
@@ -746,7 +745,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
@Override
protected void runInContext() {
try {
- final List<DomainRouterVO> routers = _routerDao.listByStateAndNetworkType(State.Running, GuestType.Isolated, mgmtSrvrId);
+ final List<DomainRouterVO> routers = _routerDao.listByStateAndNetworkType(VirtualMachine.State.Running, GuestType.Isolated, mgmtSrvrId);
s_logger.debug("Found " + routers.size() + " running routers. ");
for (final DomainRouterVO router : routers) {
@@ -910,7 +909,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
if (conns == null || conns.isEmpty()) {
continue;
}
- if (router.getState() != State.Running) {
+ if (router.getState() != VirtualMachine.State.Running) {
for (final Site2SiteVpnConnectionVO conn : conns) {
if (conn.getState() != Site2SiteVpnConnection.State.Error) {
conn.setState(Site2SiteVpnConnection.State.Disconnected);
@@ -991,7 +990,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
continue;
}
final RedundantState prevState = router.getRedundantState();
- if (router.getState() != State.Running) {
+ if (router.getState() != VirtualMachine.State.Running) {
router.setRedundantState(RedundantState.UNKNOWN);
updated = true;
} else {
@@ -1041,7 +1040,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
// Ensure router status is update to date before execute this function. The
// function would try best to recover all routers except MASTER
protected void recoverRedundantNetwork(final DomainRouterVO masterRouter, final DomainRouterVO backupRouter) {
- if (masterRouter.getState() == State.Running && backupRouter.getState() == State.Running) {
+ if (masterRouter.getState() == VirtualMachine.State.Running && backupRouter.getState() == VirtualMachine.State.Running) {
final HostVO masterHost = _hostDao.findById(masterRouter.getHostId());
final HostVO backupHost = _hostDao.findById(backupRouter.getHostId());
if (masterHost.getState() == Status.Up && backupHost.getState() == Status.Up) {
@@ -1174,7 +1173,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
final DomainRouterVO router0 = routers.get(0);
final DomainRouterVO router1 = routers.get(1);
- if (router0.getState() != State.Running || router1.getState() != State.Running) {
+ if (router0.getState() != VirtualMachine.State.Running || router1.getState() != VirtualMachine.State.Running) {
updateRoutersRedundantState(routers);
// Wilder Rodrigues (wrodrigues@schubergphilis.com) - One of the routers is not running,
// so we don't have to continue here since the host will be null any way. Also, there is no need
@@ -1188,8 +1187,8 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
} else {
router = router1;
}
- // && router.getState() == State.Stopped
- if (router.getHostId() == null && router.getState() == State.Running) {
+ // && router.getState() == VirtualMachine.State.Stopped
+ if (router.getHostId() == null && router.getState() == VirtualMachine.State.Running) {
s_logger.debug("Skip router pair (" + router0.getInstanceName() + "," + router1.getInstanceName() + ") due to can't find host");
continue;
}
@@ -1259,7 +1258,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
protected void getRouterAlerts() {
try {
- final List<DomainRouterVO> routers = _routerDao.listByStateAndManagementServer(State.Running, mgmtSrvrId);
+ final List<DomainRouterVO> routers = _routerDao.listByStateAndManagementServer(VirtualMachine.State.Running, mgmtSrvrId);
s_logger.debug("Found " + routers.size() + " running routers. ");
@@ -2148,7 +2147,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
}
for (final VirtualRouter router : routers) {
- if (router.getState() != State.Running) {
+ if (router.getState() != VirtualMachine.State.Running) {
s_logger.warn("Failed to start remote access VPN: router not in right state " + router.getState());
throw new ResourceUnavailableException("Failed to start remote access VPN: router not in right state " + router.getState(), DataCenter.class,
network.getDataCenterId());
@@ -2189,11 +2188,11 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
boolean result = true;
for (final VirtualRouter router : routers) {
- if (router.getState() == State.Running) {
+ if (router.getState() == VirtualMachine.State.Running) {
final Commands cmds = new Commands(Command.OnError.Continue);
_commandSetupHelper.createApplyVpnCommands(false, vpn, router, cmds);
result = result && _nwHelper.sendCommandsToRouter(router, cmds);
- } else if (router.getState() == State.Stopped) {
+ } else if (router.getState() == VirtualMachine.State.Stopped) {
s_logger.debug("Router " + router + " is in Stopped state, not sending deleteRemoteAccessVpn command to it");
continue;
} else {
@@ -2226,7 +2225,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
}
for (final DomainRouterVO router : routers) {
- if (router.getState() != State.Running) {
+ if (router.getState() != VirtualMachine.State.Running) {
s_logger.warn("Failed to add/remove VPN users: router not in running state");
throw new ResourceUnavailableException("Unable to assign ip addresses, domR is not in right state " + router.getState(), DataCenter.class,
network.getDataCenterId());
@@ -2306,7 +2305,7 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
// After start network, check if it's already running
router = _routerDao.findById(routerId);
- if (router.getState() == State.Running) {
+ if (router.getState() == VirtualMachine.State.Running) {
return router;
}
@@ -2365,8 +2364,8 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
for (DomainRouterVO router : routers) {
if (router.isStopPending()) {
s_logger.info("Stopping router " + router.getInstanceName() + " due to stop pending flag found!");
- final State state = router.getState();
- if (state != State.Stopped && state != State.Destroyed) {
+ final VirtualMachine.State state = router.getState();
+ if (state != VirtualMachine.State.Stopped && state != VirtualMachine.State.Destroyed) {
try {
stopRouter(router.getId(), false);
} catch (final ResourceUnavailableException e) {
@@ -2598,18 +2597,18 @@ Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
}
@Override
- public boolean preStateTransitionEvent(final State oldState, final VirtualMachine.Event event, final State newState, final VirtualMachine vo, final boolean status,
+ public boolean preStateTransitionEvent(final VirtualMachine.State oldState, final VirtualMachine.Event event, final VirtualMachine.State newState, final VirtualMachine vo, final boolean status,
final Object opaque) {
return true;
}
@Override
- public boolean postStateTransitionEvent(final StateMachine2.Transition<State, VirtualMachine.Event> transition, final VirtualMachine vo, final boolean status, final Object opaque) {
- final State newState = transition.getToState();
+ public boolean postStateTransitionEvent(final StateMachine2.Transition<VirtualMachine.State, VirtualMachine.Event> transition, final VirtualMachine vo, final boolean status, final Object opaque) {
+ final VirtualMachine.State newState = transition.getToState();
final VirtualMachine.Event event = transition.getEvent();
if (vo.getType() == VirtualMachine.Type.DomainRouter &&
event == VirtualMachine.Event.FollowAgentPowerOnReport &&
- newState == State.Running &&
+ newState == VirtualMachine.State.Running &&
isOutOfBandMigrated(opaque)) {
s_logger.debug("Virtual router " + vo.getInstanceName() + " is powered-on out-of-band");
}
[2/4] git commit: updated refs/heads/master to 638f1cf
Posted by da...@apache.org.
CLOUDSTACK-9046 renamed enums in kvm plugin
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/962d4b4a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/962d4b4a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/962d4b4a
Branch: refs/heads/master
Commit: 962d4b4afee6fb55aca09862b42c0f7c33f25a5f
Parents: 586c325
Author: Daan Hoogland <da...@onecht.net>
Authored: Mon Nov 9 10:52:30 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Nov 16 13:41:14 2015 +0000
----------------------------------------------------------------------
.../kvm/resource/LibvirtNetworkDef.java | 14 +++----
.../kvm/resource/LibvirtSecretDef.java | 14 +++----
.../kvm/resource/LibvirtStoragePoolDef.java | 32 +++++++--------
.../resource/LibvirtStoragePoolXMLParser.java | 10 ++---
.../kvm/resource/LibvirtStorageVolumeDef.java | 16 ++++----
.../resource/LibvirtStorageVolumeXMLParser.java | 2 +-
.../kvm/storage/LibvirtStorageAdaptor.java | 42 ++++++++++----------
.../kvm/storage/ManagedNfsStorageAdaptor.java | 8 ++--
.../kvm/resource/LibvirtSecretDefTest.java | 6 +--
.../kvm/resource/LibvirtStoragePoolDefTest.java | 12 +++---
10 files changed, 78 insertions(+), 78 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtNetworkDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtNetworkDef.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtNetworkDef.java
index f20bec4..77dfd00 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtNetworkDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtNetworkDef.java
@@ -20,13 +20,13 @@ import java.util.ArrayList;
import java.util.List;
public class LibvirtNetworkDef {
- enum netType {
+ enum NetworkType {
BRIDGE, NAT, LOCAL
}
private final String _networkName;
private final String _uuid;
- private netType _networkType;
+ private NetworkType _networkType;
private String _brName;
private boolean _stp;
private int _delay;
@@ -66,7 +66,7 @@ public class LibvirtNetworkDef {
}
public void defNATNetwork(String brName, boolean stp, int delay, String fwNic, String ipAddr, String netMask) {
- _networkType = netType.NAT;
+ _networkType = NetworkType.NAT;
_brName = brName;
_stp = stp;
_delay = delay;
@@ -76,7 +76,7 @@ public class LibvirtNetworkDef {
}
public void defBrNetwork(String brName, boolean stp, int delay, String fwNic, String ipAddr, String netMask) {
- _networkType = netType.BRIDGE;
+ _networkType = NetworkType.BRIDGE;
_brName = brName;
_stp = stp;
_delay = delay;
@@ -86,7 +86,7 @@ public class LibvirtNetworkDef {
}
public void defLocalNetwork(String brName, boolean stp, int delay, String ipAddr, String netMask) {
- _networkType = netType.LOCAL;
+ _networkType = NetworkType.LOCAL;
_brName = brName;
_stp = stp;
_delay = delay;
@@ -126,13 +126,13 @@ public class LibvirtNetworkDef {
if (_domainName != null) {
netBuilder.append("<domain name='" + _domainName + "'/>\n");
}
- if (_networkType == netType.BRIDGE) {
+ if (_networkType == NetworkType.BRIDGE) {
netBuilder.append("<forward mode='route'");
if (_fwDev != null) {
netBuilder.append(" dev='" + _fwDev + "'");
}
netBuilder.append("/>\n");
- } else if (_networkType == netType.NAT) {
+ } else if (_networkType == NetworkType.NAT) {
netBuilder.append("<forward mode='nat'");
if (_fwDev != null) {
netBuilder.append(" dev='" + _fwDev + "'");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtSecretDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtSecretDef.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtSecretDef.java
index d68f3a8..80c08e9 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtSecretDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtSecretDef.java
@@ -18,11 +18,11 @@ package com.cloud.hypervisor.kvm.resource;
public class LibvirtSecretDef {
- public enum usage {
+ public enum Usage {
VOLUME("volume"), CEPH("ceph");
String _usage;
- usage(String usage) {
+ Usage(String usage) {
_usage = usage;
}
@@ -32,7 +32,7 @@ public class LibvirtSecretDef {
}
}
- private usage _usage;
+ private Usage _usage;
private boolean _ephemeral;
private boolean _private;
private String _uuid;
@@ -40,12 +40,12 @@ public class LibvirtSecretDef {
private String _cephName;
private String _volumeVolume;
- public LibvirtSecretDef(usage usage, String uuid) {
+ public LibvirtSecretDef(Usage usage, String uuid) {
_usage = usage;
_uuid = uuid;
}
- public LibvirtSecretDef(usage usage, String uuid, String description) {
+ public LibvirtSecretDef(Usage usage, String uuid, String description) {
_usage = usage;
_uuid = uuid;
_description = description;
@@ -92,10 +92,10 @@ public class LibvirtSecretDef {
secretBuilder.append("<description>" + _description + "</description>\n");
}
secretBuilder.append("<usage type='" + _usage + "'>\n");
- if (_usage == usage.VOLUME) {
+ if (_usage == Usage.VOLUME) {
secretBuilder.append("<volume>" + _volumeVolume + "</volume>\n");
}
- if (_usage == usage.CEPH) {
+ if (_usage == Usage.CEPH) {
secretBuilder.append("<name>" + _cephName + "</name>\n");
}
secretBuilder.append("</usage>\n");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java
index 7631169..31fe88f 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDef.java
@@ -17,11 +17,11 @@
package com.cloud.hypervisor.kvm.resource;
public class LibvirtStoragePoolDef {
- public enum poolType {
+ public enum PoolType {
ISCSI("iscsi"), NETFS("netfs"), LOGICAL("logical"), DIR("dir"), RBD("rbd"), GLUSTERFS("glusterfs");
String _poolType;
- poolType(String poolType) {
+ PoolType(String poolType) {
_poolType = poolType;
}
@@ -31,11 +31,11 @@ public class LibvirtStoragePoolDef {
}
}
- public enum authType {
+ public enum AuthenticationType {
CHAP("chap"), CEPH("ceph");
String _authType;
- authType(String authType) {
+ AuthenticationType(String authType) {
_authType = authType;
}
@@ -45,7 +45,7 @@ public class LibvirtStoragePoolDef {
}
}
- private poolType _poolType;
+ private PoolType _poolType;
private String _poolName;
private String _uuid;
private String _sourceHost;
@@ -53,10 +53,10 @@ public class LibvirtStoragePoolDef {
private String _sourceDir;
private String _targetPath;
private String _authUsername;
- private authType _authType;
+ private AuthenticationType _authType;
private String _secretUuid;
- public LibvirtStoragePoolDef(poolType type, String poolName, String uuid, String host, int port, String dir, String targetPath) {
+ public LibvirtStoragePoolDef(PoolType type, String poolName, String uuid, String host, int port, String dir, String targetPath) {
_poolType = type;
_poolName = poolName;
_uuid = uuid;
@@ -66,7 +66,7 @@ public class LibvirtStoragePoolDef {
_targetPath = targetPath;
}
- public LibvirtStoragePoolDef(poolType type, String poolName, String uuid, String host, String dir, String targetPath) {
+ public LibvirtStoragePoolDef(PoolType type, String poolName, String uuid, String host, String dir, String targetPath) {
_poolType = type;
_poolName = poolName;
_uuid = uuid;
@@ -75,7 +75,7 @@ public class LibvirtStoragePoolDef {
_targetPath = targetPath;
}
- public LibvirtStoragePoolDef(poolType type, String poolName, String uuid, String sourceHost, int sourcePort, String dir, String authUsername, authType authType,
+ public LibvirtStoragePoolDef(PoolType type, String poolName, String uuid, String sourceHost, int sourcePort, String dir, String authUsername, AuthenticationType authType,
String secretUuid) {
_poolType = type;
_poolName = poolName;
@@ -92,7 +92,7 @@ public class LibvirtStoragePoolDef {
return _poolName;
}
- public poolType getPoolType() {
+ public PoolType getPoolType() {
return _poolType;
}
@@ -120,14 +120,14 @@ public class LibvirtStoragePoolDef {
return _secretUuid;
}
- public authType getAuthType() {
+ public AuthenticationType getAuthType() {
return _authType;
}
@Override
public String toString() {
StringBuilder storagePoolBuilder = new StringBuilder();
- if (_poolType == poolType.GLUSTERFS) {
+ if (_poolType == PoolType.GLUSTERFS) {
/* libvirt mounts a Gluster volume, similar to NFS */
storagePoolBuilder.append("<pool type='netfs'>\n");
} else {
@@ -139,13 +139,13 @@ public class LibvirtStoragePoolDef {
storagePoolBuilder.append("<name>" + _poolName + "</name>\n");
if (_uuid != null)
storagePoolBuilder.append("<uuid>" + _uuid + "</uuid>\n");
- if (_poolType == poolType.NETFS) {
+ if (_poolType == PoolType.NETFS) {
storagePoolBuilder.append("<source>\n");
storagePoolBuilder.append("<host name='" + _sourceHost + "'/>\n");
storagePoolBuilder.append("<dir path='" + _sourceDir + "'/>\n");
storagePoolBuilder.append("</source>\n");
}
- if (_poolType == poolType.RBD) {
+ if (_poolType == PoolType.RBD) {
storagePoolBuilder.append("<source>\n");
storagePoolBuilder.append("<host name='" + _sourceHost + "' port='" + _sourcePort + "'/>\n");
storagePoolBuilder.append("<name>" + _sourceDir + "</name>\n");
@@ -156,7 +156,7 @@ public class LibvirtStoragePoolDef {
}
storagePoolBuilder.append("</source>\n");
}
- if (_poolType == poolType.GLUSTERFS) {
+ if (_poolType == PoolType.GLUSTERFS) {
storagePoolBuilder.append("<source>\n");
storagePoolBuilder.append("<host name='");
storagePoolBuilder.append(_sourceHost);
@@ -173,7 +173,7 @@ public class LibvirtStoragePoolDef {
storagePoolBuilder.append("'/>\n");
storagePoolBuilder.append("</source>\n");
}
- if (_poolType != poolType.RBD) {
+ if (_poolType != PoolType.RBD) {
storagePoolBuilder.append("<target>\n");
storagePoolBuilder.append("<path>" + _targetPath + "</path>\n");
storagePoolBuilder.append("</target>\n");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParser.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParser.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParser.java
index 6199e5d..239cc3d 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParser.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolXMLParser.java
@@ -63,10 +63,10 @@ public class LibvirtStoragePoolXMLParser {
if (auth != null) {
String authUsername = auth.getAttribute("username");
String authType = auth.getAttribute("type");
- return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.poolType.valueOf(type.toUpperCase()), poolName, uuid, host, port, pool, authUsername,
- LibvirtStoragePoolDef.authType.valueOf(authType.toUpperCase()), uuid);
+ return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.PoolType.valueOf(type.toUpperCase()), poolName, uuid, host, port, pool, authUsername,
+ LibvirtStoragePoolDef.AuthenticationType.valueOf(authType.toUpperCase()), uuid);
} else {
- return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.poolType.valueOf(type.toUpperCase()), poolName, uuid, host, port, pool, "");
+ return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.PoolType.valueOf(type.toUpperCase()), poolName, uuid, host, port, pool, "");
}
/* Gluster is a sub-type of LibvirtStoragePoolDef.poolType.NETFS, need to check format */
} else if (format != null && format.equalsIgnoreCase("glusterfs")) {
@@ -83,7 +83,7 @@ public class LibvirtStoragePoolXMLParser {
if (portValue != null && !portValue.isEmpty())
port = Integer.parseInt(portValue);
- return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.poolType.valueOf(format.toUpperCase()),
+ return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.PoolType.valueOf(format.toUpperCase()),
poolName, uuid, host, port, path, targetPath);
} else {
String path = getAttrValue("dir", "path", source);
@@ -91,7 +91,7 @@ public class LibvirtStoragePoolXMLParser {
Element target = (Element)rootElement.getElementsByTagName("target").item(0);
String targetPath = getTagValue("path", target);
- return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.poolType.valueOf(type.toUpperCase()), poolName, uuid, host, path, targetPath);
+ return new LibvirtStoragePoolDef(LibvirtStoragePoolDef.PoolType.valueOf(type.toUpperCase()), poolName, uuid, host, path, targetPath);
}
} catch (ParserConfigurationException e) {
s_logger.debug(e.toString());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeDef.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeDef.java
index 6112311..de65cae 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeDef.java
@@ -20,11 +20,11 @@ import org.apache.cloudstack.utils.qemu.QemuImg;
import org.apache.commons.lang.NotImplementedException;
public class LibvirtStorageVolumeDef {
- public enum volFormat {
+ public enum VolumeFormat {
RAW("raw"), QCOW2("qcow2"), DIR("dir"), TAR("tar");
private String _format;
- volFormat(String format) {
+ VolumeFormat(String format) {
_format = format;
}
@@ -33,7 +33,7 @@ public class LibvirtStorageVolumeDef {
return _format;
}
- public static volFormat getFormat(String format) {
+ public static VolumeFormat getFormat(String format) {
if (format == null) {
return null;
}
@@ -49,7 +49,7 @@ public class LibvirtStorageVolumeDef {
return null;
}
- public static volFormat getFormat(QemuImg.PhysicalDiskFormat format){
+ public static VolumeFormat getFormat(QemuImg.PhysicalDiskFormat format){
switch (format){
case RAW:
return RAW;
@@ -67,11 +67,11 @@ public class LibvirtStorageVolumeDef {
private String _volName;
private Long _volSize;
- private volFormat _volFormat;
+ private VolumeFormat _volFormat;
private String _backingPath;
- private volFormat _backingFormat;
+ private VolumeFormat _backingFormat;
- public LibvirtStorageVolumeDef(String volName, Long size, volFormat format, String tmplPath, volFormat tmplFormat) {
+ public LibvirtStorageVolumeDef(String volName, Long size, VolumeFormat format, String tmplPath, VolumeFormat tmplFormat) {
_volName = volName;
_volSize = size;
_volFormat = format;
@@ -79,7 +79,7 @@ public class LibvirtStorageVolumeDef {
_backingFormat = tmplFormat;
}
- public volFormat getFormat() {
+ public VolumeFormat getFormat() {
return this._volFormat;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java
index 79957b2..1c89f81 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtStorageVolumeXMLParser.java
@@ -49,7 +49,7 @@ public class LibvirtStorageVolumeXMLParser {
Element target = (Element)rootElement.getElementsByTagName("target").item(0);
String format = getAttrValue("type", "format", target);
Long capacity = Long.parseLong(getTagValue("capacity", rootElement));
- return new LibvirtStorageVolumeDef(VolName, capacity, LibvirtStorageVolumeDef.volFormat.getFormat(format), null, null);
+ return new LibvirtStorageVolumeDef(VolName, capacity, LibvirtStorageVolumeDef.VolumeFormat.getFormat(format), null, null);
} catch (ParserConfigurationException e) {
s_logger.debug(e.toString());
} catch (SAXException e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 65c4c53..d7bdab2 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -50,13 +50,13 @@ import org.apache.cloudstack.utils.qemu.QemuImgFile;
import com.cloud.exception.InternalErrorException;
import com.cloud.hypervisor.kvm.resource.LibvirtConnection;
import com.cloud.hypervisor.kvm.resource.LibvirtSecretDef;
-import com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.usage;
+import com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage;
import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef;
-import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.authType;
-import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.poolType;
+import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.AuthenticationType;
+import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType;
import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolXMLParser;
import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef;
-import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef.volFormat;
+import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef.VolumeFormat;
import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeXMLParser;
import com.cloud.storage.Storage;
import com.cloud.storage.Storage.StoragePoolType;
@@ -122,7 +122,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
return vol;
}
- public StorageVol createVolume(Connect conn, StoragePool pool, String uuid, long size, volFormat format) throws LibvirtException {
+ public StorageVol createVolume(Connect conn, StoragePool pool, String uuid, long size, VolumeFormat format) throws LibvirtException {
LibvirtStorageVolumeDef volDef = new LibvirtStorageVolumeDef(UUID.randomUUID().toString(), size, format, null, null);
s_logger.debug(volDef.toString());
@@ -139,7 +139,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
}
- private StoragePool createNetfsStoragePool(poolType fsType, Connect conn, String uuid, String host, String path) throws LibvirtException {
+ private StoragePool createNetfsStoragePool(PoolType fsType, Connect conn, String uuid, String host, String path) throws LibvirtException {
String targetPath = _mountPoint + File.separator + uuid;
LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(fsType, uuid, uuid, host, path, targetPath);
_storageLayer.mkdir(targetPath);
@@ -193,7 +193,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
s_logger.error(mountPoint + " does not exists. Check local.storage.path in agent.properties.");
return null;
}
- LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.DIR, uuid, uuid, host, path, path);
+ LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(PoolType.DIR, uuid, uuid, host, path, path);
StoragePool sp = null;
try {
s_logger.debug(spd.toString());
@@ -224,7 +224,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
String volgroupName = path;
volgroupName = volgroupName.replaceFirst("/", "");
- LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(poolType.LOGICAL, volgroupName, uuid, host, volgroupPath, volgroupPath);
+ LibvirtStoragePoolDef spd = new LibvirtStoragePoolDef(PoolType.LOGICAL, volgroupName, uuid, host, volgroupPath, volgroupPath);
StoragePool sp = null;
try {
s_logger.debug(spd.toString());
@@ -258,7 +258,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
String[] userInfoTemp = userInfo.split(":");
if (userInfoTemp.length == 2) {
- LibvirtSecretDef sd = new LibvirtSecretDef(usage.CEPH, uuid);
+ LibvirtSecretDef sd = new LibvirtSecretDef(Usage.CEPH, uuid);
sd.setCephName(userInfoTemp[0] + "@" + host + ":" + port + "/" + path);
@@ -278,9 +278,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
return null;
}
- spd = new LibvirtStoragePoolDef(poolType.RBD, uuid, uuid, host, port, path, userInfoTemp[0], authType.CEPH, uuid);
+ spd = new LibvirtStoragePoolDef(PoolType.RBD, uuid, uuid, host, port, path, userInfoTemp[0], AuthenticationType.CEPH, uuid);
} else {
- spd = new LibvirtStoragePoolDef(poolType.RBD, uuid, uuid, host, port, path, "");
+ spd = new LibvirtStoragePoolDef(PoolType.RBD, uuid, uuid, host, port, path, "");
}
try {
@@ -368,15 +368,15 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
throw new CloudRuntimeException("Unable to parse the storage pool definition for storage pool " + uuid);
}
StoragePoolType type = null;
- if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.NETFS) {
+ if (spd.getPoolType() == LibvirtStoragePoolDef.PoolType.NETFS) {
type = StoragePoolType.NetworkFilesystem;
- } else if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.DIR) {
+ } else if (spd.getPoolType() == LibvirtStoragePoolDef.PoolType.DIR) {
type = StoragePoolType.Filesystem;
- } else if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.RBD) {
+ } else if (spd.getPoolType() == LibvirtStoragePoolDef.PoolType.RBD) {
type = StoragePoolType.RBD;
- } else if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.LOGICAL) {
+ } else if (spd.getPoolType() == LibvirtStoragePoolDef.PoolType.LOGICAL) {
type = StoragePoolType.CLVM;
- } else if (spd.getPoolType() == LibvirtStoragePoolDef.poolType.GLUSTERFS) {
+ } else if (spd.getPoolType() == LibvirtStoragePoolDef.PoolType.GLUSTERFS) {
type = StoragePoolType.Gluster;
}
@@ -462,9 +462,9 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
} else {
disk.setFormat(pool.getDefaultFormat());
}
- } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.QCOW2) {
+ } else if (voldef.getFormat() == LibvirtStorageVolumeDef.VolumeFormat.QCOW2) {
disk.setFormat(PhysicalDiskFormat.QCOW2);
- } else if (voldef.getFormat() == LibvirtStorageVolumeDef.volFormat.RAW) {
+ } else if (voldef.getFormat() == LibvirtStorageVolumeDef.VolumeFormat.RAW) {
disk.setFormat(PhysicalDiskFormat.RAW);
}
return disk;
@@ -542,7 +542,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
if (type == StoragePoolType.NetworkFilesystem) {
try {
- sp = createNetfsStoragePool(poolType.NETFS, conn, name, host, path);
+ sp = createNetfsStoragePool(PoolType.NETFS, conn, name, host, path);
} catch (LibvirtException e) {
s_logger.error("Failed to create netfs mount: " + host + ":" + path , e);
s_logger.error(e.getStackTrace());
@@ -550,7 +550,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
}
} else if (type == StoragePoolType.Gluster) {
try {
- sp = createNetfsStoragePool(poolType.GLUSTERFS, conn, name, host, path);
+ sp = createNetfsStoragePool(PoolType.GLUSTERFS, conn, name, host, path);
} catch (LibvirtException e) {
s_logger.error("Failed to create glusterfs mount: " + host + ":" + path , e);
s_logger.error(e.getStackTrace());
@@ -684,7 +684,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
PhysicalDiskFormat format, Storage.ProvisioningType provisioningType, long size) {
LibvirtStoragePool libvirtPool = (LibvirtStoragePool) pool;
StoragePool virtPool = libvirtPool.getPool();
- LibvirtStorageVolumeDef.volFormat libvirtformat = LibvirtStorageVolumeDef.volFormat.getFormat(format);
+ LibvirtStorageVolumeDef.VolumeFormat libvirtformat = LibvirtStorageVolumeDef.VolumeFormat.getFormat(format);
String volPath = null;
String volName = null;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java
index bcf00d3..72edb13 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java
@@ -32,7 +32,7 @@ import org.libvirt.StorageVol;
import com.cloud.agent.api.to.DiskTO;
import com.cloud.hypervisor.kvm.resource.LibvirtConnection;
import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef;
-import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.poolType;
+import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType;
import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeDef;
import com.cloud.hypervisor.kvm.resource.LibvirtStorageVolumeXMLParser;
import com.cloud.storage.Storage.ImageFormat;
@@ -105,7 +105,7 @@ public class ManagedNfsStorageAdaptor implements StorageAdaptor {
}
targetPath = "/mnt" + volumeUuid;
- spd = new LibvirtStoragePoolDef(poolType.NETFS, volumeUuid, details.get(DiskTO.UUID), pool.getSourceHost(), details.get(DiskTO.MOUNT_POINT), targetPath);
+ spd = new LibvirtStoragePoolDef(PoolType.NETFS, volumeUuid, details.get(DiskTO.UUID), pool.getSourceHost(), details.get(DiskTO.MOUNT_POINT), targetPath);
_storageLayer.mkdir(targetPath);
s_logger.debug(spd.toString());
@@ -178,14 +178,14 @@ public class ManagedNfsStorageAdaptor implements StorageAdaptor {
throw new CloudRuntimeException(e1.toString());
}
- LibvirtStorageVolumeDef.volFormat libvirtformat = null;
+ LibvirtStorageVolumeDef.VolumeFormat libvirtformat = null;
long volCapacity = 0;
// check whether the volume is present on the given pool
StorageVol vol = getVolume(virtPool, volumeUuid);
try {
if (vol == null) {
- libvirtformat = LibvirtStorageVolumeDef.volFormat.QCOW2;
+ libvirtformat = LibvirtStorageVolumeDef.VolumeFormat.QCOW2;
StoragePoolInfo poolinfo = virtPool.getInfo();
volCapacity = poolinfo.available;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtSecretDefTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtSecretDefTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtSecretDefTest.java
index 54036b3..6fb4137 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtSecretDefTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtSecretDefTest.java
@@ -20,14 +20,14 @@
package com.cloud.hypervisor.kvm.resource;
import junit.framework.TestCase;
-import com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.usage;
+import com.cloud.hypervisor.kvm.resource.LibvirtSecretDef.Usage;
public class LibvirtSecretDefTest extends TestCase {
public void testVolumeSecretDef() {
String uuid = "db66f42b-a79e-4666-9910-9dfc8a024427";
String name = "myEncryptedQCOW2";
- usage use = usage.VOLUME;
+ Usage use = Usage.VOLUME;
LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
def.setVolumeVolume(name);
@@ -41,7 +41,7 @@ public class LibvirtSecretDefTest extends TestCase {
public void testCephSecretDef() {
String uuid = "a9febe83-ac5c-467a-bf19-eb75325ec23c";
String name = "admin";
- usage use = usage.CEPH;
+ Usage use = Usage.CEPH;
LibvirtSecretDef def = new LibvirtSecretDef(use, uuid);
def.setCephName(name);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/962d4b4a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDefTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDefTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDefTest.java
index 687432b..ec22e3f 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDefTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtStoragePoolDefTest.java
@@ -20,13 +20,13 @@
package com.cloud.hypervisor.kvm.resource;
import junit.framework.TestCase;
-import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.poolType;
-import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.authType;
+import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.PoolType;
+import com.cloud.hypervisor.kvm.resource.LibvirtStoragePoolDef.AuthenticationType;
public class LibvirtStoragePoolDefTest extends TestCase {
public void testSetGetStoragePool() {
- poolType type = poolType.NETFS;
+ PoolType type = PoolType.NETFS;
String name = "myNFSPool";
String uuid = "d7846cb0-f610-4a5b-8d38-ee6e8d63f37b";
String host = "127.0.0.1";
@@ -45,7 +45,7 @@ public class LibvirtStoragePoolDefTest extends TestCase {
}
public void testNfsStoragePool() {
- poolType type = poolType.NETFS;
+ PoolType type = PoolType.NETFS;
String name = "myNFSPool";
String uuid = "89a605bc-d470-4637-b3df-27388be452f5";
String host = "127.0.0.1";
@@ -62,14 +62,14 @@ public class LibvirtStoragePoolDefTest extends TestCase {
}
public void testRbdStoragePool() {
- poolType type = poolType.RBD;
+ PoolType type = PoolType.RBD;
String name = "myRBDPool";
String uuid = "921ef8b2-955a-4c18-a697-66bb9adf6131";
String host = "127.0.0.1";
String dir = "cloudstackrbdpool";
String authUsername = "admin";
String secretUuid = "08c2fa02-50d0-4a78-8903-b742d3f34934";
- authType auth = authType.CEPH;
+ AuthenticationType auth = AuthenticationType.CEPH;
int port = 6789;
LibvirtStoragePoolDef pool = new LibvirtStoragePoolDef(type, name, uuid, host, port, dir, authUsername, auth, secretUuid);
[4/4] git commit: updated refs/heads/master to 638f1cf
Posted by da...@apache.org.
Merge pull request #1049 from DaanHoogland/CLOUDSTACK-9047
CLOUDSTACK-9047 rename enumsmake enums adhere to best practice naming conventions
* pr/1049:
CLOUDSTACK-9046 rename enums to adhere to naming conventions
CLOUDSTACK-9046 renamed enums in kvm plugin
CLOUDSTACK-9047 use 'State's only with context there are more types called 'State' (or to be called so but now 'state') So remove imports and prepend their enclosing class/context to them.
Signed-off-by: Daan Hoogland <da...@onecht.net>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/638f1cf0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/638f1cf0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/638f1cf0
Branch: refs/heads/master
Commit: 638f1cf091056f518006af46b49bbb9dd7653b92
Parents: afe1130 c669c93
Author: Daan Hoogland <da...@onecht.net>
Authored: Sun Dec 6 20:17:03 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Sun Dec 6 20:17:04 2015 +0100
----------------------------------------------------------------------
api/src/com/cloud/gpu/GPU.java | 4 +-
api/src/com/cloud/vm/NicIpAlias.java | 2 +-
.../orchestration/NetworkOrchestrator.java | 7 ++-
.../src/com/cloud/vm/dao/NicIpAliasDao.java | 4 +-
.../src/com/cloud/vm/dao/NicIpAliasDaoImpl.java | 8 +--
.../src/com/cloud/vm/dao/NicIpAliasVO.java | 8 +--
.../kvm/resource/LibvirtNetworkDef.java | 14 +++---
.../kvm/resource/LibvirtSecretDef.java | 14 +++---
.../kvm/resource/LibvirtStoragePoolDef.java | 32 ++++++------
.../resource/LibvirtStoragePoolXMLParser.java | 10 ++--
.../kvm/resource/LibvirtStorageVolumeDef.java | 16 +++---
.../resource/LibvirtStorageVolumeXMLParser.java | 2 +-
.../kvm/storage/LibvirtStorageAdaptor.java | 42 ++++++++--------
.../kvm/storage/ManagedNfsStorageAdaptor.java | 8 +--
.../kvm/resource/LibvirtSecretDefTest.java | 6 +--
.../kvm/resource/LibvirtStoragePoolDefTest.java | 12 ++---
server/src/com/cloud/api/ApiResponseHelper.java | 2 +-
.../configuration/ConfigurationManagerImpl.java | 2 +-
.../network/router/CommandSetupHelper.java | 7 ++-
.../VirtualNetworkApplianceManagerImpl.java | 53 ++++++++++----------
.../cloud/network/rules/DhcpSubNetRules.java | 2 +-
server/src/com/cloud/server/StatsCollector.java | 10 ++--
22 files changed, 131 insertions(+), 134 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/638f1cf0/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/638f1cf0/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/638f1cf0/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/638f1cf0/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/638f1cf0/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --cc server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 419537f,32469db..41cc558
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@@ -248,8 -248,9 +247,8 @@@ import com.cloud.vm.dao.VMInstanceDao
* VirtualNetworkApplianceManagerImpl manages the different types of virtual
* network appliances available in the Cloud Stack.
*/
-@Local(value = { VirtualNetworkApplianceManager.class, VirtualNetworkApplianceService.class })
public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements VirtualNetworkApplianceManager, VirtualNetworkApplianceService, VirtualMachineGuru, Listener,
- Configurable, StateListener<State, VirtualMachine.Event, VirtualMachine> {
+ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualMachine> {
private static final Logger s_logger = Logger.getLogger(VirtualNetworkApplianceManagerImpl.class);
@Inject
[3/4] git commit: updated refs/heads/master to 638f1cf
Posted by da...@apache.org.
CLOUDSTACK-9046 rename enums to adhere to naming conventions
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c669c93b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c669c93b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c669c93b
Branch: refs/heads/master
Commit: c669c93b05f4529843d811ca9b1df52f34b8deb2
Parents: 962d4b4
Author: Daan Hoogland <da...@onecht.net>
Authored: Mon Nov 9 12:12:29 2015 +0100
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Nov 16 13:41:16 2015 +0000
----------------------------------------------------------------------
api/src/com/cloud/gpu/GPU.java | 4 ++--
api/src/com/cloud/vm/NicIpAlias.java | 2 +-
.../engine/orchestration/NetworkOrchestrator.java | 4 ++--
engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java | 4 ++--
engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java | 8 ++++----
engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java | 8 ++++----
server/src/com/cloud/api/ApiResponseHelper.java | 2 +-
.../com/cloud/configuration/ConfigurationManagerImpl.java | 2 +-
.../src/com/cloud/network/router/CommandSetupHelper.java | 2 +-
.../router/VirtualNetworkApplianceManagerImpl.java | 8 ++++----
server/src/com/cloud/network/rules/DhcpSubNetRules.java | 2 +-
server/src/com/cloud/server/StatsCollector.java | 10 +++++-----
12 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/api/src/com/cloud/gpu/GPU.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/gpu/GPU.java b/api/src/com/cloud/gpu/GPU.java
index 9177edb..8aa54c0 100644
--- a/api/src/com/cloud/gpu/GPU.java
+++ b/api/src/com/cloud/gpu/GPU.java
@@ -24,7 +24,7 @@ public class GPU {
vgpuType
}
- public enum vGPUType {
+ public enum GPUType {
GRID_K100("GRID K100"),
GRID_K120Q("GRID K120Q"),
GRID_K140Q("GRID K140Q"),
@@ -36,7 +36,7 @@ public class GPU {
private String type;
- vGPUType(String type) {
+ GPUType(String type) {
this.type = type;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/api/src/com/cloud/vm/NicIpAlias.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/NicIpAlias.java b/api/src/com/cloud/vm/NicIpAlias.java
index d7431ba..964a90f 100644
--- a/api/src/com/cloud/vm/NicIpAlias.java
+++ b/api/src/com/cloud/vm/NicIpAlias.java
@@ -27,7 +27,7 @@ public interface NicIpAlias extends ControlledEntity, Identity, InternalIdentity
/**
* @return id in the CloudStack database
*/
- enum state {
+ enum State {
active, revoked,
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index f2c6fc3..35006df 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -1756,9 +1756,9 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
Network network = _networksDao.findById(nic.getNetworkId());
DhcpServiceProvider dhcpServiceProvider = getDhcpServiceProvider(network);
try {
- final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(nic.getIPv4Gateway(), network.getId(), NicIpAlias.state.active);
+ final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(nic.getIPv4Gateway(), network.getId(), NicIpAlias.State.active);
if (ipAlias != null) {
- ipAlias.setState(NicIpAlias.state.revoked);
+ ipAlias.setState(NicIpAlias.State.revoked);
Transaction.execute(new TransactionCallbackNoReturn() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java
index b1cd02b..b79c101 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDao.java
@@ -54,8 +54,8 @@ public interface NicIpAliasDao extends GenericDao<NicIpAliasVO, Long> {
public NicIpAliasVO findByIp4AddressAndVmId(String ip4Address, long vmId);
- NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.state state);
+ NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.State state);
- List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.state state);
+ List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.State state);
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
index a267218..0c98a6c 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
@@ -84,7 +84,7 @@ public class NicIpAliasDaoImpl extends GenericDaoBase<NicIpAliasVO, Long> implem
}
@Override
- public List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.state state) {
+ public List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.State state) {
SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
sc.setParameters("network", networkId);
sc.setParameters("state", state);
@@ -103,7 +103,7 @@ public class NicIpAliasDaoImpl extends GenericDaoBase<NicIpAliasVO, Long> implem
public List<NicIpAliasVO> getAliasIpForVm(long vmId) {
SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
sc.setParameters("instanceId", vmId);
- sc.setParameters("state", NicIpAlias.state.active);
+ sc.setParameters("state", NicIpAlias.State.active);
return listBy(sc);
}
@@ -124,7 +124,7 @@ public class NicIpAliasDaoImpl extends GenericDaoBase<NicIpAliasVO, Long> implem
SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
sc.setParameters("network", networkId);
sc.setParameters("instanceId", instanceId);
- sc.setParameters("state", NicIpAlias.state.active);
+ sc.setParameters("state", NicIpAlias.State.active);
return findOneBy(sc);
}
@@ -134,7 +134,7 @@ public class NicIpAliasDaoImpl extends GenericDaoBase<NicIpAliasVO, Long> implem
}
@Override
- public NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.state state) {
+ public NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.State state) {
SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
sc.setParameters("gateway", gateway);
sc.setParameters("network", networkId);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java b/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java
index 2f000fd..7e81495 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java
@@ -45,7 +45,7 @@ public class NicIpAliasVO implements NicIpAlias {
this.networkId = networkId;
this.netmask = netmask;
this.gateway = gateway;
- state = NicIpAlias.state.active;
+ state = NicIpAlias.State.active;
String cidr = NetUtils.getCidrFromGatewayAndNetmask(gateway, netmask);
String[] cidrPair = cidr.split("\\/");
String cidrAddress = cidrPair[0];
@@ -99,7 +99,7 @@ public class NicIpAliasVO implements NicIpAlias {
@Column(name = "state")
@Enumerated(value = EnumType.STRING)
- NicIpAlias.state state;
+ NicIpAlias.State state;
@Column(name = "start_ip_of_subnet")
String startIpOfSubnet;
@@ -220,11 +220,11 @@ public class NicIpAliasVO implements NicIpAlias {
this.gateway = gateway;
}
- public NicIpAlias.state getState() {
+ public NicIpAlias.State getState() {
return state;
}
- public void setState(NicIpAlias.state state) {
+ public void setState(NicIpAlias.State state) {
this.state = state;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 00f1a27..0fa5e50 100644
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -1576,7 +1576,7 @@ public class ApiResponseHelper implements ResponseGenerator {
if (vgpuVMs.containsKey(capacity.getGroupName().concat(capacity.getModelName()))) {
capacityUsed += (float)vgpuVMs.get(capacity.getGroupName().concat(capacity.getModelName())) / capacity.getMaxVpuPerGpu();
}
- if (capacity.getModelName().equals(GPU.vGPUType.passthrough.toString())) {
+ if (capacity.getModelName().equals(GPU.GPUType.passthrough.toString())) {
capacityMax += capacity.getMaxCapacity();
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 69e70e6..d890023 100644
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -3265,7 +3265,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
}
}
} else { // !isAccountSpecific
- final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(vlanRange.getVlanGateway(), vlanRange.getNetworkId(), NicIpAlias.state.active);
+ final NicIpAliasVO ipAlias = _nicIpAliasDao.findByGatewayAndNetworkIdAndState(vlanRange.getVlanGateway(), vlanRange.getNetworkId(), NicIpAlias.State.active);
//check if the ipalias belongs to the vlan range being deleted.
if (ipAlias != null && vlanDbId == _publicIpAddressDao.findByIpAndSourceNetworkId(vlanRange.getNetworkId(), ipAlias.getIp4Address()).getVlanId()) {
throw new InvalidParameterValueException("Cannot delete vlan range " + vlanDbId + " as " + ipAlias.getIp4Address()
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/network/router/CommandSetupHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/CommandSetupHelper.java b/server/src/com/cloud/network/router/CommandSetupHelper.java
index 67c52e3..925961d 100644
--- a/server/src/com/cloud/network/router/CommandSetupHelper.java
+++ b/server/src/com/cloud/network/router/CommandSetupHelper.java
@@ -263,7 +263,7 @@ public class CommandSetupHelper {
public void configDnsMasq(final VirtualRouter router, final Network network, final Commands cmds) {
final DataCenterVO dcVo = _dcDao.findById(router.getDataCenterId());
- final List<NicIpAliasVO> ipAliasVOList = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.state.active);
+ final List<NicIpAliasVO> ipAliasVOList = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.State.active);
final List<DhcpTO> ipList = new ArrayList<DhcpTO>();
final NicVO router_guest_nic = _nicDao.findByNtwkIdAndInstanceId(network.getId(), router.getId());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index d291936..32469db 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -1951,11 +1951,11 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
_networkOfferingDao.findById(_networkDao.findById(guestNetworkId).getNetworkOfferingId()), Service.Dhcp);
final String supportsMultipleSubnets = dhcpCapabilities.get(Network.Capability.DhcpAccrossMultipleSubnets);
if (supportsMultipleSubnets != null && Boolean.valueOf(supportsMultipleSubnets)) {
- final List<NicIpAliasVO> revokedIpAliasVOs = _nicIpAliasDao.listByNetworkIdAndState(guestNetworkId, NicIpAlias.state.revoked);
+ final List<NicIpAliasVO> revokedIpAliasVOs = _nicIpAliasDao.listByNetworkIdAndState(guestNetworkId, NicIpAlias.State.revoked);
s_logger.debug("Found" + revokedIpAliasVOs.size() + "ip Aliases to revoke on the router as a part of dhcp configuration");
removeRevokedIpAliasFromDb(revokedIpAliasVOs);
- final List<NicIpAliasVO> aliasVOs = _nicIpAliasDao.listByNetworkIdAndState(guestNetworkId, NicIpAlias.state.active);
+ final List<NicIpAliasVO> aliasVOs = _nicIpAliasDao.listByNetworkIdAndState(guestNetworkId, NicIpAlias.State.active);
s_logger.debug("Found" + aliasVOs.size() + "ip Aliases to apply on the router as a part of dhcp configuration");
final List<IpAliasTO> activeIpAliasTOs = new ArrayList<IpAliasTO>();
for (final NicIpAliasVO aliasVO : aliasVOs) {
@@ -2232,13 +2232,13 @@ Configurable, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualM
}
final Commands cmds = new Commands(Command.OnError.Continue);
- final List<NicIpAliasVO> revokedIpAliasVOs = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.state.revoked);
+ final List<NicIpAliasVO> revokedIpAliasVOs = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.State.revoked);
s_logger.debug("Found" + revokedIpAliasVOs.size() + "ip Aliases to revoke on the router as a part of dhcp configuration");
final List<IpAliasTO> revokedIpAliasTOs = new ArrayList<IpAliasTO>();
for (final NicIpAliasVO revokedAliasVO : revokedIpAliasVOs) {
revokedIpAliasTOs.add(new IpAliasTO(revokedAliasVO.getIp4Address(), revokedAliasVO.getNetmask(), revokedAliasVO.getAliasCount().toString()));
}
- final List<NicIpAliasVO> aliasVOs = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.state.active);
+ final List<NicIpAliasVO> aliasVOs = _nicIpAliasDao.listByNetworkIdAndState(network.getId(), NicIpAlias.State.active);
s_logger.debug("Found" + aliasVOs.size() + "ip Aliases to apply on the router as a part of dhcp configuration");
final List<IpAliasTO> activeIpAliasTOs = new ArrayList<IpAliasTO>();
for (final NicIpAliasVO aliasVO : aliasVOs) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/network/rules/DhcpSubNetRules.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/DhcpSubNetRules.java b/server/src/com/cloud/network/rules/DhcpSubNetRules.java
index a70aa81..ed55137 100644
--- a/server/src/com/cloud/network/rules/DhcpSubNetRules.java
+++ b/server/src/com/cloud/network/rules/DhcpSubNetRules.java
@@ -94,7 +94,7 @@ public class DhcpSubNetRules extends RuleApplier {
// networks.
if (!NetUtils.sameSubnet(domrGuestNic.getIPv4Address(), _nic.getIPv4Address(), _nic.getIPv4Netmask())) {
final NicIpAliasDao nicIpAliasDao = visitor.getVirtualNetworkApplianceFactory().getNicIpAliasDao();
- final List<NicIpAliasVO> aliasIps = nicIpAliasDao.listByNetworkIdAndState(domrGuestNic.getNetworkId(), NicIpAlias.state.active);
+ final List<NicIpAliasVO> aliasIps = nicIpAliasDao.listByNetworkIdAndState(domrGuestNic.getNetworkId(), NicIpAlias.State.active);
boolean ipInVmsubnet = false;
for (final NicIpAliasVO alias : aliasIps) {
// check if any of the alias ips belongs to the Vm's subnet.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c669c93b/server/src/com/cloud/server/StatsCollector.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/StatsCollector.java b/server/src/com/cloud/server/StatsCollector.java
index 9f3c8cb..ca86cfd 100644
--- a/server/src/com/cloud/server/StatsCollector.java
+++ b/server/src/com/cloud/server/StatsCollector.java
@@ -125,11 +125,11 @@ import com.cloud.vm.dao.VMInstanceDao;
@Component
public class StatsCollector extends ManagerBase implements ComponentMethodInterceptable {
- public static enum externalStatsProtocol {
+ public static enum ExternalStatsProtocol {
NONE("none"), GRAPHITE("graphite");
String _type;
- externalStatsProtocol(String type) {
+ ExternalStatsProtocol(String type) {
_type = type;
}
@@ -218,7 +218,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
String externalStatsHost = null;
int externalStatsPort = -1;
boolean externalStatsEnabled = false;
- externalStatsProtocol externalStatsType = externalStatsProtocol.NONE;
+ ExternalStatsProtocol externalStatsType = ExternalStatsProtocol.NONE;
private ScheduledExecutorService _diskStatsUpdateExecutor;
private int _usageAggregationRange = 1440;
@@ -266,7 +266,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
String scheme = uri.getScheme();
try {
- externalStatsType = externalStatsProtocol.valueOf(scheme.toUpperCase());
+ externalStatsType = ExternalStatsProtocol.valueOf(scheme.toUpperCase());
} catch (IllegalArgumentException e) {
s_logger.info(scheme + " is not a valid protocol for external statistics. No statistics will be send.");
}
@@ -492,7 +492,7 @@ public class StatsCollector extends ManagerBase implements ComponentMethodInterc
* Currently only Graphite is supported
*/
if (!metrics.isEmpty()) {
- if (externalStatsType != null && externalStatsType == externalStatsProtocol.GRAPHITE) {
+ if (externalStatsType != null && externalStatsType == ExternalStatsProtocol.GRAPHITE) {
if (externalStatsPort == -1) {
externalStatsPort = 2003;