cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [44/50] [abbrv] VMSync: Separating jobs from api
Date Wed, 03 Jul 2013 22:26:23 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
index e577e35..bd729ea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Volume;
 import com.cloud.user.Account;
@@ -89,8 +89,8 @@ public class AttachVolumeCmd extends BaseAsyncCmd {
         return s_name;
     }
 
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     public Long getInstanceId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
index f293a03..6a5d4e5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCreateCmd;
@@ -30,7 +31,6 @@ import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.storage.Snapshot;
@@ -147,8 +147,8 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
     }
 
     @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
index 9a5929e..24dd113 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Volume;
 import com.cloud.user.Account;
@@ -82,8 +82,8 @@ public class DetachVolumeCmd extends BaseAsyncCmd {
         return "volume";
     }
 
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     public Long getInstanceId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
index 5fbe106..8588153 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.user.volume;
 import java.net.URISyntaxException;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -29,7 +30,6 @@ import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.dc.DataCenter;
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Upload;
@@ -95,8 +95,8 @@ public class ExtractVolumeCmd extends BaseAsyncCmd {
         return s_name;
     }
 
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     public Long getInstanceId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
index 0bced56..e906438 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
 import org.apache.cloudstack.api.Parameter;
@@ -28,7 +29,6 @@ import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 
 
 @APICommand(name = "listVolumes", description="Lists all volumes.", responseObject=VolumeResponse.class)
@@ -112,8 +112,8 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd {
     }
 
     @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
index 3474996..445f435 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.api.command.user.volume;
 
 import com.cloud.server.ResourceTag;
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -28,7 +29,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Volume;
 import com.cloud.user.Account;
@@ -81,8 +81,8 @@ public class RemoveResourceDetailCmd extends BaseAsyncCmd {
         return s_name;
     }
 
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
index 871bf45..0b7ff0d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.DiskOfferingResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.PermissionDeniedException;
@@ -90,8 +90,8 @@ public class ResizeVolumeCmd extends BaseAsyncCmd {
     }
 
     @Override
-    public AsyncJob.Type getInstanceType() {
-    	return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+    	return ApiCommandJobType.Volume;
     }
 
     public static String getResultObjectName() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
index 3453eef..f1e68e9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.volume;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -26,7 +27,6 @@ import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.storage.Volume;
 import com.cloud.user.Account;
@@ -70,8 +70,8 @@ public class UpdateVolumeCmd extends BaseAsyncCmd {
         return s_name;
     }
 
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.Volume;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.Volume;
     }
 
     public Long getInstanceId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
index 76a76d6..e0cfe00 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.vpc;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -27,7 +28,6 @@ import org.apache.cloudstack.api.response.PrivateGatewayResponse;
 import org.apache.cloudstack.api.response.StaticRouteResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.NetworkRuleConflictException;
@@ -140,7 +140,7 @@ public class CreateStaticRouteCmd extends BaseAsyncCreateCmd{
     }
 
     @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StaticRoute;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.StaticRoute;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
index e43412a..87c1c9d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java
@@ -17,6 +17,7 @@
 package org.apache.cloudstack.api.command.user.vpc;
 
 import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -27,7 +28,6 @@ import org.apache.cloudstack.api.response.StaticRouteResponse;
 import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.log4j.Logger;
 
-import com.cloud.async.AsyncJob;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.exception.ResourceUnavailableException;
@@ -119,7 +119,7 @@ public class DeleteStaticRouteCmd extends BaseAsyncCmd{
     }
 
     @Override
