incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [28/55] [abbrv] api_refactor: refactor project apis
Date Tue, 04 Dec 2012 10:02:56 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java
index 354a693..edd2830 100644
--- a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java
@@ -20,12 +20,12 @@ import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
 
 public class ManageVolumeAvailabilityAnswer extends Answer {
-	
+
 	protected ManageVolumeAvailabilityAnswer() {
     }
-	
+
 	public ManageVolumeAvailabilityAnswer(Command command, boolean success, String details) {
 		super(command, success, details);
 	}
-    
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java
index e27fe8c..1a7d480 100644
--- a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java
+++ b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java
@@ -19,36 +19,36 @@ package com.cloud.agent.api.storage;
 import com.cloud.agent.api.Command;
 
 public class ManageVolumeAvailabilityCommand extends Command {
-	
+
 	boolean attach;
 	String primaryStorageSRUuid;
 	String volumeUuid;
-	
-	
-	public ManageVolumeAvailabilityCommand() {	
+
+
+	public ManageVolumeAvailabilityCommand() {
 	}
-	
+
 	public ManageVolumeAvailabilityCommand(boolean attach, String primaryStorageSRUuid, String volumeUuid) {
     	this.attach = attach;
     	this.primaryStorageSRUuid = primaryStorageSRUuid;
         this.volumeUuid = volumeUuid;
     }
-	
+
 	@Override
     public boolean executeInSequence() {
         return false;
     }
-	
+
 	public boolean getAttach() {
 		return attach;
 	}
-	
+
 	public String getPrimaryStorageSRUuid() {
 		return primaryStorageSRUuid;
 	}
-	
+
 	public String getVolumeUuid() {
 		return volumeUuid;
 	}
-	
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java
index 3d5c556..a5a6c49 100644
--- a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java
@@ -21,24 +21,24 @@ import com.cloud.agent.api.Answer;
 public class PrimaryStorageDownloadAnswer extends Answer  {
 	private String installPath;
     private long templateSize = 0L;
-	
+
 	protected PrimaryStorageDownloadAnswer() {
 	}
-	
+
     public PrimaryStorageDownloadAnswer(String detail) {
         super(null, false, detail);
     }
-	
+
 	public PrimaryStorageDownloadAnswer(String installPath, long templateSize ) {
         super(null);
 		this.installPath = installPath;
-		this.templateSize = templateSize;		
+		this.templateSize = templateSize;
 	}
-	
+
 	public String getInstallPath() {
 		return installPath;
 	}
-	
+
 	public void setInstallPath(String installPath) {
 		this.installPath = installPath;
     }
@@ -50,5 +50,5 @@ public class PrimaryStorageDownloadAnswer extends Answer  {
     public Long getTemplateSize() {
         return templateSize;
     }
-	
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
index b563177..565b50d 100644
--- a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
@@ -26,7 +26,7 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
 	String localPath;
 	String poolUuid;
 	long poolId;
-	
+
 	String secondaryStorageUrl;
 	String primaryStorageUrl;
 
@@ -39,39 +39,39 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
         this.poolUuid = poolUuid;
         setWait(wait);
     }
-   
+
     public String getPoolUuid() {
         return poolUuid;
     }
-    
+
     public long getPoolId() {
         return poolId;
     }
-    
+
     public void setLocalPath(String path) {
     	this.localPath = path;
     }
-    
+
     public String getLocalPath() {
     	return localPath;
     }
-    
+
     public void setSecondaryStorageUrl(String url) {
     	secondaryStorageUrl = url;
     }
-    
+
     public String getSecondaryStorageUrl() {
     	return secondaryStorageUrl;
     }
-    
+
     public void setPrimaryStorageUrl(String url) {
     	primaryStorageUrl = url;
     }
-    
+
     public String getPrimaryStorageUrl() {
     	return primaryStorageUrl;
     }
-    
+
     @Override
     public boolean executeInSequence() {
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/UploadAnswer.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/UploadAnswer.java b/api/src/com/cloud/agent/api/storage/UploadAnswer.java
index 430eb83..f2d9788 100755
--- a/api/src/com/cloud/agent/api/storage/UploadAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/UploadAnswer.java
@@ -24,7 +24,7 @@ import com.cloud.storage.Upload;
 
 public class UploadAnswer extends Answer {
 
-	
+
 	private String jobId;
 	private int uploadPct;
 	private String errorString;
@@ -32,29 +32,29 @@ public class UploadAnswer extends Answer {
 	private String uploadPath;
 	private String installPath;
 	public Long templateSize = 0L;
-	
+
 	public int getUploadPct() {
 		return uploadPct;
 	}
 	public String getErrorString() {
 		return errorString;
 	}
-	
+
 	public String getUploadStatusString() {
 		return uploadStatus.toString();
 	}
-	
+
 	public Upload.Status getUploadStatus() {
 		return uploadStatus;
 	}
-	
+
 	public String getUploadPath() {
 		return uploadPath;
 	}
 	protected UploadAnswer() {
-		
+
 	}
-		
+
 	public void setErrorString(String errorString) {
         this.errorString = errorString;
     }
@@ -64,7 +64,7 @@ public class UploadAnswer extends Answer {
 	public void setJobId(String jobId) {
 		this.jobId = jobId;
 	}
-	
+
 	public UploadAnswer(String jobId, int uploadPct, String errorString,
 			Upload.Status uploadStatus, String fileSystemPath, String installPath, long templateSize) {
 		super();
@@ -87,7 +87,7 @@ public class UploadAnswer extends Answer {
         this.uploadPath = fileSystemPath;
         this.installPath = installPath;
     }
-		
+
 	private static String fixPath(String path){
 		if (path == null) {
             return path;
@@ -100,11 +100,11 @@ public class UploadAnswer extends Answer {
 		}
 		return path;
 	}
-	
+
 	public void setUploadStatus(Upload.Status uploadStatus) {
 		this.uploadStatus = uploadStatus;
 	}
-	
+
 	public String getInstallPath() {
 		return installPath;
 	}
@@ -115,9 +115,9 @@ public class UploadAnswer extends Answer {
 	public void setTemplateSize(long templateSize) {
 		this.templateSize = templateSize;
 	}
-	
+
 	public Long getTemplateSize() {
 		return templateSize;
 	}
-	
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/UploadCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/UploadCommand.java b/api/src/com/cloud/agent/api/storage/UploadCommand.java
index 4b004c9..02ca5d8 100644
--- a/api/src/com/cloud/agent/api/storage/UploadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/UploadCommand.java
@@ -26,7 +26,7 @@ public class UploadCommand extends AbstractUploadCommand {
 
 	private TemplateTO template;
 	private String url;
-	private String installPath;	
+	private String installPath;
 	private boolean hvm;
 	private String description;
 	private String checksum;
@@ -36,16 +36,16 @@ public class UploadCommand extends AbstractUploadCommand {
 	private Type type;
 
 	public UploadCommand(VirtualMachineTemplate template, String url, String installPath, long sizeInBytes) {
-		
+
 		this.template = new TemplateTO(template);
 		this.url = url;
 		this.installPath = installPath;
 		this.checksum = template.getChecksum();
 		this.id = template.getId();
 		this.templateSizeInBytes = sizeInBytes;
-		
+
 	}
-	
+
 	public UploadCommand(String url, long id, long sizeInBytes, String installPath, Type type){
 		this.template = null;
 		this.url = url;
@@ -54,10 +54,10 @@ public class UploadCommand extends AbstractUploadCommand {
 		this.type = type;
 		this.templateSizeInBytes = sizeInBytes;
 	}
-	
+
 	protected UploadCommand() {
 	}
-	
+
 	public UploadCommand(UploadCommand that) {
 		this.template = that.template;
 		this.url = that.url;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java b/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java
index 36b1437..7f6d584 100644
--- a/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java
+++ b/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java
@@ -25,7 +25,7 @@ public class UploadProgressCommand extends UploadCommand {
 	protected UploadProgressCommand() {
 		super();
 	}
-	
+
 	public UploadProgressCommand(UploadCommand cmd, String jobId, RequestType req) {
 	    super(cmd);
 
@@ -44,5 +44,5 @@ public class UploadProgressCommand extends UploadCommand {
 	public RequestType getRequest() {
 		return request;
 	}
-	
-}
\ No newline at end of file
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/storage/ssCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/ssCommand.java b/api/src/com/cloud/agent/api/storage/ssCommand.java
index c7b75ea..c218a8d 100644
--- a/api/src/com/cloud/agent/api/storage/ssCommand.java
+++ b/api/src/com/cloud/agent/api/storage/ssCommand.java
@@ -22,21 +22,21 @@ public abstract class ssCommand extends Command {
     private String secUrl;
 
 
-	public ssCommand() {	
+	public ssCommand() {
 	}
-	
+
     protected ssCommand(ssCommand that) {
         this.secUrl = that.secUrl;
     }
 	public ssCommand(String secUrl) {
 	    this.secUrl = secUrl;
     }
-	
+
 	@Override
     public boolean executeInSequence() {
         return true;
     }
-	
+
     public String getSecUrl() {
         return secUrl;
     }
@@ -44,5 +44,5 @@ public abstract class ssCommand extends Command {
     public void setSecUrl(String secUrl) {
         this.secUrl = secUrl;
     }
-	
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
index 0186020..a361a6d 100644
--- a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
@@ -25,14 +25,14 @@ import com.cloud.utils.net.NetUtils;
 
 /**
  * FirewallRuleTO transfers a port range for an ip to be opened.
- *   
+ *
  * There are essentially three states transferred with each state.
- *      sent multiple times to the destination.  If the rule is not on 
+ *      sent multiple times to the destination.  If the rule is not on
  *   2. alreadyAdded - the rule has been successfully added before.  Rules
  *      in this state are sent for completeness and optimization.
  *      If the rule already exists on the destination, the destination should
  *      reply the rule is successfully applied.
- *      
+ *
  *   - srcPortRange: port range to open.
  *   - protocol: protocol to open for.  Usually tcp and udp.
  *
@@ -49,34 +49,34 @@ public class FirewallRuleTO {
     FirewallRule.Purpose purpose;
     private Integer icmpType;
     private Integer icmpCode;
-    
+
 
     protected FirewallRuleTO() {
     }
-    
+
     public FirewallRuleTO(long id, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded, FirewallRule.Purpose purpose, List<String> sourceCidr,Integer icmpType,Integer icmpCode) {
        this(id,null,srcIp,protocol,srcPortStart,srcPortEnd,revoked,alreadyAdded,purpose,sourceCidr,icmpType,icmpCode);
-    } 
+    }
     public FirewallRuleTO(long id,String srcVlanTag, String srcIp, String protocol, Integer srcPortStart, Integer srcPortEnd, boolean revoked, boolean alreadyAdded, FirewallRule.Purpose purpose, List<String> sourceCidr,Integer icmpType,Integer icmpCode) {
         this.srcVlanTag = srcVlanTag;
         this.srcIp = srcIp;
         this.protocol = protocol;
-        
+
         if (srcPortStart != null) {
             List<Integer> portRange = new ArrayList<Integer>();
             portRange.add(srcPortStart);
             if (srcPortEnd != null) {
                 portRange.add(srcPortEnd);
             }
-            
+
             srcPortRange = new int[portRange.size()];
             int i = 0;
             for (Integer port : portRange) {
                 srcPortRange[i] = port.intValue();
                 i ++;
-            }   
-        } 
-        
+            }
+        }
+
         this.revoked = revoked;
         this.alreadyAdded = alreadyAdded;
         this.purpose = purpose;
@@ -87,11 +87,11 @@ public class FirewallRuleTO {
     public FirewallRuleTO(FirewallRule rule, String srcVlanTag, String srcIp) {
         this(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(),rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
     }
-    
+
     public FirewallRuleTO(FirewallRule rule, String srcIp) {
         this(rule.getId(),null, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(),rule.getSourceCidrList(),rule.getIcmpType(),rule.getIcmpCode());
     }
-    
+
     public long getId() {
         return id;
     }
@@ -99,7 +99,7 @@ public class FirewallRuleTO {
     public String getSrcVlanTag() {
     	return srcVlanTag;
     }
-    
+
     public String getSrcIp() {
         return srcIp;
     }
@@ -111,15 +111,15 @@ public class FirewallRuleTO {
     public int[] getSrcPortRange() {
         return srcPortRange;
     }
-    
+
     public Integer getIcmpType(){
     	return icmpType;
     }
-    
+
     public Integer getIcmpCode(){
-    	return icmpCode;  
+    	return icmpCode;
     }
-    
+
     public String getStringSrcPortRange() {
     	if (srcPortRange == null || srcPortRange.length < 2)
     		return "0:0";
@@ -130,11 +130,11 @@ public class FirewallRuleTO {
     public boolean revoked() {
         return revoked;
     }
-    
+
     public List<String> getSourceCidrList() {
         return sourceCidrList;
     }
-    
+
     public boolean isAlreadyAdded() {
         return alreadyAdded;
     }
@@ -142,5 +142,5 @@ public class FirewallRuleTO {
     public FirewallRule.Purpose getPurpose() {
         return purpose;
     }
-    
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/HostTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/HostTO.java b/api/src/com/cloud/agent/api/to/HostTO.java
index f7b734c..967a63d 100644
--- a/api/src/com/cloud/agent/api/to/HostTO.java
+++ b/api/src/com/cloud/agent/api/to/HostTO.java
@@ -24,10 +24,10 @@ public class HostTO {
     private NetworkTO publicNetwork;
     private NetworkTO storageNetwork1;
     private NetworkTO storageNetwork2;
-    
+
     protected HostTO() {
     }
-    
+
     public HostTO(Host vo) {
         guid = vo.getGuid();
         privateNetwork = new NetworkTO(vo.getPrivateIpAddress(), vo.getPrivateNetmask(), vo.getPrivateMacAddress());

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/NetworkACLTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/NetworkACLTO.java b/api/src/com/cloud/agent/api/to/NetworkACLTO.java
index 3cdf8fb..9930b75 100644
--- a/api/src/com/cloud/agent/api/to/NetworkACLTO.java
+++ b/api/src/com/cloud/agent/api/to/NetworkACLTO.java
@@ -36,32 +36,32 @@ public class NetworkACLTO {
     private Integer icmpType;
     private Integer icmpCode;
     private FirewallRule.TrafficType trafficType;
-    
+
 
     protected NetworkACLTO() {
     }
-    
+
 
     public NetworkACLTO(long id,String vlanTag, String protocol, Integer portStart, Integer portEnd, boolean revoked,
             boolean alreadyAdded, List<String> cidrList, Integer icmpType,Integer icmpCode,TrafficType trafficType) {
         this.vlanTag = vlanTag;
         this.protocol = protocol;
-        
+
         if (portStart != null) {
             List<Integer> range = new ArrayList<Integer>();
             range.add(portStart);
             if (portEnd != null) {
                 range.add(portEnd);
             }
-            
+
             portRange = new int[range.size()];
             int i = 0;
             for (Integer port : range) {
                 portRange[i] = port.intValue();
                 i ++;
-            }   
-        } 
-        
+            }
+        }
+
         this.revoked = revoked;
         this.alreadyAdded = alreadyAdded;
         this.cidrList = cidrList;
@@ -71,11 +71,11 @@ public class NetworkACLTO {
     }
 
     public NetworkACLTO(FirewallRule rule, String vlanTag, FirewallRule.TrafficType  trafficType ) {
-        this(rule.getId(), vlanTag, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(), 
+        this(rule.getId(), vlanTag, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(),
                 rule.getState() == FirewallRule.State.Revoke, rule.getState() == FirewallRule.State.Active,
                 rule.getSourceCidrList() ,rule.getIcmpType(), rule.getIcmpCode(),trafficType);
     }
-    
+
     public long getId() {
         return id;
     }
@@ -91,15 +91,15 @@ public class NetworkACLTO {
     public int[] getSrcPortRange() {
         return portRange;
     }
-    
+
     public Integer getIcmpType(){
     	return icmpType;
     }
-    
+
     public Integer getIcmpCode(){
-    	return icmpCode;  
+    	return icmpCode;
     }
-    
+
     public String getStringPortRange() {
     	if (portRange == null || portRange.length < 2)
     		return "0:0";
@@ -110,11 +110,11 @@ public class NetworkACLTO {
     public boolean revoked() {
         return revoked;
     }
-    
+
     public List<String> getSourceCidrList() {
         return cidrList;
     }
-    
+
     public boolean isAlreadyAdded() {
         return alreadyAdded;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/NetworkTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/NetworkTO.java b/api/src/com/cloud/agent/api/to/NetworkTO.java
index ad9d4d9..3edd4c0 100644
--- a/api/src/com/cloud/agent/api/to/NetworkTO.java
+++ b/api/src/com/cloud/agent/api/to/NetworkTO.java
@@ -100,7 +100,7 @@ public class NetworkTO {
 
     /**
      * This constructor is usually for hosts where the other information are not important.
-     * 
+     *
      * @param ip ip address
      * @param netmask netmask
      * @param mac mac address
@@ -112,7 +112,7 @@ public class NetworkTO {
     /**
      * This is the full constructor and should be used for VM's network as it contains
      * the full information about what is needed.
-     * 
+     *
      * @param ip
      * @param vlan
      * @param netmask

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/NicTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/NicTO.java b/api/src/com/cloud/agent/api/to/NicTO.java
index 79a43d2..aa2aa19 100644
--- a/api/src/com/cloud/agent/api/to/NicTO.java
+++ b/api/src/com/cloud/agent/api/to/NicTO.java
@@ -26,45 +26,45 @@ public class NicTO extends NetworkTO {
     public NicTO() {
         super();
     }
-    
+
     public void setDeviceId(int deviceId) {
         this.deviceId = deviceId;
     }
-    
+
     public int getDeviceId() {
         return deviceId;
     }
-    
+
     public Integer getNetworkRateMbps() {
         return networkRateMbps;
     }
-    
+
     public void setNetworkRateMbps(Integer networkRateMbps) {
         this.networkRateMbps = networkRateMbps;
     }
-    
+
     public Integer getNetworkRateMulticastMbps() {
         return networkRateMulticastMbps;
     }
-    
+
     public boolean isDefaultNic() {
         return defaultNic;
     }
-    
+
     public void setDefaultNic(boolean defaultNic) {
         this.defaultNic = defaultNic;
     }
-    
+
     @Override
     public String getUuid() {
         return uuid;
     }
-    
+
     @Override
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
-    
+
     @Override
     public String toString() {
         return new StringBuilder("[Nic:").append(type).append("-").append(ip).append("-").append(broadcastUri).append("]").toString();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java b/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
index c99a376..9ef8d0a 100644
--- a/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
@@ -22,23 +22,23 @@ import com.cloud.utils.net.NetUtils;
 
 /**
  * PortForwardingRuleTO specifies one port forwarding rule.
- * 
+ *
  *
  */
 public class PortForwardingRuleTO extends FirewallRuleTO {
     String dstIp;
     int[] dstPortRange;
-    
+
     protected PortForwardingRuleTO() {
         super();
     }
-    
+
     public PortForwardingRuleTO(PortForwardingRule rule, String srcVlanTag, String srcIp) {
         super(rule, srcVlanTag, srcIp);
         this.dstIp = rule.getDestinationIpAddress().addr();
         this.dstPortRange = new int[] { rule.getDestinationPortStart(), rule.getDestinationPortEnd() };
     }
-    
+
     protected PortForwardingRuleTO(long id, String srcIp, int srcPortStart, int srcPortEnd, String dstIp, int dstPortStart, int dstPortEnd, String protocol, boolean revoked, boolean brandNew) {
         super(id, srcIp,null, protocol, srcPortStart, srcPortEnd, revoked, brandNew, FirewallRule.Purpose.PortForwarding, null,0,0);
         this.dstIp = dstIp;
@@ -56,5 +56,5 @@ public class PortForwardingRuleTO extends FirewallRuleTO {
     public String getStringDstPortRange() {
         return NetUtils.portRangeToString(dstPortRange);
     }
-    
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java b/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
index fd77dd6..c85b99a 100644
--- a/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
@@ -22,27 +22,27 @@ import com.cloud.network.rules.StaticNatRule;
 
 /**
  * StaticNatRuleTO specifies one static nat rule.
- * 
+ *
  *
  */
 
 public class StaticNatRuleTO extends FirewallRuleTO{
     String dstIp;
-    
+
     protected StaticNatRuleTO() {
     }
-   
+
     public StaticNatRuleTO(StaticNatRule rule, String srcVlanTag, String srcIp, String dstIp) {
         super(rule.getId(),srcVlanTag, srcIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(),rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(), null,0,0);
         this.dstIp = dstIp;
     }
- 
+
     public StaticNatRuleTO(StaticNatRule rule, String scrIp, String dstIp) {
         super(rule.getId(), scrIp, rule.getProtocol(), rule.getSourcePortStart(), rule.getSourcePortEnd(),rule.getState()==State.Revoke, rule.getState()==State.Active, rule.getPurpose(), null,0,0);
         this.dstIp = dstIp;
     }
-    
-    
+
+
     public StaticNatRuleTO(long id, String srcIp, Integer srcPortStart, Integer srcPortEnd, String dstIp, Integer dstPortStart, Integer dstPortEnd, String protocol, boolean revoked, boolean alreadyAdded) {
         super(id, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.StaticNat, null,0,0);
         this.dstIp = dstIp;
@@ -51,5 +51,5 @@ public class StaticNatRuleTO extends FirewallRuleTO{
     public String getDstIp() {
         return dstIp;
     }
-    
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/StorageFilerTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/StorageFilerTO.java b/api/src/com/cloud/agent/api/to/StorageFilerTO.java
index 26344da..8f58c9e 100644
--- a/api/src/com/cloud/agent/api/to/StorageFilerTO.java
+++ b/api/src/com/cloud/agent/api/to/StorageFilerTO.java
@@ -27,7 +27,7 @@ public class StorageFilerTO {
     String userInfo;
     int port;
     StoragePoolType type;
-    
+
     public StorageFilerTO(StoragePool pool) {
         this.id = pool.getId();
         this.host = pool.getHostAddress();
@@ -61,14 +61,14 @@ public class StorageFilerTO {
     public int getPort() {
         return port;
     }
-    
+
     public StoragePoolType getType() {
         return type;
     }
-    
+
     protected StorageFilerTO() {
     }
-    
+
     @Override
     public String toString() {
         return new StringBuilder("Pool[").append(id).append("|").append(host).append(":").append(port).append("|").append(path).append("]").toString();

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/SwiftTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/SwiftTO.java b/api/src/com/cloud/agent/api/to/SwiftTO.java
index 7920ce8..32742c7 100644
--- a/api/src/com/cloud/agent/api/to/SwiftTO.java
+++ b/api/src/com/cloud/agent/api/to/SwiftTO.java
@@ -15,15 +15,15 @@
 // specific language governing permissions and limitations
 // under the License.
 package com.cloud.agent.api.to;
-  
+
 public class SwiftTO {
     Long id;
     String url;
     String account;
-        
+
     String userName;
     String key;
-            
+
     public SwiftTO() { }
 
     public SwiftTO(Long id, String url, String account, String userName, String key) {
@@ -33,7 +33,7 @@ public class SwiftTO {
         this.userName = userName;
         this.key = key;
     }
-    
+
     public Long getId() {
         return id;
     }
@@ -53,6 +53,6 @@ public class SwiftTO {
     public String getKey() {
         return key;
     }
-    
+
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/TemplateTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/TemplateTO.java b/api/src/com/cloud/agent/api/to/TemplateTO.java
index e163340..7598398 100644
--- a/api/src/com/cloud/agent/api/to/TemplateTO.java
+++ b/api/src/com/cloud/agent/api/to/TemplateTO.java
@@ -23,16 +23,16 @@ public class TemplateTO {
     private long id;
     private String uniqueName;
     private ImageFormat format;
-    
+
     protected TemplateTO() {
     }
-    
+
     public TemplateTO(VirtualMachineTemplate template) {
         this.id = template.getId();
         this.uniqueName = template.getUniqueName();
         this.format = template.getFormat();
     }
-    
+
     public long getId() {
         return id;
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/to/VirtualMachineTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/VirtualMachineTO.java b/api/src/com/cloud/agent/api/to/VirtualMachineTO.java
index a93c242..8f3f0eb 100644
--- a/api/src/com/cloud/agent/api/to/VirtualMachineTO.java
+++ b/api/src/com/cloud/agent/api/to/VirtualMachineTO.java
@@ -108,7 +108,7 @@ public class VirtualMachineTO {
     public boolean getLimitCpuUse() {
     	return limitCpuUse;
     }
-    
+
     public long getMinRam() {
         return minRam;
     }
@@ -185,11 +185,11 @@ public class VirtualMachineTO {
     public void setNics(NicTO[] nics) {
         this.nics = nics;
     }
-    
+
     public String getVncPassword() {
     	return this.vncPassword;
     }
-    
+
     public void setVncPassword(String vncPassword) {
     	this.vncPassword = vncPassword;
     }
@@ -201,11 +201,11 @@ public class VirtualMachineTO {
     public void setVncAddr(String vncAddr) {
         this.vncAddr = vncAddr;
     }
-    
+
     public Map<String, String> getDetails() {
     	return params;
     }
-    
+
     public void setDetails(Map<String, String> params) {
     	this.params = params;
     }
@@ -217,6 +217,6 @@ public class VirtualMachineTO {
     public void setUuid(String uuid) {
         this.uuid = uuid;
     }
-    
-    
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java b/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java
index 23f0a7e..10001b1 100644
--- a/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java
+++ b/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java
@@ -20,8 +20,8 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
 import com.cloud.agent.api.to.SwiftTO;
 
 /**
- * 
- * 
+ *
+ *
  */
 
 public class uploadTemplateToSwiftFromSecondaryStorageCommand extends Command {
@@ -34,9 +34,9 @@ public class uploadTemplateToSwiftFromSecondaryStorageCommand extends Command {
     private Long templateId;
 
     protected uploadTemplateToSwiftFromSecondaryStorageCommand() {
-        
+
     }
-   
+
     public uploadTemplateToSwiftFromSecondaryStorageCommand(SwiftTO swift, String secondaryStorageUrl, Long dcId, Long accountId, Long templateId, int wait) {
 
         this.swift = swift;
@@ -77,4 +77,4 @@ public class uploadTemplateToSwiftFromSecondaryStorageCommand extends Command {
         return true;
     }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/.gitignore
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/.gitignore b/api/src/com/cloud/api/commands/.gitignore
index 63e3fa0..6204278 100644
--- a/api/src/com/cloud/api/commands/.gitignore
+++ b/api/src/com/cloud/api/commands/.gitignore
@@ -5,9 +5,9 @@
 # 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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/ActivateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/ActivateProjectCmd.java b/api/src/com/cloud/api/commands/ActivateProjectCmd.java
deleted file mode 100644
index 24a3510..0000000
--- a/api/src/com/cloud/api/commands/ActivateProjectCmd.java
+++ /dev/null
@@ -1,100 +0,0 @@
-// 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.api.commands;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.ProjectResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.projects.Project;
-import com.cloud.user.UserContext;
-
-@Implementation(description="Activates a project", responseObject=ProjectResponse.class, since="3.0.0")
-public class ActivateProjectCmd extends BaseAsyncCmd {
-    public static final Logger s_logger = Logger.getLogger(ActivateProjectCmd.class.getName());
-
-    private static final String s_name = "activaterojectresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    
-    @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of the project to be modified")
-    private Long id;
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-    
-    
-    @Override
-    public long getEntityOwnerId() {
-        Project project= _projectService.getProject(getId());
-        //verify input parameters
-        if (project == null) {
-            throw new InvalidParameterValueException("Unable to find project by id " + getId());
-        } 
-        
-        return _projectService.getProjectOwner(getId()).getId(); 
-    }
- 
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public void execute(){
-        UserContext.current().setEventDetails("Project id: "+ getId());
-        Project project = _projectService.activateProject(getId());
-        if (project != null) {
-            ProjectResponse response = _responseGenerator.createProjectResponse(project);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to activate a project");
-        }
-    }
-    
-    @Override
-    public String getEventType() {
-        return EventTypes.EVENT_PROJECT_ACTIVATE;
-    }
-    
-    @Override
-    public String getEventDescription() {
-        return  "Activating project: " + id;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java b/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
index 22b36b8..0e5fe56 100644
--- a/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
+++ b/api/src/com/cloud/api/commands/AddAccountToProjectCmd.java
@@ -45,10 +45,10 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
     @IdentityMapper(entityTableName="projects")
     @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, required=true, description="id of the project to add the account to")
     private Long projectId;
-    
+
     @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="name of the account to be added to the project")
     private String accountName;
-    
+
     @Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, description="email to which invitation to the project is going to be sent")
     private String email;
 
@@ -65,7 +65,7 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
         return projectId;
     }
 
-    
+
     public String getEmail() {
         return email;
     }
@@ -84,7 +84,7 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
         if (accountName == null && email == null) {
             throw new InvalidParameterValueException("Either accountName or email is required");
         }
-        
+
         UserContext.current().setEventDetails("Project id: "+ projectId + "; accountName " + accountName);
         boolean result = _projectService.addAccountToProject(getProjectId(), getAccountName(), getEmail());
         if (result) {
@@ -94,31 +94,31 @@ public class AddAccountToProjectCmd extends BaseAsyncCmd {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add account to the project");
         }
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         Project project= _projectService.getProject(getProjectId());
         //verify input parameters
         if (project == null) {
-        	InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id");
-        	ex.addProxyObject(project, getProjectId(), "projectId");            
+            InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find project with specified id");
+            ex.addProxyObject(project, getProjectId(), "projectId");
             throw ex;
-        } 
-        
-        return _projectService.getProjectOwner(getProjectId()).getId(); 
+        }
+
+        return _projectService.getProjectOwner(getProjectId()).getId();
     }
-    
+
     @Override
     public String getEventType() {
         return EventTypes.EVENT_PROJECT_ACCOUNT_ADD;
     }
-    
+
     @Override
     public String getEventDescription() {
         if (accountName != null) {
             return  "Adding account " + getAccountName() + " to project: " + getProjectId();
         } else {
             return  "Sending invitation to email " + email + " to join project: " + getProjectId();
-        }  
+        }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/com/cloud/api/commands/AddClusterCmd.java
index 4191554..dc93e66 100755
--- a/api/src/com/cloud/api/commands/AddClusterCmd.java
+++ b/api/src/com/cloud/api/commands/AddClusterCmd.java
@@ -1,181 +1,181 @@
-// 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.api.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseCmd;
-import org.apache.cloudstack.api.IdentityMapper;
-import org.apache.cloudstack.api.Implementation;
-import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.ServerApiException;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.exception.DiscoveryException;
-import com.cloud.exception.ResourceInUseException;
-import com.cloud.org.Cluster;
-import com.cloud.user.Account;
-import com.cloud.utils.IdentityProxy;
-
-@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
-public class AddClusterCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
-
-    private static final String s_name = "addclusterresponse";
-    
-    @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, required=true, description="the cluster name")
-    private String clusterName;
-
-    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
-    private String password;
-
-    @IdentityMapper(entityTableName="host_pod_ref")
-    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
-    private Long podId;
-
-    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
-    private String url;
-
-    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
-    private String username;
-
-    @IdentityMapper(entityTableName="data_center")
-
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
-    private Long zoneId;
-    
-    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
-    private String hypervisor;
-    
-    @Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, required=true, description="type of the cluster: CloudManaged, ExternalManaged")
-    private String clusterType;
-    
-    @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
-    private String allocationState;
-    
-    @Parameter(name = ApiConstants.VSM_USERNAME, type = CommandType.STRING, required = false, description = "the username for the VSM associated with this cluster")
-    private String vsmusername;
-
-    @Parameter(name = ApiConstants.VSM_PASSWORD, type = CommandType.STRING, required = false, description = "the password for the VSM associated with this cluster")
-    private String vsmpassword;
-
-    @Parameter(name = ApiConstants.VSM_IPADDRESS, type = CommandType.STRING, required = false, description = "the ipaddress of the VSM associated with this cluster")
-    private String vsmipaddress;
-    
-    public String getVSMIpaddress() {
-        return vsmipaddress;
-    }
-
-    public String getVSMPassword() {
-        return vsmpassword;
-    }
-
-    public String getVSMUsername() {
-        return vsmusername;
-    }
-
-    public String getClusterName() {
-        return clusterName;
-    }
-
-    public String getPassword() {
-        return password;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public String getUsername() {
-        return username;
-    }
-
-    public Long getZoneId() {
-        return zoneId;
-    }
-    
-    public String getHypervisor() {
-    	return hypervisor;
-    }
-    
-    @Override
-    public String getCommandName() {
-    	return s_name;
-    }
-    
-    public String getClusterType() {
-    	return clusterType;
-    }
-    
-    public void setClusterType(String type) {
-    	this.clusterType = type;
-    }
-    
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-    
-    public String getAllocationState() {
-    	return allocationState;
-    }
-    
-    public void setAllocationState(String allocationState) {
-    	this.allocationState = allocationState;
-    }    
-
-    @Override
-    public void execute(){
-        try {
-            List<? extends Cluster> result = _resourceService.discoverCluster(this);
-            ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
-            List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
-            if (result != null && result.size() > 0) {
-                for (Cluster cluster : result) {
-                    ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
-                    clusterResponses.add(clusterResponse);
-                }
-            } else {
-                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add cluster");
-            }
-
-            response.setResponses(clusterResponses);
-            response.setResponseName(getCommandName());
-            
-            this.setResponseObject(response);
-        } catch (DiscoveryException ex) {
-            s_logger.warn("Exception: ", ex);
-            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-        } catch (ResourceInUseException ex) {
-            s_logger.warn("Exception: ", ex);
-            ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
-            for (IdentityProxy proxyObj : ex.getIdProxyList()) {
-                e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName());
-            }
-            throw e;
-        }
-    }
-}
+// 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.api.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.IdentityMapper;
+import org.apache.cloudstack.api.Implementation;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import com.cloud.api.response.ClusterResponse;
+import com.cloud.api.response.ListResponse;
+import com.cloud.exception.DiscoveryException;
+import com.cloud.exception.ResourceInUseException;
+import com.cloud.org.Cluster;
+import com.cloud.user.Account;
+import com.cloud.utils.IdentityProxy;
+
+@Implementation(description="Adds a new cluster", responseObject=ClusterResponse.class)
+public class AddClusterCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
+
+    private static final String s_name = "addclusterresponse";
+
+    @Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, required=true, description="the cluster name")
+    private String clusterName;
+
+    @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=false, description="the password for the host")
+    private String password;
+
+    @IdentityMapper(entityTableName="host_pod_ref")
+    @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="the Pod ID for the host")
+    private Long podId;
+
+    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
+    private String url;
+
+    @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=false, description="the username for the cluster")
+    private String username;
+
+    @IdentityMapper(entityTableName="data_center")
+
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the cluster")
+    private Long zoneId;
+
+    @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the cluster: XenServer,KVM,VMware,Hyperv,BareMetal,Simulator")
+    private String hypervisor;
+
+    @Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, required=true, description="type of the cluster: CloudManaged, ExternalManaged")
+    private String clusterType;
+
+    @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this cluster for allocation of new resources")
+    private String allocationState;
+
+    @Parameter(name = ApiConstants.VSM_USERNAME, type = CommandType.STRING, required = false, description = "the username for the VSM associated with this cluster")
+    private String vsmusername;
+
+    @Parameter(name = ApiConstants.VSM_PASSWORD, type = CommandType.STRING, required = false, description = "the password for the VSM associated with this cluster")
+    private String vsmpassword;
+
+    @Parameter(name = ApiConstants.VSM_IPADDRESS, type = CommandType.STRING, required = false, description = "the ipaddress of the VSM associated with this cluster")
+    private String vsmipaddress;
+
+    public String getVSMIpaddress() {
+        return vsmipaddress;
+    }
+
+    public String getVSMPassword() {
+        return vsmpassword;
+    }
+
+    public String getVSMUsername() {
+        return vsmusername;
+    }
+
+    public String getClusterName() {
+        return clusterName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public Long getPodId() {
+        return podId;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public Long getZoneId() {
+        return zoneId;
+    }
+
+    public String getHypervisor() {
+        return hypervisor;
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    public String getClusterType() {
+        return clusterType;
+    }
+
+    public void setClusterType(String type) {
+        this.clusterType = type;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    public String getAllocationState() {
+        return allocationState;
+    }
+
+    public void setAllocationState(String allocationState) {
+        this.allocationState = allocationState;
+    }
+
+    @Override
+    public void execute(){
+        try {
+            List<? extends Cluster> result = _resourceService.discoverCluster(this);
+            ListResponse<ClusterResponse> response = new ListResponse<ClusterResponse>();
+            List<ClusterResponse> clusterResponses = new ArrayList<ClusterResponse>();
+            if (result != null && result.size() > 0) {
+                for (Cluster cluster : result) {
+                    ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
+                    clusterResponses.add(clusterResponse);
+                }
+            } else {
+                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add cluster");
+            }
+
+            response.setResponses(clusterResponses);
+            response.setResponseName(getCommandName());
+
+            this.setResponseObject(response);
+        } catch (DiscoveryException ex) {
+            s_logger.warn("Exception: ", ex);
+            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+        } catch (ResourceInUseException ex) {
+            s_logger.warn("Exception: ", ex);
+            ServerApiException e = new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
+            for (IdentityProxy proxyObj : ex.getIdProxyList()) {
+                e.addProxyObject(proxyObj.getTableName(), proxyObj.getValue(), proxyObj.getidFieldName());
+            }
+            throw e;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/com/cloud/api/commands/AddHostCmd.java
index 8afe6be..d2e06de 100755
--- a/api/src/com/cloud/api/commands/AddHostCmd.java
+++ b/api/src/com/cloud/api/commands/AddHostCmd.java
@@ -38,7 +38,7 @@ public class AddHostCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(AddHostCmd.class.getName());
 
     private static final String s_name = "addhostresponse";
-    
+
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
@@ -66,10 +66,10 @@ public class AddHostCmd extends BaseCmd {
     @IdentityMapper(entityTableName="data_center")
     @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host")
     private Long zoneId;
-    
+
     @Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, required=true, description="hypervisor type of the host")
     private String hypervisor;
-        
+
     @Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="Allocation state of this Host for allocation of new resources")
     private String allocationState;
 
@@ -107,33 +107,33 @@ public class AddHostCmd extends BaseCmd {
     public Long getZoneId() {
         return zoneId;
     }
-    
+
     public String getHypervisor() {
-    	return hypervisor;
+        return hypervisor;
     }
-    
+
     public List<String> getHostTags() {
         return hostTags;
     }
-    
+
     public String getAllocationState() {
-    	return allocationState;
-    }    
-    
+        return allocationState;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
 
     @Override
     public String getCommandName() {
-    	return s_name;
+        return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         return Account.ACCOUNT_ID_SYSTEM;
     }
-    
+
     @Override
     public void execute(){
         try {
@@ -151,7 +151,7 @@ public class AddHostCmd extends BaseCmd {
 
             response.setResponses(hostResponses);
             response.setResponseName(getCommandName());
-            
+
             this.setResponseObject(response);
         } catch (DiscoveryException ex) {
             s_logger.warn("Exception: ", ex);

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java b/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
index a382f98..30f054f 100644
--- a/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
+++ b/api/src/com/cloud/api/commands/AddNetworkServiceProviderCmd.java
@@ -44,7 +44,7 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-    
+
     @IdentityMapper(entityTableName="physical_network")
     @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID to add the provider to")
     private Long physicalNetworkId;
@@ -52,10 +52,10 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
     @IdentityMapper(entityTableName="physical_network")
     @Parameter(name=ApiConstants.DEST_PHYSICAL_NETWORK_ID, type=CommandType.LONG, description="the destination Physical Network ID to bridge to")
     private Long destinationPhysicalNetworkId;
-    
+
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name for the physical network service provider")
     private String name;
-    
+
     @Parameter(name=ApiConstants.SERVICE_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of services to be enabled for this physical network service provider")
     private List<String> enabledServices;
 
@@ -67,7 +67,7 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
-    
+
     public Long getPhysicalNetworkId() {
         return physicalNetworkId;
     }
@@ -92,12 +92,12 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
     public String getCommandName() {
         return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         return Account.ACCOUNT_ID_SYSTEM;
     }
-    
+
     @Override
     public void execute(){
         UserContext.current().setEventDetails("Network ServiceProvider Id: "+getEntityId());
@@ -118,19 +118,19 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
             setEntityId(result.getId());
         } else {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add service provider entity to physical network");
-        }        
+        }
     }
 
     @Override
     public String getEventType() {
         return EventTypes.EVENT_SERVICE_PROVIDER_CREATE;
     }
-    
+
     @Override
     public String getEventDescription() {
         return  "Adding physical network ServiceProvider: " + getEntityId();
     }
-    
+
     @Override
     public AsyncJob.Type getInstanceType() {
         return AsyncJob.Type.PhysicalNetworkServiceProvider;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
index 85b79b9..c1946d0 100644
--- a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
+++ b/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
@@ -35,7 +35,7 @@ import com.cloud.user.Account;
 public class AddSecondaryStorageCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(AddSecondaryStorageCmd.class.getName());
     private static final String s_name = "addsecondarystorageresponse";
-     
+
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
@@ -65,14 +65,14 @@ public class AddSecondaryStorageCmd extends BaseCmd {
 
     @Override
     public String getCommandName() {
-    	return s_name;
+        return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         return Account.ACCOUNT_ID_SYSTEM;
     }
-    
+
     @Override
     public void execute(){
         try {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddSwiftCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddSwiftCmd.java b/api/src/com/cloud/api/commands/AddSwiftCmd.java
index d953be7..e0882c7 100644
--- a/api/src/com/cloud/api/commands/AddSwiftCmd.java
+++ b/api/src/com/cloud/api/commands/AddSwiftCmd.java
@@ -33,7 +33,7 @@ import com.cloud.user.Account;
 public class AddSwiftCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(AddSwiftCmd.class.getName());
     private static final String s_name = "addswiftresponse";
-     
+
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
@@ -76,14 +76,14 @@ public class AddSwiftCmd extends BaseCmd {
 
     @Override
     public String getCommandName() {
-    	return s_name;
+        return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         return Account.ACCOUNT_ID_SYSTEM;
     }
-    
+
     @Override
     public void execute(){
         try {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java b/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
index 13dfad6..9ca682c 100644
--- a/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
+++ b/api/src/com/cloud/api/commands/AddTrafficTypeCmd.java
@@ -42,30 +42,30 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
     /////////////////////////////////////////////////////
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
-    
+
     @IdentityMapper(entityTableName="physical_network")
     @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID")
     private Long physicalNetworkId;
-    
+
     @Parameter(name=ApiConstants.TRAFFIC_TYPE, type=CommandType.STRING, required=true, description="the trafficType to be added to the physical network")
     private String trafficType;
-    
+
     @Parameter(name=ApiConstants.XEN_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a XenServer host")
     private String xenLabel;
-    
+
     @Parameter(name=ApiConstants.KVM_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a KVM host")
     private String kvmLabel;
-    
+
     @Parameter(name=ApiConstants.VMWARE_NETWORK_LABEL, type=CommandType.STRING, description="The network name label of the physical device dedicated to this traffic on a VMware host")
     private String vmwareLabel;
-        
+
     @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="The VLAN id to be used for Management traffic by VMware host")
     private String vlan;
 
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
-    
+
     @Override
     public String getEntityTable() {
         return "physical_network_traffic_types";
@@ -90,10 +90,10 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
     public String getVmwareLabel() {
         return vmwareLabel;
     }
-    
+
     public String getSimulatorLabel() {
-    	//simulators will have no labels
-    	return null; 
+        //simulators will have no labels
+        return null;
     }
 
     public void setVlan(String vlan) {
@@ -112,12 +112,12 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
     public String getCommandName() {
         return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         return Account.ACCOUNT_ID_SYSTEM;
     }
-    
+
     @Override
     public void execute(){
         UserContext.current().setEventDetails("TrafficType Id: "+getEntityId());
@@ -138,19 +138,19 @@ public class AddTrafficTypeCmd extends BaseAsyncCreateCmd {
             setEntityId(result.getId());
         } else {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add traffic type to physical network");
-        }        
+        }
     }
 
     @Override
     public String getEventType() {
         return EventTypes.EVENT_TRAFFIC_TYPE_CREATE;
     }
-    
+
     @Override
     public String getEventDescription() {
         return  "Adding physical network traffic type: " + getEntityId();
     }
-    
+
     @Override
     public AsyncJob.Type getInstanceType() {
         return AsyncJob.Type.TrafficType;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AddVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AddVpnUserCmd.java b/api/src/com/cloud/api/commands/AddVpnUserCmd.java
index 15964dd..3a6f38c 100644
--- a/api/src/com/cloud/api/commands/AddVpnUserCmd.java
+++ b/api/src/com/cloud/api/commands/AddVpnUserCmd.java
@@ -43,13 +43,13 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
     /////////////////////////////////////////////////////
     @Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="username for the vpn user")
     private String userName;
-    
+
     @Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="password for the username")
     private String password;
-    
+
     @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="an optional account for the vpn user. Must be used with domainId.")
     private String accountName;
-    
+
     @IdentityMapper(entityTableName="projects")
     @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="add vpn user to the specific project")
     private Long projectId;
@@ -57,64 +57,64 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
     @IdentityMapper(entityTableName="domain")
     @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="an optional domainId for the vpn user. If the account parameter is used, domainId must also be used.")
     private Long domainId;
-    
+
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
     /////////////////////////////////////////////////////
 
 
-	public String getAccountName() {
-		return accountName;
-	}
-
-	public Long getDomainId() {
-		return domainId;
-	}
-
-	public String getUserName() {
-		return userName;
-	}
-	
-	public String getPassword() {
-		return password;
-	}
-	
-	public Long getProjectId() {
-	    return projectId;
-	}
-	
+    public String getAccountName() {
+        return accountName;
+    }
+
+    public Long getDomainId() {
+        return domainId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public Long getProjectId() {
+        return projectId;
+    }
+
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////
     /////////////////////////////////////////////////////
 
-	@Override
+    @Override
     public String getCommandName() {
         return s_name;
     }
 
-	@Override
-	public long getEntityOwnerId() {
+    @Override
+    public long getEntityOwnerId() {
         Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
         if (accountId == null) {
             return UserContext.current().getCaller().getId();
         }
-        
+
         return accountId;
     }
-	
+
     public String getEntityTable() {
-    	return "vpn_users";
+        return "vpn_users";
     }
 
-	@Override
-	public String getEventDescription() {
-		return "Add Remote Access VPN user for account " + getEntityOwnerId() + " username= " + getUserName();
-	}
+    @Override
+    public String getEventDescription() {
+        return "Add Remote Access VPN user for account " + getEntityOwnerId() + " username= " + getUserName();
+    }
 
-	@Override
-	public String getEventType() {
-		return EventTypes.EVENT_VPN_USER_ADD;
-	}
+    @Override
+    public String getEventType() {
+        return EventTypes.EVENT_VPN_USER_ADD;
+    }
 
     @Override
     public void execute(){
@@ -123,15 +123,15 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
             if (!_ravService.applyVpnUsers(vpnUser.getAccountId(), userName)) {
                 throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
             }
-            
+
             VpnUsersResponse vpnResponse = new VpnUsersResponse();
             vpnResponse.setId(vpnUser.getId());
             vpnResponse.setUserName(vpnUser.getUsername());
             vpnResponse.setAccountName(account.getAccountName());
-            
+
             vpnResponse.setDomainId(account.getDomainId());
             vpnResponse.setDomainName(_entityMgr.findById(Domain.class, account.getDomainId()).getName());
-            
+
             vpnResponse.setResponseName(getCommandName());
             vpnResponse.setObjectName("vpnuser");
             this.setResponseObject(vpnResponse);
@@ -140,11 +140,11 @@ public class AddVpnUserCmd extends BaseAsyncCreateCmd {
     @Override
     public void create() {
         Account owner = _accountService.getAccount(getEntityOwnerId());
-     
+
         VpnUser vpnUser = _ravService.addVpnUser(owner.getId(), userName, password);
         if (vpnUser == null) {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to add vpn user");
         }
         setEntityId(vpnUser.getId());
-    }	
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java b/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
index 04026d3..fc99113 100644
--- a/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/com/cloud/api/commands/AssignToLoadBalancerRuleCmd.java
@@ -92,7 +92,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
     public String getEventDescription() {
         return "applying instances for load balancer: " + getLoadBalancerId() + " (ids: " + StringUtils.join(getVirtualMachineIds(), ",") + ")";
     }
-    
+
     @Override
     public void execute(){
         UserContext.current().setEventDetails("Load balancer Id: "+getLoadBalancerId()+" VmIds: "+StringUtils.join(getVirtualMachineIds(), ","));
@@ -104,7 +104,7 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign load balancer rule");
         }
     }
-    
+
     @Override
     public String getSyncObjType() {
         return BaseAsyncCmd.networkSyncObject;
@@ -112,10 +112,10 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd {
 
     @Override
     public Long getSyncObjId() {
-    	LoadBalancer lb = _lbService.findById(id);
-    	if(lb == null){
-    		throw new InvalidParameterValueException("Unable to find load balancer rule: " + id);
-    	}
+        LoadBalancer lb = _lbService.findById(id);
+        if(lb == null){
+            throw new InvalidParameterValueException("Unable to find load balancer rule: " + id);
+        }
         return lb.getNetworkId();
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java b/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java
index 0356bc1..7057cbc 100644
--- a/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java
+++ b/api/src/com/cloud/api/commands/AssociateIPAddrCmd.java
@@ -54,33 +54,33 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     //////////////// API parameters /////////////////////
     /////////////////////////////////////////////////////
 
-    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, 
+    @Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING,
             description="the account to associate with this IP address")
     private String accountName;
 
     @IdentityMapper(entityTableName="domain")
-    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, 
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG,
         description="the ID of the domain to associate with this IP address")
     private Long domainId;
 
     @IdentityMapper(entityTableName="data_center")
-    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, 
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG,
         description="the ID of the availability zone you want to acquire an public IP address from")
     private Long zoneId;
-    
+
     @IdentityMapper(entityTableName="networks")
-    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG, 
+    @Parameter(name=ApiConstants.NETWORK_ID, type=CommandType.LONG,
         description="The network this ip address should be associated to.")
     private Long networkId;
-    
+
     @IdentityMapper(entityTableName="projects")
-    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, 
+    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG,
         description="Deploy vm for the project")
     private Long projectId;
-    
+
     @IdentityMapper(entityTableName="vpc")
     @Parameter(name=ApiConstants.VPC_ID, type=CommandType.LONG, description="the VPC you want the ip address to " +
-    		"be associated with")
+            "be associated with")
     private Long vpcId;
 
     /////////////////////////////////////////////////////
@@ -88,11 +88,11 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     /////////////////////////////////////////////////////
 
     public String getEntityTable() {
-    	return "user_ip_address";
+        return "user_ip_address";
     }
-    
+
     public String getAccountName() {
-        if (accountName != null) { 
+        if (accountName != null) {
             return accountName;
         }
         return UserContext.current().getCaller().getAccountName();
@@ -119,56 +119,56 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
                 return ntwk.getDataCenterId();
             }
         }
-        
+
         throw new InvalidParameterValueException("Unable to figure out zone to assign ip to");
     }
-    
+
     public Long getVpcId() {
         return vpcId;
     }
-    
+
     public Long getNetworkId() {
         if (vpcId != null) {
             return null;
         }
-        
+
         if (networkId != null) {
             return networkId;
-        } 
+        }
         Long zoneId = getZoneId();
-        
+
         if (zoneId == null) {
             return null;
         }
-        
+
         DataCenter zone = _configService.getZone(zoneId);
         if (zone.getNetworkType() == NetworkType.Advanced) {
-            List<? extends Network> networks = _networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(), 
+            List<? extends Network> networks = _networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(),
                     _accountService.getAccount(getEntityOwnerId()));
             if (networks.size() == 0) {
                 String domain = _domainService.getDomain(getDomainId()).getName();
-                throw new InvalidParameterValueException("Account name=" + getAccountName() + " domain=" + domain + 
+                throw new InvalidParameterValueException("Account name=" + getAccountName() + " domain=" + domain +
                         " doesn't have virtual networks in zone=" + zone.getName());
             }
-            
+
             if (networks.size() < 1) {
-            	throw new InvalidParameterValueException("Account doesn't have any Isolated networks in the zone");
+                throw new InvalidParameterValueException("Account doesn't have any Isolated networks in the zone");
             } else if (networks.size() > 1) {
-            	throw new InvalidParameterValueException("Account has more than one Isolated network in the zone");
+                throw new InvalidParameterValueException("Account has more than one Isolated network in the zone");
             }
-            
+
             return networks.get(0).getId();
         } else {
             Network defaultGuestNetwork = _networkService.getExclusiveGuestNetwork(zoneId);
             if (defaultGuestNetwork == null) {
-                throw new InvalidParameterValueException("Unable to find a default Guest network for account " + 
+                throw new InvalidParameterValueException("Unable to find a default Guest network for account " +
                         getAccountName() + " in domain id=" + getDomainId());
             } else {
                 return defaultGuestNetwork.getId();
             }
         }
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         Account caller = UserContext.current().getCaller();
@@ -193,7 +193,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     public String getEventType() {
         return EventTypes.EVENT_NET_IP_ASSIGN;
     }
-    
+
     @Override
     public String getEventDescription() {
         return  "associating ip to network id: " + getNetworkId() + " in zone " + getZoneId();
@@ -210,9 +210,9 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     }
 
     public static String getResultObjectName() {
-    	return "addressinfo";
+        return "addressinfo";
     }
-    
+
     @Override
     public void create() throws ResourceAllocationException{
         try {
@@ -231,9 +231,9 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
             throw new ServerApiException(BaseCmd.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
         }
     }
-    
+
     @Override
-    public void execute() throws ResourceUnavailableException, ResourceAllocationException, 
+    public void execute() throws ResourceUnavailableException, ResourceAllocationException,
                                     ConcurrentOperationException, InsufficientCapacityException {
         UserContext.current().setEventDetails("Ip Id: " + getEntityId());
 
@@ -242,9 +242,9 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
         if (getVpcId() != null) {
             result = _vpcService.associateIPToVpc(getEntityId(), getVpcId());
         } else if (getNetworkId() != null) {
-            result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId()); 
+            result = _networkService.associateIPToNetwork(getEntityId(), getNetworkId());
         }
-        
+
         if (result != null) {
             IPAddressResponse ipResponse = _responseGenerator.createIPAddressResponse(result);
             ipResponse.setResponseName(getCommandName());
@@ -253,8 +253,8 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
             throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to assign ip address");
         }
     }
-    
-    
+
+
     @Override
     public String getSyncObjType() {
         return BaseAsyncCmd.networkSyncObject;
@@ -264,7 +264,7 @@ public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
     public Long getSyncObjId() {
         return getNetworkId();
     }
-    
+
     @Override
     public AsyncJob.Type getInstanceType() {
         return AsyncJob.Type.IpAddress;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AttachIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AttachIsoCmd.java b/api/src/com/cloud/api/commands/AttachIsoCmd.java
index 8bd97e7..ac1be64 100755
--- a/api/src/com/cloud/api/commands/AttachIsoCmd.java
+++ b/api/src/com/cloud/api/commands/AttachIsoCmd.java
@@ -72,14 +72,14 @@ public class AttachIsoCmd extends BaseAsyncCmd {
     public String getCommandName() {
         return s_name;
     }
-    
+
     @Override
     public long getEntityOwnerId() {
         UserVm vm = _entityMgr.findById(UserVm.class, getVirtualMachineId());
         if (vm == null) {
             throw new InvalidParameterValueException("Unable to find virtual machine by id " + getVirtualMachineId());
-        } 
-        
+        }
+
         return vm.getAccountId();
     }
 
@@ -92,15 +92,15 @@ public class AttachIsoCmd extends BaseAsyncCmd {
     public String getEventDescription() {
         return  "attaching ISO: " + getId() + " to vm: " + getVirtualMachineId();
     }
-    
+
     @Override
     public void execute(){
-    	UserContext.current().setEventDetails("Vm Id: " +getVirtualMachineId()+ " ISO Id: "+getId());
+        UserContext.current().setEventDetails("Vm Id: " +getVirtualMachineId()+ " ISO Id: "+getId());
         boolean result = _templateService.attachIso(id, virtualMachineId);
         if (result) {
             UserVm userVm = _responseGenerator.findUserVmById(virtualMachineId);
             if (userVm != null) {
-                UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", userVm).get(0);            
+                UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", userVm).get(0);
                 response.setResponseName(DeployVMCmd.getResultObjectName());
                 this.setResponseObject(response);
             } else {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/5e0501d1/api/src/com/cloud/api/commands/AttachVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/api/commands/AttachVolumeCmd.java b/api/src/com/cloud/api/commands/AttachVolumeCmd.java
index fd9403c..752935b 100755
--- a/api/src/com/cloud/api/commands/AttachVolumeCmd.java
+++ b/api/src/com/cloud/api/commands/AttachVolumeCmd.java
@@ -34,7 +34,7 @@ import com.cloud.user.UserContext;
 
 @Implementation(description="Attaches a disk volume to a virtual machine.", responseObject=VolumeResponse.class)
 public class AttachVolumeCmd extends BaseAsyncCmd {
-	public static final Logger s_logger = Logger.getLogger(AttachVolumeCmd.class.getName());
+    public static final Logger s_logger = Logger.getLogger(AttachVolumeCmd.class.getName());
     private static final String s_name = "attachvolumeresponse";
 
     /////////////////////////////////////////////////////
@@ -42,16 +42,16 @@ public class AttachVolumeCmd extends BaseAsyncCmd {
     /////////////////////////////////////////////////////
 
     @Parameter(name=ApiConstants.DEVICE_ID, type=CommandType.LONG, description="the ID of the device to map the volume to within the guest OS. " +
-    																"If no deviceId is passed in, the next available deviceId will be chosen. " +
-    																"Possible values for a Linux OS are:" +
-    																"* 1 - /dev/xvdb" +
-    																"* 2 - /dev/xvdc" +
-    																"* 4 - /dev/xvde" +
-    																"* 5 - /dev/xvdf" +
-    																"* 6 - /dev/xvdg" +
-    																"* 7 - /dev/xvdh" +
-    																"* 8 - /dev/xvdi" +
-    																"* 9 - /dev/xvdj")
+                                                                    "If no deviceId is passed in, the next available deviceId will be chosen. " +
+                                                                    "Possible values for a Linux OS are:" +
+                                                                    "* 1 - /dev/xvdb" +
+                                                                    "* 2 - /dev/xvdc" +
+                                                                    "* 4 - /dev/xvde" +
+                                                                    "* 5 - /dev/xvdf" +
+                                                                    "* 6 - /dev/xvdg" +
+                                                                    "* 7 - /dev/xvdh" +
+                                                                    "* 8 - /dev/xvdi" +
+                                                                    "* 9 - /dev/xvdj")
     private Long deviceId;
 
     @IdentityMapper(entityTableName="volumes")
@@ -59,7 +59,7 @@ public class AttachVolumeCmd extends BaseAsyncCmd {
     private Long id;
 
     @IdentityMapper(entityTableName="vm_instance")
-    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="	the ID of the virtual machine")
+    @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="    the ID of the virtual machine")
     private Long virtualMachineId;
 
 
@@ -88,13 +88,13 @@ public class AttachVolumeCmd extends BaseAsyncCmd {
     public String getCommandName() {
         return s_name;
     }
-    
+
     public AsyncJob.Type getInstanceType() {
-    	return AsyncJob.Type.Volume;
+        return AsyncJob.Type.Volume;
     }
-    
+
     public Long getInstanceId() {
-    	return getId();
+        return getId();
     }
 
     @Override
@@ -115,7 +115,7 @@ public class AttachVolumeCmd extends BaseAsyncCmd {
     public String getEventDescription() {
         return  "attaching volume: " + getId() + " to vm: " + getVirtualMachineId();
     }
-    
+
     @Override
     public void execute(){
         UserContext.current().setEventDetails("Volume Id: "+getId()+" VmId: "+getVirtualMachineId());


Mime
View raw message