diff --git a/LICENSE b/LICENSE
index afb662a77e2..714f6847ae8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2012 The Apache Software Foundation
+Copyright (c) 2013 The Apache Software Foundation
Apache License
diff --git a/agent/pom.xml b/agent/pom.xml
index 8aab8dec706..810f33fc572 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -55,6 +55,57 @@
+
+ maven-antrun-plugin
+ 1.7
+
+
+ generate-resource
+ generate-resources
+
+ run
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/api/src/com/cloud/agent/api/AgentControlAnswer.java b/api/src/com/cloud/agent/api/AgentControlAnswer.java
index 1cdcc1e8322..7dbf7b509eb 100644
--- a/api/src/com/cloud/agent/api/AgentControlAnswer.java
+++ b/api/src/com/cloud/agent/api/AgentControlAnswer.java
@@ -19,11 +19,11 @@ package com.cloud.agent.api;
public class AgentControlAnswer extends Answer {
public AgentControlAnswer() {
}
-
+
public AgentControlAnswer(Command command) {
super(command);
}
-
+
public AgentControlAnswer(Command command, boolean success, String details) {
super(command, success, details);
}
diff --git a/api/src/com/cloud/agent/api/AgentControlCommand.java b/api/src/com/cloud/agent/api/AgentControlCommand.java
index 6cc8e6fde9b..da187ac4ca8 100644
--- a/api/src/com/cloud/agent/api/AgentControlCommand.java
+++ b/api/src/com/cloud/agent/api/AgentControlCommand.java
@@ -17,10 +17,10 @@
package com.cloud.agent.api;
public class AgentControlCommand extends Command {
-
+
public AgentControlCommand() {
}
-
+
public boolean executeInSequence() {
return false;
}
diff --git a/api/src/com/cloud/agent/api/Answer.java b/api/src/com/cloud/agent/api/Answer.java
index 932da233a05..655f4470097 100755
--- a/api/src/com/cloud/agent/api/Answer.java
+++ b/api/src/com/cloud/agent/api/Answer.java
@@ -21,40 +21,40 @@ import com.cloud.utils.exception.ExceptionUtil;
public class Answer extends Command {
protected boolean result;
protected String details;
-
+
protected Answer() {
}
-
+
public Answer(Command command) {
this(command, true, null);
}
-
+
public Answer(Command command, boolean success, String details) {
result = success;
this.details = details;
}
-
+
public Answer(Command command, Exception e) {
this(command, false, ExceptionUtil.toString(e));
}
-
+
public boolean getResult() {
return result;
}
-
+
public String getDetails() {
return details;
}
-
+
@Override
public boolean executeInSequence() {
return false;
}
-
+
public static UnsupportedAnswer createUnsupportedCommandAnswer(Command cmd) {
return new UnsupportedAnswer(cmd, "Unsupported command issued:" + cmd.toString() + ". Are you sure you got the right type of server?");
}
-
+
public static UnsupportedAnswer createUnsupportedVersionAnswer(Command cmd) {
return new UnsupportedAnswer(cmd, "Unsuppored Version.");
}
diff --git a/api/src/com/cloud/agent/api/AttachIsoCommand.java b/api/src/com/cloud/agent/api/AttachIsoCommand.java
index ff9da83669e..c6f0b6124b7 100644
--- a/api/src/com/cloud/agent/api/AttachIsoCommand.java
+++ b/api/src/com/cloud/agent/api/AttachIsoCommand.java
@@ -48,11 +48,11 @@ public class AttachIsoCommand extends Command {
public boolean isAttach() {
return attach;
}
-
+
public String getStoreUrl() {
return storeUrl;
}
-
+
public void setStoreUrl(String url) {
storeUrl = url;
}
diff --git a/api/src/com/cloud/agent/api/AttachVolumeAnswer.java b/api/src/com/cloud/agent/api/AttachVolumeAnswer.java
index 253b4445667..b377b7c1386 100644
--- a/api/src/com/cloud/agent/api/AttachVolumeAnswer.java
+++ b/api/src/com/cloud/agent/api/AttachVolumeAnswer.java
@@ -20,38 +20,38 @@ package com.cloud.agent.api;
public class AttachVolumeAnswer extends Answer {
private Long deviceId;
private String chainInfo;
-
+
protected AttachVolumeAnswer() {
-
+
}
-
+
public AttachVolumeAnswer(AttachVolumeCommand cmd, String result) {
super(cmd, false, result);
this.deviceId = null;
}
-
+
public AttachVolumeAnswer(AttachVolumeCommand cmd, Long deviceId) {
super(cmd);
this.deviceId = deviceId;
}
-
+
public AttachVolumeAnswer(AttachVolumeCommand cmd) {
super(cmd);
this.deviceId = null;
}
-
+
/**
* @return the deviceId
*/
public Long getDeviceId() {
return deviceId;
}
-
+
public void setChainInfo(String chainInfo) {
this.chainInfo = chainInfo;
}
-
+
public String getChainInfo() {
return chainInfo;
}
diff --git a/api/src/com/cloud/agent/api/AttachVolumeCommand.java b/api/src/com/cloud/agent/api/AttachVolumeCommand.java
index 98bfb2e485e..302b8f80af3 100644
--- a/api/src/com/cloud/agent/api/AttachVolumeCommand.java
+++ b/api/src/com/cloud/agent/api/AttachVolumeCommand.java
@@ -19,7 +19,7 @@ package com.cloud.agent.api;
import com.cloud.storage.Storage.StoragePoolType;
public class AttachVolumeCommand extends Command {
-
+
boolean attach;
String vmName;
StoragePoolType pooltype;
@@ -29,10 +29,10 @@ public class AttachVolumeCommand extends Command {
String volumeName;
Long deviceId;
String chainInfo;
-
+
protected AttachVolumeCommand() {
}
-
+
public AttachVolumeCommand(boolean attach, String vmName, StoragePoolType pooltype, String volumeFolder, String volumePath, String volumeName, Long deviceId, String chainInfo) {
this.attach = attach;
this.vmName = vmName;
@@ -43,20 +43,20 @@ public class AttachVolumeCommand extends Command {
this.deviceId = deviceId;
this.chainInfo = chainInfo;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public boolean getAttach() {
return attach;
}
-
+
public String getVmName() {
return vmName;
}
-
+
public StoragePoolType getPooltype() {
return pooltype;
}
@@ -68,11 +68,11 @@ public class AttachVolumeCommand extends Command {
public String getVolumeFolder() {
return volumeFolder;
}
-
+
public String getVolumePath() {
return volumePath;
}
-
+
public String getVolumeName() {
return volumeName;
}
@@ -84,15 +84,15 @@ public class AttachVolumeCommand extends Command {
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
-
+
public String getPoolUuid() {
return poolUuid;
}
-
+
public void setPoolUuid(String poolUuid) {
this.poolUuid = poolUuid;
}
-
+
public String getChainInfo() {
return chainInfo;
}
diff --git a/api/src/com/cloud/agent/api/BackupSnapshotAnswer.java b/api/src/com/cloud/agent/api/BackupSnapshotAnswer.java
index 707092fff07..9e35db66f57 100644
--- a/api/src/com/cloud/agent/api/BackupSnapshotAnswer.java
+++ b/api/src/com/cloud/agent/api/BackupSnapshotAnswer.java
@@ -20,11 +20,11 @@ package com.cloud.agent.api;
public class BackupSnapshotAnswer extends Answer {
private String backupSnapshotName;
private boolean full;
-
+
protected BackupSnapshotAnswer() {
-
+
}
-
+
public BackupSnapshotAnswer(BackupSnapshotCommand cmd, boolean success, String result, String backupSnapshotName, boolean full) {
super(cmd, success, result);
this.backupSnapshotName = backupSnapshotName;
@@ -37,7 +37,7 @@ public class BackupSnapshotAnswer extends Answer {
public String getBackupSnapshotName() {
return backupSnapshotName;
}
-
+
public boolean isFull() {
return full;
}
diff --git a/api/src/com/cloud/agent/api/BackupSnapshotCommand.java b/api/src/com/cloud/agent/api/BackupSnapshotCommand.java
index 7ea78356837..a0ac8d7ad71 100644
--- a/api/src/com/cloud/agent/api/BackupSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/BackupSnapshotCommand.java
@@ -23,7 +23,7 @@ import com.cloud.agent.api.to.SwiftTO;
import com.cloud.storage.StoragePool;
/**
- * This currently assumes that both primary and secondary storage are mounted on the XenServer.
+ * This currently assumes that both primary and secondary storage are mounted on the XenServer.
*/
public class BackupSnapshotCommand extends SnapshotCommand {
private String prevSnapshotUuid;
@@ -37,18 +37,18 @@ public class BackupSnapshotCommand extends SnapshotCommand {
StorageFilerTO pool;
protected BackupSnapshotCommand() {
-
+
}
-
+
/**
* @param primaryStoragePoolNameLabel The UUID of the primary storage Pool
* @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* @param snapshotUuid The UUID of the snapshot which is going to be backed up
* @param prevSnapshotUuid The UUID of the previous snapshot for this volume. This will be destroyed on the primary storage.
* @param prevBackupUuid This is the UUID of the vhd file which was last backed up on secondary storage.
- * @param firstBackupUuid This is the backup of the first ever snapshot taken by the volume.
+ * @param firstBackupUuid This is the backup of the first ever snapshot taken by the volume.
* @param isFirstSnapshotOfRootVolume true if this is the first snapshot of a root volume. Set the parent of the backup to null.
- * @param isVolumeInactive True if the volume belongs to a VM that is not running or is detached.
+ * @param isVolumeInactive True if the volume belongs to a VM that is not running or is detached.
*/
public BackupSnapshotCommand(String secondaryStoragePoolURL,
Long dcId,
@@ -63,7 +63,7 @@ public class BackupSnapshotCommand extends SnapshotCommand {
String prevBackupUuid,
boolean isVolumeInactive,
String vmName,
- int wait)
+ int wait)
{
super(pool, secondaryStoragePoolURL, snapshotUuid, snapshotName, dcId, accountId, volumeId);
this.snapshotId = snapshotId;
@@ -82,11 +82,11 @@ public class BackupSnapshotCommand extends SnapshotCommand {
public String getPrevBackupUuid() {
return prevBackupUuid;
}
-
+
public boolean isVolumeInactive() {
return isVolumeInactive;
}
-
+
public String getVmName() {
return vmName;
}
diff --git a/api/src/com/cloud/agent/api/CancelCommand.java b/api/src/com/cloud/agent/api/CancelCommand.java
index 76382736148..0692055ae5a 100644
--- a/api/src/com/cloud/agent/api/CancelCommand.java
+++ b/api/src/com/cloud/agent/api/CancelCommand.java
@@ -21,19 +21,19 @@ package com.cloud.agent.api;
public class CancelCommand extends Command {
protected long sequence;
protected String reason;
-
+
protected CancelCommand() {
}
-
+
public CancelCommand(long sequence, String reason) {
this.sequence = sequence;
this.reason = reason;
}
-
+
public long getSequence() {
return sequence;
}
-
+
public String getReason() {
return reason;
}
diff --git a/api/src/com/cloud/agent/api/ChangeAgentAnswer.java b/api/src/com/cloud/agent/api/ChangeAgentAnswer.java
index 4b3f103a8e2..537eabef2b0 100644
--- a/api/src/com/cloud/agent/api/ChangeAgentAnswer.java
+++ b/api/src/com/cloud/agent/api/ChangeAgentAnswer.java
@@ -19,7 +19,7 @@ package com.cloud.agent.api;
public class ChangeAgentAnswer extends Answer {
protected ChangeAgentAnswer() {
}
-
+
public ChangeAgentAnswer(ChangeAgentCommand cmd, boolean result) {
super(cmd, result, null);
}
diff --git a/api/src/com/cloud/agent/api/ChangeAgentCommand.java b/api/src/com/cloud/agent/api/ChangeAgentCommand.java
index 1b7f8c8507c..abdb60a619e 100644
--- a/api/src/com/cloud/agent/api/ChangeAgentCommand.java
+++ b/api/src/com/cloud/agent/api/ChangeAgentCommand.java
@@ -21,19 +21,19 @@ import com.cloud.host.Status.Event;
public class ChangeAgentCommand extends Command {
long agentId;
Event event;
-
+
protected ChangeAgentCommand() {
}
-
+
public ChangeAgentCommand(long agentId, Event event) {
this.agentId = agentId;
this.event = event;
}
-
+
public long getAgentId() {
return agentId;
}
-
+
public Event getEvent() {
return event;
}
diff --git a/api/src/com/cloud/agent/api/CheckHealthCommand.java b/api/src/com/cloud/agent/api/CheckHealthCommand.java
index 5298f5a76c8..ff4227678a9 100644
--- a/api/src/com/cloud/agent/api/CheckHealthCommand.java
+++ b/api/src/com/cloud/agent/api/CheckHealthCommand.java
@@ -22,7 +22,7 @@ public class CheckHealthCommand extends Command {
setWait(50);
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/CheckNetworkAnswer.java b/api/src/com/cloud/agent/api/CheckNetworkAnswer.java
index 2188fa632d9..52825fd1140 100644
--- a/api/src/com/cloud/agent/api/CheckNetworkAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckNetworkAnswer.java
@@ -20,7 +20,7 @@ public class CheckNetworkAnswer extends Answer {
// indicate if agent reconnect is needed after setupNetworkNames command
private boolean _reconnect;
public CheckNetworkAnswer() {}
-
+
public CheckNetworkAnswer(CheckNetworkCommand cmd, boolean result, String details, boolean reconnect) {
super(cmd, result, details);
@@ -34,5 +34,5 @@ public class CheckNetworkAnswer extends Answer {
public boolean needReconnect() {
return _reconnect;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/CheckOnHostAnswer.java b/api/src/com/cloud/agent/api/CheckOnHostAnswer.java
index 2a053fdad1b..e5325e3e9dd 100644
--- a/api/src/com/cloud/agent/api/CheckOnHostAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckOnHostAnswer.java
@@ -19,10 +19,10 @@ package com.cloud.agent.api;
public class CheckOnHostAnswer extends Answer {
boolean determined;
boolean alive;
-
+
protected CheckOnHostAnswer() {
}
-
+
public CheckOnHostAnswer(CheckOnHostCommand cmd, Boolean alive, String details) {
super(cmd, true, details);
if (alive == null) {
@@ -32,7 +32,7 @@ public class CheckOnHostAnswer extends Answer {
this.alive = alive;
}
}
-
+
public CheckOnHostAnswer(CheckOnHostCommand cmd, String details) {
super(cmd, false, details);
}
diff --git a/api/src/com/cloud/agent/api/CheckOnHostCommand.java b/api/src/com/cloud/agent/api/CheckOnHostCommand.java
index 3aadebd464d..596a53299a8 100644
--- a/api/src/com/cloud/agent/api/CheckOnHostCommand.java
+++ b/api/src/com/cloud/agent/api/CheckOnHostCommand.java
@@ -24,17 +24,17 @@ public class CheckOnHostCommand extends Command {
protected CheckOnHostCommand() {
}
-
-
+
+
public CheckOnHostCommand(Host host) {
this.host = new HostTO(host);
setWait(20);
}
-
+
public HostTO getHost() {
return host;
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/CheckRouterAnswer.java b/api/src/com/cloud/agent/api/CheckRouterAnswer.java
index 7240ba10cd5..da8189f552b 100644
--- a/api/src/com/cloud/agent/api/CheckRouterAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckRouterAnswer.java
@@ -23,10 +23,10 @@ public class CheckRouterAnswer extends Answer {
public static final String ROUTER_IP = "router.ip";
RedundantState state;
boolean isBumped;
-
+
protected CheckRouterAnswer() {
}
-
+
public CheckRouterAnswer(CheckRouterCommand cmd, String details, boolean parse) {
super(cmd, true, details);
if (parse) {
@@ -35,7 +35,7 @@ public class CheckRouterAnswer extends Answer {
}
}
}
-
+
public CheckRouterAnswer(CheckRouterCommand cmd, String details) {
super(cmd, false, details);
}
@@ -61,11 +61,11 @@ public class CheckRouterAnswer extends Answer {
}
return true;
}
-
+
public void setState(RedundantState state) {
this.state = state;
}
-
+
public RedundantState getState() {
return state;
}
@@ -73,9 +73,9 @@ public class CheckRouterAnswer extends Answer {
public boolean isBumped() {
return isBumped;
}
-
+
public void setIsBumped(boolean isBumped) {
this.isBumped = isBumped;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsAnswer.java b/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsAnswer.java
index ef3be811870..0e9db96fb36 100644
--- a/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsAnswer.java
@@ -5,7 +5,7 @@
// 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,
@@ -23,12 +23,12 @@ public class CheckS2SVpnConnectionsAnswer extends Answer {
Map ipToConnected;
Map ipToDetail;
String details;
-
+
protected CheckS2SVpnConnectionsAnswer() {
ipToConnected = new HashMap();
ipToDetail = new HashMap();
}
-
+
public CheckS2SVpnConnectionsAnswer(CheckS2SVpnConnectionsCommand cmd, boolean result, String details) {
super(cmd, result, details);
ipToConnected = new HashMap();
@@ -38,7 +38,7 @@ public class CheckS2SVpnConnectionsAnswer extends Answer {
parseDetails(details);
}
}
-
+
protected void parseDetails(String details) {
String[] lines = details.split("&");
for (String line : lines) {
@@ -54,14 +54,14 @@ public class CheckS2SVpnConnectionsAnswer extends Answer {
ipToDetail.put(ip, detail);
}
}
-
+
public boolean isConnected(String ip) {
if (this.getResult()) {
return ipToConnected.get(ip);
}
return false;
}
-
+
public String getDetail(String ip) {
if (this.getResult()) {
return ipToDetail.get(ip);
diff --git a/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsCommand.java b/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsCommand.java
index a736eab35ea..9cfb53b0828 100644
--- a/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsCommand.java
+++ b/api/src/com/cloud/agent/api/CheckS2SVpnConnectionsCommand.java
@@ -5,7 +5,7 @@
// 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,
@@ -22,17 +22,17 @@ import com.cloud.agent.api.routing.NetworkElementCommand;
public class CheckS2SVpnConnectionsCommand extends NetworkElementCommand {
List vpnIps;
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public CheckS2SVpnConnectionsCommand(List vpnIps) {
super();
this.vpnIps = vpnIps;
}
-
+
public List getVpnIps() {
return vpnIps;
}
diff --git a/api/src/com/cloud/agent/api/CheckStateAnswer.java b/api/src/com/cloud/agent/api/CheckStateAnswer.java
index 4864e390201..bf8ae0f330c 100755
--- a/api/src/com/cloud/agent/api/CheckStateAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckStateAnswer.java
@@ -28,17 +28,17 @@ public class CheckStateAnswer extends Answer {
public CheckStateAnswer(CheckStateCommand cmd, State state) {
this(cmd, state, null);
}
-
+
public CheckStateAnswer(CheckStateCommand cmd, String details) {
super(cmd, false, details);
this.state = null;
}
-
+
public CheckStateAnswer(CheckStateCommand cmd, State state, String details) {
super(cmd, true, details);
this.state = state;
}
-
+
public State getState() {
return state;
}
diff --git a/api/src/com/cloud/agent/api/CheckStateCommand.java b/api/src/com/cloud/agent/api/CheckStateCommand.java
index 31c341db448..89fc7731f01 100755
--- a/api/src/com/cloud/agent/api/CheckStateCommand.java
+++ b/api/src/com/cloud/agent/api/CheckStateCommand.java
@@ -17,7 +17,7 @@
package com.cloud.agent.api;
/**
- *
+ *
*
*/
public class CheckStateCommand extends Command {
@@ -28,12 +28,12 @@ public class CheckStateCommand extends Command {
public CheckStateCommand(String vmName) {
this.vmName = vmName;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public String getVmName() {
return vmName;
}
diff --git a/api/src/com/cloud/agent/api/CheckVirtualMachineAnswer.java b/api/src/com/cloud/agent/api/CheckVirtualMachineAnswer.java
index 555b0ff79ed..3f0ffdbcea1 100644
--- a/api/src/com/cloud/agent/api/CheckVirtualMachineAnswer.java
+++ b/api/src/com/cloud/agent/api/CheckVirtualMachineAnswer.java
@@ -19,33 +19,33 @@ package com.cloud.agent.api;
import com.cloud.vm.VirtualMachine.State;
public class CheckVirtualMachineAnswer extends Answer {
-
+
Integer vncPort;
State state;
-
-
+
+
protected CheckVirtualMachineAnswer() {
}
-
+
public CheckVirtualMachineAnswer(CheckVirtualMachineCommand cmd, State state, Integer vncPort, String detail) {
super(cmd, true, detail);
this.state = state;
this.vncPort = vncPort;
}
-
+
public CheckVirtualMachineAnswer(CheckVirtualMachineCommand cmd, State state, Integer vncPort) {
this(cmd, state, vncPort, null);
}
-
+
public CheckVirtualMachineAnswer(CheckVirtualMachineCommand cmd, String detail) {
super(cmd, false, detail);
}
-
+
public Integer getVncPort() {
return vncPort;
}
-
+
public State getState() {
return state;
}
diff --git a/api/src/com/cloud/agent/api/CheckVirtualMachineCommand.java b/api/src/com/cloud/agent/api/CheckVirtualMachineCommand.java
index 9e63a935af1..62f4420a586 100644
--- a/api/src/com/cloud/agent/api/CheckVirtualMachineCommand.java
+++ b/api/src/com/cloud/agent/api/CheckVirtualMachineCommand.java
@@ -17,18 +17,18 @@
package com.cloud.agent.api;
public class CheckVirtualMachineCommand extends Command {
-
+
private String vmName;
-
+
protected CheckVirtualMachineCommand() {
-
+
}
-
+
public CheckVirtualMachineCommand(String vmName) {
this.vmName = vmName;
setWait(20);
}
-
+
public String getVmName() {
return vmName;
}
diff --git a/api/src/com/cloud/agent/api/CleanupNetworkRulesCmd.java b/api/src/com/cloud/agent/api/CleanupNetworkRulesCmd.java
index 6302443b011..8b5172dfe2d 100644
--- a/api/src/com/cloud/agent/api/CleanupNetworkRulesCmd.java
+++ b/api/src/com/cloud/agent/api/CleanupNetworkRulesCmd.java
@@ -20,22 +20,22 @@ package com.cloud.agent.api;
public class CleanupNetworkRulesCmd extends Command implements CronCommand {
private int interval = 10*60;
-
+
@Override
public boolean executeInSequence() {
return false;
}
-
-
+
+
public CleanupNetworkRulesCmd(int intervalSecs) {
super();
interval = intervalSecs;
}
-
+
public CleanupNetworkRulesCmd() {
-
+
}
diff --git a/api/src/com/cloud/agent/api/CleanupSnapshotBackupCommand.java b/api/src/com/cloud/agent/api/CleanupSnapshotBackupCommand.java
index aa85c3d2ec7..ae65a529c52 100644
--- a/api/src/com/cloud/agent/api/CleanupSnapshotBackupCommand.java
+++ b/api/src/com/cloud/agent/api/CleanupSnapshotBackupCommand.java
@@ -26,20 +26,20 @@ public class CleanupSnapshotBackupCommand extends Command {
private List validBackupUUIDs;
protected CleanupSnapshotBackupCommand() {
-
+
}
-
- /*
- * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
+
+ /*
+ * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* In the code, it is present as: In the vmops.host_details table, there is a field mount.parent. This is the value of that field
- * If you have better ideas on how to get it, you are welcome.
- * @param validBackupUUID The VHD which are valid
+ * If you have better ideas on how to get it, you are welcome.
+ * @param validBackupUUID The VHD which are valid
*/
public CleanupSnapshotBackupCommand(String secondaryStoragePoolURL,
Long dcId,
Long accountId,
Long volumeId,
- List validBackupUUIDs)
+ List validBackupUUIDs)
{
this.secondaryStoragePoolURL = secondaryStoragePoolURL;
this.dcId = dcId;
@@ -67,9 +67,9 @@ public class CleanupSnapshotBackupCommand extends Command {
public List getValidBackupUUIDs() {
return validBackupUUIDs;
}
-
+
@Override
public boolean executeInSequence() {
return false;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/ClusterSyncAnswer.java b/api/src/com/cloud/agent/api/ClusterSyncAnswer.java
index ea83109fbcb..99fee2a9dd1 100644
--- a/api/src/com/cloud/agent/api/ClusterSyncAnswer.java
+++ b/api/src/com/cloud/agent/api/ClusterSyncAnswer.java
@@ -25,31 +25,31 @@ public class ClusterSyncAnswer extends Answer {
private long _clusterId;
private HashMap> _newStates;
private boolean _isExecuted=false;
-
+
// this is here because a cron command answer is being sent twice
// AgentAttache.processAnswers
// AgentManagerImpl.notifyAnswersToMonitors
public boolean isExceuted(){
return _isExecuted;
}
-
+
public void setExecuted(){
_isExecuted = true;
}
-
+
public ClusterSyncAnswer(long clusterId, HashMap> newStates){
_clusterId = clusterId;
_newStates = newStates;
result = true;
}
-
+
public long getClusterId() {
return _clusterId;
}
-
+
public HashMap> getNewStates() {
return _newStates;
- }
+ }
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/ClusterSyncCommand.java b/api/src/com/cloud/agent/api/ClusterSyncCommand.java
index e3a0da57669..17dbbd8dd7b 100644
--- a/api/src/com/cloud/agent/api/ClusterSyncCommand.java
+++ b/api/src/com/cloud/agent/api/ClusterSyncCommand.java
@@ -21,10 +21,10 @@ public class ClusterSyncCommand extends Command implements CronCommand {
int _interval;
long _clusterId;
-
+
public ClusterSyncCommand() {
}
-
+
public ClusterSyncCommand(int interval, long clusterId){
_interval = interval;
_clusterId = clusterId;
@@ -34,7 +34,7 @@ public class ClusterSyncCommand extends Command implements CronCommand {
public int getInterval() {
return _interval;
}
-
+
public long getClusterId() {
return _clusterId;
}
@@ -43,5 +43,5 @@ public class ClusterSyncCommand extends Command implements CronCommand {
public boolean executeInSequence() {
return false;
}
-
-}
\ No newline at end of file
+
+}
diff --git a/api/src/com/cloud/agent/api/Command.java b/api/src/com/cloud/agent/api/Command.java
index 4c3810ef2dd..9cd67495e04 100755
--- a/api/src/com/cloud/agent/api/Command.java
+++ b/api/src/com/cloud/agent/api/Command.java
@@ -23,9 +23,9 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
/**
* implemented by classes that extends the Command class. Command specifies
- *
+ *
*/
-public abstract class Command {
+public abstract class Command {
// allow command to carry over hypervisor or other environment related context info
@LogLevel(Log4jLevel.Trace)
@@ -63,7 +63,7 @@ public abstract class Command {
public String getContextParam(String name) {
return contextMap.get(name);
}
-
+
public boolean allowCaching() {
return true;
}
diff --git a/api/src/com/cloud/agent/api/ComputeChecksumCommand.java b/api/src/com/cloud/agent/api/ComputeChecksumCommand.java
index f0771a89de4..a2c88c440a8 100755
--- a/api/src/com/cloud/agent/api/ComputeChecksumCommand.java
+++ b/api/src/com/cloud/agent/api/ComputeChecksumCommand.java
@@ -26,12 +26,12 @@ public class ComputeChecksumCommand extends ssCommand {
public ComputeChecksumCommand() {
super();
}
-
+
public ComputeChecksumCommand(String secUrl, String templatePath) {
super(secUrl);
this.templatePath = templatePath;
- }
-
+ }
+
public String getTemplatePath() {
return templatePath;
}
diff --git a/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationAnswer.java b/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationAnswer.java
index 53a975f4874..9f50a2f3b53 100644
--- a/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationAnswer.java
+++ b/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationAnswer.java
@@ -14,75 +14,75 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.agent.api;
-
-public class ConsoleAccessAuthenticationAnswer extends AgentControlAnswer {
-
+package com.cloud.agent.api;
+
+public class ConsoleAccessAuthenticationAnswer extends AgentControlAnswer {
+
private boolean _success;
-
+
private boolean _isReauthenticating;
private String _host;
private int _port;
-
+
private String _tunnelUrl;
private String _tunnelSession;
-
+
public ConsoleAccessAuthenticationAnswer() {
_success = false;
_isReauthenticating = false;
- _port = 0;
- }
-
- public ConsoleAccessAuthenticationAnswer(Command cmd, boolean success) {
- super(cmd);
- _success = success;
- }
-
- public boolean succeeded() {
- return _success;
+ _port = 0;
}
-
+
+ public ConsoleAccessAuthenticationAnswer(Command cmd, boolean success) {
+ super(cmd);
+ _success = success;
+ }
+
+ public boolean succeeded() {
+ return _success;
+ }
+
public void setSuccess(boolean value) {
_success = value;
}
-
+
public boolean isReauthenticating() {
return _isReauthenticating;
}
-
+
public void setReauthenticating(boolean value) {
_isReauthenticating = value;
}
-
+
public String getHost() {
return _host;
}
-
+
public void setHost(String host) {
_host = host;
}
-
+
public int getPort() {
return _port;
}
-
+
public void setPort(int port) {
_port = port;
}
-
+
public String getTunnelUrl() {
return _tunnelUrl;
}
-
+
public void setTunnelUrl(String tunnelUrl) {
- _tunnelUrl = tunnelUrl;
+ _tunnelUrl = tunnelUrl;
}
-
+
public String getTunnelSession() {
return _tunnelSession;
}
-
+
public void setTunnelSession(String tunnelSession) {
_tunnelSession = tunnelSession;
- }
-}
+ }
+}
diff --git a/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java b/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
index acbc181c5b1..bd8093c7e7b 100644
--- a/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
+++ b/api/src/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
@@ -17,19 +17,19 @@
package com.cloud.agent.api;
public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
-
+
private String _host;
private String _port;
private String _vmId;
private String _sid;
private String _ticket;
-
- private boolean _isReauthenticating;
-
+
+ private boolean _isReauthenticating;
+
public ConsoleAccessAuthenticationCommand() {
- _isReauthenticating = false;
- }
-
+ _isReauthenticating = false;
+ }
+
public ConsoleAccessAuthenticationCommand(String host, String port, String vmId, String sid, String ticket) {
_host = host;
_port = port;
@@ -37,32 +37,32 @@ public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
_sid = sid;
_ticket = ticket;
}
-
+
public String getHost() {
return _host;
}
-
+
public String getPort() {
return _port;
}
-
+
public String getVmId() {
return _vmId;
}
-
+
public String getSid() {
return _sid;
}
-
+
public String getTicket() {
return _ticket;
}
-
+
public boolean isReauthenticating() {
return _isReauthenticating;
}
-
+
public void setReauthenticating(boolean value) {
_isReauthenticating = value;
- }
-}
+ }
+}
diff --git a/api/src/com/cloud/agent/api/ConsoleProxyLoadReportCommand.java b/api/src/com/cloud/agent/api/ConsoleProxyLoadReportCommand.java
index d4b101ae0d1..ebb06b64dc6 100644
--- a/api/src/com/cloud/agent/api/ConsoleProxyLoadReportCommand.java
+++ b/api/src/com/cloud/agent/api/ConsoleProxyLoadReportCommand.java
@@ -17,22 +17,22 @@
package com.cloud.agent.api;
public class ConsoleProxyLoadReportCommand extends AgentControlCommand {
-
+
private long _proxyVmId;
private String _loadInfo;
-
+
public ConsoleProxyLoadReportCommand() {
}
-
+
public ConsoleProxyLoadReportCommand(long proxyVmId, String loadInfo) {
_proxyVmId = proxyVmId;
_loadInfo = loadInfo;
}
-
+
public long getProxyVmId() {
return _proxyVmId;
}
-
+
public String getLoadInfo() {
return _loadInfo;
}
diff --git a/api/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java b/api/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
index 0140a4e0a65..9e2680e49e6 100644
--- a/api/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/CreatePrivateTemplateFromSnapshotCommand.java
@@ -19,28 +19,28 @@ package com.cloud.agent.api;
import com.cloud.storage.StoragePool;
/**
- * This currently assumes that both primary and secondary storage are mounted on the XenServer.
+ * This currently assumes that both primary and secondary storage are mounted on the XenServer.
*/
public class CreatePrivateTemplateFromSnapshotCommand extends SnapshotCommand {
private String origTemplateInstallPath;
private Long newTemplateId;
private String templateName;
-
+
protected CreatePrivateTemplateFromSnapshotCommand() {
-
+
}
-
+
/**
* Given the UUID of a backed up snapshot VHD file on the secondary storage, the execute of this command does
* 1) Get the parent chain of this VHD all the way up to the root, say VHDList
* 2) Copy all the files in the VHDlist to some temp location
* 3) Coalesce all the VHDs to one VHD which contains all the data of the volume. This invokes the DeletePreviousBackupCommand for each VHD
* 4) Rename the UUID of this VHD
- * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
+ * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* In the code, it is present as: In the vmops.host_details table, there is a field mount.parent. This is the value of that field
* If you have better ideas on how to get it, you are welcome.
* It may not be the UUID of the base copy of the snapshot, if no data was written since last snapshot.
- * @param origTemplateInstallPath The install path of the original template VHD on the secondary
+ * @param origTemplateInstallPath The install path of the original template VHD on the secondary
*/
public CreatePrivateTemplateFromSnapshotCommand(StoragePool pool,
@@ -53,7 +53,7 @@ public class CreatePrivateTemplateFromSnapshotCommand extends SnapshotCommand {
String origTemplateInstallPath,
Long newTemplateId,
String templateName,
- int wait)
+ int wait)
{
super(pool, secondaryStoragePoolURL, backedUpSnapshotUuid, backedUpSnapshotName, dcId, accountId, volumeId);
this.origTemplateInstallPath = origTemplateInstallPath;
@@ -68,7 +68,7 @@ public class CreatePrivateTemplateFromSnapshotCommand extends SnapshotCommand {
public String getOrigTemplateInstallPath() {
return origTemplateInstallPath;
}
-
+
public Long getNewTemplateId() {
return newTemplateId;
}
diff --git a/api/src/com/cloud/agent/api/CreateStoragePoolCommand.java b/api/src/com/cloud/agent/api/CreateStoragePoolCommand.java
index ecba6c232e2..7a4d768e5cb 100644
--- a/api/src/com/cloud/agent/api/CreateStoragePoolCommand.java
+++ b/api/src/com/cloud/agent/api/CreateStoragePoolCommand.java
@@ -20,10 +20,10 @@ import com.cloud.storage.StoragePool;
public class CreateStoragePoolCommand extends ModifyStoragePoolCommand {
-
+
public CreateStoragePoolCommand() {
}
-
+
public CreateStoragePoolCommand(boolean add, StoragePool pool) {
super(add, pool);
}
diff --git a/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotAnswer.java b/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotAnswer.java
index a57d6fa3c50..2f7cd9446e8 100644
--- a/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotAnswer.java
+++ b/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotAnswer.java
@@ -19,11 +19,11 @@ package com.cloud.agent.api;
public class CreateVolumeFromSnapshotAnswer extends Answer {
private String vdiUUID;
-
+
protected CreateVolumeFromSnapshotAnswer() {
-
+
}
-
+
public CreateVolumeFromSnapshotAnswer(CreateVolumeFromSnapshotCommand cmd, boolean success, String result, String vdiUUID) {
super(cmd, success, result);
this.vdiUUID = vdiUUID;
diff --git a/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java b/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
index 9bc9b36ae0c..a19d34436f7 100644
--- a/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/CreateVolumeFromSnapshotCommand.java
@@ -19,14 +19,14 @@ package com.cloud.agent.api;
import com.cloud.storage.StoragePool;
/**
- * This currently assumes that both primary and secondary storage are mounted on the XenServer.
+ * This currently assumes that both primary and secondary storage are mounted on the XenServer.
*/
public class CreateVolumeFromSnapshotCommand extends SnapshotCommand {
-
+
protected CreateVolumeFromSnapshotCommand() {
-
+
}
-
+
/**
* Given the UUID of a backed up snapshot VHD file on the secondary storage, the execute of this command does
* 1) Get the parent chain of this VHD all the way up to the root, say VHDList
@@ -35,11 +35,11 @@ public class CreateVolumeFromSnapshotCommand extends SnapshotCommand {
* 4) Rename the UUID of this VHD
* 5) Move this VHD to primary storage
* @param primaryStoragePoolNameLabel The primary storage Pool
- * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
+ * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* In the code, it is present as: In the vmops.host_details table, there is a field mount.parent. This is the value of that field
* If you have better ideas on how to get it, you are welcome.
* It may not be the UUID of the base copy of the snapshot, if no data was written since last snapshot.
- * @param templatePath The install path of the template VHD on the secondary, if this a root volume
+ * @param templatePath The install path of the template VHD on the secondary, if this a root volume
*/
public CreateVolumeFromSnapshotCommand(StoragePool pool,
diff --git a/api/src/com/cloud/agent/api/DeleteObjectFromSwiftCommand.java b/api/src/com/cloud/agent/api/DeleteObjectFromSwiftCommand.java
index 01de89163a8..3d62c507b89 100644
--- a/api/src/com/cloud/agent/api/DeleteObjectFromSwiftCommand.java
+++ b/api/src/com/cloud/agent/api/DeleteObjectFromSwiftCommand.java
@@ -20,8 +20,8 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
import com.cloud.agent.api.to.SwiftTO;
/**
- *
- *
+ *
+ *
*/
public class DeleteObjectFromSwiftCommand extends Command {
@@ -31,9 +31,9 @@ public class DeleteObjectFromSwiftCommand extends Command {
private String object;
protected DeleteObjectFromSwiftCommand() {
-
+
}
-
+
public DeleteObjectFromSwiftCommand(SwiftTO swift, String container, String object) {
this.swift = swift;
this.container = container;
@@ -58,4 +58,4 @@ public class DeleteObjectFromSwiftCommand extends Command {
return true;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/DeleteSnapshotBackupAnswer.java b/api/src/com/cloud/agent/api/DeleteSnapshotBackupAnswer.java
index b458aa0edb0..9a895d8471a 100644
--- a/api/src/com/cloud/agent/api/DeleteSnapshotBackupAnswer.java
+++ b/api/src/com/cloud/agent/api/DeleteSnapshotBackupAnswer.java
@@ -18,15 +18,15 @@ package com.cloud.agent.api;
public class DeleteSnapshotBackupAnswer extends Answer {
-
+
protected DeleteSnapshotBackupAnswer() {
-
+
}
public DeleteSnapshotBackupAnswer(DeleteSnapshotBackupCommand cmd, boolean success, String details) {
super(cmd, success, details);
}
-
-
-
+
+
+
}
diff --git a/api/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java b/api/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
index 5e5557002e6..6114148954f 100644
--- a/api/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
+++ b/api/src/com/cloud/agent/api/DeleteSnapshotBackupCommand.java
@@ -22,7 +22,7 @@ import com.cloud.agent.api.to.SwiftTO;
/**
* This command encapsulates a primitive operation which enables coalescing the backed up VHD snapshots on the secondary server
- * This currently assumes that the secondary storage are mounted on the XenServer.
+ * This currently assumes that the secondary storage are mounted on the XenServer.
*/
public class DeleteSnapshotBackupCommand extends SnapshotCommand {
@LogLevel(Log4jLevel.Off)
@@ -52,31 +52,31 @@ public class DeleteSnapshotBackupCommand extends SnapshotCommand {
protected DeleteSnapshotBackupCommand() {
}
-
+
/**
* Given 2 VHD files on the secondary storage which are linked in a parent chain as follows:
* backupUUID = parent(childUUID)
- * It gets another VHD
+ * It gets another VHD
* previousBackupVHD = parent(backupUUID)
- *
+ *
* And
* 1) it coalesces backupUuid into its parent.
* 2) It deletes the VHD file corresponding to backupUuid
* 3) It sets the parent VHD of childUUID to that of previousBackupUuid
- *
+ *
* It takes care of the cases when
* 1) childUUID is null. - Step 3 is not done.
- * 2) previousBackupUUID is null
+ * 2) previousBackupUUID is null
* - Merge childUUID into its parent backupUUID
* - Set the UUID of the resultant VHD to childUUID
- * - Essentially we are deleting the oldest VHD file and setting the current oldest VHD to childUUID
- *
- * @param volumeName The name of the volume whose snapshot was taken (something like i-3-SV-ROOT)
- * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
+ * - Essentially we are deleting the oldest VHD file and setting the current oldest VHD to childUUID
+ *
+ * @param volumeName The name of the volume whose snapshot was taken (something like i-3-SV-ROOT)
+ * @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* In the code, it is present as: In the vmops.host_details table, there is a field mount.parent. This is the value of that field
- * If you have better ideas on how to get it, you are welcome.
- * @param backupUUID The VHD which has to be deleted
- * @param childUUID The child VHD file of the backup whose parent is reset to its grandparent.
+ * If you have better ideas on how to get it, you are welcome.
+ * @param backupUUID The VHD which has to be deleted
+ * @param childUUID The child VHD file of the backup whose parent is reset to its grandparent.
*/
public DeleteSnapshotBackupCommand(SwiftTO swift,
S3TO s3,
@@ -91,4 +91,4 @@ public class DeleteSnapshotBackupCommand extends SnapshotCommand {
this.s3 = s3;
setAll(all);
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/DeleteSnapshotsDirCommand.java b/api/src/com/cloud/agent/api/DeleteSnapshotsDirCommand.java
index 6879d2343e8..e2071d7f746 100644
--- a/api/src/com/cloud/agent/api/DeleteSnapshotsDirCommand.java
+++ b/api/src/com/cloud/agent/api/DeleteSnapshotsDirCommand.java
@@ -18,18 +18,18 @@ package com.cloud.agent.api;
/**
* This command encapsulates a primitive operation which enables coalescing the backed up VHD snapshots on the secondary server
- * This currently assumes that the secondary storage are mounted on the XenServer.
+ * This currently assumes that the secondary storage are mounted on the XenServer.
*/
public class DeleteSnapshotsDirCommand extends Command {
String secondaryStorageUrl;
Long dcId;
Long accountId;
Long volumeId;
-
+
protected DeleteSnapshotsDirCommand() {
-
+
}
-
+
public DeleteSnapshotsDirCommand(String secondaryStorageUrl,
Long dcId, Long accountId, Long volumeId)
{
@@ -60,4 +60,4 @@ public class DeleteSnapshotsDirCommand extends Command {
return volumeId;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/DeleteStoragePoolCommand.java b/api/src/com/cloud/agent/api/DeleteStoragePoolCommand.java
index 7fa60adb0fe..4618d59da26 100644
--- a/api/src/com/cloud/agent/api/DeleteStoragePoolCommand.java
+++ b/api/src/com/cloud/agent/api/DeleteStoragePoolCommand.java
@@ -23,20 +23,20 @@ import com.cloud.agent.api.to.StorageFilerTO;
import com.cloud.storage.StoragePool;
public class DeleteStoragePoolCommand extends Command {
-
+
StorageFilerTO pool;
public static final String LOCAL_PATH_PREFIX="/mnt/";
String localPath;
-
+
public DeleteStoragePoolCommand() {
-
+
}
-
+
public DeleteStoragePoolCommand(StoragePool pool, String localPath) {
this.pool = new StorageFilerTO(pool);
this.localPath = localPath;
}
-
+
public DeleteStoragePoolCommand(StoragePool pool) {
this(pool, LOCAL_PATH_PREFIX + File.separator + UUID.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
}
@@ -48,7 +48,7 @@ public class DeleteStoragePoolCommand extends Command {
public void setPool(StoragePool pool) {
this.pool = new StorageFilerTO(pool);
}
-
+
@Override
public boolean executeInSequence() {
return false;
@@ -57,5 +57,5 @@ public class DeleteStoragePoolCommand extends Command {
public String getLocalPath() {
return localPath;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/FenceAnswer.java b/api/src/com/cloud/agent/api/FenceAnswer.java
index 13ee3017660..7af18f5e7b3 100644
--- a/api/src/com/cloud/agent/api/FenceAnswer.java
+++ b/api/src/com/cloud/agent/api/FenceAnswer.java
@@ -20,15 +20,15 @@ public class FenceAnswer extends Answer {
public FenceAnswer() {
super();
}
-
+
public FenceAnswer(FenceCommand cmd) {
super(cmd, true, null);
}
-
+
public FenceAnswer(FenceCommand cmd, String details) {
super(cmd, true, details);
}
-
+
public FenceAnswer(FenceCommand cmd, boolean result, String details) {
super(cmd, result, details);
}
diff --git a/api/src/com/cloud/agent/api/FenceCommand.java b/api/src/com/cloud/agent/api/FenceCommand.java
index 5ba293af1a3..a89194442ab 100644
--- a/api/src/com/cloud/agent/api/FenceCommand.java
+++ b/api/src/com/cloud/agent/api/FenceCommand.java
@@ -20,16 +20,16 @@ import com.cloud.host.Host;
import com.cloud.vm.VirtualMachine;
public class FenceCommand extends Command {
-
+
public FenceCommand() {
super();
}
-
+
String vmName;
String hostGuid;
String hostIp;
boolean inSeq;
-
+
public FenceCommand(VirtualMachine vm, Host host) {
super();
vmName = vm.getInstanceName();
@@ -37,19 +37,19 @@ public class FenceCommand extends Command {
hostIp = host.getPrivateIpAddress();
inSeq = false;
}
-
+
public void setSeq(boolean inseq) {
inSeq = inseq;
}
-
+
public String getVmName() {
return vmName;
}
-
+
public String getHostGuid() {
return hostGuid;
}
-
+
public String getHostIp() {
return hostIp;
}
diff --git a/api/src/com/cloud/agent/api/GetDomRVersionAnswer.java b/api/src/com/cloud/agent/api/GetDomRVersionAnswer.java
index 992b5076db7..7487b57c73c 100644
--- a/api/src/com/cloud/agent/api/GetDomRVersionAnswer.java
+++ b/api/src/com/cloud/agent/api/GetDomRVersionAnswer.java
@@ -21,24 +21,24 @@ public class GetDomRVersionAnswer extends Answer {
public static final String ROUTER_IP = "router.ip";
String templateVersion;
String scriptsVersion;
-
+
protected GetDomRVersionAnswer() {
}
-
+
public GetDomRVersionAnswer(GetDomRVersionCmd cmd, String details, String templateVersion, String scriptsVersion) {
super(cmd, true, details);
this.templateVersion = templateVersion;
this.scriptsVersion = scriptsVersion;
}
-
+
public GetDomRVersionAnswer(GetDomRVersionCmd cmd, String details) {
super(cmd, false, details);
}
-
+
public String getTemplateVersion() {
return this.templateVersion;
}
-
+
public String getScriptsVersion() {
return this.scriptsVersion;
}
diff --git a/api/src/com/cloud/agent/api/GetVncPortAnswer.java b/api/src/com/cloud/agent/api/GetVncPortAnswer.java
index da464264c5b..5e94a18d3d9 100644
--- a/api/src/com/cloud/agent/api/GetVncPortAnswer.java
+++ b/api/src/com/cloud/agent/api/GetVncPortAnswer.java
@@ -19,29 +19,29 @@ package com.cloud.agent.api;
public class GetVncPortAnswer extends Answer {
String address;
int port;
-
+
protected GetVncPortAnswer() {
}
-
+
public GetVncPortAnswer(GetVncPortCommand cmd, int port) {
super(cmd, true, null);
this.port = port;
}
-
+
public GetVncPortAnswer(GetVncPortCommand cmd, String address, int port) {
super(cmd, true, null);
this.address = address;
this.port = port;
}
-
+
public GetVncPortAnswer(GetVncPortCommand cmd, String details) {
super(cmd, false, details);
}
-
+
public String getAddress() {
return address;
}
-
+
public int getPort() {
return port;
}
diff --git a/api/src/com/cloud/agent/api/GetVncPortCommand.java b/api/src/com/cloud/agent/api/GetVncPortCommand.java
index cff787e595b..06165dce8ff 100644
--- a/api/src/com/cloud/agent/api/GetVncPortCommand.java
+++ b/api/src/com/cloud/agent/api/GetVncPortCommand.java
@@ -22,21 +22,21 @@ public class GetVncPortCommand extends Command {
public GetVncPortCommand() {
}
-
+
public GetVncPortCommand(long id, String name) {
this.id = id;
this.name = name;
}
-
+
@Override
public boolean executeInSequence() {
return false;
}
-
+
public String getName() {
return name;
}
-
+
public long getId() {
return id;
}
diff --git a/api/src/com/cloud/agent/api/HostStatsEntry.java b/api/src/com/cloud/agent/api/HostStatsEntry.java
index d34e0d76f5c..0d8cfb2d349 100644
--- a/api/src/com/cloud/agent/api/HostStatsEntry.java
+++ b/api/src/com/cloud/agent/api/HostStatsEntry.java
@@ -19,7 +19,7 @@ package com.cloud.agent.api;
import com.cloud.host.HostStats;
public class HostStatsEntry implements HostStats {
-
+
long hostId;
String entityType;
double cpuUtilization;
@@ -27,12 +27,12 @@ public class HostStatsEntry implements HostStats {
double networkWriteKBs;
double totalMemoryKBs;
double freeMemoryKBs;
-
+
public HostStatsEntry() {
}
-
+
public HostStatsEntry(long hostId,double cpuUtilization, double networkReadKBs, double networkWriteKBs, String entityType,
- double totalMemoryKBs, double freeMemoryKBs, double xapiMemoryUsageKBs, double averageLoad)
+ double totalMemoryKBs, double freeMemoryKBs, double xapiMemoryUsageKBs, double averageLoad)
{
this.hostId = hostId;
this.entityType = entityType;
@@ -47,16 +47,16 @@ public class HostStatsEntry implements HostStats {
public double getNetworkReadKBs() {
return networkReadKBs;
}
-
+
public void setNetworkReadKBs(double networkReadKBs) {
this.networkReadKBs = networkReadKBs;
}
-
+
@Override
public double getNetworkWriteKBs() {
return networkWriteKBs;
}
-
+
public void setNetworkWriteKBs(double networkWriteKBs) {
this.networkWriteKBs = networkWriteKBs;
}
@@ -65,16 +65,16 @@ public class HostStatsEntry implements HostStats {
public String getEntityType(){
return this.entityType;
}
-
+
public void setEntityType(String entityType){
this.entityType = entityType;
}
-
+
@Override
public double getTotalMemoryKBs(){
return this.totalMemoryKBs;
}
-
+
public void setTotalMemoryKBs(double totalMemoryKBs){
this.totalMemoryKBs = totalMemoryKBs;
}
@@ -83,11 +83,11 @@ public class HostStatsEntry implements HostStats {
public double getFreeMemoryKBs(){
return this.freeMemoryKBs;
}
-
+
public void setFreeMemoryKBs(double freeMemoryKBs){
this.freeMemoryKBs = freeMemoryKBs;
}
-
+
@Override
public double getCpuUtilization() {
return this.cpuUtilization;
@@ -106,7 +106,7 @@ public class HostStatsEntry implements HostStats {
public HostStats getHostStats() {
return this;
}
-
+
public void setHostId(long hostId) {
this.hostId = hostId;
}
diff --git a/api/src/com/cloud/agent/api/MaintainAnswer.java b/api/src/com/cloud/agent/api/MaintainAnswer.java
index c36286934ee..dcfdab31708 100644
--- a/api/src/com/cloud/agent/api/MaintainAnswer.java
+++ b/api/src/com/cloud/agent/api/MaintainAnswer.java
@@ -18,28 +18,28 @@ package com.cloud.agent.api;
public class MaintainAnswer extends Answer {
boolean willMigrate;
-
+
public MaintainAnswer() {
}
-
+
public MaintainAnswer(MaintainCommand cmd) {
this(cmd, true, null);
}
-
+
public MaintainAnswer(MaintainCommand cmd, boolean willMigrate) {
this(cmd, true, null);
this.willMigrate = willMigrate;
}
-
+
public MaintainAnswer(MaintainCommand cmd, String details) {
this(cmd, true, details);
}
-
+
public MaintainAnswer(MaintainCommand cmd, boolean result, String details) {
super(cmd, result, details);
this.willMigrate = true;
}
-
+
public boolean getMigrate() {
return this.willMigrate;
}
diff --git a/api/src/com/cloud/agent/api/MaintainCommand.java b/api/src/com/cloud/agent/api/MaintainCommand.java
index 654476a58b6..2a9b9a5ae7d 100644
--- a/api/src/com/cloud/agent/api/MaintainCommand.java
+++ b/api/src/com/cloud/agent/api/MaintainCommand.java
@@ -20,7 +20,7 @@ public class MaintainCommand extends Command {
public MaintainCommand() {
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/ManageSnapshotAnswer.java b/api/src/com/cloud/agent/api/ManageSnapshotAnswer.java
index 6dd757505b1..e490bdf076b 100644
--- a/api/src/com/cloud/agent/api/ManageSnapshotAnswer.java
+++ b/api/src/com/cloud/agent/api/ManageSnapshotAnswer.java
@@ -20,13 +20,13 @@ package com.cloud.agent.api;
public class ManageSnapshotAnswer extends Answer {
// For create Snapshot
private String _snapshotPath;
-
+
public ManageSnapshotAnswer() {}
public ManageSnapshotAnswer(Command cmd, boolean success, String result) {
super(cmd, success, result);
}
-
+
// For XenServer
public ManageSnapshotAnswer(ManageSnapshotCommand cmd, long snapshotId, String snapshotPath, boolean success, String result) {
super(cmd, success, result);
@@ -36,5 +36,5 @@ public class ManageSnapshotAnswer extends Answer {
public String getSnapshotPath() {
return _snapshotPath;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/ManageSnapshotCommand.java b/api/src/com/cloud/agent/api/ManageSnapshotCommand.java
index 9a5f424167c..5effc542c5b 100644
--- a/api/src/com/cloud/agent/api/ManageSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/ManageSnapshotCommand.java
@@ -25,9 +25,9 @@ public class ManageSnapshotCommand extends Command {
// XXX: Anyway there is something called inheritance in Java
public static String CREATE_SNAPSHOT = "-c";
public static String DESTROY_SNAPSHOT = "-d";
-
+
private String _commandSwitch;
-
+
// Information about the volume that the snapshot is based on
private String _volumePath = null;
StorageFilerTO _pool;
@@ -43,7 +43,7 @@ public class ManageSnapshotCommand extends Command {
public ManageSnapshotCommand(long snapshotId, String volumePath, StoragePool pool, String preSnapshotPath ,String snapshotName, String vmName) {
_commandSwitch = ManageSnapshotCommand.CREATE_SNAPSHOT;
_volumePath = volumePath;
- _pool = new StorageFilerTO(pool);
+ _pool = new StorageFilerTO(pool);
_snapshotPath = preSnapshotPath;
_snapshotName = snapshotName;
_snapshotId = snapshotId;
@@ -54,8 +54,8 @@ public class ManageSnapshotCommand extends Command {
_commandSwitch = ManageSnapshotCommand.DESTROY_SNAPSHOT;
_snapshotPath = snapshotPath;
}
-
-
+
+
@Override
public boolean executeInSequence() {
return false;
@@ -64,15 +64,15 @@ public class ManageSnapshotCommand extends Command {
public String getCommandSwitch() {
return _commandSwitch;
}
-
+
public String getVolumePath() {
return _volumePath;
}
-
+
public StorageFilerTO getPool() {
return _pool;
}
-
+
public String getSnapshotPath() {
return _snapshotPath;
}
@@ -84,9 +84,9 @@ public class ManageSnapshotCommand extends Command {
public long getSnapshotId() {
return _snapshotId;
}
-
+
public String getVmName() {
return _vmName;
}
-
-}
\ No newline at end of file
+
+}
diff --git a/api/src/com/cloud/agent/api/MigrateAnswer.java b/api/src/com/cloud/agent/api/MigrateAnswer.java
index 4b5dd19d06f..19d690a2d99 100644
--- a/api/src/com/cloud/agent/api/MigrateAnswer.java
+++ b/api/src/com/cloud/agent/api/MigrateAnswer.java
@@ -18,15 +18,15 @@ package com.cloud.agent.api;
public class MigrateAnswer extends Answer {
Integer vncPort = null;
-
+
protected MigrateAnswer() {
}
-
+
public MigrateAnswer(MigrateCommand cmd, boolean result, String detail, Integer vncPort) {
super(cmd, result, detail);
this.vncPort = vncPort;
}
-
+
public Integer getVncPort() {
return vncPort;
}
diff --git a/api/src/com/cloud/agent/api/MigrateCommand.java b/api/src/com/cloud/agent/api/MigrateCommand.java
index 18a2be19d88..5042b8c1971 100644
--- a/api/src/com/cloud/agent/api/MigrateCommand.java
+++ b/api/src/com/cloud/agent/api/MigrateCommand.java
@@ -25,29 +25,29 @@ public class MigrateCommand extends Command {
protected MigrateCommand() {
}
-
+
public MigrateCommand(String vmName, String destIp, boolean isWindows) {
this.vmName = vmName;
this.destIp = destIp;
this.isWindows = isWindows;
}
-
+
public boolean isWindows() {
return isWindows;
}
-
+
public String getDestinationIp() {
return destIp;
}
-
+
public String getVmName() {
return vmName;
}
-
+
public void setHostGuid(String guid) {
this.hostGuid = guid;
}
-
+
public String getHostGuid() {
return this.hostGuid;
}
diff --git a/api/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java b/api/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
index a8ab78dec99..df77985248f 100644
--- a/api/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
+++ b/api/src/com/cloud/agent/api/ModifyStoragePoolAnswer.java
@@ -30,13 +30,13 @@ public class ModifyStoragePoolAnswer extends Answer {
public ModifyStoragePoolAnswer(ModifyStoragePoolCommand cmd, long capacityBytes, long availableBytes, Map tInfo) {
super(cmd);
this.result = true;
- this.poolInfo = new StoragePoolInfo(null,
- cmd.getPool().getHost(), cmd.getPool().getPath(), cmd.getLocalPath(),
+ this.poolInfo = new StoragePoolInfo(null,
+ cmd.getPool().getHost(), cmd.getPool().getPath(), cmd.getLocalPath(),
cmd.getPool().getType(), capacityBytes, availableBytes );
-
+
this.templateInfo = tInfo;
}
-
+
public StoragePoolInfo getPoolInfo() {
return poolInfo;
}
diff --git a/api/src/com/cloud/agent/api/ModifyStoragePoolCommand.java b/api/src/com/cloud/agent/api/ModifyStoragePoolCommand.java
index 04f14e3de8f..8bc956d54d0 100644
--- a/api/src/com/cloud/agent/api/ModifyStoragePoolCommand.java
+++ b/api/src/com/cloud/agent/api/ModifyStoragePoolCommand.java
@@ -23,25 +23,25 @@ import com.cloud.agent.api.to.StorageFilerTO;
import com.cloud.storage.StoragePool;
public class ModifyStoragePoolCommand extends Command {
-
+
boolean add;
StorageFilerTO pool;
String localPath;
String [] options;
public static final String LOCAL_PATH_PREFIX="/mnt/";
-
+
public ModifyStoragePoolCommand() {
-
+
}
-
+
public ModifyStoragePoolCommand(boolean add, StoragePool pool, String localPath) {
this.add = add;
this.pool = new StorageFilerTO(pool);
this.localPath = localPath;
}
-
+
public ModifyStoragePoolCommand(boolean add, StoragePool pool) {
this(add, pool, LOCAL_PATH_PREFIX + File.separator + UUID.nameUUIDFromBytes((pool.getHostAddress() + pool.getPath()).getBytes()));
}
@@ -53,11 +53,11 @@ public class ModifyStoragePoolCommand extends Command {
public void setPool(StoragePool pool) {
this.pool = new StorageFilerTO(pool);
}
-
+
public boolean getAdd() {
return add;
}
-
+
@Override
public boolean executeInSequence() {
return false;
@@ -71,5 +71,5 @@ public class ModifyStoragePoolCommand extends Command {
this.options = options;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/NetworkUsageAnswer.java b/api/src/com/cloud/agent/api/NetworkUsageAnswer.java
index 7d5d49b3a71..fd8ebda4d2a 100644
--- a/api/src/com/cloud/agent/api/NetworkUsageAnswer.java
+++ b/api/src/com/cloud/agent/api/NetworkUsageAnswer.java
@@ -33,7 +33,7 @@ public class NetworkUsageAnswer extends Answer {
this.bytesSent = bytesSent;
routerName = cmd.getDomRName();
}
-
+
public NetworkUsageAnswer(Command command, Exception e) {
super(command, e);
}
diff --git a/api/src/com/cloud/agent/api/NetworkUsageCommand.java b/api/src/com/cloud/agent/api/NetworkUsageCommand.java
index acb23cf61d8..6cbf93b3ef2 100644
--- a/api/src/com/cloud/agent/api/NetworkUsageCommand.java
+++ b/api/src/com/cloud/agent/api/NetworkUsageCommand.java
@@ -57,7 +57,7 @@ public class NetworkUsageCommand extends Command {
this.option = "create";
this.vpcCIDR = vpcCIDR;
}
-
+
public NetworkUsageCommand(String privateIP, String domRName, String option, boolean forVpc, String gatewayIP)
{
this.privateIP = privateIP;
@@ -66,7 +66,7 @@ public class NetworkUsageCommand extends Command {
this.gatewayIP = gatewayIP;
this.option = option;
}
-
+
public String getPrivateIP() {
return privateIP;
}
diff --git a/api/src/com/cloud/agent/api/PingAnswer.java b/api/src/com/cloud/agent/api/PingAnswer.java
index 388d67db0fb..d9ed89cc5df 100644
--- a/api/src/com/cloud/agent/api/PingAnswer.java
+++ b/api/src/com/cloud/agent/api/PingAnswer.java
@@ -21,7 +21,7 @@ public class PingAnswer extends Answer {
protected PingAnswer() {
}
-
+
public PingAnswer(PingCommand cmd) {
super(cmd);
_command = cmd;
diff --git a/api/src/com/cloud/agent/api/PingCommand.java b/api/src/com/cloud/agent/api/PingCommand.java
index 3b3ca61685a..8d9681f9fa9 100755
--- a/api/src/com/cloud/agent/api/PingCommand.java
+++ b/api/src/com/cloud/agent/api/PingCommand.java
@@ -21,23 +21,23 @@ import com.cloud.host.Host;
public class PingCommand extends Command {
Host.Type hostType;
long hostId;
-
+
protected PingCommand() {
}
-
+
public PingCommand(Host.Type type, long id) {
hostType = type;
hostId = id;
}
-
+
public Host.Type getHostType() {
return hostType;
}
-
+
public long getHostId() {
return hostId;
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/PingRoutingCommand.java b/api/src/com/cloud/agent/api/PingRoutingCommand.java
index eebe041ff21..e25ac62786f 100755
--- a/api/src/com/cloud/agent/api/PingRoutingCommand.java
+++ b/api/src/com/cloud/agent/api/PingRoutingCommand.java
@@ -25,15 +25,15 @@ public class PingRoutingCommand extends PingCommand {
Map newStates;
boolean _gatewayAccessible = true;
boolean _vnetAccessible = true;
-
+
protected PingRoutingCommand() {
}
-
+
public PingRoutingCommand(Host.Type type, long id, Map states) {
super(type, id);
this.newStates = states;
}
-
+
public Map getNewStates() {
return newStates;
}
diff --git a/api/src/com/cloud/agent/api/PingRoutingWithOvsCommand.java b/api/src/com/cloud/agent/api/PingRoutingWithOvsCommand.java
index 5842f385402..d44987b20fd 100644
--- a/api/src/com/cloud/agent/api/PingRoutingWithOvsCommand.java
+++ b/api/src/com/cloud/agent/api/PingRoutingWithOvsCommand.java
@@ -25,17 +25,17 @@ import com.cloud.vm.VirtualMachine.State;
public class PingRoutingWithOvsCommand extends PingRoutingCommand {
List> states;
-
+
protected PingRoutingWithOvsCommand() {
super();
}
-
+
public PingRoutingWithOvsCommand(Host.Type type, long id,
Map states, List> ovsStates) {
super(type, id, states);
this.states = ovsStates;
}
-
+
public List> getStates() {
return states;
}
diff --git a/api/src/com/cloud/agent/api/PingStorageCommand.java b/api/src/com/cloud/agent/api/PingStorageCommand.java
index 963bc7b2a6b..438ab507852 100755
--- a/api/src/com/cloud/agent/api/PingStorageCommand.java
+++ b/api/src/com/cloud/agent/api/PingStorageCommand.java
@@ -25,12 +25,12 @@ public class PingStorageCommand extends PingCommand {
protected PingStorageCommand() {
}
-
+
public PingStorageCommand(Host.Type type, long id, Map changes) {
super(type, id);
this.changes = changes;
}
-
+
public Map getChanges() {
return changes;
}
diff --git a/api/src/com/cloud/agent/api/PlugNicCommand.java b/api/src/com/cloud/agent/api/PlugNicCommand.java
index aa5141eab8e..b896e4540cb 100644
--- a/api/src/com/cloud/agent/api/PlugNicCommand.java
+++ b/api/src/com/cloud/agent/api/PlugNicCommand.java
@@ -19,22 +19,22 @@ package com.cloud.agent.api;
import com.cloud.agent.api.to.NicTO;
public class PlugNicCommand extends Command {
-
+
NicTO nic;
String instanceName;
-
+
public NicTO getNic() {
return nic;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
protected PlugNicCommand() {
}
-
+
public PlugNicCommand(NicTO nic, String instanceName) {
this.nic = nic;
this.instanceName = instanceName;
diff --git a/api/src/com/cloud/agent/api/PoolEjectCommand.java b/api/src/com/cloud/agent/api/PoolEjectCommand.java
index faea30e3f86..3085042eeb4 100644
--- a/api/src/com/cloud/agent/api/PoolEjectCommand.java
+++ b/api/src/com/cloud/agent/api/PoolEjectCommand.java
@@ -18,22 +18,22 @@ package com.cloud.agent.api;
public class PoolEjectCommand extends Command {
private String hostuuid;
-
+
public String getHostuuid() {
return hostuuid;
}
-
+
public void setHostuuid(String hostuuid) {
this.hostuuid = hostuuid;
}
public PoolEjectCommand() {
super();
}
- public PoolEjectCommand(String hostuuid) {
+ public PoolEjectCommand(String hostuuid) {
super();
setHostuuid(hostuuid);
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/PrepareForMigrationAnswer.java b/api/src/com/cloud/agent/api/PrepareForMigrationAnswer.java
index bbd63cc2cea..1b215bc086e 100644
--- a/api/src/com/cloud/agent/api/PrepareForMigrationAnswer.java
+++ b/api/src/com/cloud/agent/api/PrepareForMigrationAnswer.java
@@ -19,15 +19,15 @@ package com.cloud.agent.api;
public class PrepareForMigrationAnswer extends Answer {
protected PrepareForMigrationAnswer() {
}
-
+
public PrepareForMigrationAnswer(PrepareForMigrationCommand cmd, String detail) {
super(cmd, false, detail);
}
-
+
public PrepareForMigrationAnswer(PrepareForMigrationCommand cmd, Exception ex) {
super(cmd, ex);
}
-
+
public PrepareForMigrationAnswer(PrepareForMigrationCommand cmd) {
super(cmd, true, null);
}
diff --git a/api/src/com/cloud/agent/api/PrepareForMigrationCommand.java b/api/src/com/cloud/agent/api/PrepareForMigrationCommand.java
index e10bca0ba72..c0e136883f9 100644
--- a/api/src/com/cloud/agent/api/PrepareForMigrationCommand.java
+++ b/api/src/com/cloud/agent/api/PrepareForMigrationCommand.java
@@ -20,18 +20,18 @@ import com.cloud.agent.api.to.VirtualMachineTO;
public class PrepareForMigrationCommand extends Command {
VirtualMachineTO vm;
-
+
protected PrepareForMigrationCommand() {
}
-
+
public PrepareForMigrationCommand(VirtualMachineTO vm) {
this.vm = vm;
}
-
+
public VirtualMachineTO getVirtualMachine() {
return vm;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java b/api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java
index eda0fd9740f..0c80bfa6f08 100755
--- a/api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java
+++ b/api/src/com/cloud/agent/api/PrepareOCFS2NodesCommand.java
@@ -23,7 +23,7 @@ import com.cloud.utils.Ternary;
public class PrepareOCFS2NodesCommand extends Command {
List> nodes;
String clusterName;
-
+
@Override
public boolean executeInSequence() {
return true;
@@ -33,11 +33,11 @@ public class PrepareOCFS2NodesCommand extends Command {
this.nodes = nodes;
this.clusterName = clusterName;
}
-
+
public List> getNodes() {
return nodes;
}
-
+
public String getClusterName() {
return clusterName;
}
diff --git a/api/src/com/cloud/agent/api/PropagateResourceEventCommand.java b/api/src/com/cloud/agent/api/PropagateResourceEventCommand.java
index 3442c7715e1..45cd4b30ef1 100755
--- a/api/src/com/cloud/agent/api/PropagateResourceEventCommand.java
+++ b/api/src/com/cloud/agent/api/PropagateResourceEventCommand.java
@@ -21,24 +21,24 @@ import com.cloud.resource.ResourceState;
public class PropagateResourceEventCommand extends Command {
long hostId;
ResourceState.Event event;
-
+
protected PropagateResourceEventCommand() {
-
+
}
-
+
public PropagateResourceEventCommand(long hostId, ResourceState.Event event) {
this.hostId = hostId;
this.event = event;
}
-
+
public long getHostId() {
return hostId;
}
-
+
public ResourceState.Event getEvent() {
return event;
}
-
+
@Override
public boolean executeInSequence() {
// TODO Auto-generated method stub
diff --git a/api/src/com/cloud/agent/api/ReadyAnswer.java b/api/src/com/cloud/agent/api/ReadyAnswer.java
index 3f8172c39e5..b5dd0b7d360 100644
--- a/api/src/com/cloud/agent/api/ReadyAnswer.java
+++ b/api/src/com/cloud/agent/api/ReadyAnswer.java
@@ -19,11 +19,11 @@ package com.cloud.agent.api;
public class ReadyAnswer extends Answer {
protected ReadyAnswer() {
}
-
+
public ReadyAnswer(ReadyCommand cmd) {
super(cmd, true, null);
}
-
+
public ReadyAnswer(ReadyCommand cmd, String details) {
super(cmd, false, details);
}
diff --git a/api/src/com/cloud/agent/api/ReadyCommand.java b/api/src/com/cloud/agent/api/ReadyCommand.java
index 0c91a2555fa..c6ca799a132 100644
--- a/api/src/com/cloud/agent/api/ReadyCommand.java
+++ b/api/src/com/cloud/agent/api/ReadyCommand.java
@@ -24,29 +24,29 @@ public class ReadyCommand extends Command {
private Long dcId;
private Long hostId;
-
+
public ReadyCommand(Long dcId) {
super();
this.dcId = dcId;
}
-
+
public ReadyCommand(Long dcId, Long hostId) {
this(dcId);
this.hostId = hostId;
}
-
+
public void setDetails(String details) {
_details = details;
}
-
+
public String getDetails() {
return _details;
}
-
+
public Long getDataCenterId() {
return dcId;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/RebootAnswer.java b/api/src/com/cloud/agent/api/RebootAnswer.java
index da53b4fb1a3..244bf1e21ce 100644
--- a/api/src/com/cloud/agent/api/RebootAnswer.java
+++ b/api/src/com/cloud/agent/api/RebootAnswer.java
@@ -18,24 +18,24 @@ package com.cloud.agent.api;
public class RebootAnswer extends Answer {
Integer vncPort;
-
+
protected RebootAnswer() {
}
-
+
public RebootAnswer(RebootCommand cmd, String details, Integer vncport) {
super(cmd, true, details);
this.vncPort = vncport;
}
-
+
public RebootAnswer(RebootCommand cmd, String details, boolean success) {
super(cmd, success, details);
this.vncPort = null;
}
-
+
public RebootAnswer(RebootCommand cmd, Exception e) {
super(cmd, e);
}
-
+
public Integer getVncPort() {
return vncPort;
}
diff --git a/api/src/com/cloud/agent/api/RebootCommand.java b/api/src/com/cloud/agent/api/RebootCommand.java
index 2925e2a8a2b..299e61b76af 100755
--- a/api/src/com/cloud/agent/api/RebootCommand.java
+++ b/api/src/com/cloud/agent/api/RebootCommand.java
@@ -20,25 +20,25 @@ import com.cloud.vm.VirtualMachine;
public class RebootCommand extends Command {
String vmName;
-
+
protected RebootCommand() {
}
-
+
public RebootCommand(VirtualMachine vm) {
vmName = vm.getInstanceName();
}
-
+
public RebootCommand(String vmName) {
this.vmName = vmName;
}
-
+
public String getVmName() {
return vmName;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/RebootRouterCommand.java b/api/src/com/cloud/agent/api/RebootRouterCommand.java
index bf5d866b0dc..c5027b326a3 100644
--- a/api/src/com/cloud/agent/api/RebootRouterCommand.java
+++ b/api/src/com/cloud/agent/api/RebootRouterCommand.java
@@ -18,7 +18,7 @@ package com.cloud.agent.api;
public class RebootRouterCommand extends RebootCommand {
-
+
protected String privateIp;
protected RebootRouterCommand() {
diff --git a/api/src/com/cloud/agent/api/SecStorageFirewallCfgCommand.java b/api/src/com/cloud/agent/api/SecStorageFirewallCfgCommand.java
index 276ed065182..41a779b7d7a 100755
--- a/api/src/com/cloud/agent/api/SecStorageFirewallCfgCommand.java
+++ b/api/src/com/cloud/agent/api/SecStorageFirewallCfgCommand.java
@@ -33,7 +33,7 @@ public class SecStorageFirewallCfgCommand extends Command {
this.intf = intf;
}
public PortConfig() {
-
+
}
public boolean isAdd() {
return add;
@@ -48,28 +48,28 @@ public class SecStorageFirewallCfgCommand extends Command {
return intf;
}
}
-
+
private List portConfigs = new ArrayList();
- private boolean isAppendAIp = false;
-
+ private boolean isAppendAIp = false;
+
public SecStorageFirewallCfgCommand() {
-
+
}
-
+
public SecStorageFirewallCfgCommand(boolean isAppend) {
this.isAppendAIp = isAppend;
- }
-
+ }
+
public void addPortConfig(String sourceIp, String port, boolean add, String intf) {
PortConfig pc = new PortConfig(sourceIp, port, add, intf);
this.portConfigs.add(pc);
-
+
}
public boolean getIsAppendAIp() {
return isAppendAIp;
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/SecStorageSetupAnswer.java b/api/src/com/cloud/agent/api/SecStorageSetupAnswer.java
index 494bce53c3b..bb0c01652d5 100644
--- a/api/src/com/cloud/agent/api/SecStorageSetupAnswer.java
+++ b/api/src/com/cloud/agent/api/SecStorageSetupAnswer.java
@@ -20,12 +20,12 @@ public class SecStorageSetupAnswer extends Answer {
private String _dir;
protected SecStorageSetupAnswer() {
}
-
+
public SecStorageSetupAnswer(String dir) {
super(null, true, "success");
this._dir = dir;
}
-
+
public String get_dir() {
return _dir;
}
diff --git a/api/src/com/cloud/agent/api/SecStorageSetupCommand.java b/api/src/com/cloud/agent/api/SecStorageSetupCommand.java
index 208b8a6cd5b..50c06cffa43 100644
--- a/api/src/com/cloud/agent/api/SecStorageSetupCommand.java
+++ b/api/src/com/cloud/agent/api/SecStorageSetupCommand.java
@@ -21,7 +21,7 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
public class SecStorageSetupCommand extends Command {
private String secUrl;
private Certificates certs;
-
+
public static class Certificates {
@LogLevel(Log4jLevel.Off)
private String privKey;
@@ -29,30 +29,30 @@ public class SecStorageSetupCommand extends Command {
private String privCert;
@LogLevel(Log4jLevel.Off)
private String certChain;
-
+
public Certificates() {
-
+
}
-
+
public Certificates(String prvKey, String privCert, String certChain) {
this.privKey = prvKey;
this.privCert = privCert;
this.certChain = certChain;
}
-
+
public String getPrivKey() {
return this.privKey;
}
-
+
public String getPrivCert() {
return this.privCert;
}
-
+
public String getCertChain() {
return this.certChain;
}
}
-
+
public SecStorageSetupCommand() {
super();
}
@@ -62,7 +62,7 @@ public class SecStorageSetupCommand extends Command {
this.secUrl = secUrl;
this.certs = certs;
}
-
+
@Override
public boolean executeInSequence() {
return true;
@@ -71,13 +71,13 @@ public class SecStorageSetupCommand extends Command {
public String getSecUrl() {
return secUrl;
}
-
+
public Certificates getCerts() {
return this.certs;
}
public void setSecUrl(String secUrl) {
this.secUrl = secUrl;
-
+
}
}
diff --git a/api/src/com/cloud/agent/api/SecStorageVMSetupCommand.java b/api/src/com/cloud/agent/api/SecStorageVMSetupCommand.java
index 03f2321a355..be977097f06 100644
--- a/api/src/com/cloud/agent/api/SecStorageVMSetupCommand.java
+++ b/api/src/com/cloud/agent/api/SecStorageVMSetupCommand.java
@@ -20,11 +20,11 @@ public class SecStorageVMSetupCommand extends Command {
String [] allowedInternalSites = new String[0];
String copyUserName;
String copyPassword;
-
+
public SecStorageVMSetupCommand() {
super();
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/SecurityGroupRuleAnswer.java b/api/src/com/cloud/agent/api/SecurityGroupRuleAnswer.java
index 00cdbe83ffd..144fea2ae87 100644
--- a/api/src/com/cloud/agent/api/SecurityGroupRuleAnswer.java
+++ b/api/src/com/cloud/agent/api/SecurityGroupRuleAnswer.java
@@ -26,24 +26,24 @@ public class SecurityGroupRuleAnswer extends Answer {
Long logSequenceNumber = null;
Long vmId = null;
FailureReason reason = FailureReason.NONE;
-
-
+
+
protected SecurityGroupRuleAnswer() {
}
-
+
public SecurityGroupRuleAnswer(SecurityGroupRulesCmd cmd) {
super(cmd);
this.logSequenceNumber = cmd.getSeqNum();
this.vmId = cmd.getVmId();
}
-
+
public SecurityGroupRuleAnswer(SecurityGroupRulesCmd cmd, boolean result, String detail) {
super(cmd, result, detail);
this.logSequenceNumber = cmd.getSeqNum();
this.vmId = cmd.getVmId();
reason = FailureReason.PROGRAMMING_FAILED;
}
-
+
public SecurityGroupRuleAnswer(SecurityGroupRulesCmd cmd, boolean result, String detail, FailureReason r) {
super(cmd, result, detail);
this.logSequenceNumber = cmd.getSeqNum();
diff --git a/api/src/com/cloud/agent/api/SecurityGroupRulesCmd.java b/api/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
index 32550df8448..affad1f9b9d 100644
--- a/api/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
+++ b/api/src/com/cloud/agent/api/SecurityGroupRulesCmd.java
@@ -126,7 +126,7 @@ public class SecurityGroupRulesCmd extends Command {
public void setEgressRuleSet(IpPortAndProto[] egressRuleSet) {
this.egressRuleSet = egressRuleSet;
}
-
+
public String getGuestIp() {
return guestIp;
}
@@ -156,15 +156,15 @@ public class SecurityGroupRulesCmd extends Command {
}
return ruleBuilder.toString();
}
-
+
//convert cidrs in the form "a.b.c.d/e" to "hexvalue of 32bit ip/e"
private String compressCidr(String cidr) {
String [] toks = cidr.split("/");
long ipnum = NetUtils.ip2Long(toks[0]);
return Long.toHexString(ipnum) + "/" + toks[1];
}
-
-
+
+
public String stringifyCompressedRules() {
StringBuilder ruleBuilder = new StringBuilder();
for (SecurityGroupRulesCmd.IpPortAndProto ipPandP : getIngressRuleSet()) {
@@ -187,7 +187,7 @@ public class SecurityGroupRulesCmd extends Command {
}
return ruleBuilder.toString();
}
-
+
/*
* Compress the security group rules using zlib compression to allow the call to the hypervisor
* to scale beyond 8k cidrs.
@@ -243,7 +243,7 @@ public class SecurityGroupRulesCmd extends Command {
public Long getVmId() {
return vmId;
}
-
+
public int getTotalNumCidrs() {
//useful for logging
int count = 0;
@@ -255,11 +255,11 @@ public class SecurityGroupRulesCmd extends Command {
}
return count;
}
-
+
public void setMsId(long msId) {
this.msId = msId;
}
-
+
public Long getMsId() {
return msId;
}
diff --git a/api/src/com/cloud/agent/api/SetupAnswer.java b/api/src/com/cloud/agent/api/SetupAnswer.java
index beee79fb84c..97252a2708e 100644
--- a/api/src/com/cloud/agent/api/SetupAnswer.java
+++ b/api/src/com/cloud/agent/api/SetupAnswer.java
@@ -33,5 +33,5 @@ public class SetupAnswer extends Answer {
public boolean needReconnect() {
return _reconnect;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/SetupCommand.java b/api/src/com/cloud/agent/api/SetupCommand.java
index 0397813b9aa..ee43c5933da 100644
--- a/api/src/com/cloud/agent/api/SetupCommand.java
+++ b/api/src/com/cloud/agent/api/SetupCommand.java
@@ -23,7 +23,7 @@ public class SetupCommand extends Command {
HostEnvironment env;
boolean multipath;
boolean needSetup;
-
+
public boolean needSetup() {
return needSetup;
}
@@ -37,18 +37,18 @@ public class SetupCommand extends Command {
this.multipath = false;
this.needSetup = false;
}
-
+
public HostEnvironment getEnvironment() {
return env;
}
-
+
protected SetupCommand() {
}
-
+
public void setMultipathOn() {
this.multipath = true;
}
-
+
public boolean useMultipath() {
return multipath;
}
diff --git a/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java b/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
index 10dab557bf5..2cf5bf8ffaa 100644
--- a/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
+++ b/api/src/com/cloud/agent/api/SetupGuestNetworkCommand.java
@@ -28,7 +28,7 @@ public class SetupGuestNetworkCommand extends NetworkElementCommand{
Integer priority;
boolean add = true;
NicTO nic;
-
+
public NicTO getNic() {
return nic;
}
@@ -53,12 +53,12 @@ public class SetupGuestNetworkCommand extends NetworkElementCommand{
public boolean executeInSequence() {
return true;
}
-
+
protected SetupGuestNetworkCommand() {
}
-
-
- public SetupGuestNetworkCommand(String dhcpRange, String networkDomain, boolean isRedundant, Integer priority,
+
+
+ public SetupGuestNetworkCommand(String dhcpRange, String networkDomain, boolean isRedundant, Integer priority,
String defaultDns1, String defaultDns2, boolean add, NicTO nic) {
this.dhcpRange = dhcpRange;
this.networkDomain = networkDomain;
diff --git a/api/src/com/cloud/agent/api/ShutdownCommand.java b/api/src/com/cloud/agent/api/ShutdownCommand.java
index fa66e34b176..5412f35c583 100644
--- a/api/src/com/cloud/agent/api/ShutdownCommand.java
+++ b/api/src/com/cloud/agent/api/ShutdownCommand.java
@@ -24,31 +24,31 @@ public class ShutdownCommand extends Command {
public static final String Update = "update";
public static final String Unknown = "unknown";
public static final String DeleteHost = "deleteHost";
-
+
private String reason;
private String detail;
protected ShutdownCommand() {
super();
}
-
+
public ShutdownCommand(String reason, String detail) {
super();
this.reason = reason;
this.detail = detail;
}
-
+
/**
- * @return return the reason the agent shutdown. If Unknown, call getDetail() for any details.
+ * @return return the reason the agent shutdown. If Unknown, call getDetail() for any details.
*/
public String getReason() {
return reason;
}
-
+
public String getDetail() {
return detail;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/StartAnswer.java b/api/src/com/cloud/agent/api/StartAnswer.java
index d4a3f63bc96..922d060cfae 100644
--- a/api/src/com/cloud/agent/api/StartAnswer.java
+++ b/api/src/com/cloud/agent/api/StartAnswer.java
@@ -21,20 +21,20 @@ import com.cloud.agent.api.to.VirtualMachineTO;
public class StartAnswer extends Answer {
VirtualMachineTO vm;
String host_guid;
-
+
protected StartAnswer() {
}
-
+
public StartAnswer(StartCommand cmd, String msg) {
super(cmd, false, msg);
this.vm = cmd.getVirtualMachine();
}
-
+
public StartAnswer(StartCommand cmd, Exception e) {
super(cmd, false, e.getMessage());
this.vm = cmd.getVirtualMachine();
}
-
+
public StartAnswer(StartCommand cmd) {
super(cmd, true, null);
this.vm = cmd.getVirtualMachine();
@@ -46,7 +46,7 @@ public class StartAnswer extends Answer {
this.vm = cmd.getVirtualMachine();
this.host_guid = guid;
}
-
+
public VirtualMachineTO getVirtualMachine() {
return vm;
}
diff --git a/api/src/com/cloud/agent/api/StartCommand.java b/api/src/com/cloud/agent/api/StartCommand.java
index 4d871389836..ec707d6e851 100644
--- a/api/src/com/cloud/agent/api/StartCommand.java
+++ b/api/src/com/cloud/agent/api/StartCommand.java
@@ -28,12 +28,12 @@ public class StartCommand extends Command {
public VirtualMachineTO getVirtualMachine() {
return vm;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
protected StartCommand() {
}
diff --git a/api/src/com/cloud/agent/api/StartupAnswer.java b/api/src/com/cloud/agent/api/StartupAnswer.java
index a078c2dc4df..c0925cbdd6f 100755
--- a/api/src/com/cloud/agent/api/StartupAnswer.java
+++ b/api/src/com/cloud/agent/api/StartupAnswer.java
@@ -20,24 +20,24 @@ package com.cloud.agent.api;
public class StartupAnswer extends Answer {
long hostId;
int pingInterval;
-
+
protected StartupAnswer() {
}
-
+
public StartupAnswer(StartupCommand cmd, long hostId, int pingInterval) {
super(cmd);
this.hostId = hostId;
this.pingInterval = pingInterval;
}
-
+
public StartupAnswer(StartupCommand cmd, String details) {
super(cmd, false, details);
}
-
+
public long getHostId() {
return hostId;
}
-
+
public int getPingInterval() {
return pingInterval;
}
diff --git a/api/src/com/cloud/agent/api/StartupCommand.java b/api/src/com/cloud/agent/api/StartupCommand.java
index 6088beac785..dd2d3907e7b 100755
--- a/api/src/com/cloud/agent/api/StartupCommand.java
+++ b/api/src/com/cloud/agent/api/StartupCommand.java
@@ -43,11 +43,11 @@ public class StartupCommand extends Command {
String agentTag;
String resourceName;
String gatewayIpAddress;
-
+
public StartupCommand(Host.Type type) {
this.type = type;
}
-
+
public StartupCommand(Long id, Host.Type type, String name, String dataCenter, String pod, String guid, String version) {
super();
this.id = id;
@@ -58,48 +58,48 @@ public class StartupCommand extends Command {
this.version = version;
this.type = type;
}
-
+
public StartupCommand(Long id, Host.Type type, String name, String dataCenter, String pod, String guid, String version, String gatewayIpAddress) {
this(id, type, name, dataCenter, pod, guid, version);
this.gatewayIpAddress = gatewayIpAddress;
- }
-
+ }
+
public Host.Type getHostType() {
return type;
}
-
+
public void setHostType(Host.Type type) {
this.type = type;
}
-
+
public String getIqn() {
return iqn;
}
-
+
public void setCluster(String cluster) {
this.cluster = cluster;
}
-
+
public String getCluster() {
return cluster;
}
-
+
public void setIqn(String iqn) {
this.iqn = iqn;
}
-
+
public String getDataCenter() {
return dataCenter;
}
-
+
public String getPod() {
return pod;
}
-
+
public Long getId() {
return id;
}
-
+
public String getStorageIpAddressDeux() {
return storageIpAddressDeux;
}
@@ -131,11 +131,11 @@ public class StartupCommand extends Command {
public String getName() {
return name;
}
-
+
public String getVersion() {
return version;
}
-
+
public void setDataCenter(String dataCenter) {
this.dataCenter = dataCenter;
}
@@ -147,7 +147,7 @@ public class StartupCommand extends Command {
public void setGuid(String guid) {
this.guid = guid;
}
-
+
public void setGuid(String guid, String resourceName) {
this.resourceName = resourceName;
this.guid = guid + "-" + resourceName;
@@ -232,15 +232,15 @@ public class StartupCommand extends Command {
public void setVersion(String version) {
this.version = version;
}
-
+
public void setPublicIpAddress(String publicIpAddress) {
this.publicIpAddress = publicIpAddress;
}
-
+
public String getAgentTag() {
return agentTag;
}
-
+
public void setAgentTag(String tag) {
agentTag = tag;
}
@@ -248,7 +248,7 @@ public class StartupCommand extends Command {
public void setResourceName(String resourceName) {
this.resourceName = resourceName;
}
-
+
public String getGuidWithoutResource() {
if (resourceName == null) {
return guid;
@@ -265,11 +265,11 @@ public class StartupCommand extends Command {
}
}
}
-
+
public String getResourceName() {
return resourceName;
}
-
+
public String getGatewayIpAddress() {
return gatewayIpAddress;
}
@@ -277,8 +277,8 @@ public class StartupCommand extends Command {
public void setGatewayIpAddress(String gatewayIpAddress) {
this.gatewayIpAddress = gatewayIpAddress;
}
-
-
+
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/StartupExternalFirewallCommand.java b/api/src/com/cloud/agent/api/StartupExternalFirewallCommand.java
index 2ba4ab9eb40..c4ed10729fe 100644
--- a/api/src/com/cloud/agent/api/StartupExternalFirewallCommand.java
+++ b/api/src/com/cloud/agent/api/StartupExternalFirewallCommand.java
@@ -19,7 +19,7 @@ package com.cloud.agent.api;
import com.cloud.host.Host;
public class StartupExternalFirewallCommand extends StartupCommand {
-
+
public StartupExternalFirewallCommand() {
super(Host.Type.ExternalFirewall);
}
diff --git a/api/src/com/cloud/agent/api/StartupProxyCommand.java b/api/src/com/cloud/agent/api/StartupProxyCommand.java
index 63991573bea..25cd769e650 100644
--- a/api/src/com/cloud/agent/api/StartupProxyCommand.java
+++ b/api/src/com/cloud/agent/api/StartupProxyCommand.java
@@ -21,12 +21,12 @@ import com.cloud.host.Host;
public class StartupProxyCommand extends StartupCommand {
private int proxyPort;
private long proxyVmId;
-
+
public StartupProxyCommand() {
super(Host.Type.ConsoleProxy);
setIqn("NoIqn");
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/StartupRoutingCommand.java b/api/src/com/cloud/agent/api/StartupRoutingCommand.java
index e6989403c11..5961ab0017e 100755
--- a/api/src/com/cloud/agent/api/StartupRoutingCommand.java
+++ b/api/src/com/cloud/agent/api/StartupRoutingCommand.java
@@ -90,7 +90,7 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr
long memory,
long dom0MinMemory,
final String caps,
- final HypervisorType hypervisorType,
+ final HypervisorType hypervisorType,
final Map hostDetails,
Map vms) {
super(Host.Type.Routing);
@@ -114,7 +114,7 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr
public StartupRoutingCommand(int cpus, long speed, long memory, long dom0MinMemory, final String caps, final HypervisorType hypervisorType, final Map hostDetails, Map vms, String hypervisorVersion) {
this(cpus, speed, memory, dom0MinMemory, caps, hypervisorType, hostDetails, vms);
this.hypervisorVersion = hypervisorVersion;
- }
+ }
public void setChanges(Map vms) {
this.vms = vms;
@@ -128,7 +128,7 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr
this.vms.put(vm_name, new VmState(vms.get(vm_name), null));
}
}
-
+
public void setClusterVMStateChanges(HashMap> allStates){
_clusterVMStates = allStates;
}
@@ -156,7 +156,7 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr
public Map getVmStates() {
return vms;
}
-
+
public HashMap> getClusterVMStateChanges() {
return _clusterVMStates;
}
@@ -219,6 +219,6 @@ getHostDetails().put(RouterPrivateIpStrategy.class.getCanonicalName(), privIpStr
public void setHypervisorVersion(String hypervisorVersion) {
this.hypervisorVersion = hypervisorVersion;
- }
+ }
}
diff --git a/api/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java b/api/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
index 35896fb6e48..c19ea99e9e1 100644
--- a/api/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
+++ b/api/src/com/cloud/agent/api/StartupSecondaryStorageCommand.java
@@ -19,12 +19,12 @@ package com.cloud.agent.api;
import com.cloud.host.Host;
public class StartupSecondaryStorageCommand extends StartupCommand {
-
+
public StartupSecondaryStorageCommand() {
super(Host.Type.SecondaryStorage);
setIqn("NoIqn");
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/StartupStorageCommand.java b/api/src/com/cloud/agent/api/StartupStorageCommand.java
index d1e67d48800..3c3b058ce39 100755
--- a/api/src/com/cloud/agent/api/StartupStorageCommand.java
+++ b/api/src/com/cloud/agent/api/StartupStorageCommand.java
@@ -26,7 +26,7 @@ import com.cloud.storage.template.TemplateInfo;
public class StartupStorageCommand extends StartupCommand {
-
+
String parent;
Map templateInfo;
long totalSize;
@@ -39,7 +39,7 @@ public class StartupStorageCommand extends StartupCommand {
public StartupStorageCommand() {
super(Host.Type.Storage);
}
-
+
public StartupStorageCommand(String parent, StoragePoolType fsType, long totalSize, Map info) {
super(Host.Type.Storage);
this.parent = parent;
@@ -48,7 +48,7 @@ public class StartupStorageCommand extends StartupCommand {
this.poolInfo = null;
this.fsType = fsType;
}
-
+
public StartupStorageCommand(String parent, StoragePoolType fsType, Map templateInfo, StoragePoolInfo poolInfo) {
super(Host.Type.Storage);
@@ -62,7 +62,7 @@ public class StartupStorageCommand extends StartupCommand {
public String getParent() {
return parent;
}
-
+
public void setParent(String parent) {
this.parent = parent;
}
@@ -70,15 +70,15 @@ public class StartupStorageCommand extends StartupCommand {
public void setNfsShare(String nfsShare) {
this.nfsShare = nfsShare;
}
-
+
public String getNfsShare() {
return nfsShare;
}
-
+
public long getTotalSize() {
return totalSize;
}
-
+
public Map getTemplateInfo() {
return templateInfo;
}
diff --git a/api/src/com/cloud/agent/api/StopAnswer.java b/api/src/com/cloud/agent/api/StopAnswer.java
index 52f28f165f2..1111fed1375 100755
--- a/api/src/com/cloud/agent/api/StopAnswer.java
+++ b/api/src/com/cloud/agent/api/StopAnswer.java
@@ -18,28 +18,28 @@ package com.cloud.agent.api;
public class StopAnswer extends RebootAnswer {
Integer vncPort;
-
+
protected StopAnswer() {
}
-
+
public StopAnswer(StopCommand cmd, String details, Integer vncPort, boolean success) {
super(cmd, details, success);
this.vncPort = vncPort;
}
-
+
public StopAnswer(StopCommand cmd, String details, boolean success) {
super(cmd, details, success);
vncPort = null;
}
-
+
public StopAnswer(StopCommand cmd, Exception e) {
super(cmd, e);
}
-
+
@Override
public Integer getVncPort() {
return vncPort;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/StopCommand.java b/api/src/com/cloud/agent/api/StopCommand.java
index 176a7fb86ee..9ee7ce3c874 100755
--- a/api/src/com/cloud/agent/api/StopCommand.java
+++ b/api/src/com/cloud/agent/api/StopCommand.java
@@ -23,35 +23,35 @@ public class StopCommand extends RebootCommand {
private boolean isProxy=false;
private String urlPort=null;
private String publicConsoleProxyIpAddress=null;
-
+
protected StopCommand() {
}
-
+
public StopCommand(VirtualMachine vm, boolean isProxy, String urlPort, String publicConsoleProxyIpAddress) {
super(vm);
this.isProxy = isProxy;
this.urlPort = urlPort;
this.publicConsoleProxyIpAddress = publicConsoleProxyIpAddress;
}
-
+
public StopCommand(VirtualMachine vm, String vnet) {
super(vm);
this.vnet = vnet;
}
-
+
public StopCommand(VirtualMachine vm, String vmName, String vnet) {
super(vmName);
this.vnet = vnet;
}
-
+
public StopCommand(String vmName) {
super(vmName);
}
-
+
public String getVnet() {
return vnet;
}
-
+
@Override
public boolean executeInSequence() {
return true;
@@ -60,11 +60,11 @@ public class StopCommand extends RebootCommand {
public boolean isProxy() {
return this.isProxy;
}
-
+
public String getURLPort() {
return this.urlPort;
}
-
+
public String getPublicConsoleProxyIpAddress() {
return this.publicConsoleProxyIpAddress;
}
diff --git a/api/src/com/cloud/agent/api/StoragePoolInfo.java b/api/src/com/cloud/agent/api/StoragePoolInfo.java
index 4ac6b296ba3..475205f2704 100644
--- a/api/src/com/cloud/agent/api/StoragePoolInfo.java
+++ b/api/src/com/cloud/agent/api/StoragePoolInfo.java
@@ -29,7 +29,7 @@ public class StoragePoolInfo {
long capacityBytes;
long availableBytes;
Map details;
-
+
protected StoragePoolInfo() {
super();
}
@@ -46,14 +46,14 @@ public class StoragePoolInfo {
this.capacityBytes = capacityBytes;
this.availableBytes = availableBytes;
}
-
+
public StoragePoolInfo(String uuid, String host, String hostPath,
String localPath, StoragePoolType poolType, long capacityBytes,
long availableBytes, Map details) {
this(uuid, host, hostPath, localPath, poolType, capacityBytes, availableBytes);
this.details = details;
}
-
+
public long getCapacityBytes() {
return capacityBytes;
}
@@ -84,4 +84,4 @@ public class StoragePoolInfo {
public Map getDetails() {
return details;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/TransferAgentCommand.java b/api/src/com/cloud/agent/api/TransferAgentCommand.java
index f6f63b79361..0dfde7eea0c 100644
--- a/api/src/com/cloud/agent/api/TransferAgentCommand.java
+++ b/api/src/com/cloud/agent/api/TransferAgentCommand.java
@@ -23,10 +23,10 @@ public class TransferAgentCommand extends Command {
protected long futureOwner;
protected long currentOwner;
Event event;
-
+
protected TransferAgentCommand() {
}
-
+
public TransferAgentCommand(long agentId, long currentOwner, long futureOwner, Event event) {
this.agentId = agentId;
this.currentOwner = currentOwner;
diff --git a/api/src/com/cloud/agent/api/UnPlugNicCommand.java b/api/src/com/cloud/agent/api/UnPlugNicCommand.java
index 0530527d5ba..b6cab8872f5 100644
--- a/api/src/com/cloud/agent/api/UnPlugNicCommand.java
+++ b/api/src/com/cloud/agent/api/UnPlugNicCommand.java
@@ -21,7 +21,7 @@ import com.cloud.agent.api.to.NicTO;
public class UnPlugNicCommand extends Command{
NicTO nic;
String instanceName;
-
+
public NicTO getNic() {
return nic;
}
@@ -30,10 +30,10 @@ public class UnPlugNicCommand extends Command{
public boolean executeInSequence() {
return true;
}
-
+
protected UnPlugNicCommand() {
}
-
+
public UnPlugNicCommand(NicTO nic, String instanceName) {
this.nic = nic;
this.instanceName = instanceName;
diff --git a/api/src/com/cloud/agent/api/UnsupportedAnswer.java b/api/src/com/cloud/agent/api/UnsupportedAnswer.java
index 10a2b8addb8..7d0f24460d4 100644
--- a/api/src/com/cloud/agent/api/UnsupportedAnswer.java
+++ b/api/src/com/cloud/agent/api/UnsupportedAnswer.java
@@ -20,7 +20,7 @@ public class UnsupportedAnswer extends Answer {
protected UnsupportedAnswer() {
super();
}
-
+
public UnsupportedAnswer(Command cmd, String details) {
super(cmd, false, details);
}
diff --git a/api/src/com/cloud/agent/api/UpgradeAnswer.java b/api/src/com/cloud/agent/api/UpgradeAnswer.java
index b93131bdd37..00b0f25b050 100644
--- a/api/src/com/cloud/agent/api/UpgradeAnswer.java
+++ b/api/src/com/cloud/agent/api/UpgradeAnswer.java
@@ -19,7 +19,7 @@ package com.cloud.agent.api;
public class UpgradeAnswer extends Answer {
protected UpgradeAnswer() {
}
-
+
public UpgradeAnswer(UpgradeCommand cmd, String failure) {
super(cmd, false, failure);
}
diff --git a/api/src/com/cloud/agent/api/UpgradeCommand.java b/api/src/com/cloud/agent/api/UpgradeCommand.java
index e85e72c8ea8..0e1b6d2e7c4 100644
--- a/api/src/com/cloud/agent/api/UpgradeCommand.java
+++ b/api/src/com/cloud/agent/api/UpgradeCommand.java
@@ -22,18 +22,18 @@ package com.cloud.agent.api;
public class UpgradeCommand extends Command {
String url;
-
+
protected UpgradeCommand() {
}
-
+
public UpgradeCommand(String url) {
this.url = url;
}
-
+
public String getUpgradeUrl() {
return url;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/UpgradeSnapshotCommand.java b/api/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
index 703aea06be0..f00f4902970 100644
--- a/api/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/UpgradeSnapshotCommand.java
@@ -21,16 +21,16 @@ public class UpgradeSnapshotCommand extends SnapshotCommand {
private String version;
private Long templateId;
private Long tmpltAccountId;
-
+
protected UpgradeSnapshotCommand() {
-
+
}
-
+
/**
* @param primaryStoragePoolNameLabel The UUID of the primary storage Pool
* @param secondaryStoragePoolURL This is what shows up in the UI when you click on Secondary storage.
* @param snapshotUuid The UUID of the snapshot which is going to be upgraded
- * @param _version version for this snapshot
+ * @param _version version for this snapshot
*/
public UpgradeSnapshotCommand(StoragePool pool,
String secondaryStoragePoolURL,
@@ -60,5 +60,5 @@ public class UpgradeSnapshotCommand extends SnapshotCommand {
public Long getTmpltAccountId() {
return tmpltAccountId;
- }
+ }
}
diff --git a/api/src/com/cloud/agent/api/ValidateSnapshotAnswer.java b/api/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
index d9b0e61cda0..f5bb5448be0 100644
--- a/api/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
+++ b/api/src/com/cloud/agent/api/ValidateSnapshotAnswer.java
@@ -21,11 +21,11 @@ public class ValidateSnapshotAnswer extends Answer {
private String expectedSnapshotBackupUuid;
private String actualSnapshotBackupUuid;
private String actualSnapshotUuid;
-
+
protected ValidateSnapshotAnswer() {
-
+
}
-
+
public ValidateSnapshotAnswer(ValidateSnapshotCommand cmd, boolean success, String result, String expectedSnapshotBackupUuid, String actualSnapshotBackupUuid, String actualSnapshotUuid) {
super(cmd, success, result);
this.expectedSnapshotBackupUuid = expectedSnapshotBackupUuid;
@@ -39,14 +39,14 @@ public class ValidateSnapshotAnswer extends Answer {
public String getExpectedSnapshotBackupUuid() {
return expectedSnapshotBackupUuid;
}
-
+
/**
* @return the actualSnapshotBackupUuid
*/
public String getActualSnapshotBackupUuid() {
return actualSnapshotBackupUuid;
}
-
+
public String getActualSnapshotUuid() {
return actualSnapshotUuid;
}
diff --git a/api/src/com/cloud/agent/api/ValidateSnapshotCommand.java b/api/src/com/cloud/agent/api/ValidateSnapshotCommand.java
index 527502c28b3..9ffbf292281 100644
--- a/api/src/com/cloud/agent/api/ValidateSnapshotCommand.java
+++ b/api/src/com/cloud/agent/api/ValidateSnapshotCommand.java
@@ -22,24 +22,24 @@ public class ValidateSnapshotCommand extends Command {
private String firstBackupUuid;
private String previousSnapshotUuid;
private String templateUuid;
-
+
protected ValidateSnapshotCommand() {
-
+
}
-
+
/**
* @param primaryStoragePoolNameLabel The primary storage Pool Name Label
* @param volumeUuid The UUID of the volume for which the snapshot was taken
* @param firstBackupUuid This UUID of the first snapshot that was ever taken for this volume, even it was deleted.
* @param previousSnapshotUuid The UUID of the previous snapshot on the primary.
- * @param templateUuid If this is a root volume and no snapshot has been taken for it,
- * this is the UUID of the template VDI.
+ * @param templateUuid If this is a root volume and no snapshot has been taken for it,
+ * this is the UUID of the template VDI.
*/
public ValidateSnapshotCommand(String primaryStoragePoolNameLabel,
String volumeUuid,
String firstBackupUuid,
String previousSnapshotUuid,
- String templateUuid)
+ String templateUuid)
{
this.primaryStoragePoolNameLabel = primaryStoragePoolNameLabel;
this.volumeUuid = volumeUuid;
@@ -51,7 +51,7 @@ public class ValidateSnapshotCommand extends Command {
public String getPrimaryStoragePoolNameLabel() {
return primaryStoragePoolNameLabel;
}
-
+
/**
* @return the volumeUuid
*/
@@ -65,11 +65,11 @@ public class ValidateSnapshotCommand extends Command {
public String getFirstBackupUuid() {
return firstBackupUuid;
}
-
+
public String getPreviousSnapshotUuid() {
return previousSnapshotUuid;
}
-
+
/**
* @return the templateUuid
*/
@@ -81,4 +81,4 @@ public class ValidateSnapshotCommand extends Command {
public boolean executeInSequence() {
return false;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/VmStatsEntry.java b/api/src/com/cloud/agent/api/VmStatsEntry.java
index 55694f86054..8828e9114f4 100755
--- a/api/src/com/cloud/agent/api/VmStatsEntry.java
+++ b/api/src/com/cloud/agent/api/VmStatsEntry.java
@@ -19,17 +19,17 @@ package com.cloud.agent.api;
import com.cloud.vm.VmStats;
public class VmStatsEntry implements VmStats {
-
+
double cpuUtilization;
double networkReadKBs;
double networkWriteKBs;
- int numCPUs;
+ int numCPUs;
String entityType;
-
+
public VmStatsEntry() {
}
-
- public VmStatsEntry(double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String entityType)
+
+ public VmStatsEntry(double cpuUtilization, double networkReadKBs, double networkWriteKBs, int numCPUs, String entityType)
{
this.cpuUtilization = cpuUtilization;
this.networkReadKBs = networkReadKBs;
@@ -41,7 +41,7 @@ public class VmStatsEntry implements VmStats {
public double getCPUUtilization() {
return cpuUtilization;
}
-
+
public void setCPUUtilization(double cpuUtilization) {
this.cpuUtilization = cpuUtilization;
}
@@ -49,23 +49,23 @@ public class VmStatsEntry implements VmStats {
public double getNetworkReadKBs() {
return networkReadKBs;
}
-
+
public void setNetworkReadKBs(double networkReadKBs) {
this.networkReadKBs = networkReadKBs;
}
-
+
public double getNetworkWriteKBs() {
return networkWriteKBs;
}
-
+
public void setNetworkWriteKBs(double networkWriteKBs) {
this.networkWriteKBs = networkWriteKBs;
}
-
+
public int getNumCPUs() {
return numCPUs;
}
-
+
public void setNumCPUs(int numCPUs) {
this.numCPUs = numCPUs;
}
@@ -73,10 +73,10 @@ public class VmStatsEntry implements VmStats {
public String getEntityType(){
return this.entityType;
}
-
+
public void setEntityType(String entityType){
this.entityType = entityType;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java b/api/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
index e0f4a28a156..fdd1fe910e9 100644
--- a/api/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
+++ b/api/src/com/cloud/agent/api/baremetal/IpmISetBootDevCommand.java
@@ -18,23 +18,23 @@ package com.cloud.agent.api.baremetal;
import com.cloud.agent.api.Command;
-public class IpmISetBootDevCommand extends Command {
+public class IpmISetBootDevCommand extends Command {
public enum BootDev {
pxe(),
disk(),
cdrom(),
}
-
+
BootDev bootDev;
-
+
public BootDev getBootDev() {
return bootDev;
}
-
+
public IpmISetBootDevCommand(BootDev dev) {
bootDev = dev;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java b/api/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
index 1190cb30033..d8f0529b44e 100644
--- a/api/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
+++ b/api/src/com/cloud/agent/api/baremetal/PreparePxeServerAnswer.java
@@ -22,8 +22,8 @@ public class PreparePxeServerAnswer extends Answer {
public PreparePxeServerAnswer(PreparePxeServerCommand cmd) {
super(cmd, true, "SUCCESS");
}
-
+
public PreparePxeServerAnswer(PreparePxeServerCommand cmd, String details) {
super(cmd, false, details);
- }
+ }
}
diff --git a/api/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java b/api/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
index 0cda0f11464..6c735637034 100644
--- a/api/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
+++ b/api/src/com/cloud/agent/api/baremetal/PreparePxeServerCommand.java
@@ -28,12 +28,12 @@ public class PreparePxeServerCommand extends Command {
String template;
String vmName;
String hostName;
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public PreparePxeServerCommand(String ip, String mac, String netMask, String gateway, String dns, String template, String vmName, String hostName) {
this.ip = ip;
this.mac = mac;
@@ -44,7 +44,7 @@ public class PreparePxeServerCommand extends Command {
this.vmName = vmName;
this.hostName = hostName;
}
-
+
public String getIp() {
return ip;
}
@@ -68,11 +68,11 @@ public class PreparePxeServerCommand extends Command {
public String getTemplate() {
return template;
}
-
+
public String getVmName() {
return vmName;
}
-
+
public String getHostName() {
return hostName;
}
diff --git a/api/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java b/api/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
index 03d178e309a..b18742055df 100644
--- a/api/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
+++ b/api/src/com/cloud/agent/api/baremetal/prepareCreateTemplateCommand.java
@@ -25,12 +25,12 @@ public class prepareCreateTemplateCommand extends Command {
String gateway;
String dns;
String template;
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public prepareCreateTemplateCommand(String ip, String mac, String netMask, String gateway, String dns, String template) {
this.ip = ip;
this.mac = mac;
@@ -43,23 +43,23 @@ public class prepareCreateTemplateCommand extends Command {
public String getIp() {
return ip;
}
-
+
public String getMac() {
return mac;
}
-
+
public String getNetMask() {
return netMask;
}
-
+
public String getGateWay() {
return gateway;
}
-
+
public String getDns() {
return dns;
}
-
+
public String getTemplate() {
return template;
}
diff --git a/api/src/com/cloud/agent/api/check/CheckSshAnswer.java b/api/src/com/cloud/agent/api/check/CheckSshAnswer.java
index 7618159e63e..3414eb07c14 100644
--- a/api/src/com/cloud/agent/api/check/CheckSshAnswer.java
+++ b/api/src/com/cloud/agent/api/check/CheckSshAnswer.java
@@ -20,17 +20,17 @@ import com.cloud.agent.api.Answer;
public class CheckSshAnswer extends Answer {
protected CheckSshAnswer() {
-
+
}
-
+
public CheckSshAnswer(CheckSshCommand cmd) {
super(cmd, true, null);
}
-
+
public CheckSshAnswer(CheckSshCommand cmd, String details) {
super(cmd, false, details);
}
-
+
public CheckSshAnswer(CheckSshCommand cmd, Throwable th) {
super(cmd, false, th.getMessage());
}
diff --git a/api/src/com/cloud/agent/api/check/CheckSshCommand.java b/api/src/com/cloud/agent/api/check/CheckSshCommand.java
index fb4210fc725..e384983e206 100644
--- a/api/src/com/cloud/agent/api/check/CheckSshCommand.java
+++ b/api/src/com/cloud/agent/api/check/CheckSshCommand.java
@@ -24,11 +24,11 @@ public class CheckSshCommand extends Command {
int interval;
int retries;
String name;
-
+
protected CheckSshCommand() {
super();
}
-
+
public CheckSshCommand(String instanceName, String ip, int port) {
super();
this.ip = ip;
@@ -37,7 +37,7 @@ public class CheckSshCommand extends Command {
this.retries = 100;
this.name = instanceName;
}
-
+
public String getName() {
return name;
}
diff --git a/api/src/com/cloud/agent/api/downloadSnapshotFromSwiftCommand.java b/api/src/com/cloud/agent/api/downloadSnapshotFromSwiftCommand.java
index 6021762dcf0..a2ae611d316 100644
--- a/api/src/com/cloud/agent/api/downloadSnapshotFromSwiftCommand.java
+++ b/api/src/com/cloud/agent/api/downloadSnapshotFromSwiftCommand.java
@@ -20,7 +20,7 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
import com.cloud.agent.api.to.SwiftTO;
/**
- * This currently assumes that both primary and secondary storage are mounted on the XenServer.
+ * This currently assumes that both primary and secondary storage are mounted on the XenServer.
*/
public class downloadSnapshotFromSwiftCommand extends SnapshotCommand {
@LogLevel(Log4jLevel.Off)
@@ -29,9 +29,9 @@ public class downloadSnapshotFromSwiftCommand extends SnapshotCommand {
private String _parent;
protected downloadSnapshotFromSwiftCommand() {
-
+
}
-
+
public downloadSnapshotFromSwiftCommand(SwiftTO swift, String secondaryStorageUrl, Long dcId, Long accountId, Long volumeId, String parent, String BackupUuid, int wait) {
super(null, secondaryStorageUrl, BackupUuid, "", dcId, accountId, volumeId);
diff --git a/api/src/com/cloud/agent/api/downloadTemplateFromSwiftToSecondaryStorageCommand.java b/api/src/com/cloud/agent/api/downloadTemplateFromSwiftToSecondaryStorageCommand.java
index 0bf6e98e7cb..82290656095 100644
--- a/api/src/com/cloud/agent/api/downloadTemplateFromSwiftToSecondaryStorageCommand.java
+++ b/api/src/com/cloud/agent/api/downloadTemplateFromSwiftToSecondaryStorageCommand.java
@@ -20,8 +20,8 @@ import com.cloud.agent.api.LogLevel.Log4jLevel;
import com.cloud.agent.api.to.SwiftTO;
/**
- *
- *
+ *
+ *
*/
public class downloadTemplateFromSwiftToSecondaryStorageCommand extends Command {
@@ -35,9 +35,9 @@ public class downloadTemplateFromSwiftToSecondaryStorageCommand extends Command
private String path;
protected downloadTemplateFromSwiftToSecondaryStorageCommand() {
-
+
}
-
+
public downloadTemplateFromSwiftToSecondaryStorageCommand(SwiftTO swift, String secondaryStorageUrl, Long dcId, Long accountId, Long templateId, String path, int wait) {
this.swift = swift;
@@ -87,4 +87,4 @@ public class downloadTemplateFromSwiftToSecondaryStorageCommand extends Command
return true;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java b/api/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
index 318d9398d83..7582b0d880c 100644
--- a/api/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
+++ b/api/src/com/cloud/agent/api/proxy/CheckConsoleProxyLoadCommand.java
@@ -26,33 +26,33 @@ public class CheckConsoleProxyLoadCommand extends ProxyCommand {
private String proxyVmName;
private String proxyManagementIp;
private int proxyCmdPort;
-
+
public CheckConsoleProxyLoadCommand() {
}
-
+
public CheckConsoleProxyLoadCommand(long proxyVmId, String proxyVmName, String proxyManagementIp, int proxyCmdPort) {
this.proxyVmId = proxyVmId;
this.proxyVmName = proxyVmName;
this.proxyManagementIp = proxyManagementIp;
this.proxyCmdPort = proxyCmdPort;
}
-
+
public long getProxyVmId() {
return proxyVmId;
}
-
+
public String getProxyVmName() {
return proxyVmName;
}
-
+
public String getProxyManagementIp() {
return proxyManagementIp;
}
-
+
public int getProxyCmdPort() {
return proxyCmdPort;
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java b/api/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
index df8f47d3557..ae93f51789b 100644
--- a/api/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
+++ b/api/src/com/cloud/agent/api/proxy/ConsoleProxyLoadAnswer.java
@@ -23,21 +23,21 @@ public class ConsoleProxyLoadAnswer extends Answer {
private long proxyVmId;
private String proxyVmName;
-
+
protected ConsoleProxyLoadAnswer() {
}
-
+
public ConsoleProxyLoadAnswer(Command command, long proxyVmId, String proxyVmName, boolean success, String details) {
super(command, success, details);
-
+
this.proxyVmId = proxyVmId;
this.proxyVmName = proxyVmName;
}
-
+
public long getProxyVmId() {
return proxyVmId;
}
-
+
public String getProxyVmName() {
return proxyVmName;
}
diff --git a/api/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java b/api/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
index fd306ff2a92..c5af38eb724 100644
--- a/api/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
+++ b/api/src/com/cloud/agent/api/proxy/StartConsoleProxyAgentHttpHandlerCommand.java
@@ -27,21 +27,21 @@ public class StartConsoleProxyAgentHttpHandlerCommand extends Command {
private String keystorePassword;
@LogLevel(Log4jLevel.Off)
private String encryptorPassword;
-
+
public StartConsoleProxyAgentHttpHandlerCommand() {
super();
}
-
+
public StartConsoleProxyAgentHttpHandlerCommand(byte[] ksBits, String ksPassword) {
this.keystoreBits = ksBits;
this.keystorePassword = ksPassword;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public byte[] getKeystoreBits() {
return keystoreBits;
}
diff --git a/api/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java b/api/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
index b918ba49f84..ef4a549daf3 100644
--- a/api/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
+++ b/api/src/com/cloud/agent/api/proxy/WatchConsoleProxyLoadCommand.java
@@ -25,7 +25,7 @@ public class WatchConsoleProxyLoadCommand extends ProxyCommand implements CronCo
private String proxyManagementIp;
private int proxyCmdPort;
int interval;
-
+
public WatchConsoleProxyLoadCommand(int interval, long proxyVmId, String proxyVmName,
String proxyManagementIp, int proxyCmdPort) {
this.interval = interval;
@@ -34,30 +34,30 @@ public class WatchConsoleProxyLoadCommand extends ProxyCommand implements CronCo
this.proxyManagementIp = proxyManagementIp;
this.proxyCmdPort = proxyCmdPort;
}
-
+
protected WatchConsoleProxyLoadCommand() {
}
-
+
public long getProxyVmId() {
return proxyVmId;
}
-
+
public String getProxyVmName() {
return proxyVmName;
}
-
+
public String getProxyManagementIp() {
return proxyManagementIp;
}
-
+
public int getProxyCmdPort() {
return proxyCmdPort;
}
-
+
public int getInterval() {
return interval;
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java b/api/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
index ed972a22f51..dc7f1a188fd 100644
--- a/api/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
+++ b/api/src/com/cloud/agent/api/routing/CreateLoadBalancerApplianceCommand.java
@@ -27,7 +27,7 @@ public class CreateLoadBalancerApplianceCommand extends NetworkElementCommand {
String password;
String publicInterface;
String privateInterface;
-
+
public CreateLoadBalancerApplianceCommand(String ip, String netmask, String gateway) {
this.ip = ip;
this.netmask = netmask;
@@ -45,4 +45,4 @@ public class CreateLoadBalancerApplianceCommand extends NetworkElementCommand {
public String getGateway() {
return gateway;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/routing/DhcpEntryCommand.java b/api/src/com/cloud/agent/api/routing/DhcpEntryCommand.java
index ff38941f0a2..5c2cd582d4c 100644
--- a/api/src/com/cloud/agent/api/routing/DhcpEntryCommand.java
+++ b/api/src/com/cloud/agent/api/routing/DhcpEntryCommand.java
@@ -29,56 +29,56 @@ public class DhcpEntryCommand extends NetworkElementCommand {
String staticRoutes;
String defaultDns;
-
+
protected DhcpEntryCommand() {
-
+
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName) {
this.vmMac = vmMac;
this.vmIpAddress = vmIpAddress;
this.vmName = vmName;
}
-
+
public DhcpEntryCommand(String vmMac, String vmIpAddress, String vmName, String dns, String gateway) {
this(vmMac, vmIpAddress, vmName);
this.dns = dns;
this.gateway = gateway;
}
-
+
public String getDns() {
return dns;
}
-
+
public String getGateway() {
return gateway;
}
-
+
public String getVmMac() {
return vmMac;
}
-
+
public String getVmIpAddress() {
return vmIpAddress;
}
-
+
public String getVmName() {
return vmName;
}
-
+
public void setNextServer(String ip) {
nextServer = ip;
}
-
+
public String getNextServer() {
return nextServer;
}
-
+
public String getDefaultRouter() {
return defaultRouter;
}
diff --git a/api/src/com/cloud/agent/api/routing/IpAssocAnswer.java b/api/src/com/cloud/agent/api/routing/IpAssocAnswer.java
index 18921969f75..194923c497e 100644
--- a/api/src/com/cloud/agent/api/routing/IpAssocAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/IpAssocAnswer.java
@@ -20,13 +20,13 @@ import com.cloud.agent.api.Answer;
public class IpAssocAnswer extends Answer{
String[] results;
-
+
public static final String errorResult = "Failed";
-
+
protected IpAssocAnswer() {
super();
}
-
+
public IpAssocAnswer(IpAssocCommand cmd, String[] results) {
boolean finalResult = true;
@@ -41,7 +41,7 @@ public class IpAssocAnswer extends Answer{
assert(cmd.getIpAddresses().length == results.length) : "Shouldn't the results match the commands?";
this.results = results;
}
-
+
String[] getResults() {
return results;
}
diff --git a/api/src/com/cloud/agent/api/routing/IpAssocCommand.java b/api/src/com/cloud/agent/api/routing/IpAssocCommand.java
index 5326b119352..5cdc2da2efa 100644
--- a/api/src/com/cloud/agent/api/routing/IpAssocCommand.java
+++ b/api/src/com/cloud/agent/api/routing/IpAssocCommand.java
@@ -19,12 +19,12 @@ package com.cloud.agent.api.routing;
import com.cloud.agent.api.to.IpAddressTO;
public class IpAssocCommand extends NetworkElementCommand {
-
+
IpAddressTO[] ipAddresses;
protected IpAssocCommand() {
}
-
+
public IpAssocCommand(IpAddressTO[] ips) {
this.ipAddresses = ips;
}
diff --git a/api/src/com/cloud/agent/api/routing/IpAssocVpcCommand.java b/api/src/com/cloud/agent/api/routing/IpAssocVpcCommand.java
index cc7fcb00f09..e5c900d19e2 100644
--- a/api/src/com/cloud/agent/api/routing/IpAssocVpcCommand.java
+++ b/api/src/com/cloud/agent/api/routing/IpAssocVpcCommand.java
@@ -22,7 +22,7 @@ public class IpAssocVpcCommand extends IpAssocCommand{
protected IpAssocVpcCommand() {
super();
}
-
+
public IpAssocVpcCommand(IpAddressTO[] ips) {
super(ips);
}
diff --git a/api/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java b/api/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java
index a5505e1e688..1c1fb914da3 100644
--- a/api/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java
+++ b/api/src/com/cloud/agent/api/routing/LoadBalancerConfigCommand.java
@@ -31,13 +31,13 @@ public class LoadBalancerConfigCommand extends NetworkElementCommand {
public String lbStatsPort = "8081"; /*load balancer listen on this port for stats */
public String lbStatsSrcCidrs = "0/0" ; /* TODO : currently there is no filtering based on the source ip */
public String lbStatsAuth = "admin1:AdMiN123";
- public String lbStatsUri = "/admin?stats";
+ public String lbStatsUri = "/admin?stats";
NicTO nic;
Long vpcId;
-
+
protected LoadBalancerConfigCommand() {
}
-
+
public LoadBalancerConfigCommand(LoadBalancerTO[] loadBalancers, Long vpcId) {
this.loadBalancers = loadBalancers;
this.vpcId = vpcId;
@@ -51,11 +51,11 @@ public class LoadBalancerConfigCommand extends NetworkElementCommand {
this.nic = nic;
this.vpcId = vpcId;
}
-
+
public NicTO getNic() {
return nic;
}
-
+
public LoadBalancerTO[] getLoadBalancers() {
return loadBalancers;
}
diff --git a/api/src/com/cloud/agent/api/routing/NetworkElementCommand.java b/api/src/com/cloud/agent/api/routing/NetworkElementCommand.java
index 61e41e8f424..41ae80fe223 100644
--- a/api/src/com/cloud/agent/api/routing/NetworkElementCommand.java
+++ b/api/src/com/cloud/agent/api/routing/NetworkElementCommand.java
@@ -22,7 +22,7 @@ import com.cloud.agent.api.Command;
public abstract class NetworkElementCommand extends Command {
HashMap accessDetails = new HashMap(0);
-
+
public static final String ACCOUNT_ID = "account.id";
public static final String GUEST_NETWORK_CIDR = "guest.network.cidr";
public static final String GUEST_NETWORK_GATEWAY = "guest.network.gateway";
@@ -32,19 +32,19 @@ public abstract class NetworkElementCommand extends Command {
public static final String ROUTER_GUEST_IP = "router.guest.ip";
public static final String ZONE_NETWORK_TYPE = "zone.network.type";
public static final String GUEST_BRIDGE = "guest.bridge";
-
+
protected NetworkElementCommand() {
super();
}
-
+
public void setAccessDetail(String name, String value) {
accessDetails.put(name, value);
}
-
+
public String getAccessDetail(String name) {
return accessDetails.get(name);
}
-
+
@Override
public boolean executeInSequence() {
return false;
diff --git a/api/src/com/cloud/agent/api/routing/RemoteAccessVpnCfgCommand.java b/api/src/com/cloud/agent/api/routing/RemoteAccessVpnCfgCommand.java
index 8cf3ba2f89c..68d7caf016f 100644
--- a/api/src/com/cloud/agent/api/routing/RemoteAccessVpnCfgCommand.java
+++ b/api/src/com/cloud/agent/api/routing/RemoteAccessVpnCfgCommand.java
@@ -18,17 +18,17 @@ package com.cloud.agent.api.routing;
public class RemoteAccessVpnCfgCommand extends NetworkElementCommand {
-
+
boolean create;
String vpnServerIp;
String ipRange;
String presharedKey;
String localIp;
-
+
protected RemoteAccessVpnCfgCommand() {
this.create = false;
}
-
+
public boolean isCreate() {
return create;
}
@@ -37,12 +37,12 @@ public class RemoteAccessVpnCfgCommand extends NetworkElementCommand {
public boolean executeInSequence() {
return true;
}
-
-
+
+
public RemoteAccessVpnCfgCommand(boolean create, String vpnServerAddress, String localIp, String ipRange, String ipsecPresharedKey) {
this.vpnServerIp = vpnServerAddress;
this.ipRange = ipRange;
- this.presharedKey = ipsecPresharedKey;
+ this.presharedKey = ipsecPresharedKey;
this.localIp = localIp;
this.create = create;
}
diff --git a/api/src/com/cloud/agent/api/routing/SavePasswordCommand.java b/api/src/com/cloud/agent/api/routing/SavePasswordCommand.java
index 92cf671db6f..6dac1488e11 100644
--- a/api/src/com/cloud/agent/api/routing/SavePasswordCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SavePasswordCommand.java
@@ -22,25 +22,25 @@ public class SavePasswordCommand extends NetworkElementCommand {
String password;
String vmIpAddress;
String vmName;
-
- protected SavePasswordCommand() {
+
+ protected SavePasswordCommand() {
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public SavePasswordCommand(String password, String vmIpAddress, String vmName) {
this.password = password;
this.vmIpAddress = vmIpAddress;
this.vmName = vmName;
}
-
+
public String getPassword() {
return password;
}
-
+
public String getVmIpAddress() {
return vmIpAddress;
}
@@ -48,7 +48,7 @@ public class SavePasswordCommand extends NetworkElementCommand {
public String getVmName() {
return vmName;
}
-
-
-
+
+
+
}
diff --git a/api/src/com/cloud/agent/api/routing/SetFirewallRulesAnswer.java b/api/src/com/cloud/agent/api/routing/SetFirewallRulesAnswer.java
index 82730bd7ea2..5268c3dda76 100644
--- a/api/src/com/cloud/agent/api/routing/SetFirewallRulesAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/SetFirewallRulesAnswer.java
@@ -20,16 +20,16 @@ import com.cloud.agent.api.Answer;
public class SetFirewallRulesAnswer extends Answer {
String[] results;
-
+
protected SetFirewallRulesAnswer() {
}
-
+
public SetFirewallRulesAnswer(SetFirewallRulesCommand cmd, boolean success, String[] results) {
super(cmd, success, null);
assert (cmd.getRules().length == results.length) : "rules and their results should be the same length don't you think?";
this.results = results;
}
-
+
public String[] getResults() {
return results;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetFirewallRulesCommand.java b/api/src/com/cloud/agent/api/routing/SetFirewallRulesCommand.java
index 528f36bfa81..3841bd7a157 100644
--- a/api/src/com/cloud/agent/api/routing/SetFirewallRulesCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetFirewallRulesCommand.java
@@ -23,7 +23,7 @@ import java.util.Set;
import com.cloud.agent.api.to.FirewallRuleTO;
/**
- *
+ *
* AccessDetails allow different components to put in information about
* how to access the components inside the command.
*/
@@ -32,11 +32,11 @@ public class SetFirewallRulesCommand extends NetworkElementCommand {
protected SetFirewallRulesCommand() {
}
-
+
public SetFirewallRulesCommand(List rules) {
- this.rules = rules.toArray(new FirewallRuleTO[rules.size()]);
+ this.rules = rules.toArray(new FirewallRuleTO[rules.size()]);
}
-
+
public FirewallRuleTO[] getRules() {
return rules;
}
@@ -45,34 +45,34 @@ public class SetFirewallRulesCommand extends NetworkElementCommand {
String [][] result = new String [2][];
Set toAdd = new HashSet();
-
+
for (FirewallRuleTO fwTO: rules) {
- /* example : 172.16.92.44:tcp:80:80:0.0.0.0/0:,200.16.92.44:tcp:220:220:0.0.0.0/0:,
+ /* example : 172.16.92.44:tcp:80:80:0.0.0.0/0:,200.16.92.44:tcp:220:220:0.0.0.0/0:,
* each entry format :protocol:srcport:destport:scidr:
* reverted entry format :reverted:0:0:0:
*/
- if (fwTO.revoked() == true)
+ if (fwTO.revoked() == true)
{
StringBuilder sb = new StringBuilder();
/* This entry is added just to make sure atleast there will one entry in the list to get the ipaddress */
- sb.append(fwTO.getSrcIp()).append(":reverted:0:0:0:");
+ sb.append(fwTO.getSrcIp()).append(":reverted:0:0:0:");
String fwRuleEntry = sb.toString();
toAdd.add(fwRuleEntry);
continue;
}
-
+
List cidr;
StringBuilder sb = new StringBuilder();
sb.append(fwTO.getSrcIp()).append(":").append(fwTO.getProtocol()).append(":");
if ("icmp".compareTo(fwTO.getProtocol()) == 0)
{
sb.append(fwTO.getIcmpType()).append(":").append(fwTO.getIcmpCode()).append(":");
-
+
}else if (fwTO.getStringSrcPortRange() == null)
sb.append("0:0").append(":");
else
sb.append(fwTO.getStringSrcPortRange()).append(":");
-
+
cidr = fwTO.getSourceCidrList();
if (cidr == null || cidr.isEmpty())
{
@@ -80,19 +80,19 @@ public class SetFirewallRulesCommand extends NetworkElementCommand {
}else{
Boolean firstEntry = true;
for (String tag : cidr) {
- if (!firstEntry) sb.append("-");
+ if (!firstEntry) sb.append("-");
sb.append(tag);
firstEntry = false;
}
}
sb.append(":");
String fwRuleEntry = sb.toString();
-
+
toAdd.add(fwRuleEntry);
-
+
}
result[0] = toAdd.toArray(new String[toAdd.size()]);
-
+
return result;
}
}
diff --git a/api/src/com/cloud/agent/api/routing/SetNetworkACLAnswer.java b/api/src/com/cloud/agent/api/routing/SetNetworkACLAnswer.java
index cc14295e227..dc192add20b 100644
--- a/api/src/com/cloud/agent/api/routing/SetNetworkACLAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/SetNetworkACLAnswer.java
@@ -20,17 +20,17 @@ import com.cloud.agent.api.Answer;
public class SetNetworkACLAnswer extends Answer {
String[] results;
-
+
protected SetNetworkACLAnswer() {
}
-
+
public SetNetworkACLAnswer(SetNetworkACLCommand cmd, boolean success, String[] results) {
super(cmd, success, null);
assert (cmd.getRules().length == results.length) : "ACLs and their results should be the same length";
this.results = results;
}
-
+
public String[] getResults() {
return results;
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java b/api/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
index b8fe119176f..dba7354c8f2 100644
--- a/api/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetNetworkACLCommand.java
@@ -30,12 +30,12 @@ public class SetNetworkACLCommand extends NetworkElementCommand{
protected SetNetworkACLCommand() {
}
-
+
public SetNetworkACLCommand(List rules, NicTO nic) {
- this.rules = rules.toArray(new NetworkACLTO[rules.size()]);
+ this.rules = rules.toArray(new NetworkACLTO[rules.size()]);
this.nic = nic;
}
-
+
public NetworkACLTO[] getRules() {
return rules;
}
@@ -43,22 +43,22 @@ public class SetNetworkACLCommand extends NetworkElementCommand{
String [][] result = new String [2][];
Set toAdd = new HashSet();
-
+
for (NetworkACLTO aclTO: rules) {
- /* example : Ingress:tcp:80:80:0.0.0.0/0:,Egress:tcp:220:220:0.0.0.0/0:,
+ /* example : Ingress:tcp:80:80:0.0.0.0/0:,Egress:tcp:220:220:0.0.0.0/0:,
* each entry format Ingress/Egress:protocol:start port: end port:scidrs:
* reverted entry format Ingress/Egress:reverted:0:0:0:
*/
- if (aclTO.revoked() == true)
+ if (aclTO.revoked() == true)
{
StringBuilder sb = new StringBuilder();
/* This entry is added just to make sure atleast there will one entry in the list to get the ipaddress */
- sb.append(aclTO.getTrafficType().toString()).append(":reverted:0:0:0:");
+ sb.append(aclTO.getTrafficType().toString()).append(":reverted:0:0:0:");
String aclRuleEntry = sb.toString();
toAdd.add(aclRuleEntry);
continue;
}
-
+
List cidr;
StringBuilder sb = new StringBuilder();
sb.append(aclTO.getTrafficType().toString()).append(":").append(aclTO.getProtocol()).append(":");
@@ -75,22 +75,22 @@ public class SetNetworkACLCommand extends NetworkElementCommand{
}else{
Boolean firstEntry = true;
for (String tag : cidr) {
- if (!firstEntry) sb.append("-");
+ if (!firstEntry) sb.append("-");
sb.append(tag);
firstEntry = false;
}
}
sb.append(":");
String aclRuleEntry = sb.toString();
-
+
toAdd.add(aclRuleEntry);
-
+
}
result[0] = toAdd.toArray(new String[toAdd.size()]);
-
+
return result;
}
-
+
public NicTO getNic() {
return nic;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesAnswer.java b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesAnswer.java
index 9aa2f6db5d2..15306fbe645 100644
--- a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesAnswer.java
@@ -23,14 +23,14 @@ public class SetPortForwardingRulesAnswer extends Answer {
protected SetPortForwardingRulesAnswer() {
super();
}
-
+
public SetPortForwardingRulesAnswer(SetPortForwardingRulesCommand cmd, String[] results, boolean success) {
super(cmd, success, null);
-
+
assert(cmd.getRules().length == results.length) : "Shouldn't the results match the commands?";
this.results = results;
}
-
+
String[] getResults() {
return results;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesCommand.java b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesCommand.java
index dc820431e36..a7bf37f83ef 100644
--- a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesCommand.java
@@ -25,7 +25,7 @@ public class SetPortForwardingRulesCommand extends NetworkElementCommand {
protected SetPortForwardingRulesCommand() {
}
-
+
public SetPortForwardingRulesCommand(List extends PortForwardingRuleTO> pfRules) {
rules = new PortForwardingRuleTO[pfRules.size()];
int i = 0;
@@ -33,7 +33,7 @@ public class SetPortForwardingRulesCommand extends NetworkElementCommand {
rules[i++] = rule;
}
}
-
+
public PortForwardingRuleTO[] getRules() {
return rules;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesVpcCommand.java b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesVpcCommand.java
index 042e788b4ce..7228457d890 100644
--- a/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesVpcCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetPortForwardingRulesVpcCommand.java
@@ -23,7 +23,7 @@ import com.cloud.agent.api.to.PortForwardingRuleTO;
public class SetPortForwardingRulesVpcCommand extends SetPortForwardingRulesCommand{
protected SetPortForwardingRulesVpcCommand() {
}
-
+
public SetPortForwardingRulesVpcCommand(List extends PortForwardingRuleTO> pfRules) {
super(pfRules);
}
diff --git a/api/src/com/cloud/agent/api/routing/SetSourceNatCommand.java b/api/src/com/cloud/agent/api/routing/SetSourceNatCommand.java
index 165a15d5640..96aa001de84 100644
--- a/api/src/com/cloud/agent/api/routing/SetSourceNatCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetSourceNatCommand.java
@@ -21,10 +21,10 @@ import com.cloud.agent.api.to.IpAddressTO;
public class SetSourceNatCommand extends NetworkElementCommand{
IpAddressTO ipAddress;
boolean add;
-
+
protected SetSourceNatCommand() {
}
-
+
public SetSourceNatCommand(IpAddressTO ip, boolean add) {
this.ipAddress = ip;
this.add = add;
@@ -38,5 +38,5 @@ public class SetSourceNatCommand extends NetworkElementCommand{
public IpAddressTO getIpAddress() {
return ipAddress;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/routing/SetStaticNatRulesAnswer.java b/api/src/com/cloud/agent/api/routing/SetStaticNatRulesAnswer.java
index e57b3277850..9b5d09b25c5 100644
--- a/api/src/com/cloud/agent/api/routing/SetStaticNatRulesAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/SetStaticNatRulesAnswer.java
@@ -23,14 +23,14 @@ public class SetStaticNatRulesAnswer extends Answer {
protected SetStaticNatRulesAnswer() {
super();
}
-
+
public SetStaticNatRulesAnswer(SetStaticNatRulesCommand cmd, String[] results, boolean success) {
super(cmd, success, null);
-
+
assert(cmd.getRules().length == results.length) : "Shouldn't the results match the commands?";
this.results = results;
}
-
+
String[] getResults() {
return results;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetStaticNatRulesCommand.java b/api/src/com/cloud/agent/api/routing/SetStaticNatRulesCommand.java
index c28032ccdfb..852d16167ab 100644
--- a/api/src/com/cloud/agent/api/routing/SetStaticNatRulesCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetStaticNatRulesCommand.java
@@ -21,13 +21,13 @@ import java.util.List;
import com.cloud.agent.api.to.StaticNatRuleTO;
public class SetStaticNatRulesCommand extends NetworkElementCommand{
-
+
StaticNatRuleTO[] rules;
Long vpcId;
protected SetStaticNatRulesCommand() {
}
-
+
public SetStaticNatRulesCommand(List extends StaticNatRuleTO> staticNatRules, Long vpcId) {
rules = new StaticNatRuleTO[staticNatRules.size()];
int i = 0;
@@ -36,7 +36,7 @@ public class SetStaticNatRulesCommand extends NetworkElementCommand{
}
this.vpcId = vpcId;
}
-
+
public StaticNatRuleTO[] getRules() {
return rules;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetStaticRouteAnswer.java b/api/src/com/cloud/agent/api/routing/SetStaticRouteAnswer.java
index c13bda060e2..76f5bb96b1e 100644
--- a/api/src/com/cloud/agent/api/routing/SetStaticRouteAnswer.java
+++ b/api/src/com/cloud/agent/api/routing/SetStaticRouteAnswer.java
@@ -20,16 +20,16 @@ import com.cloud.agent.api.Answer;
public class SetStaticRouteAnswer extends Answer{
String[] results;
-
+
protected SetStaticRouteAnswer() {
}
-
+
public SetStaticRouteAnswer(SetStaticRouteCommand cmd, boolean success, String[] results) {
super(cmd, success, null);
assert (cmd.getStaticRoutes().length == results.length) : "Static routes and their results should be the same length";
this.results = results;
}
-
+
public String[] getResults() {
return results;
}
diff --git a/api/src/com/cloud/agent/api/routing/SetStaticRouteCommand.java b/api/src/com/cloud/agent/api/routing/SetStaticRouteCommand.java
index 0c91a9efa74..c9c2056816b 100644
--- a/api/src/com/cloud/agent/api/routing/SetStaticRouteCommand.java
+++ b/api/src/com/cloud/agent/api/routing/SetStaticRouteCommand.java
@@ -27,12 +27,12 @@ import com.cloud.utils.net.NetUtils;
public class SetStaticRouteCommand extends NetworkElementCommand{
StaticRouteProfile[] staticRoutes;
-
+
protected SetStaticRouteCommand() {
}
-
+
public SetStaticRouteCommand(List staticRoutes) {
- this.staticRoutes = staticRoutes.toArray(new StaticRouteProfile[staticRoutes.size()]);
+ this.staticRoutes = staticRoutes.toArray(new StaticRouteProfile[staticRoutes.size()]);
}
public StaticRouteProfile[] getStaticRoutes() {
diff --git a/api/src/com/cloud/agent/api/routing/Site2SiteVpnCfgCommand.java b/api/src/com/cloud/agent/api/routing/Site2SiteVpnCfgCommand.java
index 97db2f96cc3..83163039f51 100644
--- a/api/src/com/cloud/agent/api/routing/Site2SiteVpnCfgCommand.java
+++ b/api/src/com/cloud/agent/api/routing/Site2SiteVpnCfgCommand.java
@@ -5,7 +5,7 @@
// 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,
@@ -30,16 +30,16 @@ public class Site2SiteVpnCfgCommand extends NetworkElementCommand {
private long ikeLifetime;
private long espLifetime;
private boolean dpd;
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public Site2SiteVpnCfgCommand () {
this.create = false;
}
-
+
public Site2SiteVpnCfgCommand (boolean create, String localPublicIp, String localPublicGateway, String localGuestCidr, String peerGatewayIp,
String peerGuestCidrList, String ikePolicy, String espPolicy, String ipsecPsk, Long ikeLifetime, Long espLifetime, Boolean dpd) {
this.create = create;
@@ -55,11 +55,11 @@ public class Site2SiteVpnCfgCommand extends NetworkElementCommand {
this.espLifetime = espLifetime;
this.dpd = dpd;
}
-
+
public boolean isCreate() {
return create;
}
-
+
public void setCreate(boolean create) {
this.create = create;
}
diff --git a/api/src/com/cloud/agent/api/routing/UserDataCommand.java b/api/src/com/cloud/agent/api/routing/UserDataCommand.java
index 103bd91f804..f7b38c8c364 100644
--- a/api/src/com/cloud/agent/api/routing/UserDataCommand.java
+++ b/api/src/com/cloud/agent/api/routing/UserDataCommand.java
@@ -23,31 +23,31 @@ public class UserDataCommand extends NetworkElementCommand {
String vmIpAddress;
String routerPrivateIpAddress;
String vmName;
-
+
protected UserDataCommand() {
-
+
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public UserDataCommand(String userData, String vmIpAddress, String routerPrivateIpAddress, String vmName) {
this.userData = userData;
this.vmIpAddress = vmIpAddress;
this.routerPrivateIpAddress = routerPrivateIpAddress;
this.vmName = vmName;
}
-
+
public String getRouterPrivateIpAddress() {
return routerPrivateIpAddress;
}
-
+
public String getVmIpAddress() {
return vmIpAddress;
}
-
+
public String getVmName() {
return vmName;
}
@@ -59,5 +59,5 @@ public class UserDataCommand extends NetworkElementCommand {
public void setUserData(String userData) {
this.userData = userData;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/routing/VmDataCommand.java b/api/src/com/cloud/agent/api/routing/VmDataCommand.java
index d5053840e0b..df882554479 100644
--- a/api/src/com/cloud/agent/api/routing/VmDataCommand.java
+++ b/api/src/com/cloud/agent/api/routing/VmDataCommand.java
@@ -23,24 +23,24 @@ import com.cloud.agent.api.LogLevel;
import com.cloud.agent.api.LogLevel.Log4jLevel;
public class VmDataCommand extends NetworkElementCommand {
-
+
String vmIpAddress;
String vmName;
@LogLevel(Log4jLevel.Trace)
List vmData;
-
+
protected VmDataCommand() {
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public VmDataCommand(String vmIpAddress) {
this(vmIpAddress, null);
}
-
+
public String getVmName() {
return vmName;
}
@@ -50,18 +50,18 @@ public class VmDataCommand extends NetworkElementCommand {
this.vmIpAddress = vmIpAddress;
this.vmData = new ArrayList();
}
-
-
+
+
public String getVmIpAddress() {
return vmIpAddress;
}
-
+
public List getVmData() {
return vmData;
}
-
+
public void addVmData(String folder, String file, String contents) {
vmData.add(new String[]{folder, file, contents});
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/routing/VpnUsersCfgCommand.java b/api/src/com/cloud/agent/api/routing/VpnUsersCfgCommand.java
index 249c2358d2f..ebe725d2911 100644
--- a/api/src/com/cloud/agent/api/routing/VpnUsersCfgCommand.java
+++ b/api/src/com/cloud/agent/api/routing/VpnUsersCfgCommand.java
@@ -23,12 +23,12 @@ import com.cloud.network.VpnUser;
public class VpnUsersCfgCommand extends NetworkElementCommand {
- public static class UsernamePassword{
+ public static class UsernamePassword{
private String username;
@LogLevel(Log4jLevel.Off)
private String password;
boolean add = true;
-
+
public boolean isAdd() {
return add;
}
@@ -66,11 +66,11 @@ public class VpnUsersCfgCommand extends NetworkElementCommand {
}
}
UsernamePassword [] userpwds;
-
+
protected VpnUsersCfgCommand() {
-
+
}
-
+
public VpnUsersCfgCommand(List addUsers, List removeUsers) {
userpwds = new UsernamePassword[addUsers.size() + removeUsers.size()];
int i = 0;
@@ -86,7 +86,7 @@ public class VpnUsersCfgCommand extends NetworkElementCommand {
public boolean executeInSequence() {
return true;
}
-
+
public UsernamePassword[] getUserpwds() {
return userpwds;
}
diff --git a/api/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java b/api/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
index 5737a05d98b..04b3d4360d5 100644
--- a/api/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/AbstractDownloadCommand.java
@@ -24,46 +24,46 @@ public abstract class AbstractDownloadCommand extends ssCommand {
private ImageFormat format;
private long accountId;
private String name;
-
+
protected AbstractDownloadCommand() {
}
-
+
protected AbstractDownloadCommand(String name, String url, ImageFormat format, long accountId) {
assert(url != null);
url = url.replace('\\', '/');
-
+
this.url = url;
this.format = format;
this.accountId = accountId;
this.name = name;
}
-
+
protected AbstractDownloadCommand(AbstractDownloadCommand that) {
super(that);
assert(that.url != null);
-
+
this.url = that.url.replace('\\', '/');
this.format = that.format;
this.accountId = that.accountId;
this.name = that.name;
}
-
+
public String getUrl() {
return url;
}
-
+
public String getName() {
return name;
}
-
+
public ImageFormat getFormat() {
return format;
}
-
+
public long getAccountId() {
return accountId;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/storage/AbstractUploadCommand.java b/api/src/com/cloud/agent/api/storage/AbstractUploadCommand.java
index 1c55e8fafd6..49c04b16a81 100644
--- a/api/src/com/cloud/agent/api/storage/AbstractUploadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/AbstractUploadCommand.java
@@ -25,37 +25,37 @@ public class AbstractUploadCommand extends StorageCommand{
private ImageFormat format;
private long accountId;
private String name;
-
+
protected AbstractUploadCommand() {
}
-
+
protected AbstractUploadCommand(String name, String url, ImageFormat format, long accountId) {
this.url = url;
this.format = format;
this.accountId = accountId;
this.name = name;
}
-
+
protected AbstractUploadCommand(AbstractUploadCommand that) {
this(that.name, that.url, that.format, that.accountId);
}
-
+
public String getUrl() {
return url;
}
-
+
public String getName() {
return name;
}
-
+
public ImageFormat getFormat() {
return format;
}
-
+
public long getAccountId() {
return accountId;
}
-
+
@Override
public boolean executeInSequence() {
return true;
diff --git a/api/src/com/cloud/agent/api/storage/CopyVolumeAnswer.java b/api/src/com/cloud/agent/api/storage/CopyVolumeAnswer.java
index 7704569b37a..8c55ac3eecc 100644
--- a/api/src/com/cloud/agent/api/storage/CopyVolumeAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CopyVolumeAnswer.java
@@ -22,20 +22,20 @@ import com.cloud.agent.api.Command;
public class CopyVolumeAnswer extends Answer {
private String volumeFolder;
private String volumePath;
-
+
protected CopyVolumeAnswer() {
}
-
+
public CopyVolumeAnswer(Command command, boolean success, String details, String volumeFolder, String volumePath) {
super(command, success, details);
this.volumeFolder = volumeFolder;
this.volumePath = volumePath;
}
-
+
public String getVolumeFolder() {
return volumeFolder;
}
-
+
public String getVolumePath() {
return volumePath;
}
diff --git a/api/src/com/cloud/agent/api/storage/CopyVolumeCommand.java b/api/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
index 26bd1871138..3d05e9ba69c 100644
--- a/api/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
+++ b/api/src/com/cloud/agent/api/storage/CopyVolumeCommand.java
@@ -23,49 +23,49 @@ import com.cloud.storage.StoragePool;
public class CopyVolumeCommand extends Command {
long volumeId;
- String volumePath;
+ String volumePath;
StorageFilerTO pool;
String secondaryStorageURL;
boolean toSecondaryStorage;
String vmName;
-
- public CopyVolumeCommand() {
+
+ public CopyVolumeCommand() {
}
-
+
public CopyVolumeCommand(long volumeId, String volumePath, StoragePool pool, String secondaryStorageURL, boolean toSecondaryStorage, int wait) {
this.volumeId = volumeId;
- this.volumePath = volumePath;
+ this.volumePath = volumePath;
this.pool = new StorageFilerTO(pool);
this.secondaryStorageURL = secondaryStorageURL;
this.toSecondaryStorage = toSecondaryStorage;
setWait(wait);
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public String getVolumePath() {
return volumePath;
}
-
+
public long getVolumeId() {
return volumeId;
}
-
+
public StorageFilerTO getPool() {
return pool;
}
-
+
public String getSecondaryStorageURL() {
return secondaryStorageURL;
}
-
+
public boolean toSecondaryStorage() {
return toSecondaryStorage;
}
-
+
public String getVmName() {
return vmName;
}
diff --git a/api/src/com/cloud/agent/api/storage/CreateAnswer.java b/api/src/com/cloud/agent/api/storage/CreateAnswer.java
index 695b6bad316..ab6cc038604 100644
--- a/api/src/com/cloud/agent/api/storage/CreateAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CreateAnswer.java
@@ -24,29 +24,29 @@ public class CreateAnswer extends Answer {
boolean requestTemplateReload = false;
protected CreateAnswer() {
}
-
+
public CreateAnswer(CreateCommand cmd, VolumeTO volume) {
super(cmd, true, null);
this.volume = volume;
}
-
+
public CreateAnswer(CreateCommand cmd, String details) {
super(cmd, false, details);
}
-
+
public CreateAnswer(CreateCommand cmd, String details, boolean requestTemplateReload) {
super(cmd, false, details);
this.requestTemplateReload = requestTemplateReload;
}
-
+
public CreateAnswer(CreateCommand cmd, Exception e) {
super(cmd, e);
}
-
+
public VolumeTO getVolume() {
return volume;
}
-
+
public boolean templateReloadRequested() {
return requestTemplateReload;
}
diff --git a/api/src/com/cloud/agent/api/storage/CreateCommand.java b/api/src/com/cloud/agent/api/storage/CreateCommand.java
index b8b2446216d..fd0375aa6e7 100644
--- a/api/src/com/cloud/agent/api/storage/CreateCommand.java
+++ b/api/src/com/cloud/agent/api/storage/CreateCommand.java
@@ -26,14 +26,14 @@ public class CreateCommand extends Command {
private StorageFilerTO pool;
private DiskProfile diskCharacteristics;
private String templateUrl;
-
+
protected CreateCommand() {
super();
}
/**
* Construction for template based volumes.
- *
+ *
* @param vol
* @param vm
* @param diskCharacteristics
@@ -47,7 +47,7 @@ public class CreateCommand extends Command {
/**
* Construction for regular volumes.
- *
+ *
* @param vol
* @param vm
* @param diskCharacteristics
@@ -55,19 +55,19 @@ public class CreateCommand extends Command {
*/
public CreateCommand(DiskProfile diskCharacteristics, StorageFilerTO pool) {
this.volId = diskCharacteristics.getVolumeId();
- this.diskCharacteristics = diskCharacteristics;
+ this.diskCharacteristics = diskCharacteristics;
this.pool = pool;
this.templateUrl = null;
}
-
+
public CreateCommand(DiskProfile diskCharacteristics, String templateUrl, StoragePool pool) {
this(diskCharacteristics, templateUrl, new StorageFilerTO(pool));
}
-
+
public CreateCommand(DiskProfile diskCharacteristics, StoragePool pool) {
this(diskCharacteristics, new StorageFilerTO(pool));
}
-
+
@Override
public boolean executeInSequence() {
return true;
@@ -76,19 +76,19 @@ public class CreateCommand extends Command {
public String getTemplateUrl() {
return templateUrl;
}
-
+
public StorageFilerTO getPool() {
return pool;
}
-
+
public DiskProfile getDiskCharacteristics() {
return diskCharacteristics;
}
-
+
public long getVolumeId() {
return volId;
}
-
+
@Deprecated
public String getInstanceName() {
return null;
diff --git a/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLAnswer.java b/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLAnswer.java
index 550a9490e90..808a67f994f 100644
--- a/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLAnswer.java
@@ -19,19 +19,19 @@ package com.cloud.agent.api.storage;
import com.cloud.agent.api.Answer;
public class CreateEntityDownloadURLAnswer extends Answer{
-
+
String resultString;
short resultCode;
public static final short RESULT_SUCCESS = 1;
public static final short RESULT_FAILURE = 0;
-
+
public CreateEntityDownloadURLAnswer(String resultString, short resultCode) {
super();
this.resultString = resultString;
this.resultCode = resultCode;
- }
-
- public CreateEntityDownloadURLAnswer(){
+ }
+
+ public CreateEntityDownloadURLAnswer(){
}
}
diff --git a/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLCommand.java b/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLCommand.java
index f32002257ca..c80179a0560 100755
--- a/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLCommand.java
+++ b/api/src/com/cloud/agent/api/storage/CreateEntityDownloadURLCommand.java
@@ -26,7 +26,7 @@ public class CreateEntityDownloadURLCommand extends AbstractDownloadCommand {
this.installPath = installPath;
this.extractLinkUUID = uuid;
}
-
+
public CreateEntityDownloadURLCommand(String installPath, String uuid) {
super();
this.parent = parent;
@@ -40,7 +40,7 @@ public class CreateEntityDownloadURLCommand extends AbstractDownloadCommand {
private String installPath;
private String parent;
private String extractLinkUUID;
-
+
@Override
public boolean executeInSequence() {
return false;
@@ -53,7 +53,7 @@ public class CreateEntityDownloadURLCommand extends AbstractDownloadCommand {
public void setInstallPath(String installPath) {
this.installPath = installPath;
}
-
+
public String getParent() {
return parent;
}
diff --git a/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateAnswer.java b/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateAnswer.java
index 2dfcf211c0f..83db84d8b87 100644
--- a/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateAnswer.java
@@ -29,7 +29,7 @@ public class CreatePrivateTemplateAnswer extends Answer {
public CreatePrivateTemplateAnswer() {}
- public CreatePrivateTemplateAnswer(Command cmd, boolean success, String result, String path, long virtualSize,
+ public CreatePrivateTemplateAnswer(Command cmd, boolean success, String result, String path, long virtualSize,
long physicalSize, String uniqueName, ImageFormat format) {
super(cmd, success, result);
_path = path;
@@ -42,23 +42,23 @@ public class CreatePrivateTemplateAnswer extends Answer {
public CreatePrivateTemplateAnswer(Command cmd, boolean success, String result) {
super(cmd, success, result);
}
-
+
public String getPath() {
return _path;
}
-
+
public void setPath(String path) {
_path = path;
}
-
+
public long getVirtualSize() {
return _virtualSize;
}
-
+
public void setVirtualSize(long virtualSize) {
_virtualSize = virtualSize;
}
-
+
public void setphysicalSize(long _physicalSize) {
this._physicalSize = _physicalSize;
}
@@ -70,7 +70,7 @@ public class CreatePrivateTemplateAnswer extends Answer {
public String getUniqueName() {
return _uniqueName;
}
-
+
public ImageFormat getImageFormat() {
return _format;
}
diff --git a/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateCommand.java b/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateCommand.java
index 5fd186cb37f..d392a89ec38 100644
--- a/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateCommand.java
+++ b/api/src/com/cloud/agent/api/storage/CreatePrivateTemplateCommand.java
@@ -24,7 +24,7 @@ public class CreatePrivateTemplateCommand extends StorageCommand {
private String _uniqueName;
private long _templateId;
private long _accountId;
-
+
// For XenServer
private String _secondaryStorageURL;
private String _snapshotName;
@@ -44,10 +44,10 @@ public class CreatePrivateTemplateCommand extends StorageCommand {
}
@Override
- public boolean executeInSequence() {
+ public boolean executeInSequence() {
return false;
}
-
+
public String getSecondaryStorageURL() {
return _secondaryStorageURL;
}
@@ -67,23 +67,23 @@ public class CreatePrivateTemplateCommand extends StorageCommand {
public String getSnapshotPath() {
return _snapshotPath;
}
-
+
public String getSnapshotName() {
return _snapshotName;
}
-
+
public String getUserFolder() {
return _userFolder;
}
-
+
public long getTemplateId() {
return _templateId;
}
-
+
public long getAccountId() {
return _accountId;
}
-
+
public void setTemplateId(long templateId) {
_templateId = templateId;
}
diff --git a/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java b/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java
index 69a2b495a30..c6fdf3cb6fe 100644
--- a/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java
@@ -19,19 +19,19 @@ package com.cloud.agent.api.storage;
import com.cloud.agent.api.Answer;
public class DeleteEntityDownloadURLAnswer extends Answer{
-
+
String resultString;
short resultCode;
public static final short RESULT_SUCCESS = 1;
public static final short RESULT_FAILURE = 0;
-
+
public DeleteEntityDownloadURLAnswer(String resultString, short resultCode) {
super();
this.resultString = resultString;
this.resultCode = resultCode;
- }
-
- public DeleteEntityDownloadURLAnswer(){
+ }
+
+ public DeleteEntityDownloadURLAnswer(){
}
}
diff --git a/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLCommand.java b/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLCommand.java
index 772e6c6b251..fbfacb97c85 100755
--- a/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLCommand.java
@@ -19,9 +19,9 @@ package com.cloud.agent.api.storage;
import com.cloud.storage.Upload;
public class DeleteEntityDownloadURLCommand extends AbstractDownloadCommand {
-
+
private String path;
- private String extractUrl;
+ private String extractUrl;
private Upload.Type type;
private String parentPath;
diff --git a/api/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java b/api/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
index ce349dda522..69f465c6b16 100644
--- a/api/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DeleteTemplateCommand.java
@@ -21,19 +21,19 @@ public class DeleteTemplateCommand extends ssCommand {
private String templatePath;
- public DeleteTemplateCommand() {
+ public DeleteTemplateCommand() {
}
-
+
public DeleteTemplateCommand(String secUrl, String templatePath) {
this.setSecUrl(secUrl);
this.templatePath = templatePath;
}
-
+
@Override
public boolean executeInSequence() {
return true;
}
-
+
public String getTemplatePath() {
return templatePath;
}
diff --git a/api/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java b/api/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
index ea729e81bda..949af010423 100755
--- a/api/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java
@@ -14,25 +14,25 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.agent.api.storage;
-
-public class DeleteVolumeCommand extends ssCommand {
- private String volumePath;
-
- public DeleteVolumeCommand() {
- }
-
- public DeleteVolumeCommand(String secUrl, String volumePath) {
- this.setSecUrl(secUrl);
- this.volumePath = volumePath;
- }
-
- @Override
- public boolean executeInSequence() {
- return true;
- }
-
- public String getVolumePath() {
- return volumePath;
- }
-}
+package com.cloud.agent.api.storage;
+
+public class DeleteVolumeCommand extends ssCommand {
+ private String volumePath;
+
+ public DeleteVolumeCommand() {
+ }
+
+ public DeleteVolumeCommand(String secUrl, String volumePath) {
+ this.setSecUrl(secUrl);
+ this.volumePath = volumePath;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public String getVolumePath() {
+ return volumePath;
+ }
+}
diff --git a/api/src/com/cloud/agent/api/storage/DestroyAnswer.java b/api/src/com/cloud/agent/api/storage/DestroyAnswer.java
index 2f01c1bcd28..ac60015944f 100644
--- a/api/src/com/cloud/agent/api/storage/DestroyAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/DestroyAnswer.java
@@ -22,7 +22,7 @@ public class DestroyAnswer extends Answer {
public DestroyAnswer(DestroyCommand cmd, boolean result, String details) {
super(cmd, result, details);
}
-
+
// Constructor for gson.
protected DestroyAnswer() {
super();
diff --git a/api/src/com/cloud/agent/api/storage/DestroyCommand.java b/api/src/com/cloud/agent/api/storage/DestroyCommand.java
index 29c564c3bc3..6732ea59c23 100755
--- a/api/src/com/cloud/agent/api/storage/DestroyCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DestroyCommand.java
@@ -25,25 +25,25 @@ public class DestroyCommand extends StorageCommand {
// in VMware, things are designed around VM instead of volume, we need it the volume VM context if the volume is attached
String vmName;
VolumeTO volume;
-
+
protected DestroyCommand() {
}
-
+
public DestroyCommand(StoragePool pool, Volume volume, String vmName) {
this.volume = new VolumeTO(volume, pool);
this.vmName = vmName;
}
-
+
public DestroyCommand(StoragePool pool, VMTemplateStorageResourceAssoc templatePoolRef) {
- volume = new VolumeTO(templatePoolRef.getId(), null, pool.getPoolType(), pool.getUuid(),
- null, pool.getPath(), templatePoolRef.getInstallPath(),
+ volume = new VolumeTO(templatePoolRef.getId(), null, pool.getPoolType(), pool.getUuid(),
+ null, pool.getPath(), templatePoolRef.getInstallPath(),
templatePoolRef.getTemplateSize(), null);
}
-
+
public VolumeTO getVolume() {
return volume;
}
-
+
public String getVmName() {
return vmName;
}
diff --git a/api/src/com/cloud/agent/api/storage/DownloadAnswer.java b/api/src/com/cloud/agent/api/storage/DownloadAnswer.java
index 52c32455d80..bb7b8a9239c 100755
--- a/api/src/com/cloud/agent/api/storage/DownloadAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/DownloadAnswer.java
@@ -33,40 +33,40 @@ public class DownloadAnswer extends Answer {
private long templateSize = 0L;
private long templatePhySicalSize = 0L;
private String checkSum;
-
+
public String getCheckSum() {
return checkSum;
}
-
+
public int getDownloadPct() {
return downloadPct;
}
public String getErrorString() {
return errorString;
}
-
+
public String getDownloadStatusString() {
return downloadStatus.toString();
}
-
+
public VMTemplateStorageResourceAssoc.Status getDownloadStatus() {
return downloadStatus;
}
-
+
public String getDownloadPath() {
return downloadPath;
}
protected DownloadAnswer() {
-
+
}
-
+
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
-
+
public DownloadAnswer(String errorString, Status status) {
super();
this.downloadPct = 0;
@@ -74,7 +74,7 @@ public class DownloadAnswer extends Answer {
this.downloadStatus = status;
this.details = errorString;
}
-
+
public DownloadAnswer(String jobId, int downloadPct, String errorString,
Status downloadStatus, String fileSystemPath, String installPath, long templateSize, long templatePhySicalSize, String checkSum) {
super();
@@ -89,7 +89,7 @@ public class DownloadAnswer extends Answer {
this.templatePhySicalSize = templatePhySicalSize;
this.checkSum = checkSum;
}
-
+
public DownloadAnswer(String jobId, int downloadPct, Command command,
Status downloadStatus, String fileSystemPath, String installPath) {
super(command);
@@ -99,7 +99,7 @@ public class DownloadAnswer extends Answer {
this.downloadPath = fileSystemPath;
this.installPath = installPath;
}
-
+
private static String fixPath(String path){
if (path == null) {
return path;
@@ -112,11 +112,11 @@ public class DownloadAnswer extends Answer {
}
return path;
}
-
+
public void setDownloadStatus(VMTemplateStorageResourceAssoc.Status downloadStatus) {
this.downloadStatus = downloadStatus;
}
-
+
public String getInstallPath() {
return installPath;
}
@@ -127,7 +127,7 @@ public class DownloadAnswer extends Answer {
public void setTemplateSize(long templateSize) {
this.templateSize = templateSize;
}
-
+
public Long getTemplateSize() {
return templateSize;
}
@@ -137,5 +137,5 @@ public class DownloadAnswer extends Answer {
public long getTemplatePhySicalSize() {
return templatePhySicalSize;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/storage/DownloadCommand.java b/api/src/com/cloud/agent/api/storage/DownloadCommand.java
index af9ff40b0f2..efb5ecb5256 100644
--- a/api/src/com/cloud/agent/api/storage/DownloadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DownloadCommand.java
@@ -21,14 +21,15 @@ import java.net.URI;
import com.cloud.storage.Volume;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
+import org.apache.cloudstack.api.InternalIdentity;
-public class DownloadCommand extends AbstractDownloadCommand {
+public class DownloadCommand extends AbstractDownloadCommand implements InternalIdentity {
public static class PasswordAuth {
String userName;
String password;
public PasswordAuth() {
-
+
}
public PasswordAuth(String user, String password) {
this.userName = user;
@@ -41,28 +42,28 @@ public class DownloadCommand extends AbstractDownloadCommand {
return password;
}
}
-
+
public static enum ResourceType {
VOLUME, TEMPLATE
}
-
+
public static class Proxy {
private String _host;
private int _port;
private String _userName;
private String _password;
-
+
public Proxy() {
-
+
}
-
+
public Proxy(String host, int port, String userName, String password) {
this._host = host;
this._port = port;
this._userName = userName;
this._password = password;
}
-
+
public Proxy(URI uri) {
this._host = uri.getHost();
this._port = uri.getPort() == -1 ? 3128 : uri.getPort();
@@ -78,19 +79,19 @@ public class DownloadCommand extends AbstractDownloadCommand {
}
}
}
-
+
public String getHost() {
return _host;
}
-
+
public int getPort() {
return _port;
}
-
+
public String getUserName() {
return _userName;
}
-
+
public String getPassword() {
return _password;
}
@@ -103,11 +104,11 @@ public class DownloadCommand extends AbstractDownloadCommand {
private Long maxDownloadSizeInBytes = null;
private long id;
private ResourceType resourceType = ResourceType.TEMPLATE;
-
+
protected DownloadCommand() {
}
-
-
+
+
public DownloadCommand(DownloadCommand that) {
super(that);
this.hvm = that.hvm;
@@ -119,7 +120,7 @@ public class DownloadCommand extends AbstractDownloadCommand {
this.maxDownloadSizeInBytes = that.getMaxDownloadSizeInBytes();
this.resourceType = that.resourceType;
}
-
+
public DownloadCommand(String secUrl, VirtualMachineTemplate template, Long maxDownloadSizeInBytes) {
super(template.getUniqueName(), template.getUrl(), template.getFormat(), template.getAccountId());
this.hvm = template.isRequiresHvm();
@@ -129,7 +130,7 @@ public class DownloadCommand extends AbstractDownloadCommand {
this.setSecUrl(secUrl);
this.maxDownloadSizeInBytes = maxDownloadSizeInBytes;
}
-
+
public DownloadCommand(String secUrl, Volume volume, Long maxDownloadSizeInBytes, String checkSum, String url, ImageFormat format) {
super(volume.getName(), url, format, volume.getAccountId());
//this.hvm = volume.isRequiresHvm();
@@ -150,11 +151,11 @@ public class DownloadCommand extends AbstractDownloadCommand {
this.maxDownloadSizeInBytes = maxDownloadSizeInBytes;
auth = new PasswordAuth(user, passwd);
}
-
+
public long getId() {
return id;
}
-
+
public void setHvm(boolean hvm) {
this.hvm = hvm;
}
@@ -188,19 +189,19 @@ public class DownloadCommand extends AbstractDownloadCommand {
public PasswordAuth getAuth() {
return auth;
}
-
+
public void setCreds(String userName, String passwd) {
auth = new PasswordAuth(userName, passwd);
}
-
+
public Proxy getProxy() {
return _proxy;
}
-
+
public void setProxy(Proxy proxy) {
_proxy = proxy;
}
-
+
public Long getMaxDownloadSizeInBytes() {
return maxDownloadSizeInBytes;
}
diff --git a/api/src/com/cloud/agent/api/storage/DownloadProgressCommand.java b/api/src/com/cloud/agent/api/storage/DownloadProgressCommand.java
index 205ba801527..835847bedeb 100644
--- a/api/src/com/cloud/agent/api/storage/DownloadProgressCommand.java
+++ b/api/src/com/cloud/agent/api/storage/DownloadProgressCommand.java
@@ -26,7 +26,7 @@ public class DownloadProgressCommand extends DownloadCommand {
protected DownloadProgressCommand() {
super();
}
-
+
public DownloadProgressCommand(DownloadCommand cmd, String jobId, RequestType req) {
super(cmd);
diff --git a/api/src/com/cloud/agent/api/storage/ListTemplateAnswer.java b/api/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
index 45622faffd3..06e95fe4265 100644
--- a/api/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/ListTemplateAnswer.java
@@ -25,17 +25,17 @@ import com.cloud.storage.template.TemplateInfo;
public class ListTemplateAnswer extends Answer {
private String secUrl;
private Map templateInfos;
-
+
public ListTemplateAnswer() {
-
+
}
-
+
public ListTemplateAnswer(String secUrl, Map templateInfos) {
super(null, true, "success");
this.setSecUrl(secUrl);
- this.templateInfos = templateInfos;
+ this.templateInfos = templateInfos;
}
-
+
public Map getTemplateInfo() {
return templateInfos;
}
diff --git a/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java b/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
index 18123fa1997..da25ed56bf3 100644
--- a/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
+++ b/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
@@ -24,15 +24,15 @@ public class ListTemplateCommand extends StorageCommand {
private String secUrl;
@LogLevel(Log4jLevel.Off)
private SwiftTO swift;
-
+
public ListTemplateCommand() {
}
-
+
public ListTemplateCommand(String secUrl) {
this.secUrl = secUrl;
this.swift = null;
}
-
+
public ListTemplateCommand(SwiftTO swift) {
this.secUrl = null;
this.swift = swift;
diff --git a/api/src/com/cloud/agent/api/storage/ListVolumeAnswer.java b/api/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
index e2dc447ec6d..6bbb2e82c33 100755
--- a/api/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
+++ b/api/src/com/cloud/agent/api/storage/ListVolumeAnswer.java
@@ -14,40 +14,40 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.agent.api.storage;
-
-import java.util.Map;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.storage.template.TemplateInfo;
-
-public class ListVolumeAnswer extends Answer {
- private String secUrl;
- private Map templateInfos;
-
- public ListVolumeAnswer() {
-
- }
-
- public ListVolumeAnswer(String secUrl, Map templateInfos) {
- super(null, true, "success");
- this.setSecUrl(secUrl);
- this.templateInfos = templateInfos;
- }
-
- public Map getTemplateInfo() {
- return templateInfos;
- }
-
- public void setTemplateInfo(Map templateInfos) {
- this.templateInfos = templateInfos;
- }
-
- public void setSecUrl(String secUrl) {
- this.secUrl = secUrl;
- }
-
- public String getSecUrl() {
- return secUrl;
- }
-}
+package com.cloud.agent.api.storage;
+
+import java.util.Map;
+
+import com.cloud.agent.api.Answer;
+import com.cloud.storage.template.TemplateInfo;
+
+public class ListVolumeAnswer extends Answer {
+ private String secUrl;
+ private Map templateInfos;
+
+ public ListVolumeAnswer() {
+
+ }
+
+ public ListVolumeAnswer(String secUrl, Map templateInfos) {
+ super(null, true, "success");
+ this.setSecUrl(secUrl);
+ this.templateInfos = templateInfos;
+ }
+
+ public Map getTemplateInfo() {
+ return templateInfos;
+ }
+
+ public void setTemplateInfo(Map templateInfos) {
+ this.templateInfos = templateInfos;
+ }
+
+ public void setSecUrl(String secUrl) {
+ this.secUrl = secUrl;
+ }
+
+ public String getSecUrl() {
+ return secUrl;
+ }
+}
diff --git a/api/src/com/cloud/agent/api/storage/ListVolumeCommand.java b/api/src/com/cloud/agent/api/storage/ListVolumeCommand.java
index afec624b984..a2776c2af46 100755
--- a/api/src/com/cloud/agent/api/storage/ListVolumeCommand.java
+++ b/api/src/com/cloud/agent/api/storage/ListVolumeCommand.java
@@ -14,30 +14,30 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.agent.api.storage;
-
-import com.cloud.agent.api.LogLevel;
-import com.cloud.agent.api.LogLevel.Log4jLevel;
-import com.cloud.agent.api.to.SwiftTO;
-
-public class ListVolumeCommand extends StorageCommand {
-
- private String secUrl;
-
- public ListVolumeCommand() {
- }
-
- public ListVolumeCommand(String secUrl) {
- this.secUrl = secUrl;
- }
-
- @Override
- public boolean executeInSequence() {
- return true;
- }
-
- public String getSecUrl() {
- return secUrl;
- }
-
-}
+package com.cloud.agent.api.storage;
+
+import com.cloud.agent.api.LogLevel;
+import com.cloud.agent.api.LogLevel.Log4jLevel;
+import com.cloud.agent.api.to.SwiftTO;
+
+public class ListVolumeCommand extends StorageCommand {
+
+ private String secUrl;
+
+ public ListVolumeCommand() {
+ }
+
+ public ListVolumeCommand(String secUrl) {
+ this.secUrl = secUrl;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return true;
+ }
+
+ public String getSecUrl() {
+ return secUrl;
+ }
+
+}
diff --git a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityAnswer.java
index 354a693ee9d..edd283090b1 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);
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java b/api/src/com/cloud/agent/api/storage/ManageVolumeAvailabilityCommand.java
index e27fe8ce2b3..1a7d4807f28 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;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadAnswer.java
index 3d5c55645ae..a5a6c49e9ab 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;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
index f66d00eb8cb..b450041597f 100644
--- a/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/PrimaryStorageDownloadCommand.java
@@ -27,8 +27,9 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
String localPath;
String poolUuid;
long poolId;
- StorageFilerTO primaryPool;
-
+
+ StorageFilerTO primaryPool;
+
String secondaryStorageUrl;
String primaryStorageUrl;
@@ -42,11 +43,11 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
this.primaryPool = new StorageFilerTO(pool);
setWait(wait);
}
-
+
public String getPoolUuid() {
return poolUuid;
}
-
+
public long getPoolId() {
return poolId;
}
@@ -58,27 +59,27 @@ public class PrimaryStorageDownloadCommand extends AbstractDownloadCommand {
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;
diff --git a/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java b/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java
new file mode 100644
index 00000000000..3434b985aaa
--- /dev/null
+++ b/api/src/com/cloud/agent/api/storage/ResizeVolumeAnswer.java
@@ -0,0 +1,40 @@
+// 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.agent.api.storage;
+
+import com.cloud.agent.api.Answer;
+
+public class ResizeVolumeAnswer extends Answer {
+ private long newSize;
+
+ protected ResizeVolumeAnswer() {
+
+ }
+
+ public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details, long newSize) {
+ super(cmd, result, details);
+ this.newSize = newSize;
+ }
+
+ public ResizeVolumeAnswer(ResizeVolumeCommand cmd, boolean result, String details) {
+ super(cmd, result, details);
+ }
+
+ public long getNewSize() {
+ return newSize;
+ }
+}
diff --git a/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java b/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java
new file mode 100644
index 00000000000..8af23a0ab81
--- /dev/null
+++ b/api/src/com/cloud/agent/api/storage/ResizeVolumeCommand.java
@@ -0,0 +1,86 @@
+// 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.agent.api.storage;
+
+import com.cloud.agent.api.Command;
+import com.cloud.agent.api.to.StorageFilerTO;
+import com.cloud.storage.StoragePool;
+
+public class ResizeVolumeCommand extends Command {
+ private String path;
+ private StorageFilerTO pool;
+ private String vmInstance;
+ private Long newSize;
+ private Long currentSize;
+ private boolean shrinkOk;
+
+ protected ResizeVolumeCommand() {
+
+ }
+
+ public ResizeVolumeCommand(String path,
+ StorageFilerTO pool,
+ Long currentSize,
+ Long newSize,
+ boolean shrinkOk,
+ String vmInstance)
+ {
+ this.path = path;
+ this.pool = pool;
+ this.vmInstance = vmInstance;
+ this.currentSize = currentSize;
+ this.newSize = newSize;
+ this.shrinkOk = shrinkOk;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public String getPoolUuid() {
+ return pool.getUuid();
+ }
+
+ public StorageFilerTO getPool() {
+ return pool;
+ }
+
+ public long getNewSize() {
+ return newSize;
+ }
+
+ public long getCurrentSize() {
+ return currentSize;
+ }
+
+ public boolean getShrinkOk() {
+ return shrinkOk;
+ }
+
+ public String getInstanceName() {
+ return vmInstance;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+
+}
diff --git a/api/src/com/cloud/agent/api/storage/UploadAnswer.java b/api/src/com/cloud/agent/api/storage/UploadAnswer.java
index 430eb83c9b0..f2d9788e8dc 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;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/storage/UploadCommand.java b/api/src/com/cloud/agent/api/storage/UploadCommand.java
index 4b004c91ed7..2a7c60a51ff 100644
--- a/api/src/com/cloud/agent/api/storage/UploadCommand.java
+++ b/api/src/com/cloud/agent/api/storage/UploadCommand.java
@@ -20,13 +20,14 @@ import com.cloud.agent.api.storage.DownloadCommand.PasswordAuth;
import com.cloud.agent.api.to.TemplateTO;
import com.cloud.storage.Upload.Type;
import com.cloud.template.VirtualMachineTemplate;
+import org.apache.cloudstack.api.InternalIdentity;
-public class UploadCommand extends AbstractUploadCommand {
+public class UploadCommand extends AbstractUploadCommand implements InternalIdentity {
private TemplateTO template;
private String url;
- private String installPath;
+ private String installPath;
private boolean hvm;
private String description;
private String checksum;
@@ -36,16 +37,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 +55,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;
diff --git a/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java b/api/src/com/cloud/agent/api/storage/UploadProgressCommand.java
index 36b1437ef90..7f6d584045d 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
+
+}
diff --git a/api/src/com/cloud/agent/api/storage/ssCommand.java b/api/src/com/cloud/agent/api/storage/ssCommand.java
index c7b75ea3873..c218a8d5b79 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;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
index 01860204c00..95ac57c3867 100644
--- a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
@@ -22,22 +22,23 @@ import java.util.List;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.FirewallRule.State;
import com.cloud.utils.net.NetUtils;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* 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.
*
*/
-public class FirewallRuleTO {
+public class FirewallRuleTO implements InternalIdentity {
long id;
String srcVlanTag;
String srcIp;
@@ -49,34 +50,35 @@ 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 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 sourceCidr,Integer icmpType,Integer icmpCode) {
+ this.id = id;
this.srcVlanTag = srcVlanTag;
this.srcIp = srcIp;
this.protocol = protocol;
-
+
if (srcPortStart != null) {
List portRange = new ArrayList();
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 +89,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 +101,7 @@ public class FirewallRuleTO {
public String getSrcVlanTag() {
return srcVlanTag;
}
-
+
public String getSrcIp() {
return srcIp;
}
@@ -111,15 +113,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 +132,11 @@ public class FirewallRuleTO {
public boolean revoked() {
return revoked;
}
-
+
public List getSourceCidrList() {
return sourceCidrList;
}
-
+
public boolean isAlreadyAdded() {
return alreadyAdded;
}
@@ -142,5 +144,5 @@ public class FirewallRuleTO {
public FirewallRule.Purpose getPurpose() {
return purpose;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/to/HostTO.java b/api/src/com/cloud/agent/api/to/HostTO.java
index f7b734c19d2..967a63d63b5 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());
diff --git a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java
index 2e19af05569..2d166ea1e1e 100644
--- a/api/src/com/cloud/agent/api/to/LoadBalancerTO.java
+++ b/api/src/com/cloud/agent/api/to/LoadBalancerTO.java
@@ -43,12 +43,13 @@ public class LoadBalancerTO {
String algorithm;
boolean revoked;
boolean alreadyAdded;
+ boolean inline;
DestinationTO[] destinations;
private StickinessPolicyTO[] stickinessPolicies;
private AutoScaleVmGroupTO autoScaleVmGroupTO;
final static int MAX_STICKINESS_POLICIES = 1;
- public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List destinations) {
+ public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List destinations) {
if (destinations == null) { // for autoscaleconfig destinations will be null;
destinations = new ArrayList();
}
@@ -59,6 +60,7 @@ public class LoadBalancerTO {
this.algorithm = algorithm;
this.revoked = revoked;
this.alreadyAdded = alreadyAdded;
+ this.inline = inline;
this.destinations = new DestinationTO[destinations.size()];
this.stickinessPolicies = null;
int i = 0;
@@ -67,8 +69,8 @@ public class LoadBalancerTO {
}
}
- public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, List arg_destinations, List stickinessPolicies) {
- this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, arg_destinations);
+ public LoadBalancerTO(String id, String srcIp, int srcPort, String protocol, String algorithm, boolean revoked, boolean alreadyAdded, boolean inline, List arg_destinations, List stickinessPolicies) {
+ this(id, srcIp, srcPort, protocol, algorithm, revoked, alreadyAdded, inline, arg_destinations);
this.stickinessPolicies = null;
if (stickinessPolicies != null && stickinessPolicies.size() > 0) {
this.stickinessPolicies = new StickinessPolicyTO[MAX_STICKINESS_POLICIES];
@@ -116,6 +118,10 @@ public class LoadBalancerTO {
return alreadyAdded;
}
+ public boolean isInline() {
+ return inline;
+ }
+
public StickinessPolicyTO[] getStickinessPolicies() {
return stickinessPolicies;
}
diff --git a/api/src/com/cloud/agent/api/to/NetworkACLTO.java b/api/src/com/cloud/agent/api/to/NetworkACLTO.java
index 3cdf8fb476e..9b1a6296b08 100644
--- a/api/src/com/cloud/agent/api/to/NetworkACLTO.java
+++ b/api/src/com/cloud/agent/api/to/NetworkACLTO.java
@@ -23,9 +23,10 @@ import java.util.List;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.FirewallRule.TrafficType;
import com.cloud.utils.net.NetUtils;
+import org.apache.cloudstack.api.InternalIdentity;
-public class NetworkACLTO {
+public class NetworkACLTO implements InternalIdentity {
long id;
String vlanTag;
String protocol;
@@ -36,32 +37,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 cidrList, Integer icmpType,Integer icmpCode,TrafficType trafficType) {
this.vlanTag = vlanTag;
this.protocol = protocol;
-
+
if (portStart != null) {
List range = new ArrayList();
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 +72,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 +92,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 +111,11 @@ public class NetworkACLTO {
public boolean revoked() {
return revoked;
}
-
+
public List getSourceCidrList() {
return cidrList;
}
-
+
public boolean isAlreadyAdded() {
return alreadyAdded;
}
diff --git a/api/src/com/cloud/agent/api/to/NetworkTO.java b/api/src/com/cloud/agent/api/to/NetworkTO.java
index ad9d4d90ee7..3edd4c0f937 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
diff --git a/api/src/com/cloud/agent/api/to/NicTO.java b/api/src/com/cloud/agent/api/to/NicTO.java
index 79a43d2e625..aa2aa19cc19 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();
diff --git a/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java b/api/src/com/cloud/agent/api/to/PortForwardingRuleTO.java
index 19673a6e4c7..c23dce8ea86 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() };
}
-
+
public PortForwardingRuleTO(long id, String srcIp, int srcPortStart, int srcPortEnd, String dstIp, int dstPortStart, int dstPortEnd, String protocol, boolean revoked, boolean alreadyAdded) {
super(id, null, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, 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);
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java b/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
index fd77dd69578..64ca266a1ca 100644
--- a/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/StaticNatRuleTO.java
@@ -22,34 +22,39 @@ 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;
}
+
+ public StaticNatRuleTO(long id,String srcVlanTag, String srcIp, Integer srcPortStart, Integer srcPortEnd, String dstIp, Integer dstPortStart, Integer dstPortEnd, String protocol, boolean revoked, boolean alreadyAdded) {
+ super(id, srcVlanTag, srcIp, protocol, srcPortStart, srcPortEnd, revoked, alreadyAdded, FirewallRule.Purpose.StaticNat, null,0,0);
+ this.dstIp = dstIp;
+ }
public String getDstIp() {
return dstIp;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/to/StorageFilerTO.java b/api/src/com/cloud/agent/api/to/StorageFilerTO.java
index 26344daaeb6..8f58c9e1c91 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();
diff --git a/api/src/com/cloud/agent/api/to/SwiftTO.java b/api/src/com/cloud/agent/api/to/SwiftTO.java
index 7920ce83e27..32742c7d0e3 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;
}
-
+
}
diff --git a/api/src/com/cloud/agent/api/to/TemplateTO.java b/api/src/com/cloud/agent/api/to/TemplateTO.java
index e163340fbf0..d77b80551f4 100644
--- a/api/src/com/cloud/agent/api/to/TemplateTO.java
+++ b/api/src/com/cloud/agent/api/to/TemplateTO.java
@@ -18,21 +18,22 @@ package com.cloud.agent.api.to;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
+import org.apache.cloudstack.api.InternalIdentity;
-public class TemplateTO {
+public class TemplateTO implements InternalIdentity {
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;
}
diff --git a/api/src/com/cloud/agent/api/to/VirtualMachineTO.java b/api/src/com/cloud/agent/api/to/VirtualMachineTO.java
index a93c242b7c1..8f3f0eb39d6 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 getDetails() {
return params;
}
-
+
public void setDetails(Map params) {
this.params = params;
}
@@ -217,6 +217,6 @@ public class VirtualMachineTO {
public void setUuid(String uuid) {
this.uuid = uuid;
}
-
-
+
+
}
diff --git a/api/src/com/cloud/agent/api/to/VolumeTO.java b/api/src/com/cloud/agent/api/to/VolumeTO.java
index ca0acb57876..ff739c58f80 100644
--- a/api/src/com/cloud/agent/api/to/VolumeTO.java
+++ b/api/src/com/cloud/agent/api/to/VolumeTO.java
@@ -19,8 +19,9 @@ package com.cloud.agent.api.to;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
import com.cloud.storage.Volume;
+import org.apache.cloudstack.api.InternalIdentity;
-public class VolumeTO {
+public class VolumeTO implements InternalIdentity {
protected VolumeTO() {
}
diff --git a/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java b/api/src/com/cloud/agent/api/uploadTemplateToSwiftFromSecondaryStorageCommand.java
index 23f0a7e0fb9..10001b149fa 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
+}
diff --git a/api/src/com/cloud/alert/Alert.java b/api/src/com/cloud/alert/Alert.java
index c9368a34522..defd15490e5 100644
--- a/api/src/com/cloud/alert/Alert.java
+++ b/api/src/com/cloud/alert/Alert.java
@@ -16,10 +16,12 @@
// under the License.
package com.cloud.alert;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
-public interface Alert {
- long getId();
+public interface Alert extends Identity, InternalIdentity {
short getType();
String getSubject();
Long getPodId();
diff --git a/api/src/com/cloud/api/commands/.gitignore b/api/src/com/cloud/api/commands/.gitignore
index 63e3fa0c721..62042786c83 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
diff --git a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java b/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
index 99fd48f82d2..263f023b3e5 100644
--- a/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
+++ b/api/src/com/cloud/api/commands/CreatePrivateNetworkCmd.java
@@ -16,16 +16,14 @@
// under the License.
package com.cloud.api.commands;
+import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.NetworkResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.NetworkResponse;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@@ -33,7 +31,7 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.Network;
import com.cloud.user.UserContext;
-@Implementation(description="Creates a private network", responseObject=NetworkResponse.class)
+//@APICommand(description="Creates a private network", responseObject=NetworkResponse.class)
public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreatePrivateNetworkCmd.class.getName());
@@ -42,42 +40,42 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
+
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="the name of the network")
private String name;
-
+
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, required=true, description="the display text of the network")
private String displayText;
-
- @IdentityMapper(entityTableName="physical_network")
- @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.LONG, required=true, description="the Physical Network ID the network belongs to")
+
+ @Parameter(name=ApiConstants.PHYSICAL_NETWORK_ID, type=CommandType.UUID, entityType = PhysicalNetworkResponse.class,
+ required=true, description="the Physical Network ID the network belongs to")
private Long physicalNetworkId;
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway of the network")
private String gateway;
-
+
@Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask of the network")
private String netmask;
-
+
@Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address in the network IP range")
private String startIp;
-
+
@Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address in the network IP" +
" range. If not specified, will be defaulted to startIP")
private String endIp;
-
+
@Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, required=true, description="the ID or VID of the network")
private String vlan;
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="account who will own the network")
private String accountName;
-
- @IdentityMapper(entityTableName="projects")
- @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.LONG, description="an optional project for the ssh key")
+
+ @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType = ProjectResponse.class,
+ description="an optional project for the ssh key")
private Long projectId;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="domain ID of the account owning a network")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType = DomainResponse.class,
+ description="domain ID of the account owning a network")
private Long domainId;
@@ -100,7 +98,7 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
public Long getDomainId() {
return domainId;
}
-
+
public String getNetmask() {
return netmask;
}
@@ -108,23 +106,23 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
public String getStartIp() {
return startIp;
}
-
+
public String getNetworkName() {
return name;
}
-
+
public String getDisplayText() {
return displayText;
}
-
+
public Long getProjectId() {
return projectId;
}
-
+
public long getPhysicalNetworkId() {
return physicalNetworkId;
}
-
+
public String getEndIp() {
return endIp;
}
@@ -136,8 +134,8 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
public String getCommandName() {
return s_name;
}
-
-
+
+
@Override
public void create() throws ResourceAllocationException {
Network result = null;
@@ -152,14 +150,15 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
s_logger.warn("Exception: ", ex);
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, ex.getMessage());
}
-
+
if (result != null) {
this.setEntityId(result.getId());
+ this.setEntityUuid(result.getUuid());
} else {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a Private network");
}
}
-
+
@Override
public void execute() throws InsufficientCapacityException, ConcurrentOperationException, ResourceAllocationException{
Network result = _networkService.getNetwork(getEntityId());
@@ -171,7 +170,7 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create private network");
}
}
-
+
@Override
public long getEntityOwnerId() {
Long accountId = finalyzeAccountId(accountName, domainId, projectId, true);
@@ -191,9 +190,5 @@ public class CreatePrivateNetworkCmd extends BaseAsyncCreateCmd {
return "creating private network";
}
-
- @Override
- public String getEntityTable() {
- return "networks";
- }
+
}
diff --git a/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java b/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java
deleted file mode 100755
index 8299ec94693..00000000000
--- a/api/src/com/cloud/api/commands/CreateStorageNetworkIpRangeCmd.java
+++ /dev/null
@@ -1,127 +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 com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.StorageNetworkIpRangeResponse;
-import com.cloud.dc.StorageNetworkIpRange;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-
-@Implementation(description="Creates a Storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
-public class CreateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(CreateStorageNetworkIpRangeCmd.class);
-
- private static final String s_name = "createstoragenetworkiprangeresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, required=true, description="UUID of pod where the ip range belongs to")
- private Long podId;
-
- @Parameter(name=ApiConstants.START_IP, type=CommandType.STRING, required=true, description="the beginning IP address")
- private String startIp;
-
- @Parameter(name=ApiConstants.END_IP, type=CommandType.STRING, description="the ending IP address")
- private String endIp;
-
- @Parameter(name = ApiConstants.VLAN, type = CommandType.INTEGER, description = "Optional. The vlan the ip range sits on, default to Null when it is not specificed which means you network is not on any Vlan. This is mainly for Vmware as other hypervisors can directly reterive bridge from pyhsical network traffic type table")
- private Integer vlan;
-
- @Parameter(name=ApiConstants.NETMASK, type=CommandType.STRING, required=true, description="the netmask for storage network")
- private String netmask;
-
- @Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="the gateway for storage network")
- private String gateway;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public String getEndIp() {
- return endIp;
- }
-
- public Long getPodId() {
- return podId;
- }
-
- public String getStartIp() {
- return startIp;
- }
-
- public Integer getVlan() {
- return vlan;
- }
-
- public String getNetmask() {
- return netmask;
- }
-
- public String getGateWay() {
- return gateway;
- }
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_STORAGE_IP_RANGE_CREATE;
- }
-
- @Override
- public String getEventDescription() {
- return "Creating storage ip range from " + getStartIp() + " to " + getEndIp() + " with vlan " + getVlan();
- }
-
- @Override
- public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
- ResourceAllocationException {
- try {
- StorageNetworkIpRange result = _storageNetworkService.createIpRange(this);
- StorageNetworkIpRangeResponse response = _responseGenerator.createStorageNetworkIpRangeResponse(result);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } catch (Exception e) {
- s_logger.warn("Create storage network IP range failed", e);
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
- }
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
-}
diff --git a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
index 3ae61c1118b..80269075744 100644
--- a/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
+++ b/api/src/com/cloud/api/commands/DestroyConsoleProxyCmd.java
@@ -16,25 +16,21 @@
// under the License.
package com.cloud.api.commands;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Destroys console proxy", responseObject=SuccessResponse.class)
+//@APICommand(description="Destroys console proxy", responseObject=SuccessResponse.class)
public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
+ public static final Logger s_logger = Logger.getLogger(DestroyConsoleProxyCmd.class.getName());
private static final String s_name = "destroyconsoleproxyresponse";
-
+
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
@@ -80,7 +76,7 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "destroying console proxy: " + getId();
}
-
+
@Override
public void execute(){
boolean result = _consoleProxyService.destroyConsoleProxy(this);
diff --git a/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java b/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java
index 7583cc06a05..709da6af30c 100644
--- a/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java
+++ b/api/src/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java
@@ -19,15 +19,15 @@ package com.cloud.api.commands;
import java.util.ArrayList;
import java.util.List;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.SnapshotScheduleResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
import com.cloud.storage.snapshot.SnapshotSchedule;
-@Implementation(description="Lists recurring snapshot schedule", responseObject=SnapshotScheduleResponse.class)
+//@APICommand(description="Lists recurring snapshot schedule", responseObject=SnapshotScheduleResponse.class)
public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
private static final String s_name = "listrecurringsnapshotscheduleresponse";
@@ -61,20 +61,14 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public void execute(){
List extends SnapshotSchedule> snapshotSchedules = _snapshotService.findRecurringSnapshotSchedule(this);
ListResponse response = new ListResponse();
List snapshotScheduleResponses = new ArrayList();
for (SnapshotSchedule snapshotSchedule : snapshotSchedules) {
- SnapshotScheduleResponse snapSchedResponse = new SnapshotScheduleResponse();
- snapSchedResponse.setId(snapshotSchedule.getId());
- snapSchedResponse.setVolumeId(snapshotSchedule.getVolumeId());
- snapSchedResponse.setSnapshotPolicyId(snapshotSchedule.getPolicyId());
- snapSchedResponse.setScheduled(snapshotSchedule.getScheduledTimestamp());
-
- snapSchedResponse.setObjectName("snapshot");
+ SnapshotScheduleResponse snapSchedResponse = _responseGenerator.createSnapshotScheduleResponse(snapshotSchedule);
snapshotScheduleResponses.add(snapSchedResponse);
}
diff --git a/api/src/com/cloud/api/commands/RestoreVMCmd.java b/api/src/com/cloud/api/commands/RestoreVMCmd.java
deleted file mode 100755
index 31d2c229dee..00000000000
--- a/api/src/com/cloud/api/commands/RestoreVMCmd.java
+++ /dev/null
@@ -1,90 +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 com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.event.EventTypes;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-
-@Implementation(description="Restore a VM to original template or specific snapshot", responseObject=UserVmResponse.class, since="3.0.0")
-public class RestoreVMCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(RestoreVMCmd.class);
- private static final String s_name = "restorevmresponse";
-
- @IdentityMapper(entityTableName="vm_instance")
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=true, description="Virtual Machine ID")
- private Long vmId;
-
- @Override
- public String getEventType() {
- return EventTypes.EVENT_VM_RESTORE;
- }
-
- @Override
- public String getEventDescription() {
- return "Restore a VM to orignal template or specific snapshot";
- }
-
- @Override
- public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
- ResourceAllocationException {
- UserVm result;
- UserContext.current().setEventDetails("Vm Id: " + getVmId());
- result = _userVmService.restoreVM(this);
- if (result != null) {
- UserVmResponse response = _responseGenerator.createUserVmResponse("virtualmachine", result).get(0);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } else {
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to restore vm " + getVmId());
- }
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- UserVm vm = _responseGenerator.findUserVmById(getVmId());
- if (vm == null) {
- return Account.ACCOUNT_ID_SYSTEM; // bad id given, parent this command to SYSTEM so ERROR events are tracked
- }
- return vm.getAccountId();
- }
-
- public long getVmId() {
- return vmId;
- }
-
-}
diff --git a/api/src/com/cloud/api/commands/listStorageNetworkIpRangeCmd.java b/api/src/com/cloud/api/commands/listStorageNetworkIpRangeCmd.java
deleted file mode 100755
index f0b3a53fcb1..00000000000
--- a/api/src/com/cloud/api/commands/listStorageNetworkIpRangeCmd.java
+++ /dev/null
@@ -1,108 +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 java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.StorageNetworkIpRangeResponse;
-import com.cloud.dc.StorageNetworkIpRange;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.user.Account;
-
-@Implementation(description="List a storage network IP range.", responseObject=StorageNetworkIpRangeResponse.class, since="3.0.0")
-public class listStorageNetworkIpRangeCmd extends BaseListCmd {
- public static final Logger s_logger = Logger.getLogger(listStorageNetworkIpRangeCmd.class);
-
- String s_name = "liststoragenetworkiprangeresponse";
-
- /////////////////////////////////////////////////////
- //////////////// API parameters /////////////////////
- /////////////////////////////////////////////////////
-
- @IdentityMapper(entityTableName="dc_storage_network_ip_range")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="optional parameter. Storaget network IP range uuid, if specicied, using it to search the range.")
- private Long rangeId;
-
- @IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="optional parameter. Pod uuid, if specicied and range uuid is absent, using it to search the range.")
- private Long podId;
-
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="optional parameter. Zone uuid, if specicied and both pod uuid and range uuid are absent, using it to search the range.")
- private Long zoneId;
-
- /////////////////////////////////////////////////////
- /////////////////// Accessors ///////////////////////
- /////////////////////////////////////////////////////
-
- public Long getRangeId() {
- return rangeId;
- }
-
- public Long getPodId() {
- return podId;
- }
-
- public Long getZoneId() {
- return zoneId;
- }
-
- @Override
- public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
- ResourceAllocationException {
- try {
- List results = _storageNetworkService.listIpRange(this);
- ListResponse response = new ListResponse();
- List resList = new ArrayList(results.size());
- for (StorageNetworkIpRange r : results) {
- StorageNetworkIpRangeResponse resp = _responseGenerator.createStorageNetworkIpRangeResponse(r);
- resList.add(resp);
- }
- response.setResponses(resList);
- response.setResponseName(getCommandName());
- this.setResponseObject(response);
- } catch (Exception e) {
- s_logger.warn("Failed to list storage network ip range for rangeId=" + getRangeId() + " podId=" + getPodId() + " zoneId=" + getZoneId());
- throw new ServerApiException(BaseCmd.INTERNAL_ERROR, e.getMessage());
- }
- }
-
- @Override
- public String getCommandName() {
- return s_name;
- }
-
- @Override
- public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
- }
-
-}
diff --git a/api/src/com/cloud/api/response/AsyncJobResponse.java b/api/src/com/cloud/api/response/AsyncJobResponse.java
deleted file mode 100644
index 45aee122cdb..00000000000
--- a/api/src/com/cloud/api/response/AsyncJobResponse.java
+++ /dev/null
@@ -1,159 +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.response;
-
-import java.util.Date;
-
-import com.cloud.api.ApiConstants;
-import com.cloud.api.ResponseObject;
-import com.cloud.async.AsyncJob;
-import com.cloud.serializer.Param;
-import com.cloud.utils.IdentityProxy;
-import com.google.gson.annotations.SerializedName;
-
-@SuppressWarnings("unused")
-public class AsyncJobResponse extends BaseResponse {
-
- @SerializedName("accountid") @Param(description="the account that executed the async command")
- private IdentityProxy accountId = new IdentityProxy("account");
-
- @SerializedName(ApiConstants.USER_ID) @Param(description="the user that executed the async command")
- private IdentityProxy userId = new IdentityProxy("user");
-
- @SerializedName("cmd") @Param(description="the async command executed")
- private String cmd;
-
- @SerializedName("jobstatus") @Param(description="the current job status-should be 0 for PENDING")
- private Integer jobStatus;
-
- @SerializedName("jobprocstatus") @Param(description="the progress information of the PENDING job")
- private Integer jobProcStatus;
-
- @SerializedName("jobresultcode") @Param(description="the result code for the job")
- private Integer jobResultCode;
-
- @SerializedName("jobresulttype") @Param(description="the result type")
- private String jobResultType;
-
- @SerializedName("jobresult") @Param(description="the result reason")
- private ResponseObject jobResult;
-
- @SerializedName("jobinstancetype") @Param(description="the instance/entity object related to the job")
- private String jobInstanceType;
-
- @SerializedName("jobinstanceid") @Param(description="the unique ID of the instance/entity object related to the job")
- private IdentityProxy jobInstanceId = new IdentityProxy();
-
- @SerializedName(ApiConstants.CREATED) @Param(description=" the created date of the job")
- private Date created;
-
- public void setAccountId(Long accountId) {
- this.accountId.setValue(accountId);
- }
-
- public void setUserId(Long userId) {
- this.userId.setValue(userId);
- }
-
- public void setCmd(String cmd) {
- this.cmd = cmd;
- }
-
- @Override
- public void setJobStatus(Integer jobStatus) {
- this.jobStatus = jobStatus;
- }
-
- public void setJobProcStatus(Integer jobProcStatus) {
- this.jobProcStatus = jobProcStatus;
- }
-
- public void setJobResultCode(Integer jobResultCode) {
- this.jobResultCode = jobResultCode;
- }
-
- public void setJobResultType(String jobResultType) {
- this.jobResultType = jobResultType;
- }
-
- public void setJobResult(ResponseObject jobResult) {
- this.jobResult = jobResult;
- }
-
- public void setJobInstanceType(String jobInstanceType) {
- this.jobInstanceType = jobInstanceType;
-
- if(jobInstanceType != null) {
- if(jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Volume.toString())) {
- this.jobInstanceId.setTableName("volumes");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Template.toString())) {
- this.jobInstanceId.setTableName("vm_template");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Iso.toString())) {
- this.jobInstanceId.setTableName("vm_template");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.VirtualMachine.toString()) || jobInstanceType.equalsIgnoreCase(AsyncJob.Type.ConsoleProxy.toString()) || jobInstanceType.equalsIgnoreCase(AsyncJob.Type.SystemVm.toString()) || jobInstanceType.equalsIgnoreCase(AsyncJob.Type.DomainRouter.toString()) ) {
- this.jobInstanceId.setTableName("vm_instance");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Snapshot.toString())) {
- this.jobInstanceId.setTableName("snapshots");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Host.toString())) {
- this.jobInstanceId.setTableName("host");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.StoragePool.toString())) {
- this.jobInstanceId.setTableName("storage_pool");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.IpAddress.toString())) {
- this.jobInstanceId.setTableName("user_ip_address");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.SecurityGroup.toString())) {
- this.jobInstanceId.setTableName("security_group");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.PhysicalNetwork.toString())) {
- this.jobInstanceId.setTableName("physical_network");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.TrafficType.toString())) {
- this.jobInstanceId.setTableName("physical_network_traffic_types");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.PhysicalNetworkServiceProvider.toString())) {
- this.jobInstanceId.setTableName("physical_network_service_providers");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.FirewallRule.toString())) {
- this.jobInstanceId.setTableName("firewall_rules");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Account.toString())) {
- this.jobInstanceId.setTableName("account");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.User.toString())) {
- this.jobInstanceId.setTableName("user");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.StaticRoute.toString())) {
- this.jobInstanceId.setTableName("static_routes");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.PrivateGateway.toString())) {
- this.jobInstanceId.setTableName("vpc_gateways");
- }else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Counter.toString())) {
- this.jobInstanceId.setTableName("counter");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.Condition.toString())) {
- this.jobInstanceId.setTableName("conditions");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.AutoScalePolicy.toString())) {
- this.jobInstanceId.setTableName("autoscale_policies");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.AutoScaleVmProfile.toString())) {
- this.jobInstanceId.setTableName("autoscale_vmprofiles");
- } else if (jobInstanceType.equalsIgnoreCase(AsyncJob.Type.AutoScaleVmGroup.toString())) {
- this.jobInstanceId.setTableName("autoscale_vmgroups");
- } else if (!jobInstanceType.equalsIgnoreCase(AsyncJob.Type.None.toString())){
- // TODO : when we hit here, we need to add instanceType -> UUID entity table mapping
- assert(false);
- }
- }
- }
-
- public void setJobInstanceId(Long jobInstanceId) {
- this.jobInstanceId.setValue(jobInstanceId);
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-}
diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java
index b8551edc83e..034c853e8f9 100644
--- a/api/src/com/cloud/async/AsyncJob.java
+++ b/api/src/com/cloud/async/AsyncJob.java
@@ -18,9 +18,10 @@ package com.cloud.async;
import java.util.Date;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface AsyncJob extends Identity {
+public interface AsyncJob extends Identity, InternalIdentity {
public enum Type {
None,
VirtualMachine,
@@ -50,8 +51,6 @@ public interface AsyncJob extends Identity {
AutoScaleVmGroup
}
- Long getId();
-
long getUserId();
long getAccountId();
diff --git a/api/src/com/cloud/capacity/Capacity.java b/api/src/com/cloud/capacity/Capacity.java
index 2da2a672ce3..c1c5d8fa9b2 100755
--- a/api/src/com/cloud/capacity/Capacity.java
+++ b/api/src/com/cloud/capacity/Capacity.java
@@ -16,7 +16,10 @@
// under the License.
package com.cloud.capacity;
-public interface Capacity {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface Capacity extends InternalIdentity, Identity {
public static final short CAPACITY_TYPE_MEMORY = 0;
public static final short CAPACITY_TYPE_CPU = 1;
public static final short CAPACITY_TYPE_STORAGE = 2;
@@ -28,8 +31,6 @@ public interface Capacity {
public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8;
public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9;
- public long getId();
-
public Long getHostOrPoolId();
public Long getDataCenterId();
@@ -42,11 +43,9 @@ public interface Capacity {
public long getTotalCapacity();
- public short getCapacityType();
+ public short getCapacityType();
public long getReservedCapacity();
-
+
public Float getUsedPercentage();
-
-
}
diff --git a/api/src/com/cloud/capacity/CapacityState.java b/api/src/com/cloud/capacity/CapacityState.java
index be17663f602..b368567c022 100755
--- a/api/src/com/cloud/capacity/CapacityState.java
+++ b/api/src/com/cloud/capacity/CapacityState.java
@@ -17,9 +17,9 @@
package com.cloud.capacity;
public enum CapacityState {
-
+
Enabled,
- Disabled,
+ Disabled,
Maintenance,
-
+
}
diff --git a/api/src/com/cloud/cluster/ManagementServerHost.java b/api/src/com/cloud/cluster/ManagementServerHost.java
index 0273d472bea..9c88a2b2006 100644
--- a/api/src/com/cloud/cluster/ManagementServerHost.java
+++ b/api/src/com/cloud/cluster/ManagementServerHost.java
@@ -16,7 +16,9 @@
// under the License.
package com.cloud.cluster;
-public interface ManagementServerHost {
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface ManagementServerHost extends InternalIdentity {
public static enum State {
Up, Starting, Down
diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java
index 78d7a2250a9..48a060719c6 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -20,26 +20,24 @@ import java.util.List;
import javax.naming.NamingException;
-import com.cloud.api.commands.CreateDiskOfferingCmd;
-import com.cloud.api.commands.CreateNetworkOfferingCmd;
-import com.cloud.api.commands.CreateServiceOfferingCmd;
-import com.cloud.api.commands.CreateVlanIpRangeCmd;
-import com.cloud.api.commands.CreateZoneCmd;
-import com.cloud.api.commands.DeleteDiskOfferingCmd;
-import com.cloud.api.commands.DeleteNetworkOfferingCmd;
-import com.cloud.api.commands.DeletePodCmd;
-import com.cloud.api.commands.DeleteServiceOfferingCmd;
-import com.cloud.api.commands.DeleteVlanIpRangeCmd;
-import com.cloud.api.commands.DeleteZoneCmd;
-import com.cloud.api.commands.LDAPConfigCmd;
-import com.cloud.api.commands.LDAPRemoveCmd;
-import com.cloud.api.commands.ListNetworkOfferingsCmd;
-import com.cloud.api.commands.UpdateCfgCmd;
-import com.cloud.api.commands.UpdateDiskOfferingCmd;
-import com.cloud.api.commands.UpdateNetworkOfferingCmd;
-import com.cloud.api.commands.UpdatePodCmd;
-import com.cloud.api.commands.UpdateServiceOfferingCmd;
-import com.cloud.api.commands.UpdateZoneCmd;
+import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
+import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd;
+import org.apache.cloudstack.api.command.admin.offering.CreateServiceOfferingCmd;
+import org.apache.cloudstack.api.command.admin.vlan.CreateVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.offering.*;
+import org.apache.cloudstack.api.command.admin.pod.DeletePodCmd;
+import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd;
+import org.apache.cloudstack.api.command.admin.offering.DeleteDiskOfferingCmd;
+import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
+import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd;
+import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
+import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
+import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd;
+import org.apache.cloudstack.api.command.admin.pod.UpdatePodCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
+import org.apache.cloudstack.api.command.admin.offering.UpdateDiskOfferingCmd;
+import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd;
import com.cloud.dc.DataCenter;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
@@ -57,7 +55,7 @@ public interface ConfigurationService {
/**
* Updates a configuration entry with a new value
- *
+ *
* @param cmd
* - the command wrapping name and value parameters
* @return updated configuration object if successful
@@ -66,7 +64,7 @@ public interface ConfigurationService {
/**
* Create a service offering through the API
- *
+ *
* @param cmd
* the command object that specifies the name, number of cpu cores, amount of RAM, etc. for the service
* offering
@@ -76,7 +74,7 @@ public interface ConfigurationService {
/**
* Updates a service offering
- *
+ *
* @param serviceOfferingId
* @param userId
* @param name
@@ -90,7 +88,7 @@ public interface ConfigurationService {
/**
* Deletes a service offering
- *
+ *
* @param userId
* @param serviceOfferingId
*/
@@ -98,7 +96,7 @@ public interface ConfigurationService {
/**
* Updates a disk offering
- *
+ *
* @param cmd
* - the command specifying diskOfferingId, name, description, tags
* @return updated disk offering
@@ -108,7 +106,7 @@ public interface ConfigurationService {
/**
* Deletes a disk offering
- *
+ *
* @param cmd
* - the command specifying disk offering id
* @return true or false
@@ -118,7 +116,7 @@ public interface ConfigurationService {
/**
* Creates a new disk offering
- *
+ *
* @param domainId
* @param name
* @param description
@@ -131,7 +129,7 @@ public interface ConfigurationService {
/**
* Creates a new pod based on the parameters specified in the command object
- *
+ *
* @param zoneId
* TODO
* @param name
@@ -154,7 +152,7 @@ public interface ConfigurationService {
/**
* Edits a pod in the database. Will not allow you to edit pods that are being used anywhere in the system.
- *
+ *
* @param UpdatePodCmd
* api command
*/
@@ -162,7 +160,7 @@ public interface ConfigurationService {
/**
* Deletes a pod from the database. Will not allow you to delete pods that are being used anywhere in the system.
- *
+ *
* @param cmd
* - the command containing podId
* @return true or false
@@ -172,7 +170,7 @@ public interface ConfigurationService {
/**
* Creates a new zone
- *
+ *
* @param cmd
* @return the zone if successful, null otherwise
* @throws
@@ -182,7 +180,7 @@ public interface ConfigurationService {
/**
* Edits a zone in the database. Will not allow you to edit DNS values if there are VMs in the specified zone.
- *
+ *
* @param UpdateZoneCmd
* @return Updated zone
*/
@@ -190,7 +188,7 @@ public interface ConfigurationService {
/**
* Deletes a zone from the database. Will not allow you to delete zones that are being used anywhere in the system.
- *
+ *
* @param userId
* @param zoneId
*/
@@ -200,7 +198,7 @@ public interface ConfigurationService {
* Adds a VLAN to the database, along with an IP address range. Can add three types of VLANs: (1) zone-wide VLANs on
* the
* virtual public network (2) pod-wide direct attached VLANs (3) account-specific direct attached VLANs
- *
+ *
* @param userId
* @param vlanType
* - either "DomR" (VLAN for a virtual public network) or "DirectAttached" (VLAN for IPs that will be
diff --git a/api/src/com/cloud/configuration/ResourceCount.java b/api/src/com/cloud/configuration/ResourceCount.java
index d776a72d2b1..f0b1d7190d5 100644
--- a/api/src/com/cloud/configuration/ResourceCount.java
+++ b/api/src/com/cloud/configuration/ResourceCount.java
@@ -16,9 +16,9 @@
// under the License.
package com.cloud.configuration;
-public interface ResourceCount extends Resource {
+import org.apache.cloudstack.api.InternalIdentity;
- public Long getId();
+public interface ResourceCount extends Resource, InternalIdentity {
public long getCount();
diff --git a/api/src/com/cloud/configuration/ResourceLimit.java b/api/src/com/cloud/configuration/ResourceLimit.java
index df47d09b484..801feebbe10 100644
--- a/api/src/com/cloud/configuration/ResourceLimit.java
+++ b/api/src/com/cloud/configuration/ResourceLimit.java
@@ -16,9 +16,9 @@
// under the License.
package com.cloud.configuration;
-public interface ResourceLimit extends Resource {
+import org.apache.cloudstack.api.InternalIdentity;
- public Long getId();
+public interface ResourceLimit extends Resource, InternalIdentity {
public Long getMax();
diff --git a/api/src/com/cloud/dao/EntityManager.java b/api/src/com/cloud/dao/EntityManager.java
index 0e5b07f51e4..4e4b9c293b5 100644
--- a/api/src/com/cloud/dao/EntityManager.java
+++ b/api/src/com/cloud/dao/EntityManager.java
@@ -37,7 +37,16 @@ public interface EntityManager {
* @return T if found; null if not.
*/
public T findById(Class entityType, K id);
-
+
+ /**
+ * Finds a unique entity by uuid string
+ * @param entity class
+ * @param entityType type of entity you're looking for.
+ * @param uuid the unique id
+ * @return T if found, null if not.
+ */
+ public T findByUuid(Class entityType, String uuid);
+
/**
* Finds an entity by external id which is always String
* @param entity class
@@ -45,8 +54,8 @@ public interface EntityManager {
* @param xid external id
* @return T if found, null if not.
*/
- public T findByXid(Class entityType, String xid);
-
+ public T findByXId(Class entityType, String xid);
+
/**
* Lists all entities. Use this method at your own risk.
* @param entity class
@@ -54,7 +63,7 @@ public interface EntityManager {
* @return List
*/
public List extends T> list(Class entityType);
-
+
/**
* Persists the entity.
* @param entity class
@@ -62,13 +71,13 @@ public interface EntityManager {
* @return persisted entity. Only use this after persisting.
*/
public T persist(T t);
-
+
public SearchBuilder createSearchBuilder(Class entityType);
-
+
public GenericSearchBuilder createGenericSearchBuilder(Class entityType, Class resultType);
-
+
public List search(Class entityType, SearchCriteria sc);
-
+
public void remove(Class entityType, K id);
}
diff --git a/api/src/com/cloud/dc/DataCenter.java b/api/src/com/cloud/dc/DataCenter.java
index 707cd34524e..946e9ccb5bd 100644
--- a/api/src/com/cloud/dc/DataCenter.java
+++ b/api/src/com/cloud/dc/DataCenter.java
@@ -19,18 +19,19 @@ package com.cloud.dc;
import java.util.Map;
import com.cloud.org.Grouping;
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
*
*/
-public interface DataCenter extends Grouping {
+public interface DataCenter extends InfrastructureEntity, Grouping, Identity, InternalIdentity {
public enum NetworkType {
Basic,
Advanced,
}
- long getId();
-
String getDns1();
String getDns2();
diff --git a/api/src/com/cloud/dc/Pod.java b/api/src/com/cloud/dc/Pod.java
index 791c5ad2c2d..9da5b7e7836 100644
--- a/api/src/com/cloud/dc/Pod.java
+++ b/api/src/com/cloud/dc/Pod.java
@@ -17,16 +17,15 @@
package com.cloud.dc;
import com.cloud.org.Grouping;
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* Represents one pod in the cloud stack.
- *
+ *
*/
-public interface Pod extends Grouping {
- /**
- * @return unique id mapped to the pod.
- */
- long getId();
+public interface Pod extends InfrastructureEntity, Grouping, Identity, InternalIdentity {
String getCidrAddress();
@@ -36,8 +35,6 @@ public interface Pod extends Grouping {
long getDataCenterId();
- // String getUniqueName();
-
String getDescription();
String getName();
diff --git a/api/src/com/cloud/dc/StorageNetworkIpRange.java b/api/src/com/cloud/dc/StorageNetworkIpRange.java
index 59aa98ae11e..2b50ca1594e 100755
--- a/api/src/com/cloud/dc/StorageNetworkIpRange.java
+++ b/api/src/com/cloud/dc/StorageNetworkIpRange.java
@@ -16,8 +16,11 @@
// under the License.
package com.cloud.dc;
-public interface StorageNetworkIpRange {
- String getUuid();
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface StorageNetworkIpRange extends InfrastructureEntity, InternalIdentity, Identity {
Integer getVlan();
@@ -30,8 +33,8 @@ public interface StorageNetworkIpRange {
String getNetworkUuid();
String getZoneUuid();
-
+
String getNetmask();
-
+
String getGateway();
}
diff --git a/api/src/com/cloud/dc/Vlan.java b/api/src/com/cloud/dc/Vlan.java
index 1e1fce15fc4..0f629ef3cbf 100644
--- a/api/src/com/cloud/dc/Vlan.java
+++ b/api/src/com/cloud/dc/Vlan.java
@@ -16,7 +16,11 @@
// under the License.
package com.cloud.dc;
-public interface Vlan {
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface Vlan extends InfrastructureEntity, InternalIdentity, Identity {
public enum VlanType {
DirectAttached,
VirtualNetwork
@@ -24,8 +28,6 @@ public interface Vlan {
public final static String UNTAGGED = "untagged";
- public long getId();
-
public String getVlanTag();
public String getVlanGateway();
diff --git a/api/src/com/cloud/deploy/DataCenterDeployment.java b/api/src/com/cloud/deploy/DataCenterDeployment.java
index 25522e06cfa..f046b66ef06 100644
--- a/api/src/com/cloud/deploy/DataCenterDeployment.java
+++ b/api/src/com/cloud/deploy/DataCenterDeployment.java
@@ -37,7 +37,7 @@ public class DataCenterDeployment implements DeploymentPlan {
public DataCenterDeployment(long dataCenterId, Long podId, Long clusterId, Long hostId, Long poolId, Long physicalNetworkId) {
this(dataCenterId, podId, clusterId, hostId, poolId, physicalNetworkId, null);
}
-
+
public DataCenterDeployment(long dataCenterId, Long podId, Long clusterId, Long hostId, Long poolId, Long physicalNetworkId, ReservationContext context) {
_dcId = dataCenterId;
_podId = podId;
@@ -87,7 +87,7 @@ public class DataCenterDeployment implements DeploymentPlan {
public Long getPhysicalNetworkId() {
return _physicalNetworkId;
}
-
+
@Override
public ReservationContext getReservationContext() {
return _context;
diff --git a/api/src/com/cloud/deploy/DeploymentPlanner.java b/api/src/com/cloud/deploy/DeploymentPlanner.java
index e5dcff1be54..537dd314733 100644
--- a/api/src/com/cloud/deploy/DeploymentPlanner.java
+++ b/api/src/com/cloud/deploy/DeploymentPlanner.java
@@ -37,7 +37,7 @@ import com.cloud.vm.VirtualMachineProfile;
public interface DeploymentPlanner extends Adapter {
/**
* plan is called to determine where a virtual machine should be running.
- *
+ *
* @param vm
* virtual machine.
* @param plan
@@ -51,7 +51,7 @@ public interface DeploymentPlanner extends Adapter {
/**
* check() is called right before the virtual machine starts to make sure
* the host has enough capacity.
- *
+ *
* @param vm
* virtual machine in question.
* @param plan
@@ -69,7 +69,7 @@ public interface DeploymentPlanner extends Adapter {
* canHandle is called before plan to determine if the plan can do the allocation. Planers should be exclusive so
* planner writer must
* make sure only one planer->canHandle return true in the planner list
- *
+ *
* @param vm
* virtual machine.
* @param plan
@@ -187,7 +187,7 @@ public interface DeploymentPlanner extends Adapter {
}
_clusterIds.addAll(clusterList);
}
-
+
public void addHost(long hostId) {
if (_hostIds == null) {
_hostIds = new HashSet();
diff --git a/api/src/com/cloud/domain/Domain.java b/api/src/com/cloud/domain/Domain.java
index a7b4031dce5..cfed519ada9 100644
--- a/api/src/com/cloud/domain/Domain.java
+++ b/api/src/com/cloud/domain/Domain.java
@@ -19,19 +19,20 @@ package com.cloud.domain;
import java.util.Date;
import com.cloud.user.OwnedBy;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* Domain defines the Domain object.
*/
-public interface Domain extends OwnedBy {
+
+public interface Domain extends OwnedBy, Identity, InternalIdentity {
public static final long ROOT_DOMAIN = 1L;
enum State {
Active, Inactive
};
- long getId();
-
Long getParent();
void setParent(Long parent);
diff --git a/api/src/com/cloud/event/Event.java b/api/src/com/cloud/event/Event.java
index 6a305378931..1a61636828a 100644
--- a/api/src/com/cloud/event/Event.java
+++ b/api/src/com/cloud/event/Event.java
@@ -18,26 +18,24 @@ package com.cloud.event;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Event extends ControlledEntity{
+public interface Event extends ControlledEntity, Identity, InternalIdentity {
public enum State {
Created,
Scheduled,
Started,
Completed;
}
-
- long getId();
String getType();
State getState();
String getDescription();
Date getCreateDate();
long getUserId();
- long getAccountId();
- long getDomainId();
int getTotalSize();
String getLevel();
long getStartId();
diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java
index e69e4a446a2..87eddca5a69 100755
--- a/api/src/com/cloud/event/EventTypes.java
+++ b/api/src/com/cloud/event/EventTypes.java
@@ -108,6 +108,7 @@ public class EventTypes {
public static final String EVENT_VOLUME_EXTRACT = "VOLUME.EXTRACT";
public static final String EVENT_VOLUME_UPLOAD = "VOLUME.UPLOAD";
public static final String EVENT_VOLUME_MIGRATE = "VOLUME.MIGRATE";
+ public static final String EVENT_VOLUME_RESIZE = "VOLUME.RESIZE";
// Domains
public static final String EVENT_DOMAIN_CREATE = "DOMAIN.CREATE";
@@ -267,26 +268,26 @@ public class EventTypes {
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_ADD = "PHYSICAL.FIREWALL.ADD";
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE = "PHYSICAL.FIREWALL.DELETE";
public static final String EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE = "PHYSICAL.FIREWALL.CONFIGURE";
-
+
// VPC
public static final String EVENT_VPC_CREATE = "VPC.CREATE";
public static final String EVENT_VPC_UPDATE = "VPC.UPDATE";
public static final String EVENT_VPC_DELETE = "VPC.DELETE";
public static final String EVENT_VPC_RESTART = "VPC.RESTART";
-
+
// VPC offerings
public static final String EVENT_VPC_OFFERING_CREATE = "VPC.OFFERING.CREATE";
public static final String EVENT_VPC_OFFERING_UPDATE = "VPC.OFFERING.UPDATE";
public static final String EVENT_VPC_OFFERING_DELETE = "VPC.OFFERING.DELETE";
-
+
// Private gateway
public static final String EVENT_PRIVATE_GATEWAY_CREATE = "PRIVATE.GATEWAY.CREATE";
public static final String EVENT_PRIVATE_GATEWAY_DELETE = "PRIVATE.GATEWAY.DELETE";
-
+
// Static routes
public static final String EVENT_STATIC_ROUTE_CREATE = "STATIC.ROUTE.CREATE";
public static final String EVENT_STATIC_ROUTE_DELETE = "STATIC.ROUTE.DELETE";
-
+
// tag related events
public static final String EVENT_TAGS_CREATE = "CREATE_TAGS";
public static final String EVENT_TAGS_DELETE = "DELETE_TAGS";
@@ -295,7 +296,7 @@ public class EventTypes {
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_ADD = "PHYSICAL.NVPCONTROLLER.ADD";
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_DELETE = "PHYSICAL.NVPCONTROLLER.DELETE";
public static final String EVENT_EXTERNAL_NVP_CONTROLLER_CONFIGURE = "PHYSICAL.NVPCONTROLLER.CONFIGURE";
-
+
// AutoScale
public static final String EVENT_COUNTER_CREATE = "COUNTER.CREATE";
public static final String EVENT_COUNTER_DELETE = "COUNTER.DELETE";
diff --git a/api/src/com/cloud/exception/AgentUnavailableException.java b/api/src/com/cloud/exception/AgentUnavailableException.java
index a2d052b61f5..89193243e1d 100644
--- a/api/src/com/cloud/exception/AgentUnavailableException.java
+++ b/api/src/com/cloud/exception/AgentUnavailableException.java
@@ -24,17 +24,17 @@ import com.cloud.utils.SerialVersionUID;
*
*/
public class AgentUnavailableException extends ResourceUnavailableException {
-
+
private static final long serialVersionUID = SerialVersionUID.AgentUnavailableException;
-
+
public AgentUnavailableException(String msg, long agentId) {
this(msg, agentId, null);
}
-
+
public AgentUnavailableException(long agentId) {
this("Unable to reach host.", agentId);
}
-
+
public AgentUnavailableException(String msg, long agentId, Throwable cause) {
super("Host " + agentId + ": " + msg, Host.class, agentId, cause);
}
diff --git a/api/src/com/cloud/exception/CloudAuthenticationException.java b/api/src/com/cloud/exception/CloudAuthenticationException.java
index 2bba79bab1e..0bf114c0394 100644
--- a/api/src/com/cloud/exception/CloudAuthenticationException.java
+++ b/api/src/com/cloud/exception/CloudAuthenticationException.java
@@ -17,9 +17,9 @@
package com.cloud.exception;
import com.cloud.utils.SerialVersionUID;
-import com.cloud.utils.exception.RuntimeCloudException;
+import com.cloud.utils.exception.CloudRuntimeException;
-public class CloudAuthenticationException extends RuntimeCloudException {
+public class CloudAuthenticationException extends CloudRuntimeException {
private static final long serialVersionUID = SerialVersionUID.CloudAuthenticationException;
public CloudAuthenticationException(String message) {
diff --git a/api/src/com/cloud/exception/CloudException.java b/api/src/com/cloud/exception/CloudException.java
index 9ebeaad6675..732670288f1 100644
--- a/api/src/com/cloud/exception/CloudException.java
+++ b/api/src/com/cloud/exception/CloudException.java
@@ -16,24 +16,22 @@
// under the License.
package com.cloud.exception;
-import com.cloud.utils.IdentityProxy;
import java.util.ArrayList;
import com.cloud.utils.exception.CSExceptionErrorCode;
-import com.cloud.utils.AnnotationHelper;
/**
* by the API response serializer. Any exceptions that are thrown by
* class, which extends RuntimeException instead of Exception like this
- * class does.
+ * class does.
*/
public class CloudException extends Exception {
-
+
// This holds a list of uuids and their names. Add uuid:fieldname pairs
- protected ArrayList idList = new ArrayList();
-
- protected Integer csErrorCode;
-
+ protected ArrayList idList = new ArrayList();
+
+ protected Integer csErrorCode;
+
public CloudException(String message) {
super(message);
setCSErrorCode(CSExceptionErrorCode.getCSErrCode(this.getClass().getName()));
@@ -43,34 +41,27 @@ public class CloudException extends Exception {
super(message, cause);
setCSErrorCode(CSExceptionErrorCode.getCSErrCode(this.getClass().getName()));
}
-
- public void addProxyObject(Object voObj, Long id, String idFieldName) {
- // Get the VO object's table name.
- String tablename = AnnotationHelper.getTableName(voObj);
- if (tablename != null) {
- addProxyObject(tablename, id, idFieldName);
- }
- return;
- }
-
+
+
+
public CloudException() {
super();
setCSErrorCode(CSExceptionErrorCode.getCSErrCode(this.getClass().getName()));
}
-
- public void addProxyObject(String tableName, Long id, String idFieldName) {
- idList.add(new IdentityProxy(tableName, id, idFieldName));
+
+ public void addProxyObject(String uuid) {
+ idList.add(uuid);
return;
}
-
- public ArrayList getIdProxyList() {
+
+ public ArrayList getIdProxyList() {
return idList;
}
-
+
public void setCSErrorCode(int cserrcode) {
this.csErrorCode = cserrcode;
}
-
+
public int getCSErrorCode() {
return this.csErrorCode;
}
diff --git a/api/src/com/cloud/exception/CloudExecutionException.java b/api/src/com/cloud/exception/CloudExecutionException.java
deleted file mode 100755
index 74b116a0983..00000000000
--- a/api/src/com/cloud/exception/CloudExecutionException.java
+++ /dev/null
@@ -1,57 +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.exception;
-
-import java.util.HashMap;
-import com.cloud.utils.exception.RuntimeCloudException;
-
-import com.cloud.utils.SerialVersionUID;
-
-/**
- *
- */
-public class CloudExecutionException extends RuntimeCloudException {
- private final static long serialVersionUID = SerialVersionUID.CloudExecutionException;
-
- private final ErrorCode code;
- private final HashMap details;
-
- public CloudExecutionException(ErrorCode code, String message, Throwable cause) {
- super(message, cause);
- this.code = code;
- details = new HashMap();
- }
-
- public ErrorCode getErrorCode() {
- return code;
- }
-
- public String getErrorMessage() {
- return new StringBuilder("Error Code=").append(code).append("; Error Message=").append(super.toString()).toString();
- }
-
- @Override
- public String toString() {
- StringBuilder buff = new StringBuilder();
- buff.append("Error Code=").append(code);
- buff.append("; Error Message=").append(super.toString());
- if (details.size() > 0) {
- buff.append("; Error Details=").append(details.toString());
- }
- return buff.toString();
- }
-}
diff --git a/api/src/com/cloud/exception/ConcurrentOperationException.java b/api/src/com/cloud/exception/ConcurrentOperationException.java
index 54826d6a5e9..cfe6ba3fa0a 100644
--- a/api/src/com/cloud/exception/ConcurrentOperationException.java
+++ b/api/src/com/cloud/exception/ConcurrentOperationException.java
@@ -19,9 +19,9 @@ package com.cloud.exception;
import com.cloud.utils.SerialVersionUID;
public class ConcurrentOperationException extends CloudException {
-
+
private static final long serialVersionUID = SerialVersionUID.ConcurrentOperationException;
-
+
public ConcurrentOperationException(String msg) {
super(msg);
}
diff --git a/api/src/com/cloud/exception/ConflictingNetworkSettingsException.java b/api/src/com/cloud/exception/ConflictingNetworkSettingsException.java
index 7afcfe64575..a777afabeb7 100644
--- a/api/src/com/cloud/exception/ConflictingNetworkSettingsException.java
+++ b/api/src/com/cloud/exception/ConflictingNetworkSettingsException.java
@@ -21,7 +21,7 @@ import com.cloud.utils.SerialVersionUID;
public class ConflictingNetworkSettingsException extends CloudException {
private static final long serialVersionUID = SerialVersionUID.ConflictingNetworkSettingException;
-
+
public ConflictingNetworkSettingsException() {
super();
}
diff --git a/api/src/com/cloud/exception/ConnectionException.java b/api/src/com/cloud/exception/ConnectionException.java
index 966e39b3fd2..b3f0726fd34 100644
--- a/api/src/com/cloud/exception/ConnectionException.java
+++ b/api/src/com/cloud/exception/ConnectionException.java
@@ -25,26 +25,26 @@ import com.cloud.utils.SerialVersionUID;
* processing. Upon receiving this exception, the AgentManager will
* immediately place the agent under alert. When the function to enable
* to disable the agent, the agent is disabled.
- * should be disconnected and reconnected to "refresh" all resource
+ * should be disconnected and reconnected to "refresh" all resource
* information. This is useful when the Listener needed to perform setup
* on the agent and decided it is best to flush connection and reconnect.
* situation where it keeps throwing ConnectionException.
*/
public class ConnectionException extends CloudException {
-
+
private static final long serialVersionUID = SerialVersionUID.ConnectionException;
boolean _error;
public ConnectionException(boolean setupError, String msg) {
this(setupError, msg, null);
}
-
+
public ConnectionException(boolean setupError, String msg, Throwable cause) {
super(msg, cause);
_error = setupError;
-
+
}
-
+
public boolean isSetupError() {
return _error;
}
diff --git a/api/src/com/cloud/exception/DiscoveredWithErrorException.java b/api/src/com/cloud/exception/DiscoveredWithErrorException.java
index f59066f83c1..ee59baf45da 100644
--- a/api/src/com/cloud/exception/DiscoveredWithErrorException.java
+++ b/api/src/com/cloud/exception/DiscoveredWithErrorException.java
@@ -19,13 +19,13 @@ package com.cloud.exception;
import com.cloud.utils.SerialVersionUID;
public class DiscoveredWithErrorException extends DiscoveryException {
-
+
private static final long serialVersionUID = SerialVersionUID.DiscoveredWithErrorException;
public DiscoveredWithErrorException(String msg) {
this(msg, null);
}
-
+
public DiscoveredWithErrorException(String msg, Throwable cause) {
super(msg, cause);
}
diff --git a/api/src/com/cloud/exception/DiscoveryException.java b/api/src/com/cloud/exception/DiscoveryException.java
index 10a7c5b338f..62ae2724ea5 100644
--- a/api/src/com/cloud/exception/DiscoveryException.java
+++ b/api/src/com/cloud/exception/DiscoveryException.java
@@ -19,13 +19,13 @@ package com.cloud.exception;
import com.cloud.utils.SerialVersionUID;
public class DiscoveryException extends CloudException {
-
+
private static final long serialVersionUID = SerialVersionUID.DiscoveryException;
public DiscoveryException(String msg) {
this(msg, null);
}
-
+
public DiscoveryException(String msg, Throwable cause) {
super(msg, cause);
}
diff --git a/api/src/com/cloud/exception/ErrorCode.java b/api/src/com/cloud/exception/ErrorCode.java
deleted file mode 100755
index 15d9b7e8a1e..00000000000
--- a/api/src/com/cloud/exception/ErrorCode.java
+++ /dev/null
@@ -1,52 +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.exception;
-
-import java.util.HashSet;
-
-/**
- */
-public class ErrorCode {
- String code;
- private static HashSet s_codes = new HashSet();
-
- public ErrorCode(String code) {
- this.code = code;
- assert !s_codes.contains(this) : "There is already an error code registered for this code: " + code;
- s_codes.add(this);
- }
-
- public String getCode() {
- return code;
- }
-
- @Override
- public int hashCode() {
- return code.hashCode();
- }
-
- @Override
- public boolean equals(Object that) {
- if (!(that instanceof ErrorCode)) {
- return false;
- }
-
- return this.code.equals(((ErrorCode)that).code);
- }
-
- public final static ErrorCode UnableToReachResource = new ErrorCode("resource.unavailable");
-}
diff --git a/api/src/com/cloud/exception/HAStateException.java b/api/src/com/cloud/exception/HAStateException.java
index aaa5e756aa1..cb2517446ba 100644
--- a/api/src/com/cloud/exception/HAStateException.java
+++ b/api/src/com/cloud/exception/HAStateException.java
@@ -23,9 +23,9 @@ import com.cloud.utils.SerialVersionUID;
* done with it. Hence this special state.
*/
public class HAStateException extends ManagementServerException {
-
+
private static final long serialVersionUID = SerialVersionUID.HAStateException;
-
+
public HAStateException(String msg) {
super(msg);
}
diff --git a/api/src/com/cloud/exception/InsufficientCapacityException.java b/api/src/com/cloud/exception/InsufficientCapacityException.java
index 8a0557f8c06..51a4e593858 100755
--- a/api/src/com/cloud/exception/InsufficientCapacityException.java
+++ b/api/src/com/cloud/exception/InsufficientCapacityException.java
@@ -49,7 +49,7 @@ public abstract class InsufficientCapacityException extends CloudException {
/**
* @return the id of the object that it is insufficient in. Note that this method is
* marked such that if the id is not set, then it will throw NullPointerException.
- * This is intended as you should check to see if the Scope is present before
+ * This is intended as you should check to see if the Scope is present before
* accessing this method.
*/
public long getId() {
diff --git a/api/src/com/cloud/exception/InsufficientNetworkCapacityException.java b/api/src/com/cloud/exception/InsufficientNetworkCapacityException.java
index 09a077bfc24..71ec16d88f3 100644
--- a/api/src/com/cloud/exception/InsufficientNetworkCapacityException.java
+++ b/api/src/com/cloud/exception/InsufficientNetworkCapacityException.java
@@ -20,11 +20,11 @@ import com.cloud.utils.SerialVersionUID;
public class InsufficientNetworkCapacityException extends InsufficientCapacityException {
private static final long serialVersionUID = SerialVersionUID.InsufficientAddressCapacityException;
-
+
protected InsufficientNetworkCapacityException() {
super();
}
-
+
public InsufficientNetworkCapacityException(String msg, Class> scope, Long id) {
super(msg, scope, id);
}
diff --git a/api/src/com/cloud/exception/InsufficientServerCapacityException.java b/api/src/com/cloud/exception/InsufficientServerCapacityException.java
index 4a30595c12b..af34e579943 100755
--- a/api/src/com/cloud/exception/InsufficientServerCapacityException.java
+++ b/api/src/com/cloud/exception/InsufficientServerCapacityException.java
@@ -24,13 +24,13 @@ import com.cloud.utils.SerialVersionUID;
* trying to start.
*/
public class InsufficientServerCapacityException extends InsufficientCapacityException {
-
+
private static final long serialVersionUID = SerialVersionUID.InsufficientServerCapacityException;
-
+
public InsufficientServerCapacityException(String msg, Long clusterId) {
this(msg, Cluster.class, clusterId);
}
-
+
public InsufficientServerCapacityException(String msg, Class> scope, Long id) {
super(msg, scope, id);
}
diff --git a/api/src/com/cloud/exception/InsufficientStorageCapacityException.java b/api/src/com/cloud/exception/InsufficientStorageCapacityException.java
index f8ec10610ce..c70bfc38c8c 100755
--- a/api/src/com/cloud/exception/InsufficientStorageCapacityException.java
+++ b/api/src/com/cloud/exception/InsufficientStorageCapacityException.java
@@ -24,13 +24,13 @@ import com.cloud.utils.SerialVersionUID;
* storage space to create the VM.
*/
public class InsufficientStorageCapacityException extends InsufficientCapacityException {
-
+
private static final long serialVersionUID = SerialVersionUID.InsufficientStorageCapacityException;
-
+
public InsufficientStorageCapacityException(String msg, long id) {
this(msg, StoragePool.class, id);
}
-
+
public InsufficientStorageCapacityException(String msg, Class> scope, Long id) {
super(msg, scope, id);
}
diff --git a/api/src/com/cloud/exception/InsufficientVirtualNetworkCapcityException.java b/api/src/com/cloud/exception/InsufficientVirtualNetworkCapcityException.java
index 10d9ffc82ce..4741baaf62d 100644
--- a/api/src/com/cloud/exception/InsufficientVirtualNetworkCapcityException.java
+++ b/api/src/com/cloud/exception/InsufficientVirtualNetworkCapcityException.java
@@ -21,11 +21,11 @@ import com.cloud.utils.SerialVersionUID;
public class InsufficientVirtualNetworkCapcityException extends InsufficientNetworkCapacityException {
private static final long serialVersionUID = SerialVersionUID.InsufficientVirtualNetworkCapacityException;
-
+
public InsufficientVirtualNetworkCapcityException(String msg, Class> scope, Long id) {
super(msg, scope, id);
}
-
+
public InsufficientVirtualNetworkCapcityException(String msg, long podId) {
this(msg, Pod.class, podId);
}
diff --git a/api/src/com/cloud/exception/PermissionDeniedException.java b/api/src/com/cloud/exception/PermissionDeniedException.java
index 4900afcd67a..638b762d4c4 100644
--- a/api/src/com/cloud/exception/PermissionDeniedException.java
+++ b/api/src/com/cloud/exception/PermissionDeniedException.java
@@ -18,7 +18,7 @@ package com.cloud.exception;
import java.util.List;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.user.Account;
import com.cloud.utils.SerialVersionUID;
import com.cloud.utils.exception.CloudRuntimeException;
diff --git a/api/src/com/cloud/exception/ResourceUnavailableException.java b/api/src/com/cloud/exception/ResourceUnavailableException.java
index 484659a6a94..30daf566b03 100644
--- a/api/src/com/cloud/exception/ResourceUnavailableException.java
+++ b/api/src/com/cloud/exception/ResourceUnavailableException.java
@@ -23,21 +23,21 @@ public class ResourceUnavailableException extends CloudException {
Class> _scope;
long _id;
-
+
public ResourceUnavailableException(String msg, Class> scope, long resourceId) {
this(msg, scope, resourceId, null);
}
-
+
public ResourceUnavailableException(String msg, Class> scope, long resourceId, Throwable cause) {
super(new StringBuilder("Resource [").append(scope.getSimpleName()).append(":").append(resourceId).append("] is unreachable: ").append(msg).toString(), cause);
_scope = scope;
_id = resourceId;
}
-
+
public Class> getScope() {
return _scope;
}
-
+
public long getResourceId() {
return _id;
}
diff --git a/api/src/com/cloud/exception/StorageUnavailableException.java b/api/src/com/cloud/exception/StorageUnavailableException.java
index 7b443a91087..6db16290237 100644
--- a/api/src/com/cloud/exception/StorageUnavailableException.java
+++ b/api/src/com/cloud/exception/StorageUnavailableException.java
@@ -20,9 +20,9 @@ import com.cloud.storage.StoragePool;
import com.cloud.utils.SerialVersionUID;
/**
- * If the cause is due to storage pool unavailable, calling
+ * If the cause is due to storage pool unavailable, calling
* problem with.
- *
+ *
*/
public class StorageUnavailableException extends ResourceUnavailableException {
private static final long serialVersionUID = SerialVersionUID.StorageUnavailableException;
@@ -33,11 +33,11 @@ public class StorageUnavailableException extends ResourceUnavailableException {
public StorageUnavailableException(String msg, long poolId, Throwable cause) {
this(msg, StoragePool.class, poolId, cause);
}
-
+
public StorageUnavailableException(String msg, Class> scope, long resourceId) {
this(msg, scope, resourceId, null);
}
-
+
public StorageUnavailableException(String msg, Class> scope, long resourceId, Throwable th) {
super(msg, scope, resourceId, th);
}
diff --git a/api/src/com/cloud/host/Host.java b/api/src/com/cloud/host/Host.java
index 1bac0d20a40..bd26f81c8c2 100755
--- a/api/src/com/cloud/host/Host.java
+++ b/api/src/com/cloud/host/Host.java
@@ -21,12 +21,14 @@ import java.util.Date;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.resource.ResourceState;
import com.cloud.utils.fsm.StateObject;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* Host represents one particular host server.
*/
-public interface Host extends StateObject {
+public interface Host extends StateObject, Identity, InternalIdentity {
public enum Type {
Storage(false),
Routing(false),
@@ -61,11 +63,6 @@ public interface Host extends StateObject {
}
}
- /**
- * @return id of the host.
- */
- long getId();
-
/**
* @return name of the machine.
*/
@@ -198,6 +195,6 @@ public interface Host extends StateObject {
String getHypervisorVersion();
boolean isInMaintenanceStates();
-
- ResourceState getResourceState();
+
+ ResourceState getResourceState();
}
diff --git a/api/src/com/cloud/host/HostEnvironment.java b/api/src/com/cloud/host/HostEnvironment.java
index 31849748486..89077b5fed1 100644
--- a/api/src/com/cloud/host/HostEnvironment.java
+++ b/api/src/com/cloud/host/HostEnvironment.java
@@ -22,29 +22,29 @@ package com.cloud.host;
* the environment.
*/
public class HostEnvironment {
-
+
public String managementIpAddress;
public String managementNetmask;
public String managementGateway;
public String managementVlan;
-
+
public String[] neighborHosts;
-
+
public String storageIpAddress;
public String storageNetwork;
public String storageGateway;
public String storageVlan;
public String secondaryStroageIpAddress;
-
+
public String storage2IpAddress;
public String storage2Network;
public String storage2Gateway;
public String storage2Vlan;
public String secondaryStorageIpAddress2;
-
+
public String[] neighborStorages;
public String[] neighborStorages2;
-
+
public String publicIpAddress;
public String publicNetmask;
public String publicGateway;
diff --git a/api/src/com/cloud/host/HostStats.java b/api/src/com/cloud/host/HostStats.java
index e8fa19ef3d1..803b1484b2b 100755
--- a/api/src/com/cloud/host/HostStats.java
+++ b/api/src/com/cloud/host/HostStats.java
@@ -17,7 +17,7 @@
package com.cloud.host;
public interface HostStats {
-
+
// host related stats
public double getCpuUtilization();
public double getNetworkWriteKBs();
@@ -27,7 +27,7 @@ public interface HostStats {
public String getEntityType();
public double getUsedMemory();
public HostStats getHostStats();
-
+
// public double getAverageLoad();
- // public double getXapiMemoryUsageKBs();
+ // public double getXapiMemoryUsageKBs();
}
diff --git a/api/src/com/cloud/host/Status.java b/api/src/com/cloud/host/Status.java
index aed35cbb040..97b151dc723 100755
--- a/api/src/com/cloud/host/Status.java
+++ b/api/src/com/cloud/host/Status.java
@@ -32,25 +32,25 @@ public enum Status {
Removed(true, false, true),
Error(true, false, true),
Rebalancing(true, false, true);
-
+
private final boolean updateManagementServer;
private final boolean checkManagementServer;
private final boolean lostConnection;
-
+
private Status(boolean updateConnection, boolean checkManagementServer, boolean lostConnection) {
this.updateManagementServer = updateConnection;
this.checkManagementServer = checkManagementServer;
this.lostConnection = lostConnection;
}
-
+
public boolean updateManagementServer() {
return updateManagementServer;
}
-
+
public boolean checkManagementServer() {
return checkManagementServer;
}
-
+
public boolean lostConnection() {
return lostConnection;
}
@@ -82,16 +82,16 @@ public enum Status {
public String getDescription() {
return comment;
}
-
+
public boolean isUserRequest() {
return isUserRequest;
}
}
-
+
public static StateMachine2 getStateMachine() {
return s_fsm;
}
-
+
public Status getNextStatus(Event e) throws NoTransitionException {
return s_fsm.getNextState(this, e);
}
@@ -100,7 +100,7 @@ public enum Status {
List from = s_fsm.getFromStates(this, e);
return from.toArray(new Status[from.size()]);
}
-
+
public Set getPossibleEvents() {
return s_fsm.getPossibleEvents(this);
}
diff --git a/api/src/com/cloud/hypervisor/Hypervisor.java b/api/src/com/cloud/hypervisor/Hypervisor.java
index 25dd8b1458d..2e0012dca6f 100644
--- a/api/src/com/cloud/hypervisor/Hypervisor.java
+++ b/api/src/com/cloud/hypervisor/Hypervisor.java
@@ -23,7 +23,7 @@ public class Hypervisor {
XenServer,
KVM,
VMware,
- Hyperv,
+ Hyperv,
VirtualBox,
Parralels,
BareMetal,
diff --git a/api/src/com/cloud/hypervisor/HypervisorCapabilities.java b/api/src/com/cloud/hypervisor/HypervisorCapabilities.java
index f91da354c96..efb8a6a208b 100644
--- a/api/src/com/cloud/hypervisor/HypervisorCapabilities.java
+++ b/api/src/com/cloud/hypervisor/HypervisorCapabilities.java
@@ -17,16 +17,14 @@
package com.cloud.hypervisor;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* HypervisorCapability represents one particular hypervisor version's capabilities.
*/
-public interface HypervisorCapabilities {
- /**
- * @return id of the host.
- */
- long getId();
+public interface HypervisorCapabilities extends Identity, InternalIdentity{
/**
* @return type of hypervisor
diff --git a/api/src/com/cloud/hypervisor/HypervisorGuru.java b/api/src/com/cloud/hypervisor/HypervisorGuru.java
index d3608dcc347..b4a0b06a7af 100644
--- a/api/src/com/cloud/hypervisor/HypervisorGuru.java
+++ b/api/src/com/cloud/hypervisor/HypervisorGuru.java
@@ -27,28 +27,28 @@ import com.cloud.vm.VirtualMachineProfile;
public interface HypervisorGuru extends Adapter {
HypervisorType getHypervisorType();
-
+
/**
* Convert from a virtual machine to the
- * virtual machine that the hypervisor expects.
- * @param vm
+ * virtual machine that the hypervisor expects.
+ * @param vm
* @return
*/
VirtualMachineTO implement(VirtualMachineProfile vm);
-
+
/**
* Give hypervisor guru opportunity to decide if certain command needs to be delegated to other host, mainly to secondary storage VM host
* @param hostId original hypervisor host
* @param cmd command that is going to be sent, hypervisor guru usually needs to register various context objects into the command object
- *
+ *
* @return delegated host id if the command will be delegated
*/
long getCommandHostDelegation(long hostId, Command cmd);
-
+
/**
* @return true if VM can be migrated independently with CloudStack, and therefore CloudStack needs to track and reflect host change
* into CloudStack database, false if CloudStack enforces VM sync logic
- *
+ *
*/
boolean trackVmHostChange();
diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java
index f67a1fa3c46..0ac7f500e2c 100644
--- a/api/src/com/cloud/network/IpAddress.java
+++ b/api/src/com/cloud/network/IpAddress.java
@@ -18,28 +18,30 @@ package com.cloud.network;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.utils.net.Ip;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
- *
+ *
* - Allocated = null
* - AccountId = null
* - DomainId = null
- *
+ *
* - State = Allocated
* - AccountId = account owner.
* - DomainId = domain of the account owner.
* - Allocated = time it was allocated.
*/
-public interface IpAddress extends ControlledEntity {
+public interface IpAddress extends ControlledEntity, Identity, InternalIdentity {
enum State {
Allocating, // The IP Address is being propagated to other network elements and is not ready for use yet.
Allocated, // The IP address is in used.
Releasing, // The IP address is being released for other network elements and is not ready for allocation.
Free // The IP address is ready to be allocated.
}
-
+
enum Purpose {
StaticNat,
Lb
@@ -67,11 +69,6 @@ public interface IpAddress extends ControlledEntity {
public Long getPhysicalNetworkId();
- /**
- * @return database id.
- */
- long getId();
-
void setState(IpAddress.State state);
Long getAllocatedToAccountId();
@@ -89,5 +86,4 @@ public interface IpAddress extends ControlledEntity {
* @param vpcId
*/
void setVpcId(Long vpcId);
-
}
diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java
index 188ef92e57b..c91f6a9b80d 100644
--- a/api/src/com/cloud/network/Network.java
+++ b/api/src/com/cloud/network/Network.java
@@ -16,12 +16,14 @@
// under the License.
package com.cloud.network;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType;
import com.cloud.utils.fsm.FiniteState;
import com.cloud.utils.fsm.StateMachine;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
import java.net.URI;
import java.util.ArrayList;
@@ -31,7 +33,7 @@ import java.util.Set;
/**
* owned by an account.
*/
-public interface Network extends ControlledEntity {
+public interface Network extends ControlledEntity, InternalIdentity, Identity {
public enum GuestType {
Shared,
@@ -45,10 +47,10 @@ public interface Network extends ControlledEntity {
public static final Service Dhcp = new Service("Dhcp");
public static final Service Dns = new Service("Dns", Capability.AllowDnsSuffixModification);
public static final Service Gateway = new Service("Gateway");
- public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols,
+ public static final Service Firewall = new Service("Firewall", Capability.SupportedProtocols,
Capability.MultipleIps, Capability.TrafficStatistics);
public static final Service Lb = new Service("Lb", Capability.SupportedLBAlgorithms, Capability.SupportedLBIsolation,
- Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps,
+ Capability.SupportedProtocols, Capability.TrafficStatistics, Capability.LoadBalancingSupportedIps,
Capability.SupportedStickinessMethods, Capability.ElasticLb);
public static final Service UserData = new Service("UserData");
public static final Service SourceNat = new Service("SourceNat", Capability.SupportedSourceNatTypes, Capability.RedundantRouter);
@@ -168,9 +170,9 @@ public interface Network extends ControlledEntity {
public static final Capability AllowDnsSuffixModification = new Capability("AllowDnsSuffixModification");
public static final Capability RedundantRouter = new Capability("RedundantRouter");
public static final Capability ElasticIp = new Capability("ElasticIp");
- public static final Capability AssociatePublicIP = new Capability("AssociatePublicIP");
public static final Capability ElasticLb = new Capability("ElasticLb");
public static final Capability AutoScaleCounters = new Capability("AutoScaleCounters");
+ public static final Capability InlineMode = new Capability("InlineMode");
private String name;
@@ -251,11 +253,6 @@ public interface Network extends ControlledEntity {
}
}
- /**
- * @return id of the network profile. Null means the network profile is not from the database.
- */
- long getId();
-
String getName();
Mode getMode();
@@ -300,5 +297,5 @@ public interface Network extends ControlledEntity {
* @return
*/
Long getVpcId();
-
+
}
diff --git a/api/src/com/cloud/network/NetworkProfile.java b/api/src/com/cloud/network/NetworkProfile.java
index cd25d9f677e..b5c463de375 100644
--- a/api/src/com/cloud/network/NetworkProfile.java
+++ b/api/src/com/cloud/network/NetworkProfile.java
@@ -21,9 +21,11 @@ import java.net.URI;
import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType;
+import org.apache.cloudstack.api.InternalIdentity;
public class NetworkProfile implements Network {
private long id;
+ private String uuid;
private long dataCenterId;
private long ownerId;
private long domainId;
@@ -51,6 +53,7 @@ public class NetworkProfile implements Network {
public NetworkProfile(Network network) {
this.id = network.getId();
+ this.uuid = network.getUuid();
this.broadcastUri = network.getBroadcastUri();
this.dataCenterId = network.getDataCenterId();
this.ownerId = network.getAccountId();
@@ -105,6 +108,12 @@ public class NetworkProfile implements Network {
return id;
}
+
+ @Override
+ public String getUuid() {
+ return uuid;
+ }
+
@Override
public long getDataCenterId() {
return dataCenterId;
diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java
index b93be6fcb3d..786afb1e107 100755
--- a/api/src/com/cloud/network/NetworkService.java
+++ b/api/src/com/cloud/network/NetworkService.java
@@ -18,10 +18,10 @@ package com.cloud.network;
import java.util.List;
-import com.cloud.api.commands.CreateNetworkCmd;
-import com.cloud.api.commands.ListNetworksCmd;
-import com.cloud.api.commands.ListTrafficTypeImplementorsCmd;
-import com.cloud.api.commands.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd;
+import org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworksCmd;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
@@ -42,8 +42,7 @@ public interface NetworkService {
List extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);
-
- IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId) throws ResourceAllocationException,
+ IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) throws ResourceAllocationException,
InsufficientAddressCapacityException, ConcurrentOperationException;
boolean releaseIpAddress(long ipAddressId) throws InsufficientAddressCapacityException;
@@ -62,6 +61,8 @@ public interface NetworkService {
Network getNetwork(long networkId);
+ Network getNetwork(String networkUuid);
+
IpAddress getIp(long id);
@@ -72,10 +73,10 @@ public interface NetworkService {
PhysicalNetwork createPhysicalNetwork(Long zoneId, String vnetRange, String networkSpeed,
List isolationMethods, String broadcastDomainRange, Long domainId, List tags, String name);
- Pair, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
+ Pair, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword,
Long startIndex, Long pageSize, String name);
- PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags,
+ PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags,
String newVnetRangeString, String state);
boolean deletePhysicalNetwork(Long id);
@@ -102,7 +103,7 @@ public interface NetworkService {
long findPhysicalNetworkId(long zoneId, String tag, TrafficType trafficType);
- PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType,
+ PhysicalNetworkTrafficType addTrafficTypeToPhysicalNetwork(Long physicalNetworkId, String trafficType,
String xenLabel, String kvmLabel, String vmwareLabel, String simulatorLabel, String vlan);
PhysicalNetworkTrafficType getPhysicalNetworkTrafficType(Long id);
@@ -126,10 +127,10 @@ public interface NetworkService {
* @param networkId
* @param entityId
* @return
- * @throws ConcurrentOperationException
- * @throws ResourceUnavailableException
- * @throws ResourceAllocationException
- * @throws InsufficientAddressCapacityException
+ * @throws ConcurrentOperationException
+ * @throws ResourceUnavailableException
+ * @throws ResourceAllocationException
+ * @throws InsufficientAddressCapacityException
*/
IpAddress associateIPToNetwork(long ipId, long networkId) throws InsufficientAddressCapacityException,
ResourceAllocationException, ResourceUnavailableException, ConcurrentOperationException;
@@ -146,12 +147,12 @@ public interface NetworkService {
* @param networkOwnerId
* @param vpcId TODO
* @return
- * @throws InsufficientCapacityException
- * @throws ConcurrentOperationException
- * @throws ResourceAllocationException
+ * @throws InsufficientCapacityException
+ * @throws ConcurrentOperationException
+ * @throws ResourceAllocationException
*/
Network createPrivateNetwork(String networkName, String displayText, long physicalNetworkId, String vlan,
- String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId)
+ String startIp, String endIP, String gateway, String netmask, long networkOwnerId, Long vpcId)
throws ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException;
}
diff --git a/api/src/com/cloud/network/Networks.java b/api/src/com/cloud/network/Networks.java
index b96eaa2ff6c..b15661910b4 100755
--- a/api/src/com/cloud/network/Networks.java
+++ b/api/src/com/cloud/network/Networks.java
@@ -23,7 +23,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
/**
* Network includes all of the enums used within networking.
- *
+ *
*/
public class Networks {
diff --git a/api/src/com/cloud/network/PhysicalNetwork.java b/api/src/com/cloud/network/PhysicalNetwork.java
index be4b1d0d352..a495092879e 100644
--- a/api/src/com/cloud/network/PhysicalNetwork.java
+++ b/api/src/com/cloud/network/PhysicalNetwork.java
@@ -16,12 +16,15 @@
// under the License.
package com.cloud.network;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.List;
/**
- *
+ *
*/
-public interface PhysicalNetwork {
+public interface PhysicalNetwork extends Identity, InternalIdentity {
public enum State {
Disabled,
@@ -40,8 +43,6 @@ public interface PhysicalNetwork {
ZONE;
}
- long getId();
-
BroadcastDomainRange getBroadcastDomainRange();
// TrafficType getTrafficType();
@@ -60,8 +61,6 @@ public interface PhysicalNetwork {
String getSpeed();
- String getUuid();
-
String getName();
}
diff --git a/api/src/com/cloud/network/PhysicalNetworkServiceProvider.java b/api/src/com/cloud/network/PhysicalNetworkServiceProvider.java
index 1b913115aa4..0a433dcbc05 100644
--- a/api/src/com/cloud/network/PhysicalNetworkServiceProvider.java
+++ b/api/src/com/cloud/network/PhysicalNetworkServiceProvider.java
@@ -19,11 +19,12 @@ package com.cloud.network;
import java.util.List;
import com.cloud.network.Network.Service;
+import org.apache.cloudstack.api.InternalIdentity;
/**
- *
+ *
*/
-public interface PhysicalNetworkServiceProvider {
+public interface PhysicalNetworkServiceProvider extends InternalIdentity {
public enum State {
Disabled,
diff --git a/api/src/com/cloud/network/PhysicalNetworkTrafficType.java b/api/src/com/cloud/network/PhysicalNetworkTrafficType.java
index 0c0bfa1304e..62400e80a9e 100644
--- a/api/src/com/cloud/network/PhysicalNetworkTrafficType.java
+++ b/api/src/com/cloud/network/PhysicalNetworkTrafficType.java
@@ -17,13 +17,13 @@
package com.cloud.network;
import com.cloud.network.Networks.TrafficType;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
- *
+ *
*/
-public interface PhysicalNetworkTrafficType {
-
- long getId();
+public interface PhysicalNetworkTrafficType extends InternalIdentity, Identity {
long getPhysicalNetworkId();
@@ -36,6 +36,4 @@ public interface PhysicalNetworkTrafficType {
String getVmwareNetworkLabel();
String getSimulatorNetworkLabel();
-
- String getUuid();
}
diff --git a/api/src/com/cloud/network/PublicIpAddress.java b/api/src/com/cloud/network/PublicIpAddress.java
index 5d117b84243..21dae54202a 100644
--- a/api/src/com/cloud/network/PublicIpAddress.java
+++ b/api/src/com/cloud/network/PublicIpAddress.java
@@ -16,19 +16,20 @@
// under the License.
package com.cloud.network;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.dc.Vlan;
+import org.apache.cloudstack.api.InternalIdentity;
/**
*/
-public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan {
-
+public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan, InternalIdentity {
+
String getMacAddress();
-
+
public String getNetmask();
-
+
public String getGateway();
-
+
@Override
public String getVlanTag();
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/network/RemoteAccessVpn.java b/api/src/com/cloud/network/RemoteAccessVpn.java
index 162e0fce133..1b463309a5f 100644
--- a/api/src/com/cloud/network/RemoteAccessVpn.java
+++ b/api/src/com/cloud/network/RemoteAccessVpn.java
@@ -16,7 +16,7 @@
// under the License.
package com.cloud.network;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
public interface RemoteAccessVpn extends ControlledEntity {
enum State {
@@ -24,7 +24,7 @@ public interface RemoteAccessVpn extends ControlledEntity {
Running,
Removed
}
-
+
long getServerAddressId();
String getIpRange();
String getIpsecPresharedKey();
diff --git a/api/src/com/cloud/network/Site2SiteCustomerGateway.java b/api/src/com/cloud/network/Site2SiteCustomerGateway.java
index 8950c771705..3a5438575d9 100644
--- a/api/src/com/cloud/network/Site2SiteCustomerGateway.java
+++ b/api/src/com/cloud/network/Site2SiteCustomerGateway.java
@@ -5,7 +5,7 @@
// 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,
@@ -18,10 +18,11 @@ package com.cloud.network;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Site2SiteCustomerGateway extends ControlledEntity {
- public long getId();
+public interface Site2SiteCustomerGateway extends ControlledEntity, Identity, InternalIdentity {
public String getGatewayIp();
public String getGuestCidrList();
public String getIpsecPsk();
diff --git a/api/src/com/cloud/network/Site2SiteVpnConnection.java b/api/src/com/cloud/network/Site2SiteVpnConnection.java
index 6cf52a94943..810f9992d93 100644
--- a/api/src/com/cloud/network/Site2SiteVpnConnection.java
+++ b/api/src/com/cloud/network/Site2SiteVpnConnection.java
@@ -5,7 +5,7 @@
// 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,
@@ -18,9 +18,10 @@ package com.cloud.network;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Site2SiteVpnConnection extends ControlledEntity {
+public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdentity {
enum State {
Pending,
Connected,
@@ -28,6 +29,7 @@ public interface Site2SiteVpnConnection extends ControlledEntity {
Error,
}
public long getId();
+ public String getUuid();
public long getVpnGatewayId();
public long getCustomerGatewayId();
public State getState();
diff --git a/api/src/com/cloud/network/Site2SiteVpnGateway.java b/api/src/com/cloud/network/Site2SiteVpnGateway.java
index 52ec5971c14..81379132844 100644
--- a/api/src/com/cloud/network/Site2SiteVpnGateway.java
+++ b/api/src/com/cloud/network/Site2SiteVpnGateway.java
@@ -5,7 +5,7 @@
// 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,
@@ -18,10 +18,11 @@ package com.cloud.network;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Site2SiteVpnGateway extends ControlledEntity {
- public long getId();
+public interface Site2SiteVpnGateway extends ControlledEntity, Identity, InternalIdentity {
public long getAddrId();
public long getVpcId();
public Date getRemoved();
diff --git a/api/src/com/cloud/network/StorageNetworkService.java b/api/src/com/cloud/network/StorageNetworkService.java
index 86a8352316a..1bda247179c 100755
--- a/api/src/com/cloud/network/StorageNetworkService.java
+++ b/api/src/com/cloud/network/StorageNetworkService.java
@@ -19,18 +19,18 @@ package com.cloud.network;
import java.sql.SQLException;
import java.util.List;
-import com.cloud.api.commands.CreateStorageNetworkIpRangeCmd;
-import com.cloud.api.commands.DeleteStorageNetworkIpRangeCmd;
-import com.cloud.api.commands.UpdateStorageNetworkIpRangeCmd;
-import com.cloud.api.commands.listStorageNetworkIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.network.*;
+import org.apache.cloudstack.api.command.admin.network.UpdateStorageNetworkIpRangeCmd;
+import org.apache.cloudstack.api.command.admin.network.DeleteStorageNetworkIpRangeCmd;
import com.cloud.dc.StorageNetworkIpRange;
+import org.apache.cloudstack.api.command.admin.network.CreateStorageNetworkIpRangeCmd;
public interface StorageNetworkService {
StorageNetworkIpRange createIpRange(CreateStorageNetworkIpRangeCmd cmd) throws SQLException;
void deleteIpRange(DeleteStorageNetworkIpRangeCmd cmd);
- List listIpRange(listStorageNetworkIpRangeCmd cmd);
+ List listIpRange(ListStorageNetworkIpRangeCmd cmd);
StorageNetworkIpRange updateIpRange(UpdateStorageNetworkIpRangeCmd cmd);
}
diff --git a/api/src/com/cloud/network/VirtualNetworkApplianceService.java b/api/src/com/cloud/network/VirtualNetworkApplianceService.java
index 300c9932829..7b553b29a7f 100644
--- a/api/src/com/cloud/network/VirtualNetworkApplianceService.java
+++ b/api/src/com/cloud/network/VirtualNetworkApplianceService.java
@@ -16,7 +16,7 @@
// under the License.
package com.cloud.network;
-import com.cloud.api.commands.UpgradeRouterCmd;
+import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
@@ -26,29 +26,29 @@ import com.cloud.user.Account;
public interface VirtualNetworkApplianceService {
/**
* Starts domain router
- *
+ *
* @param cmd
* the command specifying router's id
* @return DomainRouter object
*/
- VirtualRouter startRouter(long routerId, boolean reprogramNetwork) throws ConcurrentOperationException,
+ VirtualRouter startRouter(long routerId, boolean reprogramNetwork) throws ConcurrentOperationException,
ResourceUnavailableException, InsufficientCapacityException;
/**
* Reboots domain router
- *
+ *
* @param cmd
* the command specifying router's id
* @return router if successful
*/
- VirtualRouter rebootRouter(long routerId, boolean reprogramNetwork) throws ConcurrentOperationException,
+ VirtualRouter rebootRouter(long routerId, boolean reprogramNetwork) throws ConcurrentOperationException,
ResourceUnavailableException, InsufficientCapacityException;
VirtualRouter upgradeRouter(UpgradeRouterCmd cmd);
/**
* Stops domain router
- *
+ *
* @param id
* of the router
* @param forced
diff --git a/api/src/com/cloud/network/VirtualRouterProvider.java b/api/src/com/cloud/network/VirtualRouterProvider.java
index f0837d650cf..ed6a2741ba0 100644
--- a/api/src/com/cloud/network/VirtualRouterProvider.java
+++ b/api/src/com/cloud/network/VirtualRouterProvider.java
@@ -16,7 +16,10 @@
// under the License.
package com.cloud.network;
-public interface VirtualRouterProvider {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface VirtualRouterProvider extends InternalIdentity, Identity {
public enum VirtualRouterProviderType {
VirtualRouter,
ElasticLoadBalancerVm,
@@ -25,8 +28,6 @@ public interface VirtualRouterProvider {
public VirtualRouterProviderType getType();
- public long getId();
-
public boolean isEnabled();
public long getNspId();
diff --git a/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java b/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
index 03eb576bc8d..6e8fd38ba66 100644
--- a/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
+++ b/api/src/com/cloud/network/VpcVirtualNetworkApplianceService.java
@@ -32,7 +32,7 @@ public interface VpcVirtualNetworkApplianceService extends VirtualNetworkApplian
* @throws ResourceUnavailableException
* @throws InsufficientCapacityException
*/
- boolean addVpcRouterToGuestNetwork(VirtualRouter router, Network network, boolean isRedundant)
+ boolean addVpcRouterToGuestNetwork(VirtualRouter router, Network network, boolean isRedundant)
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
/**
@@ -43,7 +43,7 @@ public interface VpcVirtualNetworkApplianceService extends VirtualNetworkApplian
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
- boolean removeVpcRouterFromGuestNetwork(VirtualRouter router, Network network, boolean isRedundant)
+ boolean removeVpcRouterFromGuestNetwork(VirtualRouter router, Network network, boolean isRedundant)
throws ConcurrentOperationException, ResourceUnavailableException;
}
diff --git a/api/src/com/cloud/network/VpnUser.java b/api/src/com/cloud/network/VpnUser.java
index 07a3ee3343e..ad84e9178d6 100644
--- a/api/src/com/cloud/network/VpnUser.java
+++ b/api/src/com/cloud/network/VpnUser.java
@@ -16,17 +16,17 @@
// under the License.
package com.cloud.network;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface VpnUser extends ControlledEntity {
+public interface VpnUser extends ControlledEntity, InternalIdentity, Identity {
enum State {
Add,
Revoke,
Active
}
- long getId();
-
String getUsername();
String getPassword();
diff --git a/api/src/com/cloud/network/as/AutoScalePolicy.java b/api/src/com/cloud/network/as/AutoScalePolicy.java
index cef198f0947..7f94f355921 100644
--- a/api/src/com/cloud/network/as/AutoScalePolicy.java
+++ b/api/src/com/cloud/network/as/AutoScalePolicy.java
@@ -17,12 +17,15 @@
package com.cloud.network.as;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface AutoScalePolicy extends ControlledEntity {
+public interface AutoScalePolicy extends ControlledEntity, InternalIdentity {
long getId();
+ String getUuid();
+
public int getDuration();
public int getQuietTime();
diff --git a/api/src/com/cloud/network/as/AutoScaleService.java b/api/src/com/cloud/network/as/AutoScaleService.java
index c1ca804bd68..daa8d191366 100644
--- a/api/src/com/cloud/network/as/AutoScaleService.java
+++ b/api/src/com/cloud/network/as/AutoScaleService.java
@@ -1,43 +1,31 @@
-// 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.
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
package com.cloud.network.as;
import java.util.List;
-import com.cloud.api.commands.CreateAutoScalePolicyCmd;
-import com.cloud.api.commands.CreateAutoScaleVmGroupCmd;
-import com.cloud.api.commands.CreateAutoScaleVmProfileCmd;
-import com.cloud.api.commands.CreateConditionCmd;
-import com.cloud.api.commands.CreateCounterCmd;
-import com.cloud.api.commands.ListAutoScalePoliciesCmd;
-import com.cloud.api.commands.ListAutoScaleVmGroupsCmd;
-import com.cloud.api.commands.ListAutoScaleVmProfilesCmd;
-import com.cloud.api.commands.ListConditionsCmd;
-import com.cloud.api.commands.ListCountersCmd;
-import com.cloud.api.commands.UpdateAutoScalePolicyCmd;
-import com.cloud.api.commands.UpdateAutoScaleVmGroupCmd;
-import com.cloud.api.commands.UpdateAutoScaleVmProfileCmd;
+import org.apache.cloudstack.api.command.admin.autoscale.CreateCounterCmd;
+import org.apache.cloudstack.api.command.user.autoscale.*;
+import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScalePolicyCmd;
+import org.apache.cloudstack.api.command.user.autoscale.CreateAutoScaleVmProfileCmd;
+import org.apache.cloudstack.api.command.user.autoscale.ListAutoScalePoliciesCmd;
+import org.apache.cloudstack.api.command.user.autoscale.UpdateAutoScaleVmGroupCmd;
import com.cloud.exception.ResourceInUseException;
import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.as.AutoScalePolicy;
-import com.cloud.network.as.AutoScaleVmGroup;
-import com.cloud.network.as.AutoScaleVmProfile;
-import com.cloud.network.as.Condition;
-import com.cloud.network.as.Counter;
public interface AutoScaleService {
diff --git a/api/src/com/cloud/network/as/AutoScaleVmGroup.java b/api/src/com/cloud/network/as/AutoScaleVmGroup.java
index 6d41ae3a7e0..faa166d2bae 100644
--- a/api/src/com/cloud/network/as/AutoScaleVmGroup.java
+++ b/api/src/com/cloud/network/as/AutoScaleVmGroup.java
@@ -17,10 +17,11 @@
package com.cloud.network.as;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface AutoScaleVmGroup extends ControlledEntity {
+public interface AutoScaleVmGroup extends ControlledEntity, InternalIdentity {
String State_New = "new";
String State_Revoke = "revoke";
diff --git a/api/src/com/cloud/network/as/AutoScaleVmProfile.java b/api/src/com/cloud/network/as/AutoScaleVmProfile.java
index 77f5ce45f98..3be5a3e8124 100644
--- a/api/src/com/cloud/network/as/AutoScaleVmProfile.java
+++ b/api/src/com/cloud/network/as/AutoScaleVmProfile.java
@@ -1,34 +1,37 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements. See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership. The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network.as;
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package com.cloud.network.as;
import java.util.List;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.utils.Pair;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* AutoScaleVmProfile
*/
-public interface AutoScaleVmProfile extends ControlledEntity {
+public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity {
public long getId();
+ public String getUuid();
+
public Long getZoneId();
public Long getServiceOfferingId();
diff --git a/api/src/com/cloud/network/as/Condition.java b/api/src/com/cloud/network/as/Condition.java
index b990731dd23..b09dc2e91a8 100644
--- a/api/src/com/cloud/network/as/Condition.java
+++ b/api/src/com/cloud/network/as/Condition.java
@@ -17,9 +17,11 @@
package com.cloud.network.as;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Condition extends ControlledEntity {
+public interface Condition extends ControlledEntity, Identity, InternalIdentity {
static enum Operator {
EQ, GT, LT, GE, LE
@@ -30,8 +32,4 @@ public interface Condition extends ControlledEntity {
long getThreshold();
Operator getRelationalOperator();
-
- String getUuid();
-
- long getId();
}
diff --git a/api/src/com/cloud/network/as/Counter.java b/api/src/com/cloud/network/as/Counter.java
index d9e2e0a1e1f..207ec57b592 100644
--- a/api/src/com/cloud/network/as/Counter.java
+++ b/api/src/com/cloud/network/as/Counter.java
@@ -17,7 +17,10 @@
package com.cloud.network.as;
-public interface Counter {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface Counter extends InternalIdentity, Identity {
public static enum Source {
netscaler,
@@ -29,8 +32,4 @@ public interface Counter {
String getValue();
Source getSource();
-
- String getUuid();
-
- long getId();
}
diff --git a/api/src/com/cloud/network/element/IpDeployer.java b/api/src/com/cloud/network/element/IpDeployer.java
index 8036d4b7bf2..c92d3e3cf2d 100644
--- a/api/src/com/cloud/network/element/IpDeployer.java
+++ b/api/src/com/cloud/network/element/IpDeployer.java
@@ -21,6 +21,7 @@ import java.util.Set;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
+import com.cloud.network.Network.Provider;
import com.cloud.network.Network.Service;
import com.cloud.network.PublicIpAddress;
import com.cloud.utils.component.Adapter;
@@ -34,4 +35,6 @@ public interface IpDeployer extends Adapter{
* @throws ResourceUnavailableException
*/
boolean applyIps(Network network, List extends PublicIpAddress> ipAddress, Set services) throws ResourceUnavailableException;
+
+ Provider getProvider();
}
diff --git a/api/src/com/cloud/network/element/IpDeployingRequester.java b/api/src/com/cloud/network/element/IpDeployingRequester.java
new file mode 100644
index 00000000000..01a11b570c1
--- /dev/null
+++ b/api/src/com/cloud/network/element/IpDeployingRequester.java
@@ -0,0 +1,28 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.element;
+
+import com.cloud.network.Network;
+
+public interface IpDeployingRequester {
+ /**
+ * Would return the IpDeployer can deploy IP for this element
+ * @param network
+ * @return IpDeployer object, or null if there is no deployer for this element
+ */
+ IpDeployer getIpDeployer(Network network);
+}
diff --git a/api/src/com/cloud/network/element/LoadBalancingServiceProvider.java b/api/src/com/cloud/network/element/LoadBalancingServiceProvider.java
index 3c5474642a4..879ea0ed663 100644
--- a/api/src/com/cloud/network/element/LoadBalancingServiceProvider.java
+++ b/api/src/com/cloud/network/element/LoadBalancingServiceProvider.java
@@ -22,7 +22,7 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.lb.LoadBalancingRule;
-public interface LoadBalancingServiceProvider extends NetworkElement {
+public interface LoadBalancingServiceProvider extends NetworkElement, IpDeployingRequester {
/**
* Apply rules
* @param network
@@ -32,13 +32,12 @@ public interface LoadBalancingServiceProvider extends NetworkElement {
*/
boolean applyLBRules(Network network, List rules) throws ResourceUnavailableException;
- IpDeployer getIpDeployer(Network network);
/**
* Validate rules
* @param network
* @param rule
* @return true/false. true should be return if there are no validations. false should be return if any oneof the validation fails.
- * @throws
+ * @throws
*/
boolean validateLBRule(Network network, LoadBalancingRule rule);
}
diff --git a/api/src/com/cloud/network/element/NetworkElement.java b/api/src/com/cloud/network/element/NetworkElement.java
index 10ea5095b58..1ddd60b27de 100644
--- a/api/src/com/cloud/network/element/NetworkElement.java
+++ b/api/src/com/cloud/network/element/NetworkElement.java
@@ -41,25 +41,25 @@ import com.cloud.vm.VirtualMachineProfile;
* Represents one network element that exists in a network.
*/
public interface NetworkElement extends Adapter {
-
+
Map> getCapabilities();
-
+
/**
- * NOTE:
+ * NOTE:
* NetworkElement -> Network.Provider is a one-to-one mapping. While adding a new NetworkElement, one must add a new Provider name to Network.Provider.
*/
Provider getProvider();
-
+
/**
- * Implement the network configuration as specified.
+ * Implement the network configuration as specified.
* @param config fully specified network configuration.
* @param offering network offering that originated the network configuration.
* @return true if network configuration is now usable; false if not; null if not handled by this element.
* @throws InsufficientNetworkCapacityException TODO
*/
- boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context)
+ boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
-
+
/**
* Prepare for a nic to be added into this network.
* @param network
@@ -72,10 +72,10 @@ public interface NetworkElement extends Adapter {
* @throws ResourceUnavailableException
* @throws InsufficientNetworkCapacityException
*/
- boolean prepare(Network network, NicProfile nic, VirtualMachineProfile extends VirtualMachine> vm,
- DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
+ boolean prepare(Network network, NicProfile nic, VirtualMachineProfile extends VirtualMachine> vm,
+ DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
ResourceUnavailableException, InsufficientCapacityException;
-
+
/**
* A nic is released from this network.
* @param network
@@ -86,9 +86,9 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
- boolean release(Network network, NicProfile nic, VirtualMachineProfile extends VirtualMachine> vm,
+ boolean release(Network network, NicProfile nic, VirtualMachineProfile extends VirtualMachine> vm,
ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
/**
* The network is being shutdown.
* @param network
@@ -98,9 +98,9 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
- boolean shutdown(Network network, ReservationContext context, boolean cleanup)
+ boolean shutdown(Network network, ReservationContext context, boolean cleanup)
throws ConcurrentOperationException, ResourceUnavailableException;
-
+
/**
* The network is being destroyed.
* @param network
@@ -109,14 +109,14 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException
*/
boolean destroy(Network network, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
/**
* Check if the instances of this Element are configured to be used on the physical network referred by this provider.
* @param provider
* @return boolean true/false
*/
boolean isReady(PhysicalNetworkServiceProvider provider);
-
+
/**
* The network service provider is being shutdown. This should shutdown all instances of this element deployed for this provider.
* @param context
@@ -125,15 +125,15 @@ public interface NetworkElement extends Adapter {
* @throws ConcurrentOperationException
* @throws ResourceUnavailableException
*/
- boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context)
+ boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context)
throws ConcurrentOperationException, ResourceUnavailableException;
-
+
/**
- * This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false.
+ * This should return true if out of multiple services provided by this element, only some can be enabled. If all the services MUST be provided, this should return false.
* @return true/false
*/
boolean canEnableIndividualServices();
-
+
/**
* Would return true if the service combination is supported by the provider
* @param services
diff --git a/api/src/com/cloud/network/element/PortForwardingServiceProvider.java b/api/src/com/cloud/network/element/PortForwardingServiceProvider.java
index d6589515d2a..e99bc2fd416 100644
--- a/api/src/com/cloud/network/element/PortForwardingServiceProvider.java
+++ b/api/src/com/cloud/network/element/PortForwardingServiceProvider.java
@@ -22,7 +22,7 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.rules.PortForwardingRule;
-public interface PortForwardingServiceProvider extends NetworkElement {
+public interface PortForwardingServiceProvider extends NetworkElement, IpDeployingRequester {
/**
* Apply rules
* @param network
@@ -31,6 +31,4 @@ public interface PortForwardingServiceProvider extends NetworkElement {
* @throws ResourceUnavailableException
*/
boolean applyPFRules(Network network, List rules) throws ResourceUnavailableException;
-
- IpDeployer getIpDeployer(Network network);
}
diff --git a/api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java b/api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
index 2eb0389226f..4950ed92cab 100644
--- a/api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
+++ b/api/src/com/cloud/network/element/RemoteAccessVPNServiceProvider.java
@@ -28,6 +28,6 @@ public interface RemoteAccessVPNServiceProvider extends Adapter {
String[] applyVpnUsers(RemoteAccessVpn vpn, List extends VpnUser> users) throws ResourceUnavailableException;
boolean startVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
-
+
boolean stopVpn(Network network, RemoteAccessVpn vpn) throws ResourceUnavailableException;
}
diff --git a/api/src/com/cloud/network/element/Site2SiteVpnServiceProvider.java b/api/src/com/cloud/network/element/Site2SiteVpnServiceProvider.java
index eadf8013602..dd451324a72 100644
--- a/api/src/com/cloud/network/element/Site2SiteVpnServiceProvider.java
+++ b/api/src/com/cloud/network/element/Site2SiteVpnServiceProvider.java
@@ -5,7 +5,7 @@
// 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,
@@ -22,6 +22,6 @@ import com.cloud.utils.component.Adapter;
public interface Site2SiteVpnServiceProvider extends Adapter {
boolean startSite2SiteVpn(Site2SiteVpnConnection conn) throws ResourceUnavailableException;
-
+
boolean stopSite2SiteVpn(Site2SiteVpnConnection conn) throws ResourceUnavailableException;
}
diff --git a/api/src/com/cloud/network/element/SourceNatServiceProvider.java b/api/src/com/cloud/network/element/SourceNatServiceProvider.java
index af63c6018b9..eaf43f82edd 100644
--- a/api/src/com/cloud/network/element/SourceNatServiceProvider.java
+++ b/api/src/com/cloud/network/element/SourceNatServiceProvider.java
@@ -16,8 +16,5 @@
// under the License.
package com.cloud.network.element;
-import com.cloud.network.Network;
-
-public interface SourceNatServiceProvider extends NetworkElement {
- IpDeployer getIpDeployer(Network network);
+public interface SourceNatServiceProvider extends NetworkElement, IpDeployingRequester {
}
diff --git a/api/src/com/cloud/network/element/StaticNatServiceProvider.java b/api/src/com/cloud/network/element/StaticNatServiceProvider.java
index 20174b17251..50f5e204658 100644
--- a/api/src/com/cloud/network/element/StaticNatServiceProvider.java
+++ b/api/src/com/cloud/network/element/StaticNatServiceProvider.java
@@ -22,7 +22,7 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Network;
import com.cloud.network.rules.StaticNat;
-public interface StaticNatServiceProvider extends NetworkElement {
+public interface StaticNatServiceProvider extends NetworkElement, IpDeployingRequester {
/**
* Creates static nat rule (public IP to private IP mapping) on the network element
* @param config
@@ -31,6 +31,4 @@ public interface StaticNatServiceProvider extends NetworkElement {
* @throws ResourceUnavailableException
*/
boolean applyStaticNats(Network config, List extends StaticNat> rules) throws ResourceUnavailableException;
-
- IpDeployer getIpDeployer(Network network);
}
diff --git a/api/src/com/cloud/network/element/VirtualRouterElementService.java b/api/src/com/cloud/network/element/VirtualRouterElementService.java
index bf8cad27946..3ba2045cfd6 100644
--- a/api/src/com/cloud/network/element/VirtualRouterElementService.java
+++ b/api/src/com/cloud/network/element/VirtualRouterElementService.java
@@ -18,8 +18,8 @@ package com.cloud.network.element;
import java.util.List;
-import com.cloud.api.commands.ConfigureVirtualRouterElementCmd;
-import com.cloud.api.commands.ListVirtualRouterElementsCmd;
+import org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElementCmd;
+import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
import com.cloud.network.VirtualRouterProvider;
import com.cloud.network.VirtualRouterProvider.VirtualRouterProviderType;
import com.cloud.utils.component.PluggableService;
diff --git a/api/src/com/cloud/network/element/VpcProvider.java b/api/src/com/cloud/network/element/VpcProvider.java
index aa5d2245a44..482fe6245a7 100644
--- a/api/src/com/cloud/network/element/VpcProvider.java
+++ b/api/src/com/cloud/network/element/VpcProvider.java
@@ -36,7 +36,7 @@ public interface VpcProvider extends NetworkElement{
* @param vpc fully specified vpc configuration.
* @throws InsufficientNetworkCapacityException TODO
*/
- boolean implementVpc(Vpc vpc, DeployDestination dest, ReservationContext context)
+ boolean implementVpc(Vpc vpc, DeployDestination dest, ReservationContext context)
throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
/**
@@ -47,10 +47,10 @@ public interface VpcProvider extends NetworkElement{
* @throws ResourceUnavailableException
*/
boolean shutdownVpc(Vpc vpc, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
boolean createPrivateGateway(PrivateGateway gateway) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
boolean deletePrivateGateway(PrivateGateway privateGateway) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
boolean applyStaticRoutes(Vpc vpc, List routes) throws ResourceUnavailableException;
}
diff --git a/api/src/com/cloud/network/firewall/FirewallService.java b/api/src/com/cloud/network/firewall/FirewallService.java
index 07c2fb5a838..3858499b2bb 100644
--- a/api/src/com/cloud/network/firewall/FirewallService.java
+++ b/api/src/com/cloud/network/firewall/FirewallService.java
@@ -19,7 +19,7 @@ package com.cloud.network.firewall;
import java.util.List;
-import com.cloud.api.commands.ListFirewallRulesCmd;
+import org.apache.cloudstack.api.command.user.firewall.ListFirewallRulesCmd;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
@@ -33,7 +33,7 @@ public interface FirewallService {
/**
* Revokes a firewall rule
- *
+ *
* @param ruleId
* the id of the rule to revoke.
* @return
diff --git a/api/src/com/cloud/network/firewall/NetworkACLService.java b/api/src/com/cloud/network/firewall/NetworkACLService.java
index 10896b6dc74..a1fb02cb71f 100644
--- a/api/src/com/cloud/network/firewall/NetworkACLService.java
+++ b/api/src/com/cloud/network/firewall/NetworkACLService.java
@@ -19,7 +19,7 @@ package com.cloud.network.firewall;
import java.util.List;
-import com.cloud.api.commands.ListNetworkACLsCmd;
+import org.apache.cloudstack.api.command.user.network.ListNetworkACLsCmd;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.FirewallRule;
@@ -29,7 +29,7 @@ import com.cloud.utils.Pair;
public interface NetworkACLService {
FirewallRule getNetworkACL(long ruleId);
boolean applyNetworkACLs(long networkId, Account caller) throws ResourceUnavailableException;
-
+
/**
* @param createNetworkACLCmd
* @return
@@ -46,5 +46,5 @@ public interface NetworkACLService {
* @return
*/
Pair, Integer> listNetworkACLs(ListNetworkACLsCmd cmd);
-
+
}
diff --git a/api/src/com/cloud/network/guru/NetworkGuru.java b/api/src/com/cloud/network/guru/NetworkGuru.java
index 9b8c04b4fc3..4a9b871e240 100755
--- a/api/src/com/cloud/network/guru/NetworkGuru.java
+++ b/api/src/com/cloud/network/guru/NetworkGuru.java
@@ -35,7 +35,7 @@ import com.cloud.vm.VirtualMachineProfile;
/**
* - Designs a virtual network depending on the network offering.
* - Implements the virtual network when a virtual machine requires the network to be started.
- *
+ *
* There can be multiple NetworkGurus in a CloudStack system. Each NetworkGuru
* resources when VMs are gone.
*
@@ -44,28 +44,28 @@ import com.cloud.vm.VirtualMachineProfile;
* This means the NetworkGuru checks the parameters such as cidr, gateway,
* vlan, etc and returns a network that can work with those paremeters.
* Note that at this point the network is only a virtual network. It has
- * not been substantiated with resources, such as vlan, to make the network
+ * not been substantiated with resources, such as vlan, to make the network
* functional in the physical environment. At this stage, the network is in
- * Allocated state.
- *
- * - When the first virtual machine is about to be started and requires network
+ * Allocated state.
+ *
+ * - When the first virtual machine is about to be started and requires network
* services, the guest network needs to have resources to make it usable
* within the physical environment. At this time, the NetworkGuru is
* called with the implement() method to acquire those resources.
- *
+ *
* - For every virtual machine starting in the network, the NetworkGuru is
* asked via the reserve() method to make sure everything the virtual
* machine needs to be functional in the network is reserved.
- *
+ *
* - For every virtual machine being stopped in the network, the NetworkGuru
* is informed via the release() method to make sure resources occupied
* by the virtual machine is released.
- *
+ *
* - If all virtual machines within the network have been stopped, the guest
* network is garbage collected. When a guest network is garbage collected
* the NetworkGuru is informed via the shutdown() method to release any
* resources it allocated to that network.
- *
+ *
* - When a guest network is being deleted, the NetworkGuru is informed via
* the trash() method.
*
@@ -74,18 +74,18 @@ public interface NetworkGuru extends Adapter {
/**
* Cloud stack requires the NetworkGuru to design a guest network given
* the software packages Once a NetworkGuru returns the designed network,
- * that NetworkGuru is forever associated with the guest network. It is
+ * that NetworkGuru is forever associated with the guest network. It is
* very important for the NetworkGuru implementation to be very specific
* about the network it is responsible for designing. Things that can
* be used to make determination can be isolation methods, services
* provided on the guest network and the service provider that's on the
* guest network.
- *
+ *
* If a network is already fully substantiated with the necessary resources
- * during this design phase, then the state should be set to Setup. If
+ * during this design phase, then the state should be set to Setup. If
* the resources are not allocated at this point, the state should be set
- * to Allocated.
- *
+ * to Allocated.
+ *
* @param offering network offering that contains the package of services
* the end user intends to use on that network.
* @param plan where is this network being deployed.
@@ -99,29 +99,29 @@ public interface NetworkGuru extends Adapter {
* For guest networks that are in Allocated state after the design stage,
* resources are allocated when the guest network is actually being used
* by a virtual machine. implement() is called to acquire those resources.
- *
+ *
* @param network network to be implemented.
* @param offering network offering that the network was created with.
* @param destination where the network is being deployed in.
* @return a fully implemented Network.
- * @throws InsufficientVirtualNetworkCapcityException if there's not
+ * @throws InsufficientVirtualNetworkCapcityException if there's not
* enough resources to make the guest network usable in the physical
- * environment. At this time, the admin generally must be involved to
+ * environment. At this time, the admin generally must be involved to
* allocate more resources before any more guest network can be implemented.
*/
Network implement(Network network, NetworkOffering offering, DeployDestination destination, ReservationContext context) throws InsufficientVirtualNetworkCapcityException;
/**
- * Once a guest network has been designed, virtual machines can be
- * created. allocated() is called for the NetworkGuru to design a nic
- * that will make the virtual machine work within the guest network.
- *
+ * Once a guest network has been designed, virtual machines can be
+ * created. allocated() is called for the NetworkGuru to design a nic
+ * that will make the virtual machine work within the guest network.
+ *
* @param network guest network that the virtual machine will be deployed in.
- * @param nic nic information that the end user wants to set. The
+ * @param nic nic information that the end user wants to set. The
* NetworkGuru should check this information with the guest
* network settings to make sure everything will work.
* @param vm virtual machine that is about to be deployed.
- * @return NicProfile nic with all of the information
+ * @return NicProfile nic with all of the information
* @throws InsufficientVirtualNetworkCapcityException if there's
* insufficient capacity within the guest network.
* @throws InsufficientAddressCapacityException if there are not addresses
@@ -134,7 +134,7 @@ public interface NetworkGuru extends Adapter {
* be allocated its resources in order for it to participate within the
* guest network. reserve() is called for the NetworkGuru to make sure
* that works.
- *
+ *
* @param nic nic that the vm is using to access the guest network.
* @param network guest network the vm is in.
* @param vm vm
@@ -145,14 +145,14 @@ public interface NetworkGuru extends Adapter {
* @throws InsufficientAddressCapacityException if there's not enough ip
* addresses.
* @throws ConcurrentOperationException if there are multiple operations
- * happening on this guest network or vm.
+ * happening on this guest network or vm.
*/
void reserve(NicProfile nic, Network network, VirtualMachineProfile extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException, ConcurrentOperationException;
/**
* When a virtual machine is stopped, the NetworkGuru is informed via the
- * release() method to release any resources.
- *
+ * release() method to release any resources.
+ *
* @param nic nic that the vm is using to access the guest network.
* @param vm virtual machine
* @param reservationId reservation id passed to it in the ReservationContext
@@ -164,7 +164,7 @@ public interface NetworkGuru extends Adapter {
* When a virtual machine is destroyed, the NetworkGuru is informed via
* the deallocate() method to make sure any resources that are allocated
* are released.
- *
+ *
* @param network guest network that the vm was running in.
* @param nic nic that the vm was using to access the guest network.
* @param vm virtual machine being destroyed.
@@ -181,19 +181,19 @@ public interface NetworkGuru extends Adapter {
void updateNicProfile(NicProfile profile, Network network);
/**
- * When no virtual machines are running in the network, the network is
+ * When no virtual machines are running in the network, the network is
* shutdown and all physical resources are released. The NetworkGuru is
* informed via the shutdown method().
- *
+ *
* @param network guest network being shut down
* @param offering network offering the guest network was created with.
*/
void shutdown(NetworkProfile network, NetworkOffering offering);
/**
- * When a guest network is destroyed, the NetworkGuru is informed via the
+ * When a guest network is destroyed, the NetworkGuru is informed via the
* trash() method to recover any resources.
- *
+ *
* @param network guest network being destroyed.
* @param offering network offering the guest network was created with.
* @param owner owner of the network.
diff --git a/api/src/com/cloud/network/lb/LoadBalancingRule.java b/api/src/com/cloud/network/lb/LoadBalancingRule.java
index 186ea566f97..b68b9cbddd4 100644
--- a/api/src/com/cloud/network/lb/LoadBalancingRule.java
+++ b/api/src/com/cloud/network/lb/LoadBalancingRule.java
@@ -26,6 +26,7 @@ import com.cloud.network.as.Counter;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.utils.Pair;
+import org.apache.cloudstack.api.InternalIdentity;
public class LoadBalancingRule implements FirewallRule, LoadBalancer {
private LoadBalancer lb;
@@ -230,7 +231,7 @@ public class LoadBalancingRule implements FirewallRule, LoadBalancer {
return null;
}
-
+
@Override
public TrafficType getTrafficType() {
return null;
diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
index 0cf2ef94ace..4081f6efc2c 100644
--- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
+++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java
@@ -18,12 +18,9 @@ package com.cloud.network.lb;
import java.util.List;
-import com.cloud.api.commands.CreateLBStickinessPolicyCmd;
-import com.cloud.api.commands.CreateLoadBalancerRuleCmd;
-import com.cloud.api.commands.ListLBStickinessPoliciesCmd;
-import com.cloud.api.commands.ListLoadBalancerRuleInstancesCmd;
-import com.cloud.api.commands.ListLoadBalancerRulesCmd;
-import com.cloud.api.commands.UpdateLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.loadbalancer.*;
+import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd;
+import org.apache.cloudstack.api.command.user.loadbalancer.UpdateLoadBalancerRuleCmd;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
@@ -36,7 +33,7 @@ import com.cloud.utils.Pair;
public interface LoadBalancingRulesService {
/**
* Create a load balancer rule from the given ipAddress/port to the given private port
- *
+ *
* @param openFirewall
* TODO
* @param cmd
@@ -53,7 +50,7 @@ public interface LoadBalancingRulesService {
/**
* Create a stickiness policy to a load balancer from the given stickiness method name and parameters in
* (name,value) pairs.
- *
+ *
* @param cmd
* the command specifying the stickiness method name, params (name,value pairs), policy name and
* description.
@@ -63,7 +60,7 @@ public interface LoadBalancingRulesService {
public StickinessPolicy createLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws NetworkRuleConflictException;
public boolean applyLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd) throws ResourceUnavailableException;
-
+
boolean deleteLBStickinessPolicy(long stickinessPolicyId, boolean apply);
/**
* Assign a virtual machine, or list of virtual machines, to a load balancer.
@@ -77,7 +74,7 @@ public interface LoadBalancingRulesService {
/**
* List instances that have either been applied to a load balancer or are eligible to be assigned to a load
* balancer.
- *
+ *
* @param cmd
* @return list of vm instances that have been or can be applied to a load balancer
*/
@@ -85,7 +82,7 @@ public interface LoadBalancingRulesService {
/**
* List load balancer rules based on the given criteria
- *
+ *
* @param cmd
* the command that specifies the criteria to use for listing load balancers. Load balancers can be
* listed
@@ -96,7 +93,7 @@ public interface LoadBalancingRulesService {
/**
* List stickiness policies based on the given criteria
- *
+ *
* @param cmd
* the command specifies the load balancing rule id.
* @return list of stickiness policies that match the criteria.
@@ -107,4 +104,4 @@ public interface LoadBalancingRulesService {
LoadBalancer findById(long LoadBalancer);
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/network/rules/FirewallRule.java b/api/src/com/cloud/network/rules/FirewallRule.java
index f2a83af29fe..042665cdcf9 100644
--- a/api/src/com/cloud/network/rules/FirewallRule.java
+++ b/api/src/com/cloud/network/rules/FirewallRule.java
@@ -18,9 +18,11 @@ package com.cloud.network.rules;
import java.util.List;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface FirewallRule extends ControlledEntity {
+public interface FirewallRule extends ControlledEntity, Identity, InternalIdentity {
enum Purpose {
Firewall,
PortForwarding,
@@ -29,39 +31,34 @@ public interface FirewallRule extends ControlledEntity {
StaticNat,
NetworkACL,
}
-
+
enum FirewallRuleType {
- System, // The pre-defined rules created by admin, in the system wide
- User; // the rules created by user, to a specific ip
+ System, // The pre-defined rules created by admin, in the system wide
+ User // the rules created by user, to a specific ip
}
-
+
enum State {
Staged, // Rule been created but has never got through network rule conflict detection. Rules in this state can not be sent to network elements.
Add, // Add means the rule has been created and has gone through network rule conflict detection.
Active, // Rule has been sent to the network elements and reported to be active.
Revoke // Revoke means this rule has been revoked. If this rule has been sent to the network elements, the rule will be deleted from database.
}
-
+
enum TrafficType {
Ingress,
Egress
}
-
- /**
- * @return database id.
- */
- long getId();
-
+
/**
* @return external id.
*/
String getXid();
-
+
/**
* @return first port of the source port range.
*/
Integer getSourcePortStart();
-
+
/**
* @return last port of the source prot range. If this is null, that means only one port is mapped.
*/
@@ -71,21 +68,21 @@ public interface FirewallRule extends ControlledEntity {
* @return protocol to open these ports for.
*/
String getProtocol();
-
+
Purpose getPurpose();
-
+
State getState();
-
+
long getNetworkId();
-
+
Long getSourceIpAddressId();
Integer getIcmpCode();
Integer getIcmpType();
-
+
List getSourceCidrList();
-
+
Long getRelated();
FirewallRuleType getType();
diff --git a/api/src/com/cloud/network/rules/LbStickinessMethod.java b/api/src/com/cloud/network/rules/LbStickinessMethod.java
index 5f0abe8aaf6..c71b19e3a86 100644
--- a/api/src/com/cloud/network/rules/LbStickinessMethod.java
+++ b/api/src/com/cloud/network/rules/LbStickinessMethod.java
@@ -24,14 +24,14 @@ import com.google.gson.annotations.SerializedName;
public class LbStickinessMethod {
public static class StickinessMethodType {
private String _name;
-
+
public static final StickinessMethodType LBCookieBased = new StickinessMethodType("LbCookie");
public static final StickinessMethodType AppCookieBased = new StickinessMethodType("AppCookie");
public static final StickinessMethodType SourceBased = new StickinessMethodType("SourceBased");
public StickinessMethodType(String name) {
_name = name;
}
-
+
public String getName() {
return _name;
}
@@ -40,13 +40,13 @@ public class LbStickinessMethod {
public class LbStickinessMethodParam {
@SerializedName("paramname")
private String _paramName;
-
+
@SerializedName("required")
private Boolean _required;
-
+
@SerializedName("isflag")
private Boolean _isFlag;
-
+
@SerializedName("description")
private String _description;
@@ -65,7 +65,7 @@ public class LbStickinessMethod {
public void setParamName(String paramName) {
this._paramName = paramName;
}
-
+
public Boolean getIsflag() {
return _isFlag;
}
@@ -73,7 +73,7 @@ public class LbStickinessMethod {
public void setIsflag(Boolean isFlag) {
this._isFlag = isFlag;
}
-
+
public Boolean getRequired() {
return _required;
}
@@ -94,10 +94,10 @@ public class LbStickinessMethod {
@SerializedName("methodname")
private String _methodName;
-
+
@SerializedName("paramlist")
private List _paramList;
-
+
@SerializedName("description")
private String _description;
@@ -118,7 +118,7 @@ public class LbStickinessMethod {
public String getMethodName() {
return _methodName;
}
-
+
public List getParamList() {
return _paramList;
}
diff --git a/api/src/com/cloud/network/rules/LoadBalancer.java b/api/src/com/cloud/network/rules/LoadBalancer.java
index 9734e7e3cb6..ab6085aceb7 100644
--- a/api/src/com/cloud/network/rules/LoadBalancer.java
+++ b/api/src/com/cloud/network/rules/LoadBalancer.java
@@ -31,5 +31,4 @@ public interface LoadBalancer extends FirewallRule {
String getAlgorithm();
- String getUuid();
}
diff --git a/api/src/com/cloud/network/rules/PortForwardingRule.java b/api/src/com/cloud/network/rules/PortForwardingRule.java
index 6ac6f4521f9..c353e9bc3d4 100644
--- a/api/src/com/cloud/network/rules/PortForwardingRule.java
+++ b/api/src/com/cloud/network/rules/PortForwardingRule.java
@@ -26,26 +26,26 @@ public interface PortForwardingRule extends FirewallRule {
* @return destination ip address.
*/
Ip getDestinationIpAddress();
-
-
+
+
/**
* updates the destination ip address.
*/
void setDestinationIpAddress(Ip destinationIpAddress);
-
+
/**
* @return start of destination port.
*/
int getDestinationPortStart();
-
+
/**
* @return end of destination port range
*/
int getDestinationPortEnd();
-
+
/**
* @return destination ip address.
*/
- long getVirtualMachineId();
-
+ long getVirtualMachineId();
+
}
diff --git a/api/src/com/cloud/network/rules/RulesService.java b/api/src/com/cloud/network/rules/RulesService.java
index 8eadfba7712..80c96d558c4 100644
--- a/api/src/com/cloud/network/rules/RulesService.java
+++ b/api/src/com/cloud/network/rules/RulesService.java
@@ -18,7 +18,7 @@ package com.cloud.network.rules;
import java.util.List;
-import com.cloud.api.commands.ListPortForwardingRulesCmd;
+import org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
@@ -31,7 +31,7 @@ public interface RulesService {
/**
* Creates a port forwarding rule between two ip addresses or between
* an ip address and a virtual machine.
- *
+ *
* @param rule
* rule to be created.
* @param vmId
@@ -46,7 +46,7 @@ public interface RulesService {
/**
* Revokes a port forwarding rule
- *
+ *
* @param ruleId
* the id of the rule to revoke.
* @param caller
@@ -56,7 +56,7 @@ public interface RulesService {
/**
* List port forwarding rules assigned to an ip address
- *
+ *
* @param cmd
* the command object holding the criteria for listing port forwarding rules (the ipAddress)
* @return list of port forwarding rules on the given address, empty list if no rules exist
diff --git a/api/src/com/cloud/network/rules/StaticNat.java b/api/src/com/cloud/network/rules/StaticNat.java
index bf29ab4bf9c..390a0dbaedc 100644
--- a/api/src/com/cloud/network/rules/StaticNat.java
+++ b/api/src/com/cloud/network/rules/StaticNat.java
@@ -18,13 +18,13 @@ package com.cloud.network.rules;
public interface StaticNat{
-
+
long getAccountId();
-
+
long getDomainId();
-
+
long getNetworkId();
-
+
long getSourceIpAddressId();
String getDestIpAddress();
diff --git a/api/src/com/cloud/network/rules/StaticNatRule.java b/api/src/com/cloud/network/rules/StaticNatRule.java
index 601cd6afb9e..839430a6b8c 100644
--- a/api/src/com/cloud/network/rules/StaticNatRule.java
+++ b/api/src/com/cloud/network/rules/StaticNatRule.java
@@ -16,31 +16,7 @@
// under the License.
package com.cloud.network.rules;
-import com.cloud.acl.ControlledEntity;
-
-public interface StaticNatRule extends ControlledEntity, FirewallRule {
-
- long getId();
-
- String getXid();
-
- String getProtocol();
-
- Integer getSourcePortStart();
-
- Integer getSourcePortEnd();
-
- Purpose getPurpose();
-
- State getState();
-
- long getAccountId();
-
- long getDomainId();
-
- long getNetworkId();
-
- Long getSourceIpAddressId();
+public interface StaticNatRule extends FirewallRule {
String getDestIpAddress();
-}
+}
\ No newline at end of file
diff --git a/api/src/com/cloud/network/rules/StickinessPolicy.java b/api/src/com/cloud/network/rules/StickinessPolicy.java
index 49c2e60c493..e23ff828f74 100644
--- a/api/src/com/cloud/network/rules/StickinessPolicy.java
+++ b/api/src/com/cloud/network/rules/StickinessPolicy.java
@@ -19,12 +19,12 @@ package com.cloud.network.rules;
import java.util.List;
import com.cloud.utils.Pair;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
*/
-public interface StickinessPolicy {
-
- public long getId();
+public interface StickinessPolicy extends InternalIdentity, Identity {
public long getLoadBalancerId();
@@ -38,5 +38,4 @@ public interface StickinessPolicy {
public List> getParams(); /* get params in Map format */
- public String getUuid();
}
diff --git a/api/src/com/cloud/network/security/SecurityGroup.java b/api/src/com/cloud/network/security/SecurityGroup.java
index 68467407f3d..3ac0e7cea62 100644
--- a/api/src/com/cloud/network/security/SecurityGroup.java
+++ b/api/src/com/cloud/network/security/SecurityGroup.java
@@ -16,10 +16,12 @@
// under the License.
package com.cloud.network.security;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface SecurityGroup extends ControlledEntity {
- long getId();
+//FIXME: Annotation @doc("")
+public interface SecurityGroup extends ControlledEntity, InternalIdentity, Identity {
String getName();
diff --git a/api/src/com/cloud/network/security/SecurityGroupRules.java b/api/src/com/cloud/network/security/SecurityGroupRules.java
index 37287f0c76b..0b575e10d56 100644
--- a/api/src/com/cloud/network/security/SecurityGroupRules.java
+++ b/api/src/com/cloud/network/security/SecurityGroupRules.java
@@ -16,9 +16,9 @@
// under the License.
package com.cloud.network.security;
import com.cloud.network.security.SecurityRule.SecurityRuleType;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface SecurityGroupRules {
- long getId();
+public interface SecurityGroupRules extends InternalIdentity {
String getName();
@@ -39,6 +39,6 @@ public interface SecurityGroupRules {
Long getAllowedNetworkId();
String getAllowedSourceIpCidr();
-
+
SecurityRuleType getRuleType();
}
diff --git a/api/src/com/cloud/network/security/SecurityGroupService.java b/api/src/com/cloud/network/security/SecurityGroupService.java
index 4a4b1712aba..741f179db50 100644
--- a/api/src/com/cloud/network/security/SecurityGroupService.java
+++ b/api/src/com/cloud/network/security/SecurityGroupService.java
@@ -18,13 +18,8 @@ package com.cloud.network.security;
import java.util.List;
-import com.cloud.api.commands.AuthorizeSecurityGroupEgressCmd;
-import com.cloud.api.commands.AuthorizeSecurityGroupIngressCmd;
-import com.cloud.api.commands.CreateSecurityGroupCmd;
-import com.cloud.api.commands.DeleteSecurityGroupCmd;
-import com.cloud.api.commands.ListSecurityGroupsCmd;
-import com.cloud.api.commands.RevokeSecurityGroupEgressCmd;
-import com.cloud.api.commands.RevokeSecurityGroupIngressCmd;
+import org.apache.cloudstack.api.command.user.securitygroup.*;
+
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.exception.ResourceInUseException;
@@ -38,18 +33,12 @@ public interface SecurityGroupService {
public SecurityGroup createSecurityGroup(CreateSecurityGroupCmd command) throws PermissionDeniedException, InvalidParameterValueException;
boolean revokeSecurityGroupIngress(RevokeSecurityGroupIngressCmd cmd);
boolean revokeSecurityGroupEgress(RevokeSecurityGroupEgressCmd cmd);
-
+
boolean deleteSecurityGroup(DeleteSecurityGroupCmd cmd) throws ResourceInUseException;
- /**
- * Search for security groups and associated ingress rules for the given account, domain, group name, and/or keyword.
- * The search terms are specified in the search criteria.
- * @return the list of security groups and associated ingress rules
- */
- public List extends SecurityGroupRules> searchForSecurityGroupRules(ListSecurityGroupsCmd cmd) throws PermissionDeniedException, InvalidParameterValueException;
public List extends SecurityRule> authorizeSecurityGroupIngress(AuthorizeSecurityGroupIngressCmd cmd);
-
+
public List extends SecurityRule> authorizeSecurityGroupEgress(AuthorizeSecurityGroupEgressCmd cmd);
}
diff --git a/api/src/com/cloud/network/security/SecurityRule.java b/api/src/com/cloud/network/security/SecurityRule.java
index 401283aba4b..bd4192d614c 100644
--- a/api/src/com/cloud/network/security/SecurityRule.java
+++ b/api/src/com/cloud/network/security/SecurityRule.java
@@ -17,34 +17,35 @@
package com.cloud.network.security;
import com.cloud.async.AsyncInstanceCreateStatus;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface SecurityRule {
+public interface SecurityRule extends Identity, InternalIdentity {
public static class SecurityRuleType {
public static final SecurityRuleType IngressRule = new SecurityRuleType("ingress");
public static final SecurityRuleType EgressRule = new SecurityRuleType("egress");
-
+
public SecurityRuleType(String type) {
this._type = type;
}
-
+
public String getType(){
return _type;
}
private String _type;
}
- long getId();
long getSecurityGroupId();
int getStartPort();
int getEndPort();
-
+
String getType();
-
+
SecurityRuleType getRuleType();
-
+
String getProtocol();
AsyncInstanceCreateStatus getCreateStatus();
@@ -52,7 +53,4 @@ public interface SecurityRule {
Long getAllowedNetworkId();
String getAllowedSourceIpCidr();
-
- String getUuid();
-
}
diff --git a/api/src/com/cloud/network/vpc/PrivateGateway.java b/api/src/com/cloud/network/vpc/PrivateGateway.java
index 82672a6ef12..2f346852e30 100644
--- a/api/src/com/cloud/network/vpc/PrivateGateway.java
+++ b/api/src/com/cloud/network/vpc/PrivateGateway.java
@@ -16,6 +16,6 @@
// under the License.
package com.cloud.network.vpc;
-public interface PrivateGateway extends VpcGateway{
+public interface PrivateGateway extends VpcGateway {
long getPhysicalNetworkId();
}
diff --git a/api/src/com/cloud/network/vpc/PrivateIp.java b/api/src/com/cloud/network/vpc/PrivateIp.java
index 992a87ca475..857fc226f30 100644
--- a/api/src/com/cloud/network/vpc/PrivateIp.java
+++ b/api/src/com/cloud/network/vpc/PrivateIp.java
@@ -42,7 +42,7 @@ public interface PrivateIp {
* @return
*/
String getMacAddress();
-
+
long getNetworkId();
}
diff --git a/api/src/com/cloud/network/vpc/StaticRoute.java b/api/src/com/cloud/network/vpc/StaticRoute.java
index 56b34cbaa86..ccdbec899b8 100644
--- a/api/src/com/cloud/network/vpc/StaticRoute.java
+++ b/api/src/com/cloud/network/vpc/StaticRoute.java
@@ -16,9 +16,11 @@
// under the License.
package com.cloud.network.vpc;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface StaticRoute extends ControlledEntity{
+public interface StaticRoute extends ControlledEntity, Identity, InternalIdentity {
enum State {
Staged, // route been created but has never got through network rule conflict detection. Routes in this state can not be sent to VPC virtual router.
Add, // Add means the route has been created and has gone through network rule conflict detection.
@@ -45,11 +47,4 @@ public interface StaticRoute extends ControlledEntity{
* @return
*/
Long getVpcId();
-
- /**
- * @return
- */
- long getId();
-
-
}
diff --git a/api/src/com/cloud/network/vpc/StaticRouteProfile.java b/api/src/com/cloud/network/vpc/StaticRouteProfile.java
index 73d0a84f8b7..656355590f3 100644
--- a/api/src/com/cloud/network/vpc/StaticRouteProfile.java
+++ b/api/src/com/cloud/network/vpc/StaticRouteProfile.java
@@ -16,8 +16,11 @@
// under the License.
package com.cloud.network.vpc;
-public class StaticRouteProfile implements StaticRoute{
+import org.apache.cloudstack.api.InternalIdentity;
+
+public class StaticRouteProfile implements StaticRoute {
private long id;
+ private String uuid;
private String targetCidr;
private long accountId;
private long domainId;
@@ -28,10 +31,11 @@ public class StaticRouteProfile implements StaticRoute{
String gateway;
String netmask;
String ipAddress;
-
+
public StaticRouteProfile(StaticRoute staticRoute, VpcGateway gateway) {
this.id = staticRoute.getId();
+ this.uuid = staticRoute.getUuid();
this.targetCidr = staticRoute.getCidr();
this.accountId = staticRoute.getAccountId();
this.domainId = staticRoute.getDomainId();
@@ -79,10 +83,16 @@ public class StaticRouteProfile implements StaticRoute{
return id;
}
+
+ @Override
+ public String getUuid() {
+ return uuid;
+ }
+
public String getVlanTag() {
return vlanTag;
}
-
+
public String getIp4Address() {
return ipAddress;
}
@@ -94,5 +104,5 @@ public class StaticRouteProfile implements StaticRoute{
public String getNetmask() {
return netmask;
}
-
+
}
diff --git a/api/src/com/cloud/network/vpc/Vpc.java b/api/src/com/cloud/network/vpc/Vpc.java
index c9f52ff999f..9365e56dd82 100644
--- a/api/src/com/cloud/network/vpc/Vpc.java
+++ b/api/src/com/cloud/network/vpc/Vpc.java
@@ -16,23 +16,21 @@
// under the License.
package com.cloud.network.vpc;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.network.Network;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Vpc extends ControlledEntity{
+public interface Vpc extends ControlledEntity, Identity, InternalIdentity {
public enum State {
Enabled,
Inactive
}
-
+
public static final String _supportedProviders = Network.Provider.VPCVirtualRouter.getName();
boolean readyToUse();
- long getId();
-
- String getUuid();
-
String getName();
long getZoneId();
@@ -42,11 +40,11 @@ public interface Vpc extends ControlledEntity{
State getState();
long getVpcOfferingId();
-
+
String getDisplayText();
String getNetworkDomain();
boolean isRestartRequired();
-
+
}
diff --git a/api/src/com/cloud/network/vpc/VpcGateway.java b/api/src/com/cloud/network/vpc/VpcGateway.java
index c972c35c3fb..17566160ec3 100644
--- a/api/src/com/cloud/network/vpc/VpcGateway.java
+++ b/api/src/com/cloud/network/vpc/VpcGateway.java
@@ -16,23 +16,22 @@
// under the License.
package com.cloud.network.vpc;
-import com.cloud.acl.ControlledEntity;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface VpcGateway extends Identity, ControlledEntity {
+public interface VpcGateway extends Identity, ControlledEntity, InternalIdentity {
public enum Type {
Private,
Public,
Vpn
}
-
+
public enum State {
Creating,
Ready,
Deleting
}
-
- long getId();
/**
* @return
diff --git a/api/src/com/cloud/network/vpc/VpcOffering.java b/api/src/com/cloud/network/vpc/VpcOffering.java
index 10c1d2aca96..1acfcd21418 100644
--- a/api/src/com/cloud/network/vpc/VpcOffering.java
+++ b/api/src/com/cloud/network/vpc/VpcOffering.java
@@ -16,18 +16,17 @@
// under the License.
package com.cloud.network.vpc;
-public interface VpcOffering {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface VpcOffering extends InternalIdentity, Identity {
public enum State {
Disabled,
Enabled
}
-
+
public static final String defaultVPCOfferingName = "Default VPC offering";
- long getId();
-
- String getUuid();
-
String getName();
String getUniqueName();
@@ -35,7 +34,7 @@ public interface VpcOffering {
String getDisplayText();
State getState();
-
+
boolean isDefault();
/**
diff --git a/api/src/com/cloud/network/vpc/VpcService.java b/api/src/com/cloud/network/vpc/VpcService.java
index c13e37f1b55..68e062c7d79 100644
--- a/api/src/com/cloud/network/vpc/VpcService.java
+++ b/api/src/com/cloud/network/vpc/VpcService.java
@@ -20,8 +20,8 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
-import com.cloud.api.commands.ListPrivateGatewaysCmd;
-import com.cloud.api.commands.ListStaticRoutesCmd;
+import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd;
+import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
@@ -37,20 +37,20 @@ import com.cloud.user.User;
import com.cloud.utils.Pair;
public interface VpcService {
-
+
public VpcOffering getVpcOffering(long vpcOfferingId);
-
+
public VpcOffering createVpcOffering(String name, String displayText, List supportedServices);
-
+
public Vpc getVpc(long vpcId);
-
+
public Vpc getActiveVpc(long vpcId);
-
+
public List extends Network> getVpcNetworks(long vpcId);
-
+
Map> getVpcOffSvcProvidersMap(long vpcOffId);
-
- List extends VpcOffering> listVpcOfferings(Long id, String name, String displayText, List supportedServicesStr,
+
+ List extends VpcOffering> listVpcOfferings(Long id, String name, String displayText, List supportedServicesStr,
Boolean isDefault, String keyword, String state, Long startIndex, Long pageSizeVal);
/**
@@ -85,9 +85,9 @@ public interface VpcService {
/**
* @param vpcId
* @return
- * @throws InsufficientCapacityException
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
+ * @throws InsufficientCapacityException
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
*/
public boolean deleteVpc(long vpcId) throws ConcurrentOperationException, ResourceUnavailableException;
@@ -120,22 +120,22 @@ public interface VpcService {
* @param vpc
* @return
*/
- public List extends Vpc> listVpcs(Long id, String vpcName, String displayText,
+ public List extends Vpc> listVpcs(Long id, String vpcName, String displayText,
List supportedServicesStr, String cidr, Long vpcOffId, String state, String accountName, Long domainId,
- String keyword, Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll,
+ String keyword, Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll,
Boolean restartRequired, Map tags, Long projectId);
/**
* @param vpcId
* @param destroyOnFailure TODO
* @return
- * @throws InsufficientCapacityException
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
+ * @throws InsufficientCapacityException
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
*/
- boolean startVpc(long vpcId, boolean destroyOnFailure) throws ConcurrentOperationException,
+ boolean startVpc(long vpcId, boolean destroyOnFailure) throws ConcurrentOperationException,
ResourceUnavailableException, InsufficientCapacityException;
-
+
/**
* @param vpcId
* @return
@@ -147,10 +147,10 @@ public interface VpcService {
/**
* @param id
* @return
- * @throws InsufficientCapacityException
+ * @throws InsufficientCapacityException
*/
boolean restartVpc(long id) throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException;
-
+
PrivateGateway getVpcPrivateGateway(long id);
/**
@@ -162,28 +162,28 @@ public interface VpcService {
* @param netmask
* @param gatewayOwnerId
* @return
- * @throws InsufficientCapacityException
- * @throws ConcurrentOperationException
- * @throws ResourceAllocationException
+ * @throws InsufficientCapacityException
+ * @throws ConcurrentOperationException
+ * @throws ResourceAllocationException
*/
- public PrivateGateway createVpcPrivateGateway(long vpcId, Long physicalNetworkId, String vlan, String ipAddress,
- String gateway, String netmask, long gatewayOwnerId) throws ResourceAllocationException,
+ public PrivateGateway createVpcPrivateGateway(long vpcId, Long physicalNetworkId, String vlan, String ipAddress,
+ String gateway, String netmask, long gatewayOwnerId) throws ResourceAllocationException,
ConcurrentOperationException, InsufficientCapacityException;
/**
* @param gatewayId
* @param destroyOnFailure TODO
* @return
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
*/
public PrivateGateway applyVpcPrivateGateway(long gatewayId, boolean destroyOnFailure) throws ConcurrentOperationException, ResourceUnavailableException;
-
+
/**
* @param id
* @return
- * @throws ResourceUnavailableException
- * @throws ConcurrentOperationException
+ * @throws ResourceUnavailableException
+ * @throws ConcurrentOperationException
*/
boolean deleteVpcPrivateGateway(long gatewayId) throws ConcurrentOperationException, ResourceUnavailableException;
@@ -202,14 +202,14 @@ public interface VpcService {
/**
* @param vpcId
* @return
- * @throws ResourceUnavailableException
+ * @throws ResourceUnavailableException
*/
public boolean applyStaticRoutes(long vpcId) throws ResourceUnavailableException;
/**
* @param routeId
* @return TODO
- * @throws ResourceUnavailableException
+ * @throws ResourceUnavailableException
*/
public boolean revokeStaticRoute(long routeId) throws ResourceUnavailableException;
@@ -231,7 +231,7 @@ public interface VpcService {
* @return
*/
VpcGateway getVpcGateway(long id);
-
+
/**
* @param ipId
* @param vpcId
@@ -243,7 +243,7 @@ public interface VpcService {
*/
IpAddress associateIPToVpc(long ipId, long vpcId) throws ResourceAllocationException, ResourceUnavailableException,
InsufficientAddressCapacityException, ConcurrentOperationException;
-
- public Network updateVpcGuestNetwork(long networkId, String name, String displayText, Account callerAccount,
+
+ public Network updateVpcGuestNetwork(long networkId, String name, String displayText, Account callerAccount,
User callerUser, String domainSuffix, Long ntwkOffId, Boolean changeCidr);
}
diff --git a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
index 4d820a7a258..81599a0c3c9 100644
--- a/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
+++ b/api/src/com/cloud/network/vpn/RemoteAccessVpnService.java
@@ -18,8 +18,8 @@ package com.cloud.network.vpn;
import java.util.List;
-import com.cloud.api.commands.ListRemoteAccessVpnsCmd;
-import com.cloud.api.commands.ListVpnUsersCmd;
+import org.apache.cloudstack.api.command.user.vpn.ListVpnUsersCmd;
+import org.apache.cloudstack.api.command.user.vpn.ListRemoteAccessVpnsCmd;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.RemoteAccessVpn;
@@ -29,7 +29,7 @@ import com.cloud.utils.Pair;
public interface RemoteAccessVpnService {
- RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, long networkId)
+ RemoteAccessVpn createRemoteAccessVpn(long vpnServerAddressId, String ipRange, boolean openFirewall, long networkId)
throws NetworkRuleConflictException;
void destroyRemoteAccessVpn(long vpnServerAddressId, Account caller) throws ResourceUnavailableException;
RemoteAccessVpn startRemoteAccessVpn(long vpnServerAddressId, boolean openFirewall) throws ResourceUnavailableException;
@@ -38,12 +38,12 @@ public interface RemoteAccessVpnService {
boolean removeVpnUser(long vpnOwnerId, String userName, Account caller);
List extends VpnUser> listVpnUsers(long vpnOwnerId, String userName);
boolean applyVpnUsers(long vpnOwnerId, String userName);
-
+
Pair, Integer> searchForRemoteAccessVpns(ListRemoteAccessVpnsCmd cmd);
Pair, Integer> searchForVpnUsers(ListVpnUsersCmd cmd);
-
+
List extends RemoteAccessVpn> listRemoteAccessVpns(long networkId);
-
+
RemoteAccessVpn getRemoteAccessVpn(long vpnId);
}
diff --git a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
index 69eab1a13f6..7ac567774d8 100644
--- a/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
+++ b/api/src/com/cloud/network/vpn/Site2SiteVpnService.java
@@ -18,17 +18,17 @@ package com.cloud.network.vpn;
import java.util.List;
-import com.cloud.api.commands.CreateVpnConnectionCmd;
-import com.cloud.api.commands.CreateVpnCustomerGatewayCmd;
-import com.cloud.api.commands.CreateVpnGatewayCmd;
-import com.cloud.api.commands.DeleteVpnConnectionCmd;
-import com.cloud.api.commands.DeleteVpnCustomerGatewayCmd;
-import com.cloud.api.commands.DeleteVpnGatewayCmd;
-import com.cloud.api.commands.ListVpnConnectionsCmd;
-import com.cloud.api.commands.ListVpnCustomerGatewaysCmd;
-import com.cloud.api.commands.ListVpnGatewaysCmd;
-import com.cloud.api.commands.ResetVpnConnectionCmd;
-import com.cloud.api.commands.UpdateVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.command.user.vpn.*;
+import org.apache.cloudstack.api.command.user.vpn.CreateVpnConnectionCmd;
+import org.apache.cloudstack.api.command.user.vpn.CreateVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.command.user.vpn.CreateVpnGatewayCmd;
+import org.apache.cloudstack.api.command.user.vpn.DeleteVpnConnectionCmd;
+import org.apache.cloudstack.api.command.user.vpn.DeleteVpnCustomerGatewayCmd;
+import org.apache.cloudstack.api.command.user.vpn.DeleteVpnGatewayCmd;
+import org.apache.cloudstack.api.command.user.vpn.ListVpnConnectionsCmd;
+import org.apache.cloudstack.api.command.user.vpn.ListVpnGatewaysCmd;
+import org.apache.cloudstack.api.command.user.vpn.ResetVpnConnectionCmd;
+import org.apache.cloudstack.api.command.user.vpn.UpdateVpnCustomerGatewayCmd;
import com.cloud.exception.NetworkRuleConflictException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Site2SiteCustomerGateway;
diff --git a/api/src/com/cloud/offering/DiskOffering.java b/api/src/com/cloud/offering/DiskOffering.java
index a937c6d789d..9a48f4bb655 100644
--- a/api/src/com/cloud/offering/DiskOffering.java
+++ b/api/src/com/cloud/offering/DiskOffering.java
@@ -16,15 +16,18 @@
// under the License.
package com.cloud.offering;
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
/**
* Represents a disk offering that specifies what the end user needs in
* the disk offering.
- *
+ *
*/
-public interface DiskOffering {
- long getId();
+public interface DiskOffering extends InfrastructureEntity, Identity, InternalIdentity {
String getUniqueName();
diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java
index 29828ab6172..f2c4de520a1 100644
--- a/api/src/com/cloud/offering/NetworkOffering.java
+++ b/api/src/com/cloud/offering/NetworkOffering.java
@@ -18,12 +18,15 @@ package com.cloud.offering;
import com.cloud.network.Network.GuestType;
import com.cloud.network.Networks.TrafficType;
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* Describes network offering
- *
+ *
*/
-public interface NetworkOffering {
+public interface NetworkOffering extends InfrastructureEntity, InternalIdentity, Identity {
public enum Availability {
Required,
@@ -40,7 +43,7 @@ public interface NetworkOffering {
public final static String SystemManagementNetwork = "System-Management-Network";
public final static String SystemStorageNetwork = "System-Storage-Network";
public final static String SystemPrivateGatewayNetworkOffering = "System-Private-Gateway-Network-Offering";
-
+
public final static String DefaultSharedNetworkOfferingWithSGService = "DefaultSharedNetworkOfferingWithSGService";
public final static String DefaultIsolatedNetworkOfferingWithSourceNatService = "DefaultIsolatedNetworkOfferingWithSourceNatService";
public final static String OvsIsolatedNetworkOfferingWithSourceNatService = "OvsIsolatedNetworkOfferingWithSourceNatService";
@@ -50,9 +53,6 @@ public interface NetworkOffering {
public final static String DefaultIsolatedNetworkOfferingForVpcNetworks = "DefaultIsolatedNetworkOfferingForVpcNetworks";
public final static String DefaultIsolatedNetworkOfferingForVpcNetworksNoLB = "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB";
-
- long getId();
-
/**
* @return name for the network offering.
*/
@@ -105,10 +105,9 @@ public interface NetworkOffering {
boolean getElasticIp();
- boolean getAssociatePublicIP();
-
boolean getElasticLb();
boolean getSpecifyIpRanges();
+ boolean isInline();
}
diff --git a/api/src/com/cloud/offering/OfferingManager.java b/api/src/com/cloud/offering/OfferingManager.java
index 3cc68dbcc6f..576679d04c9 100644
--- a/api/src/com/cloud/offering/OfferingManager.java
+++ b/api/src/com/cloud/offering/OfferingManager.java
@@ -18,30 +18,30 @@ package com.cloud.offering;
/**
* An administrator can create, delete, enable, and disable offerings.
- *
+ *
* There are three types of offerings:
* - Disk Offering - package of disk performance and size specification.
* - Network Offering - package of services available on a network.
- *
+ *
*/
public interface OfferingManager {
/**
* Creates a service offering.
- *
+ *
* @return ServiceOffering
*/
ServiceOffering createServiceOffering();
/**
* Creates a disk offering.
- *
+ *
* @return DiskOffering
*/
DiskOffering createDiskOffering();
/**
* Creates a network offering.
- *
+ *
* @return NetworkOffering
*/
NetworkOffering createNetworkOffering();
diff --git a/api/src/com/cloud/offering/ServiceOffering.java b/api/src/com/cloud/offering/ServiceOffering.java
index 1a1acb2ea5a..b13346cfb83 100755
--- a/api/src/com/cloud/offering/ServiceOffering.java
+++ b/api/src/com/cloud/offering/ServiceOffering.java
@@ -16,12 +16,16 @@
// under the License.
package com.cloud.offering;
+import org.apache.cloudstack.acl.InfrastructureEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
/**
* offered.
*/
-public interface ServiceOffering {
+public interface ServiceOffering extends InfrastructureEntity, InternalIdentity, Identity {
public static final String consoleProxyDefaultOffUniqueName = "Cloud.com-ConsoleProxy";
public static final String ssvmDefaultOffUniqueName = "Cloud.com-SecondaryStorage";
public static final String routerDefaultOffUniqueName = "Cloud.Com-SoftwareRouter";
@@ -32,8 +36,6 @@ public interface ServiceOffering {
shared
}
- long getId();
-
String getDisplayText();
Date getCreated();
diff --git a/api/src/com/cloud/org/Cluster.java b/api/src/com/cloud/org/Cluster.java
index 7fe64af59a5..cb72a70b817 100644
--- a/api/src/com/cloud/org/Cluster.java
+++ b/api/src/com/cloud/org/Cluster.java
@@ -18,15 +18,15 @@ package com.cloud.org;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.org.Managed.ManagedState;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Cluster extends Grouping {
+public interface Cluster extends Grouping, InternalIdentity, Identity {
public static enum ClusterType {
CloudManaged,
ExternalManaged;
};
- long getId();
-
String getName();
long getDataCenterId();
diff --git a/api/src/com/cloud/projects/Project.java b/api/src/com/cloud/projects/Project.java
index f67506e4997..78d52574f28 100644
--- a/api/src/com/cloud/projects/Project.java
+++ b/api/src/com/cloud/projects/Project.java
@@ -18,10 +18,11 @@ package com.cloud.projects;
import java.util.Date;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.api.Identity;
import com.cloud.domain.PartOf;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Project extends PartOf, Identity {
+public interface Project extends PartOf, Identity, InternalIdentity {
public enum State {
Active, Disabled, Suspended
}
diff --git a/api/src/com/cloud/projects/ProjectInvitation.java b/api/src/com/cloud/projects/ProjectInvitation.java
index 6dca006645b..ee282229034 100644
--- a/api/src/com/cloud/projects/ProjectInvitation.java
+++ b/api/src/com/cloud/projects/ProjectInvitation.java
@@ -18,15 +18,15 @@ package com.cloud.projects;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface ProjectInvitation extends ControlledEntity {
+public interface ProjectInvitation extends ControlledEntity, Identity, InternalIdentity {
public enum State {
Pending, Completed, Expired, Declined
}
- long getId();
-
long getProjectId();
Long getForAccountId();
diff --git a/api/src/com/cloud/projects/ProjectService.java b/api/src/com/cloud/projects/ProjectService.java
index ea143b7e868..01975188dd9 100644
--- a/api/src/com/cloud/projects/ProjectService.java
+++ b/api/src/com/cloud/projects/ProjectService.java
@@ -16,20 +16,16 @@
// under the License.
package com.cloud.projects;
-import java.util.List;
-import java.util.Map;
-
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.projects.ProjectAccount.Role;
import com.cloud.user.Account;
-import com.cloud.utils.Pair;
public interface ProjectService {
/**
* Creates a new project
- *
+ *
* @param name
* - project name
* @param displayText
@@ -45,7 +41,7 @@ public interface ProjectService {
/**
* Deletes a project
- *
+ *
* @param id
* - project id
* @return true if the project was deleted successfully, false otherwise
@@ -54,16 +50,13 @@ public interface ProjectService {
/**
* Gets a project by id
- *
+ *
* @param id
* - project id
* @return project object
*/
Project getProject(long id);
- Pair, Integer> listProjects(Long id, String name, String displayText, String state, String accountName,
- Long domainId, String keyword, Long startIndex, Long pageSize, boolean listAll, boolean isRecursive, Map tags);
-
ProjectAccount assignAccountToProject(Project project, long accountId, Role accountRole);
Account getProjectOwner(long projectId);
@@ -80,10 +73,7 @@ public interface ProjectService {
boolean deleteAccountFromProject(long projectId, String accountName);
- Pair, Integer> listProjectAccounts(long projectId, String accountName, String role, Long startIndex, Long pageSizeVal);
- Pair, Integer> listProjectInvitations(Long id, Long projectId, String accountName, Long domainId, String state, boolean activeOnly, Long startIndex, Long pageSizeVal, boolean isRecursive,
- boolean listAll);
boolean updateInvitation(long projectId, String accountName, String token, boolean accept);
@@ -94,6 +84,6 @@ public interface ProjectService {
Project enableProject(long projectId);
boolean deleteProjectInvitation(long invitationId);
-
+
Project findByProjectAccountIdIncludingRemoved(long projectAccountId);
}
diff --git a/api/src/com/cloud/resource/ResourceService.java b/api/src/com/cloud/resource/ResourceService.java
index 4cdb31a72ab..b9db8e734d9 100755
--- a/api/src/com/cloud/resource/ResourceService.java
+++ b/api/src/com/cloud/resource/ResourceService.java
@@ -18,19 +18,14 @@ package com.cloud.resource;
import java.util.List;
-import com.cloud.api.commands.AddClusterCmd;
-import com.cloud.api.commands.AddHostCmd;
-import com.cloud.api.commands.AddS3Cmd;
-import com.cloud.api.commands.AddSecondaryStorageCmd;
-import com.cloud.api.commands.AddSwiftCmd;
-import com.cloud.api.commands.CancelMaintenanceCmd;
-import com.cloud.api.commands.DeleteClusterCmd;
-import com.cloud.api.commands.ListS3sCmd;
-import com.cloud.api.commands.ListSwiftsCmd;
-import com.cloud.api.commands.PrepareForMaintenanceCmd;
-import com.cloud.api.commands.ReconnectHostCmd;
-import com.cloud.api.commands.UpdateHostCmd;
-import com.cloud.api.commands.UpdateHostPasswordCmd;
+import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
+import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
+import org.apache.cloudstack.api.command.admin.host.*;
+import org.apache.cloudstack.api.command.admin.storage.AddS3Cmd;
+import org.apache.cloudstack.api.command.admin.storage.ListS3sCmd;
+import org.apache.cloudstack.api.command.admin.swift.AddSwiftCmd;
+import org.apache.cloudstack.api.command.admin.swift.ListSwiftsCmd;
+import org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceInUseException;
@@ -40,15 +35,16 @@ import com.cloud.org.Cluster;
import com.cloud.storage.S3;
import com.cloud.storage.Swift;
import com.cloud.utils.fsm.NoTransitionException;
+import org.apache.cloudstack.api.command.admin.host.ReconnectHostCmd;
public interface ResourceService {
/**
* Updates a host
- *
+ *
* @param cmd
* - the command specifying hostId
* @return hostObject
- * @throws NoTransitionException
+ * @throws NoTransitionException
*/
Host updateHost(UpdateHostCmd cmd) throws NoTransitionException;
@@ -59,7 +55,7 @@ public interface ResourceService {
/**
* We will automatically create a cloud.com cluster to attach to the external cluster and return a hyper host to perform
* host related operation within the cluster
- *
+ *
* @param cmd
* @return
* @throws IllegalArgumentException
@@ -79,12 +75,12 @@ public interface ResourceService {
/**
* Deletes a host
- *
+ *
* @param hostId
* TODO
* @param isForced
* TODO
- *
+ *
* @param true if deleted, false otherwise
*/
boolean deleteHost(long hostId, boolean isForced, boolean isForceDeleteStorage);
diff --git a/api/src/com/cloud/serializer/Param.java b/api/src/com/cloud/serializer/Param.java
index 005188216c6..02deb6f1c1f 100644
--- a/api/src/com/cloud/serializer/Param.java
+++ b/api/src/com/cloud/serializer/Param.java
@@ -31,6 +31,6 @@ public @interface Param {
Class> responseObject() default Object.class;
boolean includeInApiDoc() default true;
-
+
String since() default "";
}
diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java
index 7532cae2a64..fb8af1a5b4b 100755
--- a/api/src/com/cloud/server/ManagementService.java
+++ b/api/src/com/cloud/server/ManagementService.java
@@ -23,53 +23,47 @@ import java.util.Map;
import java.util.Set;
import com.cloud.alert.Alert;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.commands.CreateSSHKeyPairCmd;
-import com.cloud.api.commands.DeleteSSHKeyPairCmd;
-import com.cloud.api.commands.DestroySystemVmCmd;
-import com.cloud.api.commands.ExtractVolumeCmd;
-import com.cloud.api.commands.GetVMPasswordCmd;
-import com.cloud.api.commands.ListAlertsCmd;
-import com.cloud.api.commands.ListAsyncJobsCmd;
-import com.cloud.api.commands.ListCapabilitiesCmd;
-import com.cloud.api.commands.ListCapacityCmd;
-import com.cloud.api.commands.ListCfgsByCmd;
-import com.cloud.api.commands.ListClustersCmd;
-import com.cloud.api.commands.ListDiskOfferingsCmd;
-import com.cloud.api.commands.ListEventsCmd;
-import com.cloud.api.commands.ListGuestOsCategoriesCmd;
-import com.cloud.api.commands.ListGuestOsCmd;
-import com.cloud.api.commands.ListHostsCmd;
-import com.cloud.api.commands.ListIsosCmd;
-import com.cloud.api.commands.ListPodsByCmd;
-import com.cloud.api.commands.ListPublicIpAddressesCmd;
-import com.cloud.api.commands.ListRoutersCmd;
-import com.cloud.api.commands.ListSSHKeyPairsCmd;
-import com.cloud.api.commands.ListServiceOfferingsCmd;
-import com.cloud.api.commands.ListStoragePoolsCmd;
-import com.cloud.api.commands.ListSystemVMsCmd;
-import com.cloud.api.commands.ListTemplatesCmd;
-import com.cloud.api.commands.ListVMGroupsCmd;
-import com.cloud.api.commands.ListVlanIpRangesCmd;
-import com.cloud.api.commands.ListZonesByCmd;
-import com.cloud.api.commands.RebootSystemVmCmd;
-import com.cloud.api.commands.RegisterSSHKeyPairCmd;
-import com.cloud.api.commands.StopSystemVmCmd;
-import com.cloud.api.commands.UpdateDomainCmd;
-import com.cloud.api.commands.UpdateHostPasswordCmd;
-import com.cloud.api.commands.UpdateIsoCmd;
-import com.cloud.api.commands.UpdateTemplateCmd;
-import com.cloud.api.commands.UpdateVMGroupCmd;
-import com.cloud.api.commands.UpgradeSystemVMCmd;
-import com.cloud.api.commands.UploadCustomCertificateCmd;
-import com.cloud.async.AsyncJob;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.command.admin.cluster.ListClustersCmd;
+import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;
+import org.apache.cloudstack.api.command.admin.pod.ListPodsByCmd;
+import org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd;
+import org.apache.cloudstack.api.command.admin.resource.ListCapacityCmd;
+import org.apache.cloudstack.api.command.admin.domain.UpdateDomainCmd;
+import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd;
+import org.apache.cloudstack.api.command.admin.systemvm.*;
+import org.apache.cloudstack.api.command.admin.vlan.ListVlanIpRangesCmd;
+import org.apache.cloudstack.api.command.user.address.ListPublicIpAddressesCmd;
+import org.apache.cloudstack.api.command.user.config.ListCapabilitiesCmd;
+import org.apache.cloudstack.api.command.user.guest.ListGuestOsCmd;
+import org.apache.cloudstack.api.command.user.offering.ListDiskOfferingsCmd;
+import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;
+import org.apache.cloudstack.api.command.user.ssh.DeleteSSHKeyPairCmd;
+import org.apache.cloudstack.api.command.user.ssh.CreateSSHKeyPairCmd;
+import org.apache.cloudstack.api.command.user.template.ListTemplatesCmd;
+import org.apache.cloudstack.api.command.user.vm.GetVMPasswordCmd;
+import org.apache.cloudstack.api.command.user.volume.ExtractVolumeCmd;
+import org.apache.cloudstack.api.command.user.template.UpdateTemplateCmd;
+import org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd;
+import org.apache.cloudstack.api.command.user.guest.ListGuestOsCategoriesCmd;
+import org.apache.cloudstack.api.command.user.iso.ListIsosCmd;
+import org.apache.cloudstack.api.command.user.ssh.ListSSHKeyPairsCmd;
+import org.apache.cloudstack.api.command.admin.systemvm.ListSystemVMsCmd;
+import org.apache.cloudstack.api.command.user.zone.ListZonesByCmd;
+import org.apache.cloudstack.api.command.admin.systemvm.RebootSystemVmCmd;
+import org.apache.cloudstack.api.command.user.ssh.RegisterSSHKeyPairCmd;
+import org.apache.cloudstack.api.command.admin.systemvm.StopSystemVmCmd;
+import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
+import org.apache.cloudstack.api.command.user.vmgroup.UpdateVMGroupCmd;
+import org.apache.cloudstack.api.command.admin.systemvm.UpgradeSystemVMCmd;
+import org.apache.cloudstack.api.command.admin.resource.UploadCustomCertificateCmd;
+
import com.cloud.capacity.Capacity;
import com.cloud.configuration.Configuration;
import com.cloud.dc.DataCenter;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
import com.cloud.domain.Domain;
-import com.cloud.event.Event;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InternalErrorException;
import com.cloud.exception.PermissionDeniedException;
@@ -78,7 +72,6 @@ import com.cloud.host.Host;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.network.IpAddress;
-import com.cloud.network.router.VirtualRouter;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.ServiceOffering;
import com.cloud.org.Cluster;
@@ -94,7 +87,7 @@ import com.cloud.vm.VirtualMachine.Type;
/**
* Hopefully this is temporary.
- *
+ *
*/
public interface ManagementService {
static final String Name = "management-server";
@@ -104,21 +97,21 @@ public interface ManagementService {
* for the
* account that invokes the API. By specifying available=true all zones which the account can access. By specifying
* available=false the zones where the account has virtual machine instances will be returned.
- *
+ *
* @return a list of DataCenters
*/
List extends DataCenter> listDataCenters(ListZonesByCmd cmd);
/**
* returns the a map of the names/values in the configuraton table
- *
+ *
* @return map of configuration name/values
*/
Pair, Integer> searchForConfigurations(ListCfgsByCmd c);
/**
* Searches for Service Offerings by the specified search criteria Can search by: "name"
- *
+ *
* @param cmd
* @return List of ServiceOfferings
*/
@@ -126,12 +119,12 @@ public interface ManagementService {
/**
* Searches for Clusters by the specified search criteria
- *
+ *
* @param c
* @return
*/
Pair, Integer> searchForClusters(ListClustersCmd c);
-
+
/**
* Searches for Clusters by the specified zone Id.
* @param zoneId
@@ -141,24 +134,16 @@ public interface ManagementService {
/**
* Searches for Pods by the specified search criteria Can search by: pod name and/or zone name
- *
+ *
* @param cmd
* @return List of Pods
*/
Pair, Integer> searchForPods(ListPodsByCmd cmd);
- /**
- * Searches for servers by the specified search criteria Can search by: "name", "type", "state", "dataCenterId",
- * "podId"
- *
- * @param cmd
- * @return List of Hosts
- */
- List extends Host> searchForServers(ListHostsCmd cmd);
/**
* Creates a new template
- *
+ *
* @param cmd
* @return updated template
*/
@@ -166,30 +151,12 @@ public interface ManagementService {
VirtualMachineTemplate updateTemplate(UpdateTemplateCmd cmd);
- /**
- * Obtains a list of events by the specified search criteria. Can search by: "username", "type", "level",
- * "startDate",
- * "endDate"
- *
- * @param c
- * @return List of Events.
- */
- List extends Event> searchForEvents(ListEventsCmd c);
- /**
- * Obtains a list of routers by the specified search criteria. Can search by: "userId", "name", "state",
- * "dataCenterId",
- * "podId", "hostId"
- *
- * @param cmd
- * @return List of DomainRouters.
- */
- Pair, Integer> searchForRouters(ListRoutersCmd cmd);
/**
* Obtains a list of IP Addresses by the specified search criteria. Can search by: "userId", "dataCenterId",
* "address"
- *
+ *
* @param cmd
* the command that wraps the search criteria
* @return List of IPAddresses
@@ -198,14 +165,14 @@ public interface ManagementService {
/**
* Obtains a list of all guest OS.
- *
+ *
* @return list of GuestOS
*/
Pair, Integer> listGuestOSByCriteria(ListGuestOsCmd cmd);
/**
* Obtains a list of all guest OS categories.
- *
+ *
* @return list of GuestOSCategories
*/
Pair, Integer> listGuestOSCategoriesByCriteria(ListGuestOsCategoriesCmd cmd);
@@ -217,12 +184,12 @@ public interface ManagementService {
VirtualMachine rebootSystemVM(RebootSystemVmCmd cmd);
VirtualMachine destroySystemVM(DestroySystemVmCmd cmd);
-
+
VirtualMachine upgradeSystemVM(UpgradeSystemVMCmd cmd);
/**
* update an existing domain
- *
+ *
* @param cmd
* - the command containing domainId and new domainName
* @return Domain object if the command succeeded
@@ -231,7 +198,7 @@ public interface ManagementService {
/**
* Searches for alerts
- *
+ *
* @param c
* @return List of Alerts
*/
@@ -239,7 +206,7 @@ public interface ManagementService {
/**
* list all the capacity rows in capacity operations table
- *
+ *
* @param cmd
* @return List of capacities
*/
@@ -247,7 +214,7 @@ public interface ManagementService {
/**
* List ISOs that match the specified criteria.
- *
+ *
* @param cmd
* The command that wraps the (optional) templateId, name, keyword, templateFilter, bootable, account,
* and zoneId
@@ -258,7 +225,7 @@ public interface ManagementService {
/**
* List templates that match the specified criteria.
- *
+ *
* @param cmd
* The command that wraps the (optional) templateId, name, keyword, templateFilter, bootable, account,
* and zoneId
@@ -269,25 +236,17 @@ public interface ManagementService {
/**
* Search for disk offerings based on search criteria
- *
+ *
* @param cmd
* the command containing the criteria to use for searching for disk offerings
* @return a list of disk offerings that match the given criteria
*/
List extends DiskOffering> searchForDiskOfferings(ListDiskOfferingsCmd cmd);
- /**
- * List storage pools that match the given criteria
- *
- * @param cmd
- * the command that wraps the search criteria (zone, pod, name, IP address, path, and cluster id)
- * @return a list of storage pools that match the given criteria
- */
- Pair, Integer> searchForStoragePools(ListStoragePoolsCmd cmd);
/**
* List system VMs by the given search criteria
- *
+ *
* @param cmd
* the command that wraps the search criteria (host, name, state, type, zone, pod, and/or id)
* @return the list of system vms that match the given criteria
@@ -296,7 +255,7 @@ public interface ManagementService {
/**
* Returns back a SHA1 signed response
- *
+ *
* @param userId
* -- id for the user
* @return -- ArrayList of
@@ -307,13 +266,12 @@ public interface ManagementService {
InstanceGroup updateVmGroup(UpdateVMGroupCmd cmd);
- Pair, Integer> searchForVmGroups(ListVMGroupsCmd cmd);
Map listCapabilities(ListCapabilitiesCmd cmd);
/**
* Extracts the volume to a particular location.
- *
+ *
* @param cmd
* the command specifying url (where the volume needs to be extracted to), zoneId (zone where the volume
* exists),
@@ -321,23 +279,23 @@ public interface ManagementService {
* @throws URISyntaxException
* @throws InternalErrorException
* @throws PermissionDeniedException
- *
+ *
*/
Long extractVolume(ExtractVolumeCmd cmd) throws URISyntaxException;
/**
* return an array of available hypervisors
- *
+ *
* @param zoneId
* TODO
- *
+ *
* @return an array of available hypervisors in the cloud
*/
List getHypervisors(Long zoneId);
/**
* This method uploads a custom cert to the db, and patches every cpvm with it on the current ms
- *
+ *
* @param cmd
* -- upload certificate cmd
* @return -- returns a string on success
@@ -350,24 +308,15 @@ public interface ManagementService {
/**
* Searches for vlan by the specified search criteria Can search by: "id", "vlan", "name", "zoneID"
- *
+ *
* @param cmd
* @return List of Vlans
*/
Pair, Integer> searchForVlans(ListVlanIpRangesCmd cmd);
- /**
- * Search for async jobs by account and/or startDate
- *
- * @param cmd
- * the command specifying the account and start date parameters
- * @return the list of async jobs that match the criteria
- */
- Pair, Integer> searchForAsyncJobs(ListAsyncJobsCmd cmd);
-
/**
* Generates a random password that will be used (initially) by newly created and started virtual machines
- *
+ *
* @return a random password
*/
String generateRandomPassword();
@@ -378,7 +327,7 @@ public interface ManagementService {
/**
* Search registered key pairs for the logged in user.
- *
+ *
* @param cmd
* The api command class.
* @return The list of key pairs found.
@@ -387,7 +336,7 @@ public interface ManagementService {
/**
* Registers a key pair for a given public key.
- *
+ *
* @param cmd
* The api command class.
* @return A VO with the key pair name and a finger print for the public key.
@@ -396,7 +345,7 @@ public interface ManagementService {
/**
* Creates a new
- *
+ *
* @param cmd
* The api command class.
* @return A VO containing the key pair name, finger print for the public key and the private key material of the
@@ -406,7 +355,7 @@ public interface ManagementService {
/**
* Deletes a key pair by name.
- *
+ *
* @param cmd
* The api command class.
* @return True on success. False otherwise.
@@ -415,7 +364,7 @@ public interface ManagementService {
/**
* Finds and returns an encrypted password for a VM.
- *
+ *
* @param cmd
* The api command class.
* @return The encrypted password.
@@ -428,7 +377,7 @@ public interface ManagementService {
* List hosts for migrating the given VM. The API returns list of all hosts in the VM's cluster minus the current
* host and
* also a list of hosts that seem to have enough CPU and RAM capacity to host this VM.
- *
+ *
* @param Long
* vmId
* Id of The VM to migrate
@@ -445,7 +394,7 @@ public interface ManagementService {
/**
* list all the top consumed resources across different capacity types
- *
+ *
* @param cmd
* @return List of capacities
*/
diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index 117e721b893..5ec9f0171cc 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -16,10 +16,12 @@
// under the License.
package com.cloud.server;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
-public interface ResourceTag extends ControlledEntity{
-
public enum TaggedResourceType {
UserVm,
Template,
@@ -38,11 +40,6 @@ public interface ResourceTag extends ControlledEntity{
StaticRoute
}
- /**
- * @return
- */
- long getId();
-
/**
* @return
*/
diff --git a/api/src/com/cloud/server/TaggedResourceService.java b/api/src/com/cloud/server/TaggedResourceService.java
index dce799e5ca2..92a4300db0a 100644
--- a/api/src/com/cloud/server/TaggedResourceService.java
+++ b/api/src/com/cloud/server/TaggedResourceService.java
@@ -19,12 +19,10 @@ package com.cloud.server;
import java.util.List;
import java.util.Map;
-import com.cloud.api.commands.ListTagsCmd;
import com.cloud.server.ResourceTag.TaggedResourceType;
-import com.cloud.utils.Pair;
public interface TaggedResourceService {
-
+
TaggedResourceType getResourceType (String resourceTypeStr);
/**
@@ -43,11 +41,6 @@ public interface TaggedResourceService {
*/
String getUuid(String resourceId, TaggedResourceType resourceType);
- /**
- * @param listTagsCmd
- * @return
- */
- Pair, Integer> listTags(ListTagsCmd listTagsCmd);
/**
* @param resourceIds
@@ -56,6 +49,6 @@ public interface TaggedResourceService {
* @return
*/
boolean deleteTags(List resourceIds, TaggedResourceType resourceType, Map tags);
-
+
List extends ResourceTag> listByResourceTypeAndId(TaggedResourceType type, long resourceId);
}
diff --git a/api/src/com/cloud/storage/GuestOS.java b/api/src/com/cloud/storage/GuestOS.java
index b9727db6612..437cd37d1ab 100644
--- a/api/src/com/cloud/storage/GuestOS.java
+++ b/api/src/com/cloud/storage/GuestOS.java
@@ -16,9 +16,10 @@
// under the License.
package com.cloud.storage;
-public interface GuestOS {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
- long getId();
+public interface GuestOS extends InternalIdentity, Identity {
String getName();
diff --git a/api/src/com/cloud/storage/GuestOsCategory.java b/api/src/com/cloud/storage/GuestOsCategory.java
index 42320d9eec8..c28d7d6bf77 100644
--- a/api/src/com/cloud/storage/GuestOsCategory.java
+++ b/api/src/com/cloud/storage/GuestOsCategory.java
@@ -16,10 +16,12 @@
// under the License.
package com.cloud.storage;
-public interface GuestOsCategory {
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface GuestOsCategory extends Identity, InternalIdentity {
// Used by OS preference, 'None' for no OS preference
public static final String CATEGORY_NONE ="None";
- long getId();
String getName();
diff --git a/api/src/com/cloud/storage/S3.java b/api/src/com/cloud/storage/S3.java
index 7a679f2adc5..708e280ca5b 100644
--- a/api/src/com/cloud/storage/S3.java
+++ b/api/src/com/cloud/storage/S3.java
@@ -19,14 +19,12 @@
package com.cloud.storage;
import com.cloud.agent.api.to.S3TO;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
import java.util.Date;
-public interface S3 {
-
- long getId();
-
- String getUuid();
+public interface S3 extends InternalIdentity, Identity {
String getAccessKey();
diff --git a/api/src/com/cloud/storage/Snapshot.java b/api/src/com/cloud/storage/Snapshot.java
index a37cc94241f..99bdee6bea9 100644
--- a/api/src/com/cloud/storage/Snapshot.java
+++ b/api/src/com/cloud/storage/Snapshot.java
@@ -18,10 +18,12 @@ package com.cloud.storage;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Snapshot extends ControlledEntity {
+public interface Snapshot extends ControlledEntity, Identity, InternalIdentity {
public enum Type {
MANUAL,
RECURRING,
@@ -67,8 +69,6 @@ public interface Snapshot extends ControlledEntity {
public static final long MANUAL_POLICY_ID = 0L;
- Long getId();
-
long getAccountId();
long getVolumeId();
diff --git a/api/src/com/cloud/storage/StoragePool.java b/api/src/com/cloud/storage/StoragePool.java
index 497523d7e38..3334da54ec0 100644
--- a/api/src/com/cloud/storage/StoragePool.java
+++ b/api/src/com/cloud/storage/StoragePool.java
@@ -19,25 +19,16 @@ package com.cloud.storage;
import java.util.Date;
import com.cloud.storage.Storage.StoragePoolType;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface StoragePool {
-
- /**
- * @return id of the pool.
- */
- long getId();
+public interface StoragePool extends Identity, InternalIdentity {
/**
* @return name of the pool.
*/
String getName();
- /***
- *
- * @return unique identifier
- */
- String getUuid();
-
/**
* @return the type of pool.
*/
diff --git a/api/src/com/cloud/storage/StorageService.java b/api/src/com/cloud/storage/StorageService.java
index 587c138465a..a06f2138042 100644
--- a/api/src/com/cloud/storage/StorageService.java
+++ b/api/src/com/cloud/storage/StorageService.java
@@ -17,15 +17,13 @@
package com.cloud.storage;
import java.net.UnknownHostException;
-import java.util.List;
-import com.cloud.api.commands.CancelPrimaryStorageMaintenanceCmd;
-import com.cloud.api.commands.CreateStoragePoolCmd;
-import com.cloud.api.commands.CreateVolumeCmd;
-import com.cloud.api.commands.DeletePoolCmd;
-import com.cloud.api.commands.ListVolumesCmd;
-import com.cloud.api.commands.UpdateStoragePoolCmd;
-import com.cloud.api.commands.UploadVolumeCmd;
+import org.apache.cloudstack.api.command.admin.storage.*;
+import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaintenanceCmd;
+import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
+import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
+import org.apache.cloudstack.api.command.user.volume.UploadVolumeCmd;
+import org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.PermissionDeniedException;
@@ -33,12 +31,11 @@ import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
-import com.cloud.utils.Pair;
public interface StorageService{
/**
* Create StoragePool based on uri
- *
+ *
* @param cmd
* the command object that specifies the zone, cluster/pod, URI, details, etc. to use to create the
* storage pool.
@@ -49,12 +46,12 @@ public interface StorageService{
* @throws ResourceUnavailableException
* TODO
*/
- StoragePool createPool(CreateStoragePoolCmd cmd) throws ResourceInUseException, IllegalArgumentException,
+ StoragePool createPool(CreateStoragePoolCmd cmd) throws ResourceInUseException, IllegalArgumentException,
UnknownHostException, ResourceUnavailableException;
/**
* Creates the database object for a volume based on the given criteria
- *
+ *
* @param cmd
* the API command wrapping the criteria (account/domainId [admin only], zone, diskOffering, snapshot,
* name)
@@ -65,7 +62,7 @@ public interface StorageService{
/**
* Creates the volume based on the given criteria
- *
+ *
* @param cmd
* the API command wrapping the criteria (account/domainId [admin only], zone, diskOffering, snapshot,
* name)
@@ -75,9 +72,18 @@ public interface StorageService{
/**
- * Delete the storage pool
+ * Resizes the volume based on the given criteria
*
* @param cmd
+ * the API command wrapping the criteria
+ * @return the volume object
+ */
+ Volume resizeVolume(ResizeVolumeCmd cmd);
+
+ /**
+ * Delete the storage pool
+ *
+ * @param cmd
* - the command specifying poolId
* @return success or failure
*/
@@ -85,7 +91,7 @@ public interface StorageService{
/**
* Enable maintenance for primary storage
- *
+ *
* @param cmd
* - the command specifying primaryStorageId
* @return the primary storage pool
@@ -94,19 +100,19 @@ public interface StorageService{
* @throws InsufficientCapacityException
* TODO
*/
- public StoragePool preparePrimaryStorageForMaintenance(Long primaryStorageId) throws ResourceUnavailableException,
+ public StoragePool preparePrimaryStorageForMaintenance(Long primaryStorageId) throws ResourceUnavailableException,
InsufficientCapacityException;
/**
* Complete maintenance for primary storage
- *
+ *
* @param cmd
* - the command specifying primaryStorageId
* @return the primary storage pool
* @throws ResourceUnavailableException
* TODO
*/
- public StoragePool cancelPrimaryStorageForMaintenance(CancelPrimaryStorageMaintenanceCmd cmd)
+ public StoragePool cancelPrimaryStorageForMaintenance(CancelPrimaryStorageMaintenanceCmd cmd)
throws ResourceUnavailableException;
public StoragePool updateStoragePool(UpdateStoragePoolCmd cmd) throws IllegalArgumentException;
@@ -115,13 +121,12 @@ public interface StorageService{
Volume migrateVolume(Long volumeId, Long storagePoolId) throws ConcurrentOperationException;
- Pair, Integer> searchForVolumes(ListVolumesCmd cmd);
/**
* Uploads the volume to secondary storage
- *
- * @param UploadVolumeCmd cmd
- *
+ *
+ * @param UploadVolumeCmd cmd
+ *
* @return Volume object
*/
Volume uploadVolume(UploadVolumeCmd cmd) throws ResourceAllocationException;
diff --git a/api/src/com/cloud/storage/StorageStats.java b/api/src/com/cloud/storage/StorageStats.java
index fe21c44b702..c30e1de10f6 100755
--- a/api/src/com/cloud/storage/StorageStats.java
+++ b/api/src/com/cloud/storage/StorageStats.java
@@ -22,7 +22,7 @@ public interface StorageStats {
*/
public long getByteUsed();
/**
- * @return bytes capacity of the storage server
+ * @return bytes capacity of the storage server
*/
public long getCapacityBytes();
}
diff --git a/api/src/com/cloud/storage/Swift.java b/api/src/com/cloud/storage/Swift.java
index 54a670cefe1..9cd3a34cd59 100644
--- a/api/src/com/cloud/storage/Swift.java
+++ b/api/src/com/cloud/storage/Swift.java
@@ -17,10 +17,13 @@
package com.cloud.storage;
import com.cloud.agent.api.to.SwiftTO;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Swift {
+public interface Swift extends InternalIdentity {
public long getId();
+ public String getUuid();
+
public String getUrl();
public String getAccount();
diff --git a/api/src/com/cloud/storage/Upload.java b/api/src/com/cloud/storage/Upload.java
index d73a9d8604c..a20faf1dc34 100755
--- a/api/src/com/cloud/storage/Upload.java
+++ b/api/src/com/cloud/storage/Upload.java
@@ -16,9 +16,12 @@
// under the License.
package com.cloud.storage;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
-public interface Upload {
+public interface Upload extends InternalIdentity, Identity {
public static enum Status {
UNKNOWN, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS, NOT_COPIED, COPY_IN_PROGRESS, COPY_ERROR, COPY_COMPLETE, DOWNLOAD_URL_CREATED, DOWNLOAD_URL_NOT_CREATED, ERROR
@@ -34,8 +37,6 @@ public interface Upload {
long getHostId();
- long getId();
-
Date getCreated();
Date getLastUpdated();
diff --git a/api/src/com/cloud/storage/VMTemplateStorageResourceAssoc.java b/api/src/com/cloud/storage/VMTemplateStorageResourceAssoc.java
index 49fbc6da427..97baa4b29c4 100644
--- a/api/src/com/cloud/storage/VMTemplateStorageResourceAssoc.java
+++ b/api/src/com/cloud/storage/VMTemplateStorageResourceAssoc.java
@@ -16,9 +16,12 @@
// under the License.
package com.cloud.storage;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
-public interface VMTemplateStorageResourceAssoc {
+public interface VMTemplateStorageResourceAssoc extends InternalIdentity {
public static enum Status {
UNKNOWN, DOWNLOAD_ERROR, NOT_DOWNLOADED, DOWNLOAD_IN_PROGRESS, DOWNLOADED, ABANDONED, UPLOADED, NOT_UPLOADED, UPLOAD_ERROR, UPLOAD_IN_PROGRESS
}
@@ -35,8 +38,6 @@ public interface VMTemplateStorageResourceAssoc {
void setDownloadState(Status downloadState);
- long getId();
-
Date getCreated();
Date getLastUpdated();
diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java
index 6e8e48e48d8..38ba2d413e0 100755
--- a/api/src/com/cloud/storage/Volume.java
+++ b/api/src/com/cloud/storage/Volume.java
@@ -18,12 +18,14 @@ package com.cloud.storage;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.template.BasedOn;
import com.cloud.utils.fsm.StateMachine2;
import com.cloud.utils.fsm.StateObject;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Volume extends ControlledEntity, BasedOn, StateObject {
+public interface Volume extends ControlledEntity, Identity, InternalIdentity, BasedOn, StateObject {
enum Type {
UNKNOWN, ROOT, SWAP, DATADISK, ISO
};
@@ -34,9 +36,10 @@ public interface Volume extends ControlledEntity, BasedOn, StateObject listTemplatePermissions(ListTemplateOrIsoPermissionsCmd cmd);
+ List listTemplatePermissions(BaseListTemplateOrIsoPermissionsCmd cmd);
- boolean updateTemplateOrIsoPermissions(UpdateTemplateOrIsoPermissionsCmd cmd);
+ boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissionsCmd cmd);
}
diff --git a/api/src/com/cloud/template/VirtualMachineTemplate.java b/api/src/com/cloud/template/VirtualMachineTemplate.java
index 27f5871b750..274b7b63843 100755
--- a/api/src/com/cloud/template/VirtualMachineTemplate.java
+++ b/api/src/com/cloud/template/VirtualMachineTemplate.java
@@ -19,12 +19,14 @@ package com.cloud.template;
import java.util.Date;
import java.util.Map;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.Storage.TemplateType;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface VirtualMachineTemplate extends ControlledEntity {
+public interface VirtualMachineTemplate extends ControlledEntity, Identity, InternalIdentity {
public static enum BootloaderType {
PyGrub, HVM, External, CD
@@ -40,11 +42,6 @@ public interface VirtualMachineTemplate extends ControlledEntity {
all // all templates (only usable by admins)
}
- /**
- * @return id.
- */
- long getId();
-
boolean isFeatured();
/**
diff --git a/api/src/com/cloud/user/Account.java b/api/src/com/cloud/user/Account.java
index 18f585be75b..a5b3e87156d 100755
--- a/api/src/com/cloud/user/Account.java
+++ b/api/src/com/cloud/user/Account.java
@@ -18,9 +18,11 @@ package com.cloud.user;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface Account extends ControlledEntity {
+public interface Account extends ControlledEntity, InternalIdentity, Identity {
public enum Type {
Normal,
Admin,
@@ -35,6 +37,7 @@ public interface Account extends ControlledEntity {
locked
}
+
public static final short ACCOUNT_TYPE_NORMAL = 0;
public static final short ACCOUNT_TYPE_ADMIN = 1;
public static final short ACCOUNT_TYPE_DOMAIN_ADMIN = 2;
@@ -48,8 +51,6 @@ public interface Account extends ControlledEntity {
public static final long ACCOUNT_ID_SYSTEM = 1;
- public long getId();
-
public String getAccountName();
public short getType();
@@ -59,6 +60,7 @@ public interface Account extends ControlledEntity {
public Date getRemoved();
public String getNetworkDomain();
-
+
public Long getDefaultZoneId();
+
}
diff --git a/api/src/com/cloud/user/AccountService.java b/api/src/com/cloud/user/AccountService.java
index 90e35519578..9f5f4d225e0 100755
--- a/api/src/com/cloud/user/AccountService.java
+++ b/api/src/com/cloud/user/AccountService.java
@@ -19,14 +19,15 @@ package com.cloud.user;
import java.util.List;
import java.util.Map;
-import com.cloud.acl.ControlledEntity;
-import com.cloud.acl.SecurityChecker.AccessType;
-import com.cloud.api.commands.DeleteUserCmd;
-import com.cloud.api.commands.ListAccountsCmd;
-import com.cloud.api.commands.ListUsersCmd;
-import com.cloud.api.commands.RegisterCmd;
-import com.cloud.api.commands.UpdateAccountCmd;
-import com.cloud.api.commands.UpdateUserCmd;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.acl.SecurityChecker.AccessType;
+
+import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd;
+import org.apache.cloudstack.api.command.admin.user.RegisterCmd;
+import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd;
+import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd;
+
import com.cloud.domain.Domain;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.PermissionDeniedException;
@@ -37,7 +38,7 @@ public interface AccountService {
/**
* Creates a new user and account, stores the password as is so encrypted passwords are recommended.
- *
+ *
* @param userName
* TODO
* @param password
@@ -58,7 +59,7 @@ public interface AccountService {
* TODO
* @param networkDomain
* TODO
- *
+ *
* @return the user if created successfully, null otherwise
*/
UserAccount createUserAccount(String userName, String password, String firstName, String lastName, String email, String timezone, String accountName, short accountType, Long domainId, String networkDomain,
@@ -66,17 +67,17 @@ public interface AccountService {
/**
* Deletes a user by userId
- *
+ *
* @param accountId
* - id of the account do delete
- *
+ *
* @return true if delete was successful, false otherwise
*/
boolean deleteUserAccount(long accountId);
/**
* Disables a user by userId
- *
+ *
* @param userId
* - the userId
* @return UserAccount object
@@ -85,7 +86,7 @@ public interface AccountService {
/**
* Enables a user
- *
+ *
* @param userId
* - the userId
* @return UserAccount object
@@ -95,7 +96,7 @@ public interface AccountService {
/**
* Locks a user by userId. A locked user cannot access the API, but will still have running VMs/IP addresses
* allocated/etc.
- *
+ *
* @param userId
* @return UserAccount object
*/
@@ -103,7 +104,7 @@ public interface AccountService {
/**
* Update a user by userId
- *
+ *
* @param userId
* @return UserAccount object
*/
@@ -111,7 +112,7 @@ public interface AccountService {
/**
* Disables an account by accountName and domainId
- *
+ *
* @param accountName
* TODO
* @param domainId
@@ -125,7 +126,7 @@ public interface AccountService {
/**
* Enables an account by accountId
- *
+ *
* @param accountName
* - the enableAccount command defining the accountId to be deleted.
* @param domainId
@@ -139,7 +140,7 @@ public interface AccountService {
* Locks an account by accountId. A locked account cannot access the API, but will still have running VMs/IP
* addresses
* allocated/etc.
- *
+ *
* @param accountName
* - the LockAccount command defining the accountId to be locked.
* @param domainId
@@ -151,7 +152,7 @@ public interface AccountService {
/**
* Updates an account name
- *
+ *
* @param cmd
* - the parameter containing accountId
* @return updated account object
@@ -191,13 +192,10 @@ public interface AccountService {
public String[] createApiKeyAndSecretKey(RegisterCmd cmd);
- Pair, Integer> searchForAccounts(ListAccountsCmd cmd);
-
- Pair, Integer> searchForUsers(ListUsersCmd cmd)
- throws PermissionDeniedException;
-
UserAccount getUserByApiKey(String apiKey);
-
+
+ RoleType getRoleType(Account account);
+
void checkAccess(Account account, Domain domain) throws PermissionDeniedException;
void checkAccess(Account account, AccessType accessType, boolean sameOwner, ControlledEntity... entities) throws PermissionDeniedException;
diff --git a/api/src/com/cloud/user/DomainService.java b/api/src/com/cloud/user/DomainService.java
index 83f362264b0..cd20060b710 100644
--- a/api/src/com/cloud/user/DomainService.java
+++ b/api/src/com/cloud/user/DomainService.java
@@ -18,8 +18,8 @@ package com.cloud.user;
import java.util.List;
-import com.cloud.api.commands.ListDomainChildrenCmd;
-import com.cloud.api.commands.ListDomainsCmd;
+import org.apache.cloudstack.api.command.admin.domain.ListDomainChildrenCmd;
+import org.apache.cloudstack.api.command.admin.domain.ListDomainsCmd;
import com.cloud.domain.Domain;
import com.cloud.exception.PermissionDeniedException;
import com.cloud.utils.Pair;
@@ -30,9 +30,11 @@ public interface DomainService {
Domain getDomain(long id);
+ Domain getDomain(String uuid);
+
/**
* Return whether a domain is a child domain of a given domain.
- *
+ *
* @param parentId
* @param childId
*/
diff --git a/api/src/com/cloud/user/ResourceLimitService.java b/api/src/com/cloud/user/ResourceLimitService.java
index 98dfc11319a..bec65d5b7e8 100644
--- a/api/src/com/cloud/user/ResourceLimitService.java
+++ b/api/src/com/cloud/user/ResourceLimitService.java
@@ -28,7 +28,7 @@ public interface ResourceLimitService {
/**
* Updates an existing resource limit with the specified details. If a limit doesn't exist, will create one.
- *
+ *
* @param accountId
* TODO
* @param domainId
@@ -37,14 +37,14 @@ public interface ResourceLimitService {
* TODO
* @param max
* TODO
- *
+ *
* @return the updated/created resource limit
*/
ResourceLimit updateResourceLimit(Long accountId, Long domainId, Integer resourceType, Long max);
/**
* Updates an existing resource count details for the account/domain
- *
+ *
* @param accountId
* TODO
* @param domainId
@@ -57,7 +57,7 @@ public interface ResourceLimitService {
/**
* Search for resource limits for the given id and/or account and/or type and/or domain.
- *
+ *
* @param id
* TODO
* @param accountId
@@ -73,17 +73,27 @@ public interface ResourceLimitService {
/**
* Finds the resource limit for a specified account and type. If the account has an infinite limit, will check
* the account's parent domain, and if that limit is also infinite, will return the ROOT domain's limit.
- *
+ *
* @param account
* @param type
* @return resource limit
*/
public long findCorrectResourceLimitForAccount(Account account, ResourceType type);
+ /**
+ * This call should be used when we have already queried resource limit for an account. This is to handle
+ * some corner cases where queried limit may be null.
+ * @param accountType
+ * @param limit
+ * @param type
+ * @return
+ */
+ public long findCorrectResourceLimitForAccount(short accountType, Long limit, ResourceType type);
+
/**
* Finds the resource limit for a specified domain and type. If the domain has an infinite limit, will check
* up the domain hierarchy
- *
+ *
* @param account
* @param type
* @return resource limit
@@ -92,7 +102,7 @@ public interface ResourceLimitService {
/**
* Increments the resource count
- *
+ *
* @param accountId
* @param type
* @param delta
@@ -101,7 +111,7 @@ public interface ResourceLimitService {
/**
* Decrements the resource count
- *
+ *
* @param accountId
* @param type
* @param delta
@@ -110,7 +120,7 @@ public interface ResourceLimitService {
/**
* Checks if a limit has been exceeded for an account
- *
+ *
* @param account
* @param type
* @param count
@@ -122,7 +132,7 @@ public interface ResourceLimitService {
/**
* Gets the count of resources for a resource type and account
- *
+ *
* @param account
* @param type
* @return count of resources
diff --git a/api/src/com/cloud/user/SSHKeyPair.java b/api/src/com/cloud/user/SSHKeyPair.java
index 494f74f5a7a..aa20c17eb07 100644
--- a/api/src/com/cloud/user/SSHKeyPair.java
+++ b/api/src/com/cloud/user/SSHKeyPair.java
@@ -16,14 +16,10 @@
// under the License.
package com.cloud.user;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface SSHKeyPair extends ControlledEntity {
-
- /**
- * @return The id of the key pair.
- */
- public long getId();
+public interface SSHKeyPair extends ControlledEntity, InternalIdentity {
/**
* @return The given name of the key pair.
diff --git a/api/src/com/cloud/user/User.java b/api/src/com/cloud/user/User.java
index c625c168d0d..36a7c6543b0 100644
--- a/api/src/com/cloud/user/User.java
+++ b/api/src/com/cloud/user/User.java
@@ -16,13 +16,17 @@
// under the License.
package com.cloud.user;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
-public interface User extends OwnedBy {
+public interface User extends OwnedBy, InternalIdentity {
public static final long UID_SYSTEM = 1;
public long getId();
+ public String getUuid();
+
public Date getCreated();
public Date getRemoved();
diff --git a/api/src/com/cloud/user/UserAccount.java b/api/src/com/cloud/user/UserAccount.java
index 2a6bd4f33e3..c09b5c0fac5 100644
--- a/api/src/com/cloud/user/UserAccount.java
+++ b/api/src/com/cloud/user/UserAccount.java
@@ -16,10 +16,12 @@
// under the License.
package com.cloud.user;
+import org.apache.cloudstack.api.InternalIdentity;
+
import java.util.Date;
-public interface UserAccount {
- Long getId();
+public interface UserAccount extends InternalIdentity {
+ long getId();
String getUsername();
diff --git a/api/src/com/cloud/user/UserContext.java b/api/src/com/cloud/user/UserContext.java
index b140728e596..539e11812af 100644
--- a/api/src/com/cloud/user/UserContext.java
+++ b/api/src/com/cloud/user/UserContext.java
@@ -50,6 +50,10 @@ public class UserContext {
return userId;
}
+ public User getCallerUser() {
+ return _accountMgr.getActiveUser(userId);
+ }
+
public void setCallerUserId(long userId) {
this.userId = userId;
}
diff --git a/api/src/com/cloud/uservm/UserVm.java b/api/src/com/cloud/uservm/UserVm.java
index 866d849748d..a587666bc8b 100755
--- a/api/src/com/cloud/uservm/UserVm.java
+++ b/api/src/com/cloud/uservm/UserVm.java
@@ -16,7 +16,7 @@
// under the License.
package com.cloud.uservm;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.vm.VirtualMachine;
/**
diff --git a/api/src/com/cloud/vm/InstanceGroup.java b/api/src/com/cloud/vm/InstanceGroup.java
index 98fac593d9b..6560b4afe81 100644
--- a/api/src/com/cloud/vm/InstanceGroup.java
+++ b/api/src/com/cloud/vm/InstanceGroup.java
@@ -18,10 +18,11 @@ package com.cloud.vm;
import java.util.Date;
-import com.cloud.acl.ControlledEntity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
-public interface InstanceGroup extends ControlledEntity {
- long getId();
+public interface InstanceGroup extends ControlledEntity, Identity, InternalIdentity {
String getName();
diff --git a/api/src/com/cloud/vm/Nic.java b/api/src/com/cloud/vm/Nic.java
index 3beff0a5ada..84c0034b430 100644
--- a/api/src/com/cloud/vm/Nic.java
+++ b/api/src/com/cloud/vm/Nic.java
@@ -25,17 +25,19 @@ import com.cloud.network.Networks.AddressFormat;
import com.cloud.network.Networks.Mode;
import com.cloud.utils.fsm.FiniteState;
import com.cloud.utils.fsm.StateMachine;
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* Nic represents one nic on the VM.
*/
-public interface Nic {
+public interface Nic extends Identity, InternalIdentity {
enum Event {
ReservationRequested, ReleaseRequested, CancelRequested, OperationCompleted, OperationFailed,
}
public enum State implements FiniteState {
- Allocated("Resource is allocated but not reserved"), Reserving("Resource is being reserved right now"),
+ Allocated("Resource is allocated but not reserved"), Reserving("Resource is being reserved right now"),
Reserved("Resource has been reserved."), Releasing("Resource is being released"), Deallocating(
"Resource is being deallocated");
@@ -86,11 +88,6 @@ public interface Nic {
PlaceHolder, Create, Start, Managed;
}
- /**
- * @return id in the CloudStack database
- */
- long getId();
-
/**
* @return reservation id returned by the allocation source. This can be the String version of the database id if
* the
diff --git a/api/src/com/cloud/vm/NicProfile.java b/api/src/com/cloud/vm/NicProfile.java
index c5ffbeaa502..32e3f212e99 100644
--- a/api/src/com/cloud/vm/NicProfile.java
+++ b/api/src/com/cloud/vm/NicProfile.java
@@ -24,8 +24,9 @@ import com.cloud.network.Networks.BroadcastDomainType;
import com.cloud.network.Networks.Mode;
import com.cloud.network.Networks.TrafficType;
import com.cloud.vm.Nic.ReservationStrategy;
+import org.apache.cloudstack.api.InternalIdentity;
-public class NicProfile {
+public class NicProfile implements InternalIdentity {
long id;
long networkId;
BroadcastDomainType broadcastType;
@@ -207,7 +208,7 @@ public class NicProfile {
return strategy;
}
- public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate,
+ public NicProfile(Nic nic, Network network, URI broadcastUri, URI isolationUri, Integer networkRate,
boolean isSecurityGroupEnabled, String name) {
this.id = nic.getId();
this.networkId = network.getId();
diff --git a/api/src/com/cloud/vm/RunningOn.java b/api/src/com/cloud/vm/RunningOn.java
index a04e28edc3d..cb642939f3d 100644
--- a/api/src/com/cloud/vm/RunningOn.java
+++ b/api/src/com/cloud/vm/RunningOn.java
@@ -17,7 +17,7 @@
package com.cloud.vm;
/**
- *
+ *
*/
public interface RunningOn {
diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java
index 98d02dbebdd..b1ebe10596d 100755
--- a/api/src/com/cloud/vm/UserVmService.java
+++ b/api/src/com/cloud/vm/UserVmService.java
@@ -21,22 +21,21 @@ import java.util.Map;
import javax.naming.InsufficientResourcesException;
-import com.cloud.api.commands.AssignVMCmd;
-import com.cloud.api.commands.AttachVolumeCmd;
-import com.cloud.api.commands.CreateTemplateCmd;
-import com.cloud.api.commands.CreateVMGroupCmd;
-import com.cloud.api.commands.DeleteVMGroupCmd;
-import com.cloud.api.commands.DeployVMCmd;
-import com.cloud.api.commands.DestroyVMCmd;
-import com.cloud.api.commands.DetachVolumeCmd;
-import com.cloud.api.commands.ListVMsCmd;
-import com.cloud.api.commands.RebootVMCmd;
-import com.cloud.api.commands.RecoverVMCmd;
-import com.cloud.api.commands.ResetVMPasswordCmd;
-import com.cloud.api.commands.RestoreVMCmd;
-import com.cloud.api.commands.StartVMCmd;
-import com.cloud.api.commands.UpdateVMCmd;
-import com.cloud.api.commands.UpgradeVMCmd;
+import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd;
+import org.apache.cloudstack.api.command.user.template.CreateTemplateCmd;
+import org.apache.cloudstack.api.command.user.vm.*;
+import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
+import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
+import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
+import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
+import org.apache.cloudstack.api.command.user.vm.DestroyVMCmd;
+import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd;
+import org.apache.cloudstack.api.command.user.vm.RebootVMCmd;
+import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd;
+import org.apache.cloudstack.api.command.user.vm.ResetVMPasswordCmd;
+import org.apache.cloudstack.api.command.user.vm.RestoreVMCmd;
+import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
+
import com.cloud.dc.DataCenter;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
@@ -53,13 +52,12 @@ import com.cloud.storage.Volume;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
-import com.cloud.utils.Pair;
import com.cloud.utils.exception.ExecutionException;
public interface UserVmService {
/**
* Destroys one virtual machine
- *
+ *
* @param userId
* the id of the user performing the action
* @param vmId
@@ -71,7 +69,7 @@ public interface UserVmService {
/**
* Destroys one virtual machine
- *
+ *
* @param userId
* the id of the user performing the action
* @param vmId
@@ -83,7 +81,7 @@ public interface UserVmService {
/**
* Resets the password of a virtual machine.
- *
+ *
* @param cmd
* - the command specifying vmId, password
* @return the VM if reset worked successfully, null otherwise
@@ -92,7 +90,7 @@ public interface UserVmService {
/**
* Attaches the specified volume to the specified VM
- *
+ *
* @param cmd
* - the command specifying volumeId and vmId
* @return the Volume object if attach worked successfully.
@@ -101,7 +99,7 @@ public interface UserVmService {
/**
* Detaches the specified volume from the VM it is currently attached to.
- *
+ *
* @param cmd
* - the command specifying volumeId
* @return the Volume object if detach worked successfully.
@@ -119,7 +117,7 @@ public interface UserVmService {
/**
* Create a template database record in preparation for creating a private template.
- *
+ *
* @param cmd
* the command object that defines the name, display text, snapshot/volume, bits, public/private, etc.
* for the
@@ -133,7 +131,7 @@ public interface UserVmService {
/**
* Creates a private template from a snapshot of a VM
- *
+ *
* @param cmd
* - the command specifying snapshotId, name, description
* @return a template if successfully created, null otherwise
@@ -142,7 +140,7 @@ public interface UserVmService {
/**
* Creates a Basic Zone User VM in the database and returns the VM to the caller.
- *
+ *
* @param zone
* - availability zone for the virtual machine
* @param serviceOffering
@@ -189,7 +187,7 @@ public interface UserVmService {
* - an optional domainId for the virtual machine. If the account parameter is used, domainId must also
* be used
* @return UserVm object if successful.
- *
+ *
* @throws InsufficientCapacityException
* if there is insufficient capacity to deploy the VM.
* @throws ConcurrentOperationException
@@ -205,7 +203,7 @@ public interface UserVmService {
/**
* Creates a User VM in Advanced Zone (Security Group feature is enabled) in the database and returns the VM to the
* caller.
- *
+ *
* @param zone
* - availability zone for the virtual machine
* @param serviceOffering
@@ -254,7 +252,7 @@ public interface UserVmService {
* - an optional domainId for the virtual machine. If the account parameter is used, domainId must also
* be used
* @return UserVm object if successful.
- *
+ *
* @throws InsufficientCapacityException
* if there is insufficient capacity to deploy the VM.
* @throws ConcurrentOperationException
@@ -271,7 +269,7 @@ public interface UserVmService {
/**
* Creates a User VM in Advanced Zone (Security Group feature is disabled) in the database and returns the VM to the
* caller.
- *
+ *
* @param zone
* - availability zone for the virtual machine
* @param serviceOffering
@@ -318,7 +316,7 @@ public interface UserVmService {
* - an optional domainId for the virtual machine. If the account parameter is used, domainId must also
* be used
* @return UserVm object if successful.
- *
+ *
* @throws InsufficientCapacityException
* if there is insufficient capacity to deploy the VM.
* @throws ConcurrentOperationException
@@ -333,7 +331,7 @@ public interface UserVmService {
/**
* Starts the virtual machine created from createVirtualMachine.
- *
+ *
* @param cmd
* Command to deploy.
* @return UserVm object if successful.
@@ -348,7 +346,7 @@ public interface UserVmService {
/**
* Creates a vm group.
- *
+ *
* @param name
* - name of the group
* @param accountId
@@ -360,7 +358,7 @@ public interface UserVmService {
/**
* upgrade the service offering of the virtual machine
- *
+ *
* @param cmd
* - the command specifying vmId and new serviceOfferingId
* @return the vm
@@ -371,15 +369,6 @@ public interface UserVmService {
void deletePrivateTemplateRecord(Long templateId);
- /**
- * Obtains a list of virtual machines by the specified search criteria. Can search by: "userId", "name", "state",
- * "dataCenterId", "podId", "hostId"
- *
- * @param cmd
- * the API command that wraps the search criteria
- * @return List of UserVMs.
- */
- Pair, Integer> searchForUserVMs(ListVMsCmd cmd);
HypervisorType getHypervisorTypeOfUserVM(long vmid);
@@ -392,7 +381,7 @@ public interface UserVmService {
* Migrate the given VM to the destination host provided. The API returns the migrated VM if migration succeeds.
* Only Root
* Admin can migrate a VM.
- *
+ *
* @param destinationStorage
* TODO
* @param Long
@@ -400,7 +389,7 @@ public interface UserVmService {
* vmId of The VM to migrate
* @param Host
* destinationHost to migrate the VM
- *
+ *
* @return VirtualMachine migrated VM
* @throws ManagementServerException
* in case we get error finding the VM or host or access errors or other internal errors.
diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java
index 1fa16c32fa0..cd305795478 100755
--- a/api/src/com/cloud/vm/VirtualMachine.java
+++ b/api/src/com/cloud/vm/VirtualMachine.java
@@ -19,17 +19,18 @@ package com.cloud.vm;
import java.util.Date;
import java.util.Map;
-import com.cloud.acl.ControlledEntity;
-import com.cloud.api.Identity;
+import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.api.Identity;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.utils.fsm.StateMachine2;
import com.cloud.utils.fsm.StateObject;
+import org.apache.cloudstack.api.InternalIdentity;
/**
* VirtualMachine describes the properties held by a virtual machine
- *
+ *
*/
-public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, StateObject {
+public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, InternalIdentity, StateObject {
public enum State {
Starting(true, "VM is being started. At this state, you should find host id filled which means it's being started on that host."),
@@ -206,11 +207,6 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, S
*/
public String getInstanceName();
- /**
- * @return the id of this virtual machine. null means the id has not been set.
- */
- public long getId();
-
/**
* @return the host name of the virtual machine. If the user did not
* specify the host name when creating the virtual machine then it is
@@ -245,7 +241,7 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, S
/**
* returns the guest OS ID
- *
+ *
* @return guestOSId
*/
public long getGuestOSId();
@@ -290,6 +286,6 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, Identity, S
HypervisorType getHypervisorType();
public Map getDetails();
-
+
boolean canPlugNics();
}
diff --git a/api/src/com/cloud/vm/VirtualMachineProfile.java b/api/src/com/cloud/vm/VirtualMachineProfile.java
index 57277db32f3..0fab4436807 100644
--- a/api/src/com/cloud/vm/VirtualMachineProfile.java
+++ b/api/src/com/cloud/vm/VirtualMachineProfile.java
@@ -30,7 +30,7 @@ import com.cloud.user.Account;
* VirtualMachineProfile describes one virtual machine. This object
* on what the virtual machine profile should look like before it is
* actually started on the hypervisor.
- *
+ *
* @param
* a VirtualMachine
*/
diff --git a/api/src/org/apache/cloudstack/acl/APIChecker.java b/api/src/org/apache/cloudstack/acl/APIChecker.java
new file mode 100644
index 00000000000..0d0dfd1be4e
--- /dev/null
+++ b/api/src/org/apache/cloudstack/acl/APIChecker.java
@@ -0,0 +1,30 @@
+// 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 org.apache.cloudstack.acl;
+
+import com.cloud.exception.PermissionDeniedException;
+import com.cloud.user.User;
+import com.cloud.utils.component.Adapter;
+
+// APIChecker checks the ownership and access control to API requests
+public interface APIChecker extends Adapter {
+ // Interface for checking access for a role using apiname
+ // If true, apiChecker has checked the operation
+ // If false, apiChecker is unable to handle the operation or not implemented
+ // On exception, checkAccess failed don't allow
+ boolean checkAccess(User user, String apiCommandName) throws PermissionDeniedException;
+}
diff --git a/api/src/com/cloud/acl/ControlledEntity.java b/api/src/org/apache/cloudstack/acl/ControlledEntity.java
similarity index 96%
rename from api/src/com/cloud/acl/ControlledEntity.java
rename to api/src/org/apache/cloudstack/acl/ControlledEntity.java
index 190dd41eea4..3e0412623e2 100644
--- a/api/src/com/cloud/acl/ControlledEntity.java
+++ b/api/src/org/apache/cloudstack/acl/ControlledEntity.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.acl;
+package org.apache.cloudstack.acl;
import com.cloud.domain.PartOf;
import com.cloud.user.OwnedBy;
@@ -22,7 +22,7 @@ import com.cloud.user.OwnedBy;
/**
* ControlledEntity defines an object for which the access from an
* access must inherit this interface.
- *
+ *
*/
public interface ControlledEntity extends OwnedBy, PartOf {
public enum ACLType {
diff --git a/api/src/org/apache/cloudstack/acl/InfrastructureEntity.java b/api/src/org/apache/cloudstack/acl/InfrastructureEntity.java
new file mode 100644
index 00000000000..451c0c89ede
--- /dev/null
+++ b/api/src/org/apache/cloudstack/acl/InfrastructureEntity.java
@@ -0,0 +1,20 @@
+// 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 org.apache.cloudstack.acl;
+
+public interface InfrastructureEntity {
+}
diff --git a/api/src/org/apache/cloudstack/acl/Role.java b/api/src/org/apache/cloudstack/acl/Role.java
new file mode 100644
index 00000000000..d039a6f95ff
--- /dev/null
+++ b/api/src/org/apache/cloudstack/acl/Role.java
@@ -0,0 +1,33 @@
+// 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 org.apache.cloudstack.acl;
+
+//metadata - consists of default dynamic roles in CS + any custom roles added by user
+public interface Role {
+
+ public static final short ROOT_ADMIN = 0;
+ public static final short DOMAIN_ADMIN = 1;
+ public static final short DOMAIN_USER = 2;
+ public static final short OWNER = 3;
+ public static final short PARENT_DOMAIN_ADMIN = 4;
+ public static final short PARENT_DOMAIN_USER = 5;
+ public static final short CHILD_DOMAIN_ADMIN = 6;
+ public static final short CHILD_DOMAIN_USER = 7;
+
+ public long getId();
+ public short getRoleType();
+ }
diff --git a/api/src/org/apache/cloudstack/acl/RoleType.java b/api/src/org/apache/cloudstack/acl/RoleType.java
new file mode 100644
index 00000000000..0d1c4460c1e
--- /dev/null
+++ b/api/src/org/apache/cloudstack/acl/RoleType.java
@@ -0,0 +1,37 @@
+// 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 org.apache.cloudstack.acl;
+
+// Enum for default roles in CloudStack
+public enum RoleType {
+
+ Admin(1),
+ ResourceAdmin(2),
+ DomainAdmin(4),
+ User(8),
+ Unknown(0);
+
+ private int mask;
+
+ private RoleType(int mask) {
+ this.mask = mask;
+ }
+
+ public int getValue() {
+ return mask;
+ }
+}
diff --git a/api/src/com/cloud/acl/SecurityChecker.java b/api/src/org/apache/cloudstack/acl/SecurityChecker.java
similarity index 98%
rename from api/src/com/cloud/acl/SecurityChecker.java
rename to api/src/org/apache/cloudstack/acl/SecurityChecker.java
index 3f76da97809..3a721fe7fcb 100644
--- a/api/src/com/cloud/acl/SecurityChecker.java
+++ b/api/src/org/apache/cloudstack/acl/SecurityChecker.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.acl;
+package org.apache.cloudstack.acl;
import com.cloud.dc.DataCenter;
import com.cloud.domain.Domain;
@@ -39,7 +39,7 @@ public interface SecurityChecker extends Adapter {
/**
* Checks if the account owns the object.
- *
+ *
* @param caller
* account to check against.
* @param object
@@ -52,7 +52,7 @@ public interface SecurityChecker extends Adapter {
/**
* Checks if the user belongs to an account that owns the object.
- *
+ *
* @param user
* user to check against.
* @param object
@@ -65,7 +65,7 @@ public interface SecurityChecker extends Adapter {
/**
* Checks if the account can access the object.
- *
+ *
* @param caller
* account to check against.
* @param entity
@@ -80,7 +80,7 @@ public interface SecurityChecker extends Adapter {
/**
* Checks if the user belongs to an account that can access the object.
- *
+ *
* @param user
* user to check against.
* @param entity
diff --git a/api/src/com/cloud/api/IdentityMapper.java b/api/src/org/apache/cloudstack/api/ACL.java
similarity index 87%
rename from api/src/com/cloud/api/IdentityMapper.java
rename to api/src/org/apache/cloudstack/api/ACL.java
index 4515b805d05..3623d1ac523 100644
--- a/api/src/com/cloud/api/IdentityMapper.java
+++ b/api/src/org/apache/cloudstack/api/ACL.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import static java.lang.annotation.ElementType.FIELD;
@@ -24,6 +24,8 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ FIELD })
-public @interface IdentityMapper {
- String entityTableName();
+public @interface ACL {
+
+ boolean checkKeyAccess() default false;
+ boolean checkValueAccess() default false;
}
diff --git a/api/src/com/cloud/api/Implementation.java b/api/src/org/apache/cloudstack/api/APICommand.java
similarity index 92%
rename from api/src/com/cloud/api/Implementation.java
rename to api/src/org/apache/cloudstack/api/APICommand.java
index 6f0b965c3ec..4d024c15a5d 100644
--- a/api/src/com/cloud/api/Implementation.java
+++ b/api/src/org/apache/cloudstack/api/APICommand.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import static java.lang.annotation.ElementType.TYPE;
@@ -22,13 +22,13 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import com.cloud.api.response.BaseResponse;
-
@Retention(RetentionPolicy.RUNTIME)
@Target({ TYPE })
-public @interface Implementation {
+public @interface APICommand {
Class extends BaseResponse> responseObject();
+ String name() default "";
+
String description() default "";
String usage() default "";
diff --git a/api/src/com/cloud/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
old mode 100755
new mode 100644
similarity index 98%
rename from api/src/com/cloud/api/ApiConstants.java
rename to api/src/org/apache/cloudstack/api/ApiConstants.java
index 588cdc6c140..58a78318fae
--- a/api/src/com/cloud/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import org.omg.CORBA.PUBLIC_MEMBER;
@@ -91,6 +91,7 @@ public class ApiConstants {
public static final String INTERVAL_TYPE = "intervaltype";
public static final String IP_ADDRESS = "ipaddress";
public static final String IP_ADDRESS_ID = "ipaddressid";
+ public static final String IS_ASYNC = "isasync";
public static final String IP_AVAILABLE = "ipavailable";
public static final String IP_LIMIT = "iplimit";
public static final String IP_TOTAL = "iptotal";
@@ -106,6 +107,7 @@ public class ApiConstants {
public static final String JOB_STATUS = "jobstatus";
public static final String LASTNAME = "lastname";
public static final String LEVEL = "level";
+ public static final String LENGTH = "length";
public static final String LIMIT_CPU_USE = "limitcpuuse";
public static final String LOCK = "lock";
public static final String LUN = "lun";
@@ -126,6 +128,7 @@ public class ApiConstants {
public static final String OP = "op";
public static final String OS_CATEGORY_ID = "oscategoryid";
public static final String OS_TYPE_ID = "ostypeid";
+ public static final String PARAMS = "params";
public static final String PARENT_DOMAIN_ID = "parentdomainid";
public static final String PASSWORD = "password";
public static final String NEW_PASSWORD = "new_password";
@@ -155,10 +158,12 @@ public class ApiConstants {
public static final String RECEIVED_BYTES = "receivedbytes";
public static final String REQUIRES_HVM = "requireshvm";
public static final String RESOURCE_TYPE = "resourcetype";
+ public static final String RESPONSE = "response";
public static final String QUERY_FILTER = "queryfilter";
public static final String SCHEDULE = "schedule";
public static final String SCOPE = "scope";
public static final String SECRET_KEY = "usersecretkey";
+ public static final String SINCE = "since";
public static final String KEY = "key";
public static final String SEARCH_BASE = "searchbase";
public static final String SECURITY_GROUP_IDS = "securitygroupids";
@@ -324,6 +329,7 @@ public class ApiConstants {
public static final String SOURCE_NAT_SUPPORTED = "sourcenatsupported";
public static final String RESOURCE_STATE = "resourcestate";
public static final String PROJECT_INVITE_REQUIRED = "projectinviterequired";
+ public static final String REQUIRED = "required";
public static final String RESTART_REQUIRED = "restartrequired";
public static final String ALLOW_USER_CREATE_PROJECTS = "allowusercreateprojects";
public static final String CONSERVE_MODE = "conservemode";
@@ -381,10 +387,11 @@ public class ApiConstants {
public static final String ESP_LIFETIME = "esplifetime";
public static final String DPD = "dpd";
public static final String FOR_VPC = "forvpc";
+ public static final String SHRINK_OK = "shrinkok";
public static final String NICIRA_NVP_DEVICE_ID = "nvpdeviceid";
public static final String NICIRA_NVP_TRANSPORT_ZONE_UUID = "transportzoneuuid";
public static final String NICIRA_NVP_DEVICE_NAME = "niciradevicename";
- public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
+ public static final String NICIRA_NVP_GATEWAYSERVICE_UUID = "l3gatewayserviceuuid";
public static final String S3_ACCESS_KEY = "accesskey";
public static final String S3_SECRET_KEY = "secretkey";
public static final String S3_END_POINT = "endpoint";
@@ -395,7 +402,6 @@ public class ApiConstants {
public static final String S3_SOCKET_TIMEOUT = "sockettimeout";
public static final String INCL_ZONES = "includezones";
public static final String EXCL_ZONES = "excludezones";
-
public static final String SOURCE = "source";
public static final String COUNTER_ID = "counterid";
public static final String AGGR_OPERATOR = "aggroperator";
@@ -429,7 +435,7 @@ public class ApiConstants {
public enum VMDetails {
all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min;
}
-
+
public enum LDAPParams {
hostname, port, usessl, queryfilter, searchbase, dn, passwd, truststore, truststorepass;
diff --git a/api/src/com/cloud/api/BaseAsyncCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
similarity index 95%
rename from api/src/com/cloud/api/BaseAsyncCmd.java
rename to api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
index cf6d0bdbb93..fd67ed89675 100644
--- a/api/src/com/cloud/api/BaseAsyncCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
@@ -14,9 +14,9 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
-import com.cloud.api.response.AsyncJobResponse;
+import org.apache.cloudstack.api.response.AsyncJobResponse;
import com.cloud.async.AsyncJob;
import com.cloud.user.User;
import com.cloud.user.UserContext;
@@ -25,7 +25,7 @@ import com.cloud.user.UserContext;
* queryAsyncJobResult API command.
*/
public abstract class BaseAsyncCmd extends BaseCmd {
-
+
public static final String ipAddressSyncObject = "ipaddress";
public static final String networkSyncObject = "network";
public static final String vpcSyncObject = "vpc";
@@ -40,7 +40,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
* For proper tracking of async commands through the system, events must be generated when the command is
* scheduled, started, and completed. Commands should specify the type of event so that when the scheduled,
* started, and completed events are saved to the events table, they have the proper type information.
- *
+ *
* @return a string representing the type of event, e.g. VM.START, VOLUME.CREATE.
*/
public abstract String getEventType();
@@ -49,7 +49,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
* For proper tracking of async commands through the system, events must be generated when the command is
* scheduled, started, and completed. Commands should specify a description for these events so that when
* the scheduled, started, and completed events are saved to the events table, they have a meaningful description.
- *
+ *
* @return a string representing a description of the event
*/
public abstract String getEventDescription();
@@ -57,7 +57,8 @@ public abstract class BaseAsyncCmd extends BaseCmd {
public ResponseObject getResponse(long jobId) {
AsyncJobResponse response = new AsyncJobResponse();
- response.setJobId(jobId);
+ AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
+ response.setJobId(job.getUuid());
response.setResponseName(getCommandName());
return response;
}
@@ -77,7 +78,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
/**
* Async commands that want to be tracked as part of the listXXX commands need to
* provide implementations of the two following methods, getInstanceId() and getInstanceType()
- *
+ *
* getObjectId() should return the id of the object the async command is executing on
* getObjectType() should return a type from the AsyncJob.Type enumeration
*/
diff --git a/api/src/com/cloud/api/BaseAsyncCreateCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
similarity index 75%
rename from api/src/com/cloud/api/BaseAsyncCreateCmd.java
rename to api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
index 586c9c9e023..1f2d3f17beb 100644
--- a/api/src/com/cloud/api/BaseAsyncCreateCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
@@ -14,15 +14,19 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
-import com.cloud.api.response.CreateCmdResponse;
+import org.apache.cloudstack.api.response.CreateCmdResponse;
+
+import com.cloud.async.AsyncJob;
import com.cloud.exception.ResourceAllocationException;
public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
@Parameter(name = "id", type = CommandType.LONG)
private Long id;
+ private String uuid;
+
public abstract void create() throws ResourceAllocationException;
public Long getEntityId() {
@@ -33,13 +37,19 @@ public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
this.id = id;
}
- public abstract String getEntityTable();
+ public String getEntityUuid() {
+ return uuid;
+ }
- public String getResponse(long jobId, long objectId, String objectEntityTable) {
+ public void setEntityUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ public String getResponse(long jobId, String objectUuid) {
CreateCmdResponse response = new CreateCmdResponse();
- response.setJobId(jobId);
- response.setId(objectId);
- response.setIdEntityTable(objectEntityTable);
+ AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
+ response.setJobId(job.getUuid());
+ response.setId(objectUuid);
response.setResponseName(getCommandName());
return _responseGenerator.toSerializedString(response, getResponseType());
}
diff --git a/api/src/com/cloud/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
old mode 100755
new mode 100644
similarity index 96%
rename from api/src/com/cloud/api/BaseCmd.java
rename to api/src/org/apache/cloudstack/api/BaseCmd.java
index 12a2176fb2e..3399784d2a2
--- a/api/src/com/cloud/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -15,17 +15,17 @@
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
+import org.apache.cloudstack.query.QueryService;
import org.apache.log4j.Logger;
import com.cloud.configuration.ConfigurationService;
@@ -63,7 +63,6 @@ import com.cloud.user.Account;
import com.cloud.user.AccountService;
import com.cloud.user.DomainService;
import com.cloud.user.ResourceLimitService;
-import com.cloud.utils.IdentityProxy;
import com.cloud.utils.Pair;
import com.cloud.utils.component.ComponentLocator;
import com.cloud.vm.BareMetalVmService;
@@ -79,7 +78,7 @@ public abstract class BaseCmd {
public static final String RESPONSE_TYPE_JSON = "json";
public enum CommandType {
- BOOLEAN, DATE, FLOAT, INTEGER, SHORT, LIST, LONG, OBJECT, MAP, STRING, TZDATE
+ BOOLEAN, DATE, FLOAT, INTEGER, SHORT, LIST, LONG, OBJECT, MAP, STRING, TZDATE, UUID
}
// FIXME: Extract these out into a separate file
@@ -141,7 +140,9 @@ public abstract class BaseCmd {
public static NetworkACLService _networkACLService;
public static Site2SiteVpnService _s2sVpnService;
- static void setComponents(ResponseGenerator generator) {
+ public static QueryService _queryService;
+
+ public static void setComponents(ResponseGenerator generator) {
ComponentLocator locator = ComponentLocator.getLocator(ManagementService.Name);
_mgr = (ManagementService) ComponentLocator.getComponent(ManagementService.Name);
_accountService = locator.getManager(AccountService.class);
@@ -172,6 +173,7 @@ public abstract class BaseCmd {
_vpcService = locator.getManager(VpcService.class);
_networkACLService = locator.getManager(NetworkACLService.class);
_s2sVpnService = locator.getManager(Site2SiteVpnService.class);
+ _queryService = locator.getManager(QueryService.class);
}
public abstract void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException;
@@ -192,7 +194,7 @@ public abstract class BaseCmd {
/**
* For commands the API framework needs to know the owner of the object being acted upon. This method is
* used to determine that information.
- *
+ *
* @return the id of the account that owns the object being acted upon
*/
public abstract long getEntityOwnerId();
@@ -304,14 +306,14 @@ public abstract class BaseCmd {
StringBuffer sb = new StringBuffer();
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
// JSON response
- sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
+ sb.append("{ \"" + getCommandName() + "\" : { " + "\"@attributes\":{\"cloudstack-version\":\"" + _mgr.getVersion() + "\"},");
sb.append("\"errorcode\" : \"" + apiException.getErrorCode() + "\", \"description\" : \"" + apiException.getDescription() + "\" } }");
} else {
sb.append("");
sb.append("<" + getCommandName() + ">");
sb.append("" + apiException.getErrorCode() + "");
sb.append("" + escapeXml(apiException.getDescription()) + "");
- sb.append("" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
+ sb.append("" + getCommandName() + " cloudstack-version=\"" + _mgr.getVersion() + "\">");
}
return sb.toString();
}
@@ -322,10 +324,10 @@ public abstract class BaseCmd {
// set up the return value with the name of the response
if (RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
- prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloud-stack-version\":\"" + _mgr.getVersion() + "\"},");
+ prefixSb.append("{ \"" + getCommandName() + "\" : { \"@attributes\":{\"cloudstack-version\":\"" + _mgr.getVersion() + "\"},");
} else {
prefixSb.append("");
- prefixSb.append("<" + getCommandName() + " cloud-stack-version=\"" + _mgr.getVersion() + "\">");
+ prefixSb.append("<" + getCommandName() + " cloudstack-version=\"" + _mgr.getVersion() + "\">");
}
int i = 0;
@@ -508,8 +510,9 @@ public abstract class BaseCmd {
throw new PermissionDeniedException("Can't add resources to the account id=" + account.getId() + " in state=" + account.getState() + " as it's no longer active");
}
} else {
- List idList = new ArrayList();
- idList.add(new IdentityProxy("domain", domainId, "domainId"));
+ // idList is not used anywhere, so removed it now
+ //List idList = new ArrayList();
+ //idList.add(new IdentityProxy("domain", domainId, "domainId"));
throw new InvalidParameterValueException("Unable to find account by name " + accountName + " in domain with specified id");
}
}
diff --git a/api/src/com/cloud/api/BaseListAccountResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
similarity index 97%
rename from api/src/com/cloud/api/BaseListAccountResourcesCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
index 37010054526..038da63ec4c 100644
--- a/api/src/com/cloud/api/BaseListAccountResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListAccountResourcesCmd.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
public abstract class BaseListAccountResourcesCmd extends BaseListDomainResourcesCmd {
diff --git a/api/src/com/cloud/api/BaseListCmd.java b/api/src/org/apache/cloudstack/api/BaseListCmd.java
old mode 100755
new mode 100644
similarity index 98%
rename from api/src/com/cloud/api/BaseListCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListCmd.java
index d5ece6b14b3..58e83f70929
--- a/api/src/com/cloud/api/BaseListCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListCmd.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
@@ -62,7 +62,7 @@ public abstract class BaseListCmd extends BaseCmd {
return pageSize;
}
- static void configure() {
+ public static void configure() {
if (_configService.getDefaultPageSize().longValue() != PAGESIZE_UNLIMITED) {
MAX_PAGESIZE = _configService.getDefaultPageSize();
}
diff --git a/api/src/com/cloud/api/BaseListDomainResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
similarity index 72%
rename from api/src/com/cloud/api/BaseListDomainResourcesCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
index 9571e1263c1..6e50a159f20 100644
--- a/api/src/com/cloud/api/BaseListDomainResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
@@ -14,21 +14,22 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
+
+import org.apache.cloudstack.api.response.DomainResponse;
public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
@Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, description = "If set to false, " +
- "list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
+ "list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
private Boolean listAll;
- @IdentityMapper(entityTableName = "domain")
- @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, description = "list only resources" +
- " belonging to the domain specified")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="list only resources belonging to the domain specified")
private Long domainId;
@Parameter(name = ApiConstants.IS_RECURSIVE, type = CommandType.BOOLEAN, description = "defaults to false," +
- " but if true, lists all resources from the parent specified by the domainId till leaves.")
+ " but if true, lists all resources from the parent specified by the domainId till leaves.")
private Boolean recursive;
public boolean listAll() {
diff --git a/api/src/com/cloud/api/BaseListProjectAndAccountResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
similarity index 80%
rename from api/src/com/cloud/api/BaseListProjectAndAccountResourcesCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
index 78e70019c9b..836527fc7c7 100644
--- a/api/src/com/cloud/api/BaseListProjectAndAccountResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
@@ -14,12 +14,14 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
+
+import org.apache.cloudstack.api.response.ProjectResponse;
public abstract class BaseListProjectAndAccountResourcesCmd extends BaseListAccountResourcesCmd {
- @IdentityMapper(entityTableName = "projects")
- @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.LONG, description = "list objects by project")
+ @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, entityType=ProjectResponse.class,
+ description="list objects by project")
private Long projectId;
public Long getProjectId() {
diff --git a/api/src/com/cloud/api/BaseListTaggedResourcesCmd.java b/api/src/org/apache/cloudstack/api/BaseListTaggedResourcesCmd.java
similarity index 98%
rename from api/src/com/cloud/api/BaseListTaggedResourcesCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListTaggedResourcesCmd.java
index 9b188d8ed25..88176a536ea 100644
--- a/api/src/com/cloud/api/BaseListTaggedResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListTaggedResourcesCmd.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import java.util.Collection;
import java.util.HashMap;
@@ -26,7 +26,7 @@ import com.cloud.exception.InvalidParameterValueException;
public abstract class BaseListTaggedResourcesCmd extends BaseListProjectAndAccountResourcesCmd{
@Parameter(name = ApiConstants.TAGS, type = CommandType.MAP, description = "List resources by tags (key/value pairs)")
private Map tags;
-
+
public Map getTags() {
Map tagsMap = null;
if (tags != null && !tags.isEmpty()) {
diff --git a/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
similarity index 76%
rename from api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java
rename to api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
index cacb41f405d..cde2d948686 100644
--- a/api/src/com/cloud/api/commands/ListTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
@@ -14,33 +14,27 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api;
import java.util.List;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.TemplatePermissionsResponse;
+import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="List template visibility and all accounts that have permissions to view this template.", responseObject=TemplatePermissionsResponse.class)
-public class ListTemplateOrIsoPermissionsCmd extends BaseCmd {
- public Logger s_logger = getLogger();
+public class BaseListTemplateOrIsoPermissionsCmd extends BaseCmd {
+ public Logger s_logger = getLogger();
protected String s_name = "listtemplatepermissionsresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="vm_template")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the template ID")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplatePermissionsResponse.class,
+ required=true, description="the template ID")
private Long id;
/////////////////////////////////////////////////////
@@ -68,23 +62,23 @@ public class ListTemplateOrIsoPermissionsCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
protected boolean templateIsCorrectType(VirtualMachineTemplate template) {
- return true;
+ return true;
}
-
+
public String getMediaType() {
- return "templateOrIso";
+ return "templateOrIso";
}
-
+
protected Logger getLogger() {
- return Logger.getLogger(UpdateTemplateOrIsoPermissionsCmd.class.getName());
+ return Logger.getLogger(BaseUpdateTemplateOrIsoPermissionsCmd.class.getName());
}
-
+
@Override
public void execute(){
List accountNames = _templateService.listTemplatePermissions(this);
-
+
Account account = UserContext.current().getCaller();
boolean isAdmin = (isAdmin(account.getType()));
diff --git a/api/src/com/cloud/api/response/BaseResponse.java b/api/src/org/apache/cloudstack/api/BaseResponse.java
old mode 100755
new mode 100644
similarity index 74%
rename from api/src/com/cloud/api/response/BaseResponse.java
rename to api/src/org/apache/cloudstack/api/BaseResponse.java
index e343a104887..01f1be3253b
--- a/api/src/com/cloud/api/response/BaseResponse.java
+++ b/api/src/org/apache/cloudstack/api/BaseResponse.java
@@ -14,18 +14,17 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.response;
+package org.apache.cloudstack.api;
-import com.cloud.api.ApiConstants;
-import com.cloud.utils.IdentityProxy;
-import com.cloud.api.ResponseObject;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ResponseObject;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
public abstract class BaseResponse implements ResponseObject {
private transient String responseName;
private transient String objectName;
-
+
@Override
public String getResponseName() {
return responseName;
@@ -35,7 +34,7 @@ public abstract class BaseResponse implements ResponseObject {
public void setResponseName(String responseName) {
this.responseName = responseName;
}
-
+
@Override
public String getObjectName() {
return objectName;
@@ -45,31 +44,35 @@ public abstract class BaseResponse implements ResponseObject {
public void setObjectName(String objectName) {
this.objectName = objectName;
}
-
- public Long getObjectId() {
- return null;
+
+ @Override
+ public String getObjectId() {
+ return null;
}
-
- // For use by list commands with pending async jobs
- @SerializedName(ApiConstants.JOB_ID) @Param(description="the ID of the latest async job acting on this object")
- protected IdentityProxy jobId = new IdentityProxy("async_job");
-
+
+ @SerializedName(ApiConstants.JOB_ID) @Param(description="the UUID of the latest async job acting on this object")
+ protected String jobId;
+
@SerializedName(ApiConstants.JOB_STATUS) @Param(description="the current status of the latest async job acting on this object")
private Integer jobStatus;
-
- public Long getJobId() {
- return jobId.getValue();
+
+ @Override
+ public String getJobId() {
+ return jobId;
}
-
- public void setJobId(Long jobId) {
- this.jobId.setValue(jobId);
+
+ @Override
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
}
-
+
+ @Override
public Integer getJobStatus() {
- return jobStatus;
+ return jobStatus;
}
-
+
+ @Override
public void setJobStatus(Integer jobStatus) {
- this.jobStatus = jobStatus;
+ this.jobStatus = jobStatus;
}
}
diff --git a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
old mode 100755
new mode 100644
similarity index 77%
rename from api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
rename to api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index 89c4ee93f5e..dd6ae007ab9
--- a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -14,17 +14,18 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api;
+import org.apache.cloudstack.api.command.user.iso.UpdateIsoCmd;
+import org.apache.cloudstack.api.response.GuestOSResponse;
+import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Parameter;
-import com.cloud.api.BaseCmd.CommandType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
-public abstract class UpdateTemplateOrIsoCmd extends BaseCmd {
+public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());
/////////////////////////////////////////////////////
@@ -37,23 +38,23 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd {
@Parameter(name=ApiConstants.DISPLAY_TEXT, type=CommandType.STRING, description="the display text of the image", length=4096)
private String displayText;
- @IdentityMapper(entityTableName="vm_template")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the image file")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = TemplateResponse.class,
+ required=true, description="the ID of the image file")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the image file")
private String templateName;
- @IdentityMapper(entityTableName="guest_os")
- @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.LONG, description="the ID of the OS type that best represents the OS of this image.")
+ @Parameter(name=ApiConstants.OS_TYPE_ID, type=CommandType.UUID, entityType = GuestOSResponse.class,
+ description="the ID of the OS type that best represents the OS of this image.")
private Long osTypeId;
-
+
@Parameter(name=ApiConstants.FORMAT, type=CommandType.STRING, description="the format for the image")
private String format;
-
+
@Parameter(name=ApiConstants.PASSWORD_ENABLED, type=CommandType.BOOLEAN, description="true if the image supports the password reset feature; default is false")
private Boolean passwordEnabled;
-
+
@Parameter(name=ApiConstants.SORT_KEY, type=CommandType.INTEGER, description="sort key of the template, integer")
private Integer sortKey;
@@ -80,16 +81,16 @@ public abstract class UpdateTemplateOrIsoCmd extends BaseCmd {
public Long getOsTypeId() {
return osTypeId;
}
-
+
public Boolean isPasswordEnabled() {
return passwordEnabled;
}
-
+
public String getFormat() {
return format;
}
-
+
public Integer getSortKey() {
- return sortKey;
+ return sortKey;
}
}
diff --git a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
old mode 100755
new mode 100644
similarity index 81%
rename from api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
rename to api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
index 38a2e394145..aacc6efa2e0
--- a/api/src/com/cloud/api/commands/UpdateTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
@@ -14,21 +14,18 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api;
import java.util.List;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.exception.InvalidParameterValueException;
-public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
+public abstract class BaseUpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
public Logger s_logger = getLogger();
protected String s_name = getResponseName();
@@ -39,8 +36,8 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
@Parameter(name = ApiConstants.ACCOUNTS, type = CommandType.LIST, collectionType = CommandType.STRING, description = "a comma delimited list of accounts. If specified, \"op\" parameter has to be passed in.")
private List accountNames;
- @IdentityMapper(entityTableName="vm_template")
- @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the template ID")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = TemplateResponse.class,
+ required = true, description = "the template ID")
private Long id;
@Parameter(name = ApiConstants.IS_FEATURED, type = CommandType.BOOLEAN, description = "true for featured template/iso, false otherwise")
@@ -48,15 +45,15 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
@Parameter(name = ApiConstants.IS_PUBLIC, type = CommandType.BOOLEAN, description = "true for public template/iso, false for private templates/isos")
private Boolean isPublic;
-
+
@Parameter(name = ApiConstants.IS_EXTRACTABLE, type = CommandType.BOOLEAN, description = "true if the template/iso is extractable, false other wise. Can be set only by root admin")
private Boolean isExtractable;
@Parameter(name = ApiConstants.OP, type = CommandType.STRING, description = "permission operator (add, remove, reset)")
private String operation;
-
- @IdentityMapper(entityTableName="projects")
- @Parameter(name = ApiConstants.PROJECT_IDS, type = CommandType.LIST, collectionType = CommandType.LONG, description = "a comma delimited list of projects. If specified, \"op\" parameter has to be passed in.")
+
+ @Parameter(name = ApiConstants.PROJECT_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = ProjectResponse.class,
+ description = "a comma delimited list of projects. If specified, \"op\" parameter has to be passed in.")
private List projectIds;
// ///////////////////////////////////////////////////
@@ -65,10 +62,10 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
public List getAccountNames() {
if (accountNames != null && projectIds != null) {
- throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
+ throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
}
-
- return accountNames;
+
+ return accountNames;
}
public Long getId() {
@@ -82,18 +79,18 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
public Boolean isPublic() {
return isPublic;
}
-
+
public Boolean isExtractable() {
return isExtractable;
}
-
+
public String getOperation() {
return operation;
}
-
+
public List getProjectIds() {
if (accountNames != null && projectIds != null) {
- throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
+ throw new InvalidParameterValueException("Accounts and projectIds can't be specified together");
}
return projectIds;
}
@@ -112,7 +109,7 @@ public abstract class UpdateTemplateOrIsoPermissionsCmd extends BaseCmd {
}
protected Logger getLogger() {
- return Logger.getLogger(UpdateTemplateOrIsoPermissionsCmd.class.getName());
+ return Logger.getLogger(BaseUpdateTemplateOrIsoPermissionsCmd.class.getName());
}
@Override
diff --git a/api/src/org/apache/cloudstack/api/EntityReference.java b/api/src/org/apache/cloudstack/api/EntityReference.java
new file mode 100644
index 00000000000..1de84cee5da
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/EntityReference.java
@@ -0,0 +1,28 @@
+// 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 org.apache.cloudstack.api;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/* There is a one on one mapping between the EntityReference and the EntityResponse
+ * to the OTW layer. Value is the actual entity class it refers to.
+ */
+@Retention(RetentionPolicy.RUNTIME)
+public @interface EntityReference {
+ Class[] value() default {};
+}
diff --git a/api/src/com/cloud/api/Identity.java b/api/src/org/apache/cloudstack/api/Identity.java
similarity index 96%
rename from api/src/com/cloud/api/Identity.java
rename to api/src/org/apache/cloudstack/api/Identity.java
index 09ce7a8ac04..22d23b70017 100644
--- a/api/src/com/cloud/api/Identity.java
+++ b/api/src/org/apache/cloudstack/api/Identity.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
public interface Identity {
String getUuid();
diff --git a/api/src/com/cloud/api/IdentityService.java b/api/src/org/apache/cloudstack/api/IdentityService.java
similarity index 91%
rename from api/src/com/cloud/api/IdentityService.java
rename to api/src/org/apache/cloudstack/api/IdentityService.java
index 1c53a1dfcd4..a2ccec2dae7 100644
--- a/api/src/com/cloud/api/IdentityService.java
+++ b/api/src/org/apache/cloudstack/api/IdentityService.java
@@ -14,12 +14,9 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
public interface IdentityService {
- Long getIdentityId(IdentityMapper mapper, String identityString);
-
Long getIdentityId(String tableName, String identityString);
-
String getIdentityUuid(String tableName, String identityString);
}
diff --git a/api/src/org/apache/cloudstack/api/InternalIdentity.java b/api/src/org/apache/cloudstack/api/InternalIdentity.java
new file mode 100644
index 00000000000..1dfeb8c9091
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/InternalIdentity.java
@@ -0,0 +1,26 @@
+// 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 org.apache.cloudstack.api;
+
+// This interface is a contract that getId() will give the internal
+// ID of an entity which extends this interface
+// Any class having an internal ID in db table/schema should extend this
+// For example, all ControlledEntity, OwnedBy would have an internal ID
+
+public interface InternalIdentity {
+ long getId();
+}
diff --git a/api/src/com/cloud/api/Parameter.java b/api/src/org/apache/cloudstack/api/Parameter.java
similarity index 88%
rename from api/src/com/cloud/api/Parameter.java
rename to api/src/org/apache/cloudstack/api/Parameter.java
index 2da3c400f07..6f64737ab83 100644
--- a/api/src/com/cloud/api/Parameter.java
+++ b/api/src/org/apache/cloudstack/api/Parameter.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import static java.lang.annotation.ElementType.FIELD;
@@ -22,7 +22,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import com.cloud.api.BaseCmd.CommandType;
+import org.apache.cloudstack.api.BaseCmd.CommandType;
@Retention(RetentionPolicy.RUNTIME)
@Target({ FIELD })
@@ -37,6 +37,8 @@ public @interface Parameter {
CommandType collectionType() default CommandType.OBJECT;
+ Class>[] entityType() default Object.class;
+
boolean expose() default true;
boolean includeInApiDoc() default true;
@@ -44,4 +46,6 @@ public @interface Parameter {
int length() default 255;
String since() default "";
+
+ String retrieveMethod() default "getById";
}
diff --git a/api/src/com/cloud/api/PlugService.java b/api/src/org/apache/cloudstack/api/PlugService.java
similarity index 97%
rename from api/src/com/cloud/api/PlugService.java
rename to api/src/org/apache/cloudstack/api/PlugService.java
index 7df86f9394f..00032e3abdd 100644
--- a/api/src/com/cloud/api/PlugService.java
+++ b/api/src/org/apache/cloudstack/api/PlugService.java
@@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
diff --git a/api/src/com/cloud/api/ResponseGenerator.java b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
old mode 100755
new mode 100644
similarity index 67%
rename from api/src/com/cloud/api/ResponseGenerator.java
rename to api/src/org/apache/cloudstack/api/ResponseGenerator.java
index ec6c00ba8d4..63df4dc5532
--- a/api/src/com/cloud/api/ResponseGenerator.java
+++ b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
@@ -14,83 +14,86 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
import java.text.DecimalFormat;
import java.util.EnumSet;
import java.util.List;
-import com.cloud.api.ApiConstants.HostDetails;
-import com.cloud.api.ApiConstants.VMDetails;
-import com.cloud.api.commands.QueryAsyncJobResultCmd;
-import com.cloud.api.response.AccountResponse;
-import com.cloud.api.response.AsyncJobResponse;
-import com.cloud.api.response.AutoScalePolicyResponse;
-import com.cloud.api.response.AutoScaleVmGroupResponse;
-import com.cloud.api.response.AutoScaleVmProfileResponse;
-import com.cloud.api.response.CapacityResponse;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ConditionResponse;
-import com.cloud.api.response.ConfigurationResponse;
-import com.cloud.api.response.CounterResponse;
-import com.cloud.api.response.CreateCmdResponse;
-import com.cloud.api.response.DiskOfferingResponse;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.DomainRouterResponse;
-import com.cloud.api.response.EventResponse;
-import com.cloud.api.response.ExtractResponse;
-import com.cloud.api.response.FirewallResponse;
-import com.cloud.api.response.FirewallRuleResponse;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.HypervisorCapabilitiesResponse;
-import com.cloud.api.response.IPAddressResponse;
-import com.cloud.api.response.InstanceGroupResponse;
-import com.cloud.api.response.IpForwardingRuleResponse;
-import com.cloud.api.response.LBStickinessResponse;
-import com.cloud.api.response.LDAPConfigResponse;
-import com.cloud.api.response.ListResponse;
-import com.cloud.api.response.LoadBalancerResponse;
-import com.cloud.api.response.NetworkACLResponse;
-import com.cloud.api.response.NetworkOfferingResponse;
-import com.cloud.api.response.NetworkResponse;
-import com.cloud.api.response.PhysicalNetworkResponse;
-import com.cloud.api.response.PodResponse;
-import com.cloud.api.response.PrivateGatewayResponse;
-import com.cloud.api.response.ProjectAccountResponse;
-import com.cloud.api.response.ProjectInvitationResponse;
-import com.cloud.api.response.ProjectResponse;
-import com.cloud.api.response.ProviderResponse;
-import com.cloud.api.response.RemoteAccessVpnResponse;
-import com.cloud.api.response.ResourceCountResponse;
-import com.cloud.api.response.ResourceLimitResponse;
-import com.cloud.api.response.ResourceTagResponse;
-import com.cloud.api.response.S3Response;
-import com.cloud.api.response.SecurityGroupResponse;
-import com.cloud.api.response.ServiceOfferingResponse;
-import com.cloud.api.response.ServiceResponse;
-import com.cloud.api.response.Site2SiteCustomerGatewayResponse;
-import com.cloud.api.response.Site2SiteVpnConnectionResponse;
-import com.cloud.api.response.Site2SiteVpnGatewayResponse;
-import com.cloud.api.response.SnapshotPolicyResponse;
-import com.cloud.api.response.SnapshotResponse;
-import com.cloud.api.response.StaticRouteResponse;
-import com.cloud.api.response.StorageNetworkIpRangeResponse;
-import com.cloud.api.response.StoragePoolResponse;
-import com.cloud.api.response.SwiftResponse;
-import com.cloud.api.response.SystemVmInstanceResponse;
-import com.cloud.api.response.SystemVmResponse;
-import com.cloud.api.response.TemplatePermissionsResponse;
-import com.cloud.api.response.TemplateResponse;
-import com.cloud.api.response.TrafficTypeResponse;
-import com.cloud.api.response.UserResponse;
-import com.cloud.api.response.UserVmResponse;
-import com.cloud.api.response.VirtualRouterProviderResponse;
-import com.cloud.api.response.VlanIpRangeResponse;
-import com.cloud.api.response.VolumeResponse;
-import com.cloud.api.response.VpcOfferingResponse;
-import com.cloud.api.response.VpcResponse;
-import com.cloud.api.response.VpnUsersResponse;
-import com.cloud.api.response.ZoneResponse;
+import org.apache.cloudstack.api.ApiConstants.HostDetails;
+import org.apache.cloudstack.api.ApiConstants.VMDetails;
+import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.AsyncJobResponse;
+import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
+import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
+import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
+import org.apache.cloudstack.api.response.CapacityResponse;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ConditionResponse;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.response.CounterResponse;
+import org.apache.cloudstack.api.response.CreateCmdResponse;
+import org.apache.cloudstack.api.response.DiskOfferingResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.DomainRouterResponse;
+import org.apache.cloudstack.api.response.EventResponse;
+import org.apache.cloudstack.api.response.ExtractResponse;
+import org.apache.cloudstack.api.response.FirewallResponse;
+import org.apache.cloudstack.api.response.FirewallRuleResponse;
+import org.apache.cloudstack.api.response.GuestOSResponse;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
+import org.apache.cloudstack.api.response.IPAddressResponse;
+import org.apache.cloudstack.api.response.InstanceGroupResponse;
+import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
+import org.apache.cloudstack.api.response.LBStickinessResponse;
+import org.apache.cloudstack.api.response.LDAPConfigResponse;
+import org.apache.cloudstack.api.response.LoadBalancerResponse;
+import org.apache.cloudstack.api.response.NetworkACLResponse;
+import org.apache.cloudstack.api.response.NetworkOfferingResponse;
+import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.PrivateGatewayResponse;
+import org.apache.cloudstack.api.response.ProjectAccountResponse;
+import org.apache.cloudstack.api.response.ProjectInvitationResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.ProviderResponse;
+import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
+import org.apache.cloudstack.api.response.ResourceCountResponse;
+import org.apache.cloudstack.api.response.ResourceLimitResponse;
+import org.apache.cloudstack.api.response.ResourceTagResponse;
+import org.apache.cloudstack.api.response.SecurityGroupResponse;
+import org.apache.cloudstack.api.response.ServiceOfferingResponse;
+import org.apache.cloudstack.api.response.ServiceResponse;
+import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
+import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
+import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
+import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
+import org.apache.cloudstack.api.response.SnapshotResponse;
+import org.apache.cloudstack.api.response.SnapshotScheduleResponse;
+import org.apache.cloudstack.api.response.StaticRouteResponse;
+import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
+import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.SwiftResponse;
+import org.apache.cloudstack.api.response.SystemVmInstanceResponse;
+import org.apache.cloudstack.api.response.SystemVmResponse;
+import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
+import org.apache.cloudstack.api.response.TemplateResponse;
+import org.apache.cloudstack.api.response.TrafficTypeResponse;
+import org.apache.cloudstack.api.response.UserResponse;
+import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
+import org.apache.cloudstack.api.response.VlanIpRangeResponse;
+import org.apache.cloudstack.api.response.VolumeResponse;
+import org.apache.cloudstack.api.response.VpcOfferingResponse;
+import org.apache.cloudstack.api.response.VpcResponse;
+import org.apache.cloudstack.api.response.VpnUsersResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
+import org.apache.cloudstack.api.response.S3Response;
+
import com.cloud.async.AsyncJob;
import com.cloud.capacity.Capacity;
import com.cloud.configuration.Configuration;
@@ -128,7 +131,6 @@ import com.cloud.network.rules.PortForwardingRule;
import com.cloud.network.rules.StaticNatRule;
import com.cloud.network.rules.StickinessPolicy;
import com.cloud.network.security.SecurityGroup;
-import com.cloud.network.security.SecurityGroupRules;
import com.cloud.network.security.SecurityRule;
import com.cloud.network.vpc.PrivateGateway;
import com.cloud.network.vpc.StaticRoute;
@@ -142,12 +144,14 @@ import com.cloud.projects.Project;
import com.cloud.projects.ProjectAccount;
import com.cloud.projects.ProjectInvitation;
import com.cloud.server.ResourceTag;
+import com.cloud.storage.GuestOS;
import com.cloud.storage.S3;
import com.cloud.storage.Snapshot;
import com.cloud.storage.StoragePool;
import com.cloud.storage.Swift;
import com.cloud.storage.Volume;
import com.cloud.storage.snapshot.SnapshotPolicy;
+import com.cloud.storage.snapshot.SnapshotSchedule;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.user.User;
@@ -237,7 +241,7 @@ public interface ResponseGenerator {
List createTemplateResponses(long templateId, Long snapshotId, Long volumeId, boolean readyOnly);
- ListResponse createSecurityGroupResponses(List extends SecurityGroupRules> networkGroups);
+ //ListResponse createSecurityGroupResponses(List extends SecurityGroupRules> networkGroups);
SecurityGroupResponse createSecurityGroupResponseFromSecurityGroupRule(List extends SecurityRule> SecurityRules);
@@ -251,6 +255,8 @@ public interface ResponseGenerator {
EventResponse createEventResponse(Event event);
+ //List createEventResponse(EventJoinVO... events);
+
TemplateResponse createIsoResponse(VirtualMachineTemplate result);
List createCapacityResponse(List extends Capacity> result, DecimalFormat format);
@@ -265,6 +271,8 @@ public interface ResponseGenerator {
UserResponse createUserResponse(User user);
+ //List createUserResponse(UserAccountJoinVO... users);
+
AccountResponse createUserAccountResponse(UserAccount user);
Long getSecurityGroupId(String groupName, long accountId);
@@ -273,6 +281,7 @@ public interface ResponseGenerator {
ProjectResponse createProjectResponse(Project project);
+
List createIsoResponses(VirtualMachineTemplate iso, long zoneId, boolean readyOnly);
List createTemplateResponses(long templateId, Long vmId);
@@ -304,13 +313,6 @@ public interface ResponseGenerator {
LDAPConfigResponse createLDAPConfigResponse(String hostname, Integer port, Boolean useSSL, String queryFilter, String baseSearch, String dn);
StorageNetworkIpRangeResponse createStorageNetworkIpRangeResponse(StorageNetworkIpRange result);
-
- /**
- * @param tableName TODO
- * @param token
- * @return
- */
- Long getIdentiyId(String tableName, String token);
/**
* @param resourceTag
@@ -319,8 +321,9 @@ public interface ResponseGenerator {
*/
ResourceTagResponse createResourceTagResponse(ResourceTag resourceTag, boolean keyValueOnly);
+
Site2SiteVpnGatewayResponse createSite2SiteVpnGatewayResponse(Site2SiteVpnGateway result);
-
+
/**
* @param offering
@@ -357,7 +360,7 @@ public interface ResponseGenerator {
Site2SiteVpnConnectionResponse createSite2SiteVpnConnectionResponse(Site2SiteVpnConnection result);
CounterResponse createCounterResponse(Counter ctr);
-
+
ConditionResponse createConditionResponse(Condition cndn);
AutoScalePolicyResponse createAutoScalePolicyResponse(AutoScalePolicy policy);
@@ -366,4 +369,7 @@ public interface ResponseGenerator {
AutoScaleVmGroupResponse createAutoScaleVmGroupResponse(AutoScaleVmGroup vmGroup);
+ GuestOSResponse createGuestOSResponse(GuestOS os);
+
+ SnapshotScheduleResponse createSnapshotScheduleResponse(SnapshotSchedule sched);
}
diff --git a/api/src/com/cloud/api/ResponseObject.java b/api/src/org/apache/cloudstack/api/ResponseObject.java
similarity index 88%
rename from api/src/com/cloud/api/ResponseObject.java
rename to api/src/org/apache/cloudstack/api/ResponseObject.java
index 2d08fb975b5..c8bd45727c9 100644
--- a/api/src/com/cloud/api/ResponseObject.java
+++ b/api/src/org/apache/cloudstack/api/ResponseObject.java
@@ -14,64 +14,65 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
+package org.apache.cloudstack.api;
public interface ResponseObject {
/**
* Get the name of the API response
- *
+ *
* @return the name of the API response
*/
String getResponseName();
/**
* Set the name of the API response
- *
+ *
* @param name
*/
void setResponseName(String name);
/**
* Get the name of the API object
- *
+ *
* @return the name of the API object
*/
String getObjectName();
/**
- *
+ *
* @param name
*/
void setObjectName(String name);
/**
- * Returns the object Id
+ * Returns the object UUid
*/
- Long getObjectId();
+ String getObjectId();
/**
* Returns the job id
- *
+ *
* @return
*/
- Long getJobId();
+ String getJobId();
+
/**
* Sets the job id
- *
+ *
* @param jobId
*/
- void setJobId(Long jobId);
+ void setJobId(String jobId);
/**
* Returns the job status
- *
+ *
* @return
*/
Integer getJobStatus();
/**
- *
+ *
* @param jobStatus
*/
void setJobStatus(Integer jobStatus);
diff --git a/api/src/com/cloud/api/ServerApiException.java b/api/src/org/apache/cloudstack/api/ServerApiException.java
similarity index 88%
rename from api/src/com/cloud/api/ServerApiException.java
rename to api/src/org/apache/cloudstack/api/ServerApiException.java
index 721cf13d353..1f57b74745d 100644
--- a/api/src/com/cloud/api/ServerApiException.java
+++ b/api/src/org/apache/cloudstack/api/ServerApiException.java
@@ -14,12 +14,11 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api;
-import com.cloud.utils.IdentityProxy;
-import com.cloud.utils.exception.RuntimeCloudException;
+package org.apache.cloudstack.api;
+import com.cloud.utils.exception.CloudRuntimeException;
@SuppressWarnings("serial")
-public class ServerApiException extends RuntimeCloudException {
+public class ServerApiException extends CloudRuntimeException {
private int _errorCode;
private String _description;
@@ -48,5 +47,5 @@ public class ServerApiException extends RuntimeCloudException {
public void setDescription(String description) {
_description = description;
}
-
+
}
diff --git a/api/src/org/apache/cloudstack/api/Validate.java b/api/src/org/apache/cloudstack/api/Validate.java
new file mode 100644
index 00000000000..deedda62273
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/Validate.java
@@ -0,0 +1,30 @@
+// 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 org.apache.cloudstack.api;
+
+import static java.lang.annotation.ElementType.FIELD;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ FIELD })
+public @interface Validate {
+ Class>[] validators() default Object.class;
+ String description() default "";
+}
diff --git a/api/src/com/cloud/api/commands/CreateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
old mode 100755
new mode 100644
similarity index 83%
rename from api/src/com/cloud/api/commands/CreateAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
index 00e87761c5d..f93787b7bc5
--- a/api/src/com/cloud/api/commands/CreateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
@@ -14,26 +14,23 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
import java.util.Collection;
import java.util.Map;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.AccountResponse;
-import com.cloud.api.response.UserResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.UserResponse;
import com.cloud.user.Account;
import com.cloud.user.UserAccount;
import com.cloud.user.UserContext;
-@Implementation(description="Creates an account", responseObject=UserResponse.class)
+@APICommand(name = "createAccount", description="Creates an account", responseObject=UserResponse.class)
public class CreateAccountCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(CreateAccountCmd.class.getName());
@@ -49,8 +46,8 @@ public class CreateAccountCmd extends BaseCmd {
@Parameter(name=ApiConstants.ACCOUNT_TYPE, type=CommandType.SHORT, required=true, description="Type of the account. Specify 0 for user, 1 for root admin, and 2 for domain admin")
private Short accountType;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Creates the user under the specified domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="Creates the user under the specified domain.")
private Long domainId;
@Parameter(name=ApiConstants.EMAIL, type=CommandType.STRING, required=true, description="email")
@@ -70,12 +67,13 @@ public class CreateAccountCmd extends BaseCmd {
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="Unique username.")
private String userName;
-
+
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the account's networks")
private String networkDomain;
- @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
+ @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
private Map details;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -115,19 +113,19 @@ public class CreateAccountCmd extends BaseCmd {
public String getUsername() {
return userName;
}
-
+
public String getNetworkDomain() {
return networkDomain;
- }
-
+ }
+
public Map getDetails() {
- if (details == null || details.isEmpty()) {
- return null;
- }
-
- Collection paramsCollection = details.values();
- Map params = (Map) (paramsCollection.toArray())[0];
- return params;
+ if (details == null || details.isEmpty()) {
+ return null;
+ }
+
+ Collection paramsCollection = details.values();
+ Map params = (Map) (paramsCollection.toArray())[0];
+ return params;
}
/////////////////////////////////////////////////////
@@ -138,12 +136,12 @@ public class CreateAccountCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Account Name: "+getAccountName()+", Domain Id:"+getDomainId());
@@ -156,4 +154,4 @@ public class CreateAccountCmd extends BaseCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to create a user account");
}
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/api/commands/DeleteAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
old mode 100755
new mode 100644
similarity index 78%
rename from api/src/com/cloud/api/commands/DeleteAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
index a7bfca78359..a1d9b6419cb
--- a/api/src/com/cloud/api/commands/DeleteAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
@@ -14,39 +14,33 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.User;
import com.cloud.user.UserContext;
-@Implementation(description="Deletes a account, and all users associated with this account", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteAccount", description="Deletes a account, and all users associated with this account", responseObject=SuccessResponse.class)
public class DeleteAccountCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName());
- private static final String s_name = "deleteaccountresponse";
+ public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName());
+ private static final String s_name = "deleteaccountresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
-
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="Account id")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=AccountResponse.class,
+ required=true, description="Account id")
private Long id;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -55,17 +49,16 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
return id;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
- public static String getStaticName() {
- return s_name;
- }
-
+ public static String getStaticName() {
+ return s_name;
+ }
+
@Override
- public String getCommandName() {
+ public String getCommandName() {
return s_name;
}
@@ -89,7 +82,7 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
User user = _responseGenerator.findUserById(getId());
return (user != null ? ("deleting User " + user.getUsername() + " (id: " + user.getId() + ") and accountId = " + user.getAccountId()) : "user delete, but this user does not exist in the system");
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Account Id: "+getId());
@@ -101,7 +94,7 @@ public class DeleteAccountCmd extends BaseAsyncCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete user account and all corresponding users");
}
}
-
+
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.Account;
diff --git a/api/src/com/cloud/api/commands/DisableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
similarity index 78%
rename from api/src/com/cloud/api/commands/DisableAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
index 7c5e5e38331..f0a5e7078b7 100644
--- a/api/src/com/cloud/api/commands/DisableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
@@ -14,18 +14,15 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.AccountResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
@@ -33,23 +30,23 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Disables an account", responseObject=AccountResponse.class)
+@APICommand(name = "disableAccount", description="Disables an account", responseObject=AccountResponse.class)
public class DisableAccountCmd extends BaseAsyncCmd {
- public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName());
+ public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName());
private static final String s_name = "disableaccountresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="Account id")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=AccountResponse.class,
+ description="Account id")
private Long id;
-
+
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Disables specified account.")
private String accountName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Disables specified account in this domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="Disables specified account in this domain.")
private Long domainId;
@Parameter(name=ApiConstants.LOCK, type=CommandType.BOOLEAN, required=true, description="If true, only lock the account; else disable the account")
@@ -62,7 +59,7 @@ public class DisableAccountCmd extends BaseAsyncCmd {
public Long getId() {
return id;
}
-
+
public String getAccountName() {
return accountName;
}
@@ -91,7 +88,7 @@ public class DisableAccountCmd extends BaseAsyncCmd {
if (account != null) {
return account.getAccountId();
}
-
+
account = _accountService.getActiveAccountByName(getAccountName(), getDomainId());
if (account != null) {
return account.getAccountId();
@@ -108,11 +105,11 @@ public class DisableAccountCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException{
UserContext.current().setEventDetails("Account Name: "+getAccountName()+", Domain Id:"+getDomainId());
- Account result = null;
- if(lockRequested)
- result = _accountService.lockAccount(getAccountName(), getDomainId(), getId());
- else
- result = _accountService.disableAccount(getAccountName(), getDomainId(), getId());
+ Account result = null;
+ if(lockRequested)
+ result = _accountService.lockAccount(getAccountName(), getDomainId(), getId());
+ else
+ result = _accountService.disableAccount(getAccountName(), getDomainId(), getId());
if (result != null){
AccountResponse response = _responseGenerator.createAccountResponse(result);
response.setResponseName(getCommandName());
@@ -121,7 +118,7 @@ public class DisableAccountCmd extends BaseAsyncCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, lockRequested == true ? "Failed to lock account" : "Failed to disable account" );
}
}
-
+
@Override
public AsyncJob.Type getInstanceType() {
return AsyncJob.Type.Account;
diff --git a/api/src/com/cloud/api/commands/EnableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
similarity index 78%
rename from api/src/com/cloud/api/commands/EnableAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
index 576f9354892..4aa1e4fc1b9 100644
--- a/api/src/com/cloud/api/commands/EnableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
@@ -14,20 +14,21 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.AccountResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+
import com.cloud.user.Account;
-@Implementation(description="Enables an account", responseObject=AccountResponse.class)
+@APICommand(name = "enableAccount", description="Enables an account", responseObject=AccountResponse.class)
public class EnableAccountCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(EnableAccountCmd.class.getName());
private static final String s_name = "enableaccountresponse";
@@ -35,15 +36,15 @@ public class EnableAccountCmd extends BaseCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="Account id")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=AccountResponse.class,
+ description="Account id")
private Long id;
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="Enables specified account.")
private String accountName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="Enables specified account in this domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="Enables specified account in this domain.")
private Long domainId;
/////////////////////////////////////////////////////
@@ -53,7 +54,7 @@ public class EnableAccountCmd extends BaseCmd {
public Long getId() {
return id;
}
-
+
public String getAccountName() {
return accountName;
}
@@ -70,14 +71,14 @@ public class EnableAccountCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Account account = _entityMgr.findById(Account.class, getId());
if (account != null) {
return account.getAccountId();
}
-
+
account = _accountService.getActiveAccountByName(getAccountName(), getDomainId());
if (account != null) {
return account.getAccountId();
diff --git a/api/src/com/cloud/api/commands/LockAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
similarity index 81%
rename from api/src/com/cloud/api/commands/LockAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
index 8c47dbc9d83..34e9e53b84d 100644
--- a/api/src/com/cloud/api/commands/LockAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
@@ -14,19 +14,20 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.AccountResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+
import com.cloud.user.Account;
-@Implementation(description="Locks an account", responseObject=AccountResponse.class)
+@APICommand(name = "lockAccount", description="Locks an account", responseObject=AccountResponse.class)
public class LockAccountCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName());
@@ -39,8 +40,8 @@ public class LockAccountCmd extends BaseCmd {
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, required=true, description="Locks the specified account.")
private String accountName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, required=true, description="Locks the specified account on this domain.")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ required=true, description="Locks the specified account on this domain.")
private Long domainId;
/////////////////////////////////////////////////////
@@ -58,12 +59,12 @@ public class LockAccountCmd extends BaseCmd {
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
-
+
@Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Account account = _accountService.getActiveAccountByName(getAccountName(), getDomainId());
diff --git a/api/src/com/cloud/api/commands/UpdateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
old mode 100755
new mode 100644
similarity index 74%
rename from api/src/com/cloud/api/commands/UpdateAccountCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
index 8e3ef4364b3..f1340464d6b
--- a/api/src/com/cloud/api/commands/UpdateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
@@ -14,49 +14,50 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.account;
import java.util.Collection;
import java.util.Map;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.AccountResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.DomainResponse;
+
import com.cloud.user.Account;
-@Implementation(description="Updates account information for the authenticated user", responseObject=AccountResponse.class)
+@APICommand(name = "updateAccount", description="Updates account information for the authenticated user", responseObject=AccountResponse.class)
public class UpdateAccountCmd extends BaseCmd{
public static final Logger s_logger = Logger.getLogger(UpdateAccountCmd.class.getName());
private static final String s_name = "updateaccountresponse";
-
+
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="account")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="Account id")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=AccountResponse.class,
+ description="Account id")
private Long id;
-
+
@Parameter(name=ApiConstants.ACCOUNT, type=CommandType.STRING, description="the current account name")
private String accountName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.LONG, description="the ID of the domain where the account exists")
+ @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="the ID of the domain where the account exists")
private Long domainId;
@Parameter(name=ApiConstants.NEW_NAME, type=CommandType.STRING, required=true, description="new name for the account")
private String newName;
-
+
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the account's networks; empty string will update domainName with NULL value")
private String networkDomain;
-
- @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
+
+ @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
private Map details;
/////////////////////////////////////////////////////
@@ -66,7 +67,7 @@ public class UpdateAccountCmd extends BaseCmd{
public Long getId() {
return id;
}
-
+
public String getAccountName() {
return accountName;
}
@@ -78,19 +79,19 @@ public class UpdateAccountCmd extends BaseCmd{
public String getNewName() {
return newName;
}
-
+
public String getNetworkDomain() {
return networkDomain;
}
-
+
public Map getDetails() {
- if (details == null || details.isEmpty()) {
- return null;
- }
-
- Collection paramsCollection = details.values();
- Map params = (Map) (paramsCollection.toArray())[0];
- return params;
+ if (details == null || details.isEmpty()) {
+ return null;
+ }
+
+ Collection paramsCollection = details.values();
+ Map params = (Map) (paramsCollection.toArray())[0];
+ return params;
}
/////////////////////////////////////////////////////
@@ -101,7 +102,7 @@ public class UpdateAccountCmd extends BaseCmd{
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
Account account = _entityMgr.findById(Account.class, getId());
@@ -115,7 +116,7 @@ public class UpdateAccountCmd extends BaseCmd{
return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
-
+
@Override
public void execute(){
Account result = _accountService.updateAccount(this);
diff --git a/api/src/com/cloud/api/commands/CreateCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
similarity index 85%
rename from api/src/com/cloud/api/commands/CreateCounterCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
index cc7d78cc31b..a119d0f44bf 100644
--- a/api/src/com/cloud/api/commands/CreateCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
@@ -15,23 +15,23 @@
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.autoscale;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCreateCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.CounterResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCreateCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.CounterResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.Counter;
import com.cloud.user.Account;
-@Implementation(description = "Adds metric counter", responseObject = CounterResponse.class)
+@APICommand(name = "createCounter", description = "Adds metric counter", responseObject = CounterResponse.class)
public class CreateCounterCmd extends BaseAsyncCreateCmd {
public static final Logger s_logger = Logger.getLogger(CreateCounterCmd.class.getName());
private static final String s_name = "counterresponse";
@@ -81,6 +81,7 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
if (ctr != null) {
this.setEntityId(ctr.getId());
+ this.setEntityUuid(ctr.getUuid());
CounterResponse response = _responseGenerator.createCounterResponse(ctr);
response.setResponseName(getCommandName());
this.setResponseObject(response);
@@ -113,8 +114,5 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
return Account.ACCOUNT_ID_SYSTEM;
}
- @Override
- public String getEntityTable() {
- return "counter";
- }
+
}
diff --git a/api/src/com/cloud/api/commands/DeleteCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
similarity index 80%
rename from api/src/com/cloud/api/commands/DeleteCounterCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
index e9b92ef28ac..9304eeb7b93 100644
--- a/api/src/com/cloud/api/commands/DeleteCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
@@ -15,24 +15,24 @@
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.autoscale;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.CounterResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceInUseException;
import com.cloud.user.Account;
-@Implementation(description = "Deletes a counter", responseObject = SuccessResponse.class)
+@APICommand(name = "deleteCounter", description = "Deletes a counter", responseObject = SuccessResponse.class)
public class DeleteCounterCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteCounterCmd.class.getName());
private static final String s_name = "deletecounterresponse";
@@ -41,8 +41,8 @@ public class DeleteCounterCmd extends BaseAsyncCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
- @IdentityMapper(entityTableName = "counter")
- @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the ID of the counter")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=CounterResponse.class,
+ required=true, description="the ID of the counter")
private Long id;
// ///////////////////////////////////////////////////
diff --git a/api/src/com/cloud/api/commands/AddClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
old mode 100755
new mode 100644
similarity index 80%
rename from api/src/com/cloud/api/commands/AddClusterCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
index 0e10f23455c..28bf72ddba7
--- a/api/src/com/cloud/api/commands/AddClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
@@ -15,41 +15,39 @@
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList;
import java.util.List;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
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")
+@APICommand(name = "addCluster", 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;
+
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
+ required=true, description="the Pod ID for the host")
private Long podId;
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=false, description="the URL")
@@ -58,20 +56,19 @@ public class AddClusterCmd extends BaseCmd {
@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.UUID, entityType=ZoneResponse.class,
+ required=true, description="the Zone ID for the cluster")
+ private Long zoneId;
- @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")
+ @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;
@@ -80,7 +77,7 @@ public class AddClusterCmd extends BaseCmd {
@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;
}
@@ -92,90 +89,90 @@ public class AddClusterCmd extends BaseCmd {
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 response = new ListResponse();
- List clusterResponses = new ArrayList();
- 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);
+
+ 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 response = new ListResponse();
+ List clusterResponses = new ArrayList();
+ 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());
+ for (String proxyObj : ex.getIdProxyList()) {
+ e.addProxyObject(proxyObj);
}
throw e;
- }
- }
+ }
+ }
}
diff --git a/api/src/com/cloud/api/commands/DeleteClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
old mode 100755
new mode 100644
similarity index 77%
rename from api/src/com/cloud/api/commands/DeleteClusterCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
index 2e08b1c9100..f0b40cb6b03
--- a/api/src/com/cloud/api/commands/DeleteClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
@@ -14,21 +14,20 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.cluster;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.user.Account;
-
-@Implementation(description="Deletes a cluster.", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteCluster", description="Deletes a cluster.", responseObject=SuccessResponse.class)
public class DeleteClusterCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(DeleteClusterCmd.class.getName());
@@ -38,11 +37,10 @@ public class DeleteClusterCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="cluster")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the cluster ID")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
+ required=true, description="the cluster ID")
private Long id;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -51,7 +49,6 @@ public class DeleteClusterCmd extends BaseCmd {
return id;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -60,12 +57,12 @@ public class DeleteClusterCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
boolean result = _resourceService.deleteCluster(this);
diff --git a/api/src/com/cloud/api/commands/ListClustersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
old mode 100755
new mode 100644
similarity index 76%
rename from api/src/com/cloud/api/commands/ListClustersCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
index e571bf52e8e..95ab0bff4f3
--- a/api/src/com/cloud/api/commands/ListClustersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
@@ -14,24 +14,27 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList;
import java.util.List;
+import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;
+import org.apache.cloudstack.api.response.PodResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.ClusterResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
import com.cloud.org.Cluster;
import com.cloud.utils.Pair;
-@Implementation(description="Lists clusters.", responseObject=ClusterResponse.class)
+@APICommand(name = "listClusters", description="Lists clusters.", responseObject=ClusterResponse.class)
public class ListClustersCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
@@ -41,19 +44,19 @@ public class ListClustersCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="cluster")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="lists clusters by the cluster ID")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
+ description="lists clusters by the cluster ID")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="lists clusters by the cluster name")
private String clusterName;
- @IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="lists clusters by Pod ID")
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
+ description="lists clusters by Pod ID")
private Long podId;
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="lists clusters by Zone ID")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
+ description="lists clusters by Zone ID")
private Long zoneId;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="lists clusters by hypervisor type")
@@ -61,13 +64,13 @@ public class ListClustersCmd extends BaseListCmd {
@Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, description="lists clusters by cluster type")
private String clusterType;
-
+
@Parameter(name=ApiConstants.ALLOCATION_STATE, type=CommandType.STRING, description="lists clusters by allocation state")
private String allocationState;
-
+
@Parameter(name=ApiConstants.MANAGED_STATE, type=CommandType.STRING, description="whether this cluster is managed by cloudstack")
private String managedState;
-
+
@Parameter(name=ApiConstants.SHOW_CAPACITIES, type=CommandType.BOOLEAN, description="flag to display the capacity of the clusters")
private Boolean showCapacities;
@@ -90,19 +93,19 @@ public class ListClustersCmd extends BaseListCmd {
public Long getZoneId() {
return zoneId;
}
-
+
public String getHypervisorType() {
- return hypervisorType;
+ return hypervisorType;
}
-
+
public String getClusterType() {
- return clusterType;
+ return clusterType;
}
public String getAllocationState() {
- return allocationState;
+ return allocationState;
}
-
+
public String getManagedstate() {
return managedState;
@@ -114,18 +117,18 @@ public class ListClustersCmd extends BaseListCmd {
public Boolean getShowCapacities() {
- return showCapacities;
- }
+ return showCapacities;
+ }
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
- @Override
+ @Override
public String getCommandName() {
return s_name;
}
-
+
@Override
public void execute(){
Pair, Integer> result = _mgr.searchForClusters(this);
diff --git a/api/src/com/cloud/api/commands/UpdateClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
old mode 100755
new mode 100644
similarity index 79%
rename from api/src/com/cloud/api/commands/UpdateClusterCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
index 9a2d66865b4..03b43def3ca
--- a/api/src/com/cloud/api/commands/UpdateClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
@@ -14,46 +14,45 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.cluster;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ClusterResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ClusterResponse;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.org.Cluster;
import com.cloud.user.Account;
-@Implementation(description="Updates an existing cluster", responseObject=ClusterResponse.class)
+@APICommand(name = "updateCluster", description="Updates an existing cluster", responseObject=ClusterResponse.class)
public class UpdateClusterCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(AddClusterCmd.class.getName());
private static final String s_name = "updateclusterresponse";
- @IdentityMapper(entityTableName="cluster")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the ID of the Cluster")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ClusterResponse.class,
+ required=true, description="the ID of the Cluster")
private Long id;
-
+
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name")
private String clusterName;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="hypervisor type of the cluster")
private String hypervisor;
-
+
@Parameter(name=ApiConstants.CLUSTER_TYPE, type=CommandType.STRING, description="hypervisor type of the cluster")
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.MANAGED_STATE, type=CommandType.STRING, description="whether this cluster is managed by cloudstack")
private String managedState;
-
+
public String getClusterName() {
return clusterName;
}
@@ -63,34 +62,34 @@ public class UpdateClusterCmd extends BaseCmd {
}
public String getHypervisor() {
- return hypervisor;
+ return hypervisor;
}
-
+
@Override
public String getCommandName() {
- return s_name;
+ return s_name;
}
-
+
public String getClusterType() {
- return clusterType;
+ return clusterType;
}
-
+
public void setClusterType(String type) {
- this.clusterType = type;
+ this.clusterType = type;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
public String getAllocationState() {
- return allocationState;
+ return allocationState;
}
-
+
public void setAllocationState(String allocationState) {
- this.allocationState = allocationState;
- }
+ this.allocationState = allocationState;
+ }
public String getManagedstate() {
return managedState;
@@ -102,11 +101,11 @@ public class UpdateClusterCmd extends BaseCmd {
@Override
public void execute(){
- Cluster cluster = _resourceService.getCluster(getId());
+ Cluster cluster = _resourceService.getCluster(getId());
if (cluster == null) {
throw new InvalidParameterValueException("Unable to find the cluster by id=" + getId());
}
-
+
Cluster result = _resourceService.updateCluster(cluster, getClusterType(), getHypervisor(), getAllocationState(), getManagedstate());
if (result != null) {
ClusterResponse clusterResponse = _responseGenerator.createClusterResponse(cluster, false);
diff --git a/api/src/com/cloud/api/commands/ListCfgsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
similarity index 86%
rename from api/src/com/cloud/api/commands/ListCfgsByCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
index 6e07ca9f519..16010fdb495 100644
--- a/api/src/com/cloud/api/commands/ListCfgsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
@@ -14,23 +14,23 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.config;
import java.util.ArrayList;
import java.util.List;
+import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.ConfigurationResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.configuration.Configuration;
import com.cloud.utils.Pair;
-@Implementation(description = "Lists all configurations.", responseObject = ConfigurationResponse.class)
+@APICommand(name = "listConfigurations", description = "Lists all configurations.", responseObject = ConfigurationResponse.class)
public class ListCfgsByCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListCfgsByCmd.class.getName());
diff --git a/api/src/com/cloud/api/commands/ListHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
similarity index 82%
rename from api/src/com/cloud/api/commands/ListHypervisorCapabilitiesCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
index 9afd3eb2903..b69e9eab597 100644
--- a/api/src/com/cloud/api/commands/ListHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
@@ -14,25 +14,24 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.config;
import java.util.ArrayList;
import java.util.List;
+import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.HypervisorCapabilitiesResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
+import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.utils.Pair;
-@Implementation(description="Lists all hypervisor capabilities.", responseObject=HypervisorCapabilitiesResponse.class, since="3.0.0")
+@APICommand(name = "listHypervisorCapabilities", description="Lists all hypervisor capabilities.", responseObject=HypervisorCapabilitiesResponse.class, since="3.0.0")
public class ListHypervisorCapabilitiesCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListHypervisorCapabilitiesCmd.class.getName());
@@ -42,14 +41,13 @@ public class ListHypervisorCapabilitiesCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="hypervisor_capabilities")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the hypervisor capability")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=HypervisorCapabilitiesResponse.class,
+ description="ID of the hypervisor capability")
private Long id;
@Parameter(name=ApiConstants.HYPERVISOR, type=CommandType.STRING, description="the hypervisor for which to restrict the search")
private String hypervisor;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
diff --git a/api/src/com/cloud/api/commands/UpdateCfgCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
similarity index 84%
rename from api/src/com/cloud/api/commands/UpdateCfgCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
index f2d9fe92cac..79693e76f84 100644
--- a/api/src/com/cloud/api/commands/UpdateCfgCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
@@ -14,20 +14,20 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.config;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
import com.cloud.configuration.Configuration;
import com.cloud.user.Account;
-@Implementation(description="Updates a configuration.", responseObject=ConfigurationResponse.class)
+@APICommand(name = "updateConfiguration", description="Updates a configuration.", responseObject=ConfigurationResponse.class)
public class UpdateCfgCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateCfgCmd.class.getName());
private static final String s_name = "updateconfigurationresponse";
@@ -62,12 +62,12 @@ public class UpdateCfgCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
Configuration cfg = _configService.updateConfiguration(this);
diff --git a/api/src/com/cloud/api/commands/UpdateHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
similarity index 80%
rename from api/src/com/cloud/api/commands/UpdateHypervisorCapabilitiesCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
index 3173775891a..82880c1fbae 100644
--- a/api/src/com/cloud/api/commands/UpdateHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
@@ -14,25 +14,21 @@
// 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.UUID;
+package org.apache.cloudstack.api.command.admin.config;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HypervisorCapabilitiesResponse;
-import com.cloud.api.response.ServiceOfferingResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.HypervisorCapabilitiesResponse;
+import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.user.Account;
-
-@Implementation(description="Updates a hypervisor capabilities.", responseObject=ServiceOfferingResponse.class, since="3.0.0")
+@APICommand(name = "updateHypervisorCapabilities", description="Updates a hypervisor capabilities.", responseObject=ServiceOfferingResponse.class, since="3.0.0")
public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateHypervisorCapabilitiesCmd.class.getName());
private static final String s_name = "updatehypervisorcapabilitiesresponse";
@@ -41,8 +37,8 @@ public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="hypervisor_capabilities")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="ID of the hypervisor capability")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=HypervisorCapabilitiesResponse.class,
+ description="ID of the hypervisor capability")
private Long id;
@Parameter(name=ApiConstants.SECURITY_GROUP_EANBLED, type=CommandType.BOOLEAN, description="set true to enable security group for this hypervisor.")
@@ -67,8 +63,6 @@ public class UpdateHypervisorCapabilitiesCmd extends BaseCmd {
return maxGuestsLimit;
}
-
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
diff --git a/api/src/com/cloud/api/commands/CreateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
similarity index 84%
rename from api/src/com/cloud/api/commands/CreateDomainCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
index 92ee7ecefe9..0e6ae32583b 100644
--- a/api/src/com/cloud/api/commands/CreateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
@@ -14,22 +14,18 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.domain;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.DomainResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.DomainResponse;
import com.cloud.domain.Domain;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Creates a domain", responseObject=DomainResponse.class)
+@APICommand(name = "createDomain", description="Creates a domain", responseObject=DomainResponse.class)
public class CreateDomainCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(CreateDomainCmd.class.getName());
@@ -42,8 +38,8 @@ public class CreateDomainCmd extends BaseCmd {
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=true, description="creates domain with this name")
private String domainName;
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.PARENT_DOMAIN_ID, type=CommandType.LONG, description="assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.")
+ @Parameter(name=ApiConstants.PARENT_DOMAIN_ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="assigns new domain a parent domain by domain ID of the parent. If no parent domain is specied, the ROOT domain is assumed.")
private Long parentDomainId;
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for networks in the domain")
@@ -63,7 +59,7 @@ public class CreateDomainCmd extends BaseCmd {
public String getNetworkDomain() {
return networkDomain;
- }
+ }
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
@@ -73,12 +69,12 @@ public class CreateDomainCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Domain Name: "+getDomainName()+((getParentDomainId()!=null)?", Parent DomainId :"+getParentDomainId():""));
diff --git a/api/src/com/cloud/api/commands/DeleteDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
similarity index 84%
rename from api/src/com/cloud/api/commands/DeleteDomainCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
index 3908256a192..7009e70ca32 100644
--- a/api/src/com/cloud/api/commands/DeleteDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
@@ -14,24 +14,20 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.domain;
+import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.domain.Domain;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Deletes a specified domain", responseObject=SuccessResponse.class)
+@APICommand(name = "deleteDomain", description="Deletes a specified domain", responseObject=SuccessResponse.class)
public class DeleteDomainCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(DeleteDomainCmd.class.getName());
private static final String s_name = "deletedomainresponse";
@@ -40,8 +36,8 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to delete")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ required=true, description="ID of domain to delete")
private Long id;
@Parameter(name=ApiConstants.CLEANUP, type=CommandType.BOOLEAN, description="true if all domain resources (child domains, accounts) have to be cleaned up, false otherwise")
@@ -88,7 +84,7 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "deleting domain: " + getId();
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Domain Id: "+getId());
diff --git a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
similarity index 81%
rename from api/src/com/cloud/api/commands/ListDomainChildrenCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
index bb0dd7f7e83..4bc05d1c0f9 100644
--- a/api/src/com/cloud/api/commands/ListDomainChildrenCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
@@ -14,26 +14,25 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.domain;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
-@Implementation(description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
+@APICommand(name = "listDomainChildren", description="Lists all children domains belonging to a specified domain", responseObject=DomainResponse.class)
public class ListDomainChildrenCmd extends BaseListCmd {
- public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
+ public static final Logger s_logger = Logger.getLogger(ListDomainChildrenCmd.class.getName());
private static final String s_name = "listdomainchildrenresponse";
@@ -41,16 +40,16 @@ public class ListDomainChildrenCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="list children domain by parent domain ID.")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="list children domain by parent domain ID.")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="list children domains by name")
private String domainName;
-
+
@Parameter(name=ApiConstants.IS_RECURSIVE, type=CommandType.BOOLEAN, description="to return the entire tree, use the value \"true\". To return the first level children, use the value \"false\".")
private Boolean recursive;
-
+
@Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
private Boolean listAll;
@@ -65,11 +64,11 @@ public class ListDomainChildrenCmd extends BaseListCmd {
public String getDomainName() {
return domainName;
}
-
+
public boolean listAll() {
return listAll == null ? false : listAll;
}
-
+
public boolean isRecursive() {
return recursive == null ? false : recursive;
}
@@ -82,7 +81,7 @@ public class ListDomainChildrenCmd extends BaseListCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public void execute(){
Pair, Integer> result = _domainService.searchForDomainChildren(this);
diff --git a/api/src/com/cloud/api/commands/ListDomainsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
similarity index 81%
rename from api/src/com/cloud/api/commands/ListDomainsCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
index 93d1570d6df..9b9e200abcd 100644
--- a/api/src/com/cloud/api/commands/ListDomainsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
@@ -14,35 +14,34 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.domain;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.DomainResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
-@Implementation(description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
+@APICommand(name = "listDomains", description="Lists domains and provides detailed information for listed domains", responseObject=DomainResponse.class)
public class ListDomainsCmd extends BaseListCmd {
- public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
-
+ public static final Logger s_logger = Logger.getLogger(ListDomainsCmd.class.getName());
+
private static final String s_name = "listdomainsresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="List domain by domain ID.")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ description="List domain by domain ID.")
private Long id;
@Parameter(name=ApiConstants.LEVEL, type=CommandType.INTEGER, description="List domains by domain level.")
@@ -50,7 +49,7 @@ public class ListDomainsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="List domain by domain name.")
private String domainName;
-
+
@Parameter(name=ApiConstants.LIST_ALL, type=CommandType.BOOLEAN, description="If set to false, list only resources belonging to the command's caller; if set to true - list resources that the caller is authorized to see. Default value is false")
private Boolean listAll;
@@ -69,7 +68,7 @@ public class ListDomainsCmd extends BaseListCmd {
public String getDomainName() {
return domainName;
}
-
+
public boolean listAll() {
return listAll == null ? false : listAll;
}
diff --git a/api/src/com/cloud/api/commands/UpdateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
similarity index 83%
rename from api/src/com/cloud/api/commands/UpdateDomainCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
index 739ae87ca05..cc5926cace1 100644
--- a/api/src/com/cloud/api/commands/UpdateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
@@ -14,22 +14,18 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.domain;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.DomainResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.DomainResponse;
import com.cloud.domain.Domain;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Updates a domain with a new name", responseObject=DomainResponse.class)
+@APICommand(name = "updateDomain", description="Updates a domain with a new name", responseObject=DomainResponse.class)
public class UpdateDomainCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateDomainCmd.class.getName());
private static final String s_name = "updatedomainresponse";
@@ -38,13 +34,13 @@ public class UpdateDomainCmd extends BaseCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="domain")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="ID of domain to update")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=DomainResponse.class,
+ required=true, description="ID of domain to update")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="updates domain with this name")
private String domainName;
-
+
@Parameter(name=ApiConstants.NETWORK_DOMAIN, type=CommandType.STRING, description="Network domain for the domain's networks; empty string will update domainName with NULL value")
private String networkDomain;
@@ -59,7 +55,7 @@ public class UpdateDomainCmd extends BaseCmd {
public String getDomainName() {
return domainName;
}
-
+
public String getNetworkDomain() {
return networkDomain;
}
@@ -72,12 +68,12 @@ public class UpdateDomainCmd extends BaseCmd {
public String getCommandName() {
return s_name;
}
-
+
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
-
+
@Override
public void execute(){
UserContext.current().setEventDetails("Domain Id: "+getId());
diff --git a/api/src/com/cloud/api/commands/AddHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
old mode 100755
new mode 100644
similarity index 79%
rename from api/src/com/cloud/api/commands/AddHostCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
index a4646a26904..0a0a98c1c45
--- a/api/src/com/cloud/api/commands/AddHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
@@ -14,37 +14,39 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.host;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.exception.DiscoveryException;
import com.cloud.host.Host;
import com.cloud.user.Account;
-@Implementation(description="Adds a new host.", responseObject=HostResponse.class)
+@APICommand(name = "addHost", description="Adds a new host.", responseObject=HostResponse.class)
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 /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="cluster")
- @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="the cluster ID for the host")
+ @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType=ClusterResponse.class,
+ description="the cluster ID for the host")
private Long clusterId;
@Parameter(name=ApiConstants.CLUSTER_NAME, type=CommandType.STRING, description="the cluster name for the host")
@@ -53,8 +55,8 @@ public class AddHostCmd extends BaseCmd {
@Parameter(name=ApiConstants.PASSWORD, type=CommandType.STRING, required=true, description="the password for the host")
private String password;
- @IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, required=true, type=CommandType.LONG, description="the Pod ID for the host")
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType=PodResponse.class,
+ required=true, description="the Pod ID for the host")
private Long podId;
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the host URL")
@@ -63,13 +65,13 @@ public class AddHostCmd extends BaseCmd {
@Parameter(name=ApiConstants.USERNAME, type=CommandType.STRING, required=true, description="the username for the host")
private String username;
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, required=true, description="the Zone ID for the host")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
+ 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 +109,33 @@ public class AddHostCmd extends BaseCmd {
public Long getZoneId() {
return zoneId;
}
-
+
public String getHypervisor() {
- return hypervisor;
+ return hypervisor;
}
-
+
public List 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 +153,7 @@ public class AddHostCmd extends BaseCmd {
response.setResponses(hostResponses);
response.setResponseName(getCommandName());
-
+
this.setResponseObject(response);
} catch (DiscoveryException ex) {
s_logger.warn("Exception: ", ex);
diff --git a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
similarity index 84%
rename from api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
index 04f84c148f2..579e286f884 100644
--- a/api/src/com/cloud/api/commands/AddSecondaryStorageCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
@@ -14,28 +14,25 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.host;
import java.util.List;
+import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.exception.DiscoveryException;
import com.cloud.host.Host;
import com.cloud.user.Account;
-@Implementation(description="Adds secondary storage.", responseObject=HostResponse.class)
+@APICommand(name = "addSecondaryStorage", description="Adds secondary storage.", responseObject=HostResponse.class)
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 /////////////////////
/////////////////////////////////////////////////////
@@ -43,8 +40,8 @@ public class AddSecondaryStorageCmd extends BaseCmd {
@Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the secondary storage")
private String url;
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the secondary storage")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
+ description="the Zone ID for the secondary storage")
private Long zoneId;
/////////////////////////////////////////////////////
@@ -65,14 +62,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 {
diff --git a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
similarity index 80%
rename from api/src/com/cloud/api/commands/CancelMaintenanceCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
index def0c2d75cd..93dca9140f9 100644
--- a/api/src/com/cloud/api/commands/CancelMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
@@ -14,25 +14,24 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.host;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseAsyncCmd;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.HostResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.HostResponse;
import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.host.Host;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-@Implementation(description="Cancels host maintenance.", responseObject=HostResponse.class)
+@APICommand(name = "cancelHostMaintenance", description="Cancels host maintenance.", responseObject=HostResponse.class)
public class CancelMaintenanceCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(CancelMaintenanceCmd.class.getName());
@@ -42,11 +41,10 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="host")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="the host ID")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=HostResponse.class,
+ required=true, description="the host ID")
private Long id;
-
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -55,7 +53,6 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
return id;
}
-
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -64,9 +61,9 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
public String getCommandName() {
return s_name;
}
-
+
public static String getResultObjectName() {
- return "host";
+ return "host";
}
@Override
@@ -88,17 +85,17 @@ public class CancelMaintenanceCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "canceling maintenance for host: " + getId();
}
-
+
@Override
public AsyncJob.Type getInstanceType() {
- return AsyncJob.Type.Host;
+ return AsyncJob.Type.Host;
}
-
+
@Override
public Long getInstanceId() {
- return getId();
+ return getId();
}
-
+
@Override
public void execute(){
Host result = _resourceService.cancelMaintenance(this);
diff --git a/api/src/com/cloud/api/commands/DeleteHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
similarity index 81%
rename from api/src/com/cloud/api/commands/DeleteHostCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
index 60e61b99f30..5103f986e10 100644
--- a/api/src/com/cloud/api/commands/DeleteHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
@@ -14,20 +14,20 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.host;
+import org.apache.cloudstack.api.response.HostResponse;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.BaseCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.ServerApiException;
-import com.cloud.api.response.SuccessResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.SuccessResponse;
import com.cloud.user.Account;
-@Implementation(description = "Deletes a host.", responseObject = SuccessResponse.class)
+@APICommand(name = "deleteHost", description = "Deletes a host.", responseObject = SuccessResponse.class)
public class DeleteHostCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(DeleteHostCmd.class.getName());
@@ -37,13 +37,13 @@ public class DeleteHostCmd extends BaseCmd {
// ////////////// API parameters /////////////////////
// ///////////////////////////////////////////////////
- @IdentityMapper(entityTableName="host")
- @Parameter(name = ApiConstants.ID, type = CommandType.LONG, required = true, description = "the host ID")
+ @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = HostResponse.class,
+ required = true, description = "the host ID")
private Long id;
@Parameter(name = ApiConstants.FORCED, type = CommandType.BOOLEAN, description = "Force delete the host. All HA enabled vms running on the host will be put to HA; HA disabled ones will be stopped")
private Boolean forced;
-
+
@Parameter(name = ApiConstants.FORCED_DESTROY_LOCAL_STORAGE, type = CommandType.BOOLEAN, description = "Force destroy local storage on this host. All VMs created on this local storage will be destroyed")
private Boolean forceDestroyLocalStorage;
@@ -58,7 +58,7 @@ public class DeleteHostCmd extends BaseCmd {
public boolean isForced() {
return (forced != null) ? forced : false;
}
-
+
public boolean isForceDestoryLocalStorage() {
return (forceDestroyLocalStorage != null) ? forceDestroyLocalStorage : true;
}
@@ -87,4 +87,4 @@ public class DeleteHostCmd extends BaseCmd {
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete host");
}
}
-}
\ No newline at end of file
+}
diff --git a/api/src/com/cloud/api/commands/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
old mode 100755
new mode 100644
similarity index 65%
rename from api/src/com/cloud/api/commands/ListHostsCmd.java
rename to api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
index 87f13302a97..82f329f4b7e
--- a/api/src/com/cloud/api/commands/ListHostsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
@@ -14,28 +14,31 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-package com.cloud.api.commands;
+package org.apache.cloudstack.api.command.admin.host;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
-import com.cloud.api.ApiConstants;
-import com.cloud.api.ApiConstants.HostDetails;
-import com.cloud.api.BaseListCmd;
-import com.cloud.api.IdentityMapper;
-import com.cloud.api.Implementation;
-import com.cloud.api.Parameter;
-import com.cloud.api.response.HostResponse;
-import com.cloud.api.response.ListResponse;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiConstants.HostDetails;
+import org.apache.cloudstack.api.BaseListCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.HostResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PodResponse;
+import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
import com.cloud.utils.Pair;
-@Implementation(description="Lists hosts.", responseObject=HostResponse.class)
+@APICommand(name = "listHosts", description="Lists hosts.", responseObject=HostResponse.class)
public class ListHostsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListHostsCmd.class.getName());
@@ -45,19 +48,19 @@ public class ListHostsCmd extends BaseListCmd {
//////////////// API parameters /////////////////////
/////////////////////////////////////////////////////
- @IdentityMapper(entityTableName="cluster")
- @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.LONG, description="lists hosts existing in particular cluster")
+ @Parameter(name=ApiConstants.CLUSTER_ID, type=CommandType.UUID, entityType = ClusterResponse.class,
+ description="lists hosts existing in particular cluster")
private Long clusterId;
- @IdentityMapper(entityTableName="host")
- @Parameter(name=ApiConstants.ID, type=CommandType.LONG, description="the id of the host")
+ @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType = HostResponse.class,
+ description="the id of the host")
private Long id;
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of the host")
private String hostName;
- @IdentityMapper(entityTableName="host_pod_ref")
- @Parameter(name=ApiConstants.POD_ID, type=CommandType.LONG, description="the Pod ID for the host")
+ @Parameter(name=ApiConstants.POD_ID, type=CommandType.UUID, entityType = PodResponse.class,
+ description="the Pod ID for the host")
private Long podId;
@Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the state of the host")
@@ -66,23 +69,23 @@ public class ListHostsCmd extends BaseListCmd {
@Parameter(name=ApiConstants.TYPE, type=CommandType.STRING, description="the host type")
private String type;
- @IdentityMapper(entityTableName="data_center")
- @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.LONG, description="the Zone ID for the host")
+ @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType = ZoneResponse.class,
+ description="the Zone ID for the host")
private Long zoneId;
- @IdentityMapper(entityTableName="vm_instance")
- @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.LONG, required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
+ @Parameter(name=ApiConstants.VIRTUAL_MACHINE_ID, type=CommandType.UUID, entityType = UserVmResponse.class,
+ required=false, description="lists hosts in the same cluster as this VM and flag hosts with enough CPU/RAm to host this VM")
private Long virtualMachineId;
-
+
@Parameter(name=ApiConstants.RESOURCE_STATE, type=CommandType.STRING, description="list hosts by resource state. Resource state represents current state determined by admin of host, valule can be one of [Enabled, Disabled, Unmanaged, PrepareForMaintenance, ErrorInMaintenance, Maintenance, Error]")
- private String resourceState;
-
+ private String resourceState;
+
@Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, value can be a list of [ min, all, capacity, events, stats]" )
private List viewDetails;
-
+
@Parameter(name=ApiConstants.HA_HOST, type=CommandType.BOOLEAN, description="if true, list only hosts dedicated to HA")
private Boolean haHost;
-
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -110,7 +113,7 @@ public class ListHostsCmd extends BaseListCmd {
public String getType() {
return type;
}
-
+
public Boolean getHaHost() {
return haHost;
}
@@ -122,7 +125,7 @@ public class ListHostsCmd extends BaseListCmd {
public Long getVirtualMachineId() {
return virtualMachineId;
}
-
+
public EnumSet getDetails() throws InvalidParameterValueException {
EnumSet dv;
if (viewDetails==null || viewDetails.size() <=0){
@@ -142,9 +145,9 @@ public class ListHostsCmd extends BaseListCmd {
}
return dv;
}
-
+
public String getResourceState() {
- return resourceState;
+ return resourceState;
}
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
@@ -154,39 +157,42 @@ public class ListHostsCmd extends BaseListCmd {
public String getCommandName() {
return s_name;
}
-
+
public AsyncJob.Type getInstanceType() {
- return AsyncJob.Type.Host;
+ return AsyncJob.Type.Host;
}
@Override
public void execute(){
- List extends Host> result = new ArrayList();
- List extends Host> hostsWithCapacity = new ArrayList();
-
- if(getVirtualMachineId() != null){
- Pair, List extends Host>> hostsForMigration = _mgr.listHostsForMigrationOfVM(getVirtualMachineId(), this.getStartIndex(), this.getPageSizeVal());
+ ListResponse response = null;
+ if (getVirtualMachineId() == null) {
+ response = _queryService.searchForServers(this);
+ } else {
+ List extends Host> result = new ArrayList