-    public AsyncJob.Type getInstanceType() {
-        return AsyncJob.Type.StaticRoute;
+    public ApiCommandJobType getInstanceType() {
+        return ApiCommandJobType.StaticRoute;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/api/ApiDBUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java
index 073e4c2..552539d 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -43,6 +43,7 @@ import com.cloud.region.ha.GlobalLoadBalancingRulesService;
 import org.apache.cloudstack.affinity.AffinityGroup;
 import org.apache.cloudstack.affinity.AffinityGroupResponse;
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiConstants.HostDetails;
 import org.apache.cloudstack.api.ApiConstants.VMDetails;
 import org.apache.cloudstack.api.response.AccountResponse;
@@ -1282,113 +1283,113 @@ public class ApiDBUtils {
         if ( job == null )
             return null;
         String jobInstanceId = null;
-        if (job.getInstanceType() == AsyncJob.Type.Volume) {
+        if (job.getInstanceType() == ApiCommandJobType.Volume) {
             VolumeVO volume = ApiDBUtils.findVolumeById(job.getInstanceId());
             if (volume != null) {
                 jobInstanceId = volume.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Template || job.getInstanceType()
== AsyncJob.Type.Iso) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Template || job.getInstanceType()
== ApiCommandJobType.Iso) {
             VMTemplateVO template = ApiDBUtils.findTemplateById(job.getInstanceId());
             if (template != null) {
                 jobInstanceId = template.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.VirtualMachine || job.getInstanceType()
== AsyncJob.Type.ConsoleProxy
-                || job.getInstanceType() == AsyncJob.Type.SystemVm || job.getInstanceType()
== AsyncJob.Type.DomainRouter) {
+        } else if (job.getInstanceType() == ApiCommandJobType.VirtualMachine || job.getInstanceType()
== ApiCommandJobType.ConsoleProxy
+                || job.getInstanceType() == ApiCommandJobType.SystemVm || job.getInstanceType()
== ApiCommandJobType.DomainRouter) {
             VMInstanceVO vm = ApiDBUtils.findVMInstanceById(job.getInstanceId());
             if (vm != null) {
                 jobInstanceId = vm.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Snapshot) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Snapshot) {
             Snapshot snapshot = ApiDBUtils.findSnapshotById(job.getInstanceId());
             if (snapshot != null) {
                 jobInstanceId = snapshot.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Host) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Host) {
             Host host = ApiDBUtils.findHostById(job.getInstanceId());
             if (host != null) {
                 jobInstanceId = host.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.StoragePool) {
+        } else if (job.getInstanceType() == ApiCommandJobType.StoragePool) {
             StoragePoolVO spool = ApiDBUtils.findStoragePoolById(job.getInstanceId());
             if (spool != null) {
                 jobInstanceId = spool.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.IpAddress) {
+        } else if (job.getInstanceType() == ApiCommandJobType.IpAddress) {
             IPAddressVO ip = ApiDBUtils.findIpAddressById(job.getInstanceId());
             if (ip != null) {
                 jobInstanceId = ip.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.SecurityGroup) {
+        } else if (job.getInstanceType() == ApiCommandJobType.SecurityGroup) {
             SecurityGroup sg = ApiDBUtils.findSecurityGroupById(job.getInstanceId());
             if (sg != null) {
                 jobInstanceId = sg.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.PhysicalNetwork) {
+        } else if (job.getInstanceType() == ApiCommandJobType.PhysicalNetwork) {
             PhysicalNetworkVO pnet = ApiDBUtils.findPhysicalNetworkById(job.getInstanceId());
             if (pnet != null) {
                 jobInstanceId = pnet.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.TrafficType) {
+        } else if (job.getInstanceType() == ApiCommandJobType.TrafficType) {
             PhysicalNetworkTrafficTypeVO trafficType = ApiDBUtils.findPhysicalNetworkTrafficTypeById(job.getInstanceId());
             if (trafficType != null) {
                 jobInstanceId = trafficType.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.PhysicalNetworkServiceProvider)
{
+        } else if (job.getInstanceType() == ApiCommandJobType.PhysicalNetworkServiceProvider)
{
             PhysicalNetworkServiceProvider sp = ApiDBUtils.findPhysicalNetworkServiceProviderById(job.getInstanceId());
             if (sp != null) {
                 jobInstanceId = sp.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.FirewallRule) {
+        } else if (job.getInstanceType() == ApiCommandJobType.FirewallRule) {
             FirewallRuleVO fw = ApiDBUtils.findFirewallRuleById(job.getInstanceId());
             if (fw != null) {
                 jobInstanceId = fw.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Account) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Account) {
             Account acct = ApiDBUtils.findAccountById(job.getInstanceId());
             if (acct != null) {
                 jobInstanceId = acct.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.User) {
+        } else if (job.getInstanceType() == ApiCommandJobType.User) {
             User usr = ApiDBUtils.findUserById(job.getInstanceId());
             if (usr != null) {
                 jobInstanceId = usr.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.StaticRoute) {
+        } else if (job.getInstanceType() == ApiCommandJobType.StaticRoute) {
             StaticRouteVO route = ApiDBUtils.findStaticRouteById(job.getInstanceId());
             if (route != null) {
                 jobInstanceId = route.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.PrivateGateway) {
+        } else if (job.getInstanceType() == ApiCommandJobType.PrivateGateway) {
             VpcGatewayVO gateway = ApiDBUtils.findVpcGatewayById(job.getInstanceId());
             if (gateway != null) {
                 jobInstanceId = gateway.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Counter) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Counter) {
             CounterVO counter = ApiDBUtils.getCounter(job.getInstanceId());
             if (counter != null) {
                 jobInstanceId = counter.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.Condition) {
+        } else if (job.getInstanceType() == ApiCommandJobType.Condition) {
             ConditionVO condition = ApiDBUtils.findConditionById(job.getInstanceId());
             if (condition != null) {
                 jobInstanceId = condition.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.AutoScalePolicy) {
+        } else if (job.getInstanceType() == ApiCommandJobType.AutoScalePolicy) {
             AutoScalePolicyVO policy = ApiDBUtils.findAutoScalePolicyById(job.getInstanceId());
             if (policy != null) {
                 jobInstanceId = policy.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.AutoScaleVmProfile) {
+        } else if (job.getInstanceType() == ApiCommandJobType.AutoScaleVmProfile) {
             AutoScaleVmProfileVO profile = ApiDBUtils.findAutoScaleVmProfileById(job.getInstanceId());
             if (profile != null) {
                 jobInstanceId = profile.getUuid();
             }
-        } else if (job.getInstanceType() == AsyncJob.Type.AutoScaleVmGroup) {
+        } else if (job.getInstanceType() == ApiCommandJobType.AutoScaleVmGroup) {
             AutoScaleVmGroupVO group = ApiDBUtils.findAutoScaleVmGroupById(job.getInstanceId());
             if (group != null) {
                 jobInstanceId = group.getUuid();
             }
-        } else if (job.getInstanceType() != AsyncJob.Type.None) {
+        } else if (job.getInstanceType() != ApiCommandJobType.None) {
             // TODO : when we hit here, we need to add instanceType -> UUID
             // entity table mapping
             assert (false);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java b/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java
index 39bcb17..c45be1c 100644
--- a/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java
@@ -24,8 +24,9 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
-import com.cloud.async.AsyncJob.Type;
 import com.cloud.utils.db.GenericDao;
+
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
@@ -95,7 +96,7 @@ public class AsyncJobJoinVO extends BaseViewVO implements InternalIdentity,
Iden
 
     @Enumerated(value=EnumType.STRING)
     @Column(name="instance_type", length=64)
-    private Type instanceType;
+    private ApiCommandJobType instanceType;
 
     @Column(name="instance_id", length=64)
     private Long instanceId;
@@ -301,12 +302,12 @@ public class AsyncJobJoinVO extends BaseViewVO implements InternalIdentity,
Iden
     }
 
 
-    public Type getInstanceType() {
+    public ApiCommandJobType getInstanceType() {
         return instanceType;
     }
 
 
-    public void setInstanceType(Type instanceType) {
+    public void setInstanceType(ApiCommandJobType instanceType) {
         this.instanceType = instanceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/async/AsyncJobManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobManager.java b/server/src/com/cloud/async/AsyncJobManager.java
index 4cd67f3..c9eee40 100644
--- a/server/src/com/cloud/async/AsyncJobManager.java
+++ b/server/src/com/cloud/async/AsyncJobManager.java
@@ -18,6 +18,7 @@ package com.cloud.async;
 
 import java.util.List;
 
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
 import com.cloud.utils.component.Manager;
 
@@ -28,7 +29,7 @@ public interface AsyncJobManager extends Manager {
 	   public AsyncJobVO getAsyncJob(long jobId);
 	    public AsyncJobVO findInstancePendingAsyncJob(String instanceType, long instanceId);
 	
-	public List<? extends AsyncJob> findInstancePendingAsyncJobs(AsyncJob.Type instanceType,
Long accountId);
+	public List<? extends AsyncJob> findInstancePendingAsyncJobs(ApiCommandJobType instanceType,
Long accountId);
 	
 	public long submitAsyncJob(AsyncJobVO job);
 	public long submitAsyncJob(AsyncJobVO job, boolean scheduleJobExecutionInContext);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/async/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobManagerImpl.java b/server/src/com/cloud/async/AsyncJobManagerImpl.java
index 0101a8a..13dd73e 100644
--- a/server/src/com/cloud/async/AsyncJobManagerImpl.java
+++ b/server/src/com/cloud/async/AsyncJobManagerImpl.java
@@ -35,6 +35,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseAsyncCmd;
 import org.apache.cloudstack.api.ServerApiException;
@@ -118,7 +119,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     }
 
     @Override
-    public List<AsyncJobVO> findInstancePendingAsyncJobs(AsyncJob.Type instanceType,
Long accountId) {
+    public List<AsyncJobVO> findInstancePendingAsyncJobs(ApiCommandJobType instanceType,
Long accountId) {
         return _jobDao.findInstancePendingAsyncJobs(instanceType, accountId);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/async/AsyncJobVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobVO.java b/server/src/com/cloud/async/AsyncJobVO.java
index c40fc98..41eccb4 100644
--- a/server/src/com/cloud/async/AsyncJobVO.java
+++ b/server/src/com/cloud/async/AsyncJobVO.java
@@ -32,6 +32,8 @@ import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 
 import com.cloud.utils.db.GenericDao;
+
+import org.apache.cloudstack.api.ApiCommandJobType;
 import org.apache.cloudstack.api.InternalIdentity;
 
 @Entity
@@ -86,7 +88,7 @@ public class AsyncJobVO implements AsyncJob {
     
     @Enumerated(value=EnumType.STRING)
     @Column(name="instance_type", length=64)
-    private Type instanceType;
+    private ApiCommandJobType instanceType;
     
 	@Column(name="instance_id", length=64)
     private Long instanceId;
@@ -125,7 +127,7 @@ public class AsyncJobVO implements AsyncJob {
         this.uuid = UUID.randomUUID().toString();
     }
 
-    public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId,
Type instanceType) {
+    public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId,
ApiCommandJobType instanceType) {
 	this.userId = userId;
 	this.accountId = accountId;
 	this.cmd = cmd;
@@ -137,7 +139,7 @@ public class AsyncJobVO implements AsyncJob {
     }
 
     public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
-	int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
+	int callbackType, String callbackAddress, Long instanceId, ApiCommandJobType instanceType)
{
 
 	this(userId, accountId, cmd, cmdInfo, instanceId, instanceType);
 	this.callbackType = callbackType;
@@ -309,11 +311,11 @@ public class AsyncJobVO implements AsyncJob {
 	}
 	
     @Override
-    public Type getInstanceType() {
+    public ApiCommandJobType getInstanceType() {
 		return instanceType;
 	}
 
-	public void setInstanceType(Type instanceType) {
+	public void setInstanceType(ApiCommandJobType instanceType) {
 		this.instanceType = instanceType;
 	}
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/async/dao/AsyncJobDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobDao.java b/server/src/com/cloud/async/dao/AsyncJobDao.java
index 9ab9b22..104bd90 100644
--- a/server/src/com/cloud/async/dao/AsyncJobDao.java
+++ b/server/src/com/cloud/async/dao/AsyncJobDao.java
@@ -19,13 +19,14 @@ package com.cloud.async.dao;
 import java.util.Date;
 import java.util.List;
 
-import com.cloud.async.AsyncJob;
+import org.apache.cloudstack.api.ApiCommandJobType;
+
 import com.cloud.async.AsyncJobVO;
 import com.cloud.utils.db.GenericDao;
 
 public interface AsyncJobDao extends GenericDao<AsyncJobVO, Long> {
 	AsyncJobVO findInstancePendingAsyncJob(String instanceType, long instanceId);
-	List<AsyncJobVO> findInstancePendingAsyncJobs(AsyncJob.Type instanceType, Long accountId);
+	List<AsyncJobVO> findInstancePendingAsyncJobs(ApiCommandJobType instanceType, Long
accountId);
 	List<AsyncJobVO> getExpiredUnfinishedJobs(Date cutTime, int limit);
 	void resetJobProcess(long msid, int jobResultCode, String jobResultMessage);
 	List<AsyncJobVO> getExpiredCompletedJobs(Date cutTime, int limit);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java b/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java
index b2c0d9c..69ffa10 100644
--- a/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java
+++ b/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java
@@ -26,7 +26,8 @@ import javax.ejb.Local;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
-import com.cloud.async.AsyncJob;
+import org.apache.cloudstack.api.ApiCommandJobType;
+
 import com.cloud.async.AsyncJobResult;
 import com.cloud.async.AsyncJobVO;
 import com.cloud.utils.db.DB;
@@ -98,7 +99,7 @@ public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long>
implements
         return null;
 	}
 	
-	public List<AsyncJobVO> findInstancePendingAsyncJobs(AsyncJob.Type instanceType, Long
accountId) {
+	public List<AsyncJobVO> findInstancePendingAsyncJobs(ApiCommandJobType instanceType,
Long accountId) {
 		SearchCriteria<AsyncJobVO> sc = pendingAsyncJobsSearch.create();
         sc.setParameters("instanceType", instanceType);
         

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bec53fb5/tools/apidoc/build-apidoc.sh
----------------------------------------------------------------------
diff --git a/tools/apidoc/build-apidoc.sh b/tools/apidoc/build-apidoc.sh
index d048a1b..03eb687 100755
--- a/tools/apidoc/build-apidoc.sh
+++ b/tools/apidoc/build-apidoc.sh
@@ -47,16 +47,7 @@ fi
 
 CP=$PATHSEP/
 
-for file in $TARGETJARDIR/*.jar
-do
-  CP=${CP}$PATHSEP$file
-done
-
-for file in $DEPSDIR/*.jar; do
-  CP=${CP}$PATHSEP$file
-done
-
-java -cp $CP com.cloud.api.doc.ApiXmlDocWriter -d "$DISTDIR" $*
+java -cp $CP$PATHSEP$TARGETJARDIR/*$PATHSEP$DEPSDIR/* com.cloud.api.doc.ApiXmlDocWriter -d
"$DISTDIR" $*
 
 if [ $? -ne 0 ]
 then


Mime
View raw message