You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ah...@apache.org on 2013/05/15 19:13:03 UTC
[01/12] git commit: updated refs/heads/vmsync to cbdc406
Updated Branches:
refs/heads/vmsync 2fa361209 -> cbdc4063c
Some small changes before the move of the async job
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/bb242a84
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/bb242a84
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/bb242a84
Branch: refs/heads/vmsync
Commit: bb242a840e0a691ed1416772a4cd775c6014c0c9
Parents: 2fa3612
Author: Alex Huang <al...@gmail.com>
Authored: Tue May 14 14:13:14 2013 -0700
Committer: Alex Huang <al...@gmail.com>
Committed: Tue May 14 14:13:14 2013 -0700
----------------------------------------------------------------------
.../cloud/entity/api/VMEntityManagerImpl.java | 14 ++++++++++----
.../engine/cloud/entity/dao/VMEntityDaoImpl.java | 13 ++++---------
2 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb242a84/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index 2292fac..b9b71ca 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -24,21 +24,23 @@ import java.util.UUID;
import javax.inject.Inject;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
import org.apache.cloudstack.engine.cloud.entity.VMReservationVO;
import org.apache.cloudstack.engine.cloud.entity.dao.VMEntityDao;
import org.apache.cloudstack.engine.cloud.entity.dao.VMReservationDao;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.springframework.stereotype.Component;
+import com.cloud.dao.EntityManager;
import com.cloud.dc.DataCenter;
import com.cloud.deploy.DataCenterDeployment;
import com.cloud.deploy.DeployDestination;
import com.cloud.deploy.DeploymentPlan;
import com.cloud.deploy.DeploymentPlanner;
-import com.cloud.deploy.DeploymentPlanningManager;
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
+import com.cloud.deploy.DeploymentPlanningManager;
import com.cloud.exception.AffinityConflictException;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.ConcurrentOperationException;
@@ -69,7 +71,11 @@ import com.cloud.vm.dao.VMInstanceDao;
public class VMEntityManagerImpl implements VMEntityManager {
@Inject
+ protected EntityManager _eneityMgr;
+
+ @Inject
protected VMInstanceDao _vmDao;
+
@Inject
protected VMTemplateDao _templateDao = null;
@@ -105,6 +111,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
@Inject
protected PrimaryDataStoreDao _storagePoolDao;
+
@Inject
DataStoreManager dataStoreMgr;
@@ -113,7 +120,6 @@ public class VMEntityManagerImpl implements VMEntityManager {
@Override
public VMEntityVO loadVirtualMachine(String vmId) {
- // TODO Auto-generated method stub
return _vmEntityDao.findByUuid(vmId);
}
@@ -141,7 +147,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vm.getId());
if(!vols.isEmpty()){
VolumeVO vol = vols.get(0);
- StoragePool pool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(vol.getPoolId());
+ StoragePool pool = (StoragePool)dataStoreMgr.getPrimaryDataStore(vol.getPoolId());
if (!pool.isInMaintenance()) {
long rootVolDcId = pool.getDataCenterId();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/bb242a84/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/dao/VMEntityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/dao/VMEntityDaoImpl.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/dao/VMEntityDaoImpl.java
index bf153bc..716c91b 100644
--- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/dao/VMEntityDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/dao/VMEntityDaoImpl.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,
@@ -17,8 +17,6 @@
package org.apache.cloudstack.engine.cloud.entity.dao;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@@ -26,20 +24,17 @@ import javax.annotation.PostConstruct;
import javax.ejb.Local;
import javax.inject.Inject;
-import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
-import org.apache.cloudstack.engine.cloud.entity.VMReservationVO;
-
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
+import org.apache.cloudstack.engine.cloud.entity.VMReservationVO;
import com.cloud.network.dao.NetworkDao;
import com.cloud.network.dao.NetworkVO;
-import com.cloud.utils.Pair;
import com.cloud.utils.db.DB;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.Transaction;
-import com.cloud.vm.NicProfile;
@@ -158,7 +153,7 @@ public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements
return;
}
- _vmComputeTagDao.persist(vmId, computeTags);
+ _vmComputeTagDao.persist(vmId, computeTags);
}
private void saveVmReservation(VMEntityVO vm) {
[03/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobMBeanImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobMBeanImpl.java b/server/src/com/cloud/async/AsyncJobMBeanImpl.java
deleted file mode 100644
index 7940751..0000000
--- a/server/src/com/cloud/async/AsyncJobMBeanImpl.java
+++ /dev/null
@@ -1,143 +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.async;
-
-import java.util.Date;
-import java.util.TimeZone;
-
-import javax.management.StandardMBean;
-
-import com.cloud.utils.DateUtil;
-
-public class AsyncJobMBeanImpl extends StandardMBean implements AsyncJobMBean {
- private AsyncJob _job;
-
- public AsyncJobMBeanImpl(AsyncJob job) {
- super(AsyncJobMBean.class, false);
-
- _job = job;
- }
-
- public long getAccountId() {
- return _job.getAccountId();
- }
-
- public long getUserId() {
- return _job.getUserId();
- }
-
- public String getCmd() {
- return _job.getCmd();
- }
-
- public String getCmdInfo() {
- return _job.getCmdInfo();
- }
-
- public String getStatus() {
- int jobStatus = _job.getStatus();
- switch(jobStatus) {
- case AsyncJobConstants.STATUS_SUCCEEDED :
- return "Completed";
-
- case AsyncJobConstants.STATUS_IN_PROGRESS:
- return "In preogress";
-
- case AsyncJobConstants.STATUS_FAILED:
- return "failed";
- }
-
- return "Unknow";
- }
-
- public int getProcessStatus() {
- return _job.getProcessStatus();
- }
-
- public int getResultCode() {
- return _job.getResultCode();
- }
-
- public String getResult() {
- return _job.getResult();
- }
-
- public String getInstanceType() {
- if(_job.getInstanceType() != null)
- return _job.getInstanceType().toString();
- return "N/A";
- }
-
- public String getInstanceId() {
- if(_job.getInstanceId() != null)
- return String.valueOf(_job.getInstanceId());
- return "N/A";
- }
-
- public String getInitMsid() {
- if(_job.getInitMsid() != null) {
- return String.valueOf(_job.getInitMsid());
- }
- return "N/A";
- }
-
- public String getCreateTime() {
- Date time = _job.getCreated();
- if(time != null)
- return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
- return "N/A";
- }
-
- public String getLastUpdateTime() {
- Date time = _job.getLastUpdated();
- if(time != null)
- return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
- return "N/A";
- }
-
- public String getLastPollTime() {
- Date time = _job.getLastPolled();
-
- if(time != null)
- return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
- return "N/A";
- }
-
- public String getSyncQueueId() {
- SyncQueueItem item = _job.getSyncSource();
- if(item != null && item.getQueueId() != null) {
- return String.valueOf(item.getQueueId());
- }
- return "N/A";
- }
-
- public String getSyncQueueContentType() {
- SyncQueueItem item = _job.getSyncSource();
- if(item != null) {
- return item.getContentType();
- }
- return "N/A";
- }
-
- public String getSyncQueueContentId() {
- SyncQueueItem item = _job.getSyncSource();
- if(item != null && item.getContentId() != null) {
- return String.valueOf(item.getContentId());
- }
- return "N/A";
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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
deleted file mode 100644
index 98d24e4..0000000
--- a/server/src/com/cloud/async/AsyncJobManager.java
+++ /dev/null
@@ -1,128 +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.async;
-
-import java.util.List;
-
-import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
-
-import com.cloud.utils.Predicate;
-import com.cloud.utils.component.Manager;
-
-public interface AsyncJobManager extends Manager {
-
- AsyncJobVO getAsyncJob(long jobId);
-
- List<? extends AsyncJob> findInstancePendingAsyncJobs(String instanceType, Long accountId);
-
- long submitAsyncJob(AsyncJob job);
- long submitAsyncJob(AsyncJob job, boolean scheduleJobExecutionInContext);
- long submitAsyncJob(AsyncJob job, String syncObjType, long syncObjId);
- AsyncJobResult queryAsyncJobResult(long jobId);
-
- void completeAsyncJob(long jobId, int jobStatus, int resultCode, Object resultObject);
- void updateAsyncJobStatus(long jobId, int processStatus, Object resultObject);
- void updateAsyncJobAttachment(long jobId, String instanceType, Long instanceId);
- void logJobJournal(long jobId, AsyncJob.JournalType journalType, String
- journalText, String journalObjJson);
-
- /**
- * A running thread inside management server can have a 1:1 linked pseudo job.
- * This is to help make some legacy code work without too dramatic changes.
- *
- * All pseudo jobs should be expunged upon management start event
- *
- * @return pseudo job for the thread
- */
- AsyncJob getPseudoJob();
-
- /**
- * Used by upper level job to wait for completion of a down-level job (usually VmWork jobs)
- * in synchronized way. Caller needs to use waitAndCheck() to check the completion status
- * of the down-level job
- *
- * Due to the amount of legacy code that relies on synchronized-call semantics, this form of joinJob
- * is used mostly
- *
- *
- * @param jobId upper job that is going to wait the completion of a down-level job
- * @param joinJobId down-level job
- */
- void joinJob(long jobId, long joinJobId);
-
- /**
- * Used by upper level job to wait for completion of a down-level job (usually VmWork jobs)
- * in asynchronized way, it will cause upper job to cease current execution, upper job will be
- * rescheduled to execute periodically or on wakeup events detected from message bus
- *
- * @param jobId upper job that is going to wait the completion of a down-level job
- * @param joinJobId down-level job
- * @Param wakeupHandler wakeup handler
- * @Param wakeupDispatcher wakeup dispatcher
- * @param wakeupTopcisOnMessageBus
- * @param wakeupIntervalInMilliSeconds
- * @param timeoutInMilliSeconds
- */
- void joinJob(long jobId, long joinJobId, String wakeupHandler, String wakupDispatcher,
- String[] wakeupTopcisOnMessageBus, long wakeupIntervalInMilliSeconds, long timeoutInMilliSeconds);
-
- /**
- * Dis-join two related jobs
- *
- * @param jobId
- * @param joinedJobId
- */
- void disjoinJob(long jobId, long joinedJobId);
-
- /**
- * Used by down-level job to notify its completion to upper level jobs
- *
- * @param joinJobId down-level job for upper level job to join with
- * @param joinStatus AsyncJobConstants status code to indicate success or failure of the
- * down-level job
- * @param joinResult object-stream serialized result object
- * this is primarily used by down-level job to pass error exception objects
- * for legacy code to work. To help pass exception object easier, we use
- * object-stream based serialization instead of GSON
- */
- void completeJoin(long joinJobId, int joinStatus, String joinResult);
-
- void releaseSyncSource();
- void syncAsyncJobExecution(AsyncJob job, String syncObjType, long syncObjId, long queueSizeLimit);
-
- /**
- * This method will be deprecated after all code has been migrated to fully-asynchronized mode
- * that uses async-feature of joinJob/disjoinJob
- *
- * @param wakupTopicsOnMessageBus topic on message bus to wakeup the wait
- * @param checkIntervalInMilliSeconds time to break out wait for checking predicate condition
- * @param timeoutInMiliseconds time out to break out the whole wait process
- * @param predicate
- * @return true, predicate condition is satisfied
- * false, wait is timed out
- */
- @Deprecated
- boolean waitAndCheck(String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds,
- long timeoutInMiliseconds, Predicate predicate);
-
- /**
- * Queries for the status or final result of an async job.
- * @param cmd the command that specifies the job id
- * @return an async-call result object
- */
- AsyncJob queryAsyncJobResult(QueryAsyncJobResultCmd cmd);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 cde184a..2556219 100644
--- a/server/src/com/cloud/async/AsyncJobManagerImpl.java
+++ b/server/src/com/cloud/async/AsyncJobManagerImpl.java
@@ -33,20 +33,34 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.log4j.Logger;
+import org.apache.log4j.NDC;
+
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
import org.apache.cloudstack.api.response.ExceptionResponse;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJobJoinMapVO;
+import org.apache.cloudstack.framework.jobs.AsyncJobJournalVO;
+import org.apache.cloudstack.framework.jobs.AsyncJobMBeanImpl;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobMonitor;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+import org.apache.cloudstack.framework.jobs.SyncQueueItem;
+import org.apache.cloudstack.framework.jobs.SyncQueueItemVO;
+import org.apache.cloudstack.framework.jobs.SyncQueueManager;
+import org.apache.cloudstack.framework.jobs.SyncQueueVO;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDao;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.framework.messagebus.MessageDetector;
import org.apache.cloudstack.framework.messagebus.PublishScope;
import org.apache.cloudstack.messagebus.TopicConstants;
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.dao.AsyncJobDao;
-import com.cloud.async.dao.AsyncJobJoinMapDao;
-import com.cloud.async.dao.AsyncJobJournalDao;
import com.cloud.cluster.ClusterManager;
import com.cloud.cluster.ClusterManagerListener;
import com.cloud.cluster.ManagementServerHostVO;
@@ -122,12 +136,12 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
@Override @DB
public AsyncJob getPseudoJob() {
- AsyncJobVO job = _jobDao.findPseudoJob(Thread.currentThread().getId(), this.getMsid());
+ AsyncJobVO job = _jobDao.findPseudoJob(Thread.currentThread().getId(), getMsid());
if(job == null) {
job = new AsyncJobVO();
job.setAccountId(_accountMgr.getSystemAccount().getId());
job.setUserId(_accountMgr.getSystemUser().getId());
- job.setInitMsid(this.getMsid());
+ job.setInitMsid(getMsid());
job.setDispatcher(AsyncJobConstants.JOB_DISPATCHER_PSEUDO);
job.setInstanceType(AsyncJobConstants.PSEUDO_JOB_INSTANCE_TYPE);
job.setInstanceId(Thread.currentThread().getId());
@@ -249,7 +263,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
scheduleExecution(jobToWakeup, false);
}
- _messageBus.publish(null, TopicConstants.JOB_STATE, PublishScope.GLOBAL, (Long)jobId);
+ _messageBus.publish(null, TopicConstants.JOB_STATE, PublishScope.GLOBAL, jobId);
} catch(Exception e) {
s_logger.error("Unexpected exception while completing async job-" + jobId, e);
txn.rollback();
@@ -314,7 +328,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
}
@Override @DB
- public void logJobJournal(long jobId, AsyncJob.JournalType journalType, String
+ public void logJobJournal(long jobId, AsyncJob.JournalType journalType, String
journalText, String journalObjJson) {
AsyncJobJournalVO journal = new AsyncJobJournalVO();
journal.setJobId(jobId);
@@ -327,7 +341,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
@Override @DB
public void joinJob(long jobId, long joinJobId) {
- _joinMapDao.joinJob(jobId, joinJobId, this.getMsid(), 0, 0, null, null, null);
+ _joinMapDao.joinJob(jobId, joinJobId, getMsid(), 0, 0, null, null, null);
}
@Override @DB
@@ -341,7 +355,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
syncSourceId = context.getJob().getSyncSource().getQueueId();
}
- _joinMapDao.joinJob(jobId, joinJobId, this.getMsid(),
+ _joinMapDao.joinJob(jobId, joinJobId, getMsid(),
wakeupIntervalInMilliSeconds, timeoutInMilliSeconds,
syncSourceId, wakeupHandler, wakeupDispatcher);
}
@@ -353,7 +367,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
@Override @DB
public void completeJoin(long joinJobId, int joinStatus, String joinResult) {
- _joinMapDao.completeJoin(joinJobId, joinStatus, joinResult, this.getMsid());
+ _joinMapDao.completeJoin(joinJobId, joinStatus, joinResult, getMsid());
}
@Override
@@ -411,7 +425,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
return _jobDao.findById(cmd.getId());
}
- @Override @DB
+ @DB
public AsyncJobResult queryAsyncJobResult(long jobId) {
if(s_logger.isTraceEnabled()) {
s_logger.trace("Query async-job status, job-" + jobId);
@@ -479,7 +493,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
private AsyncJobDispatcher getDispatcher(String dispatcherName) {
if(dispatcherName == null || dispatcherName.isEmpty())
- dispatcherName = this.defaultDispatcher;
+ dispatcherName = defaultDispatcher;
if(_jobDispatchers != null) {
for(AsyncJobDispatcher dispatcher : _jobDispatchers) {
@@ -492,7 +506,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
if(_jobDispatchers != null) {
- List<AsyncJobJoinMapVO> joinRecords = this._joinMapDao.listJoinRecords(job.getId());
+ List<AsyncJobJoinMapVO> joinRecords = _joinMapDao.listJoinRecords(job.getId());
if(joinRecords.size() > 0) {
AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
for(AsyncJobDispatcher dispatcher : _jobDispatchers) {
@@ -625,7 +639,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
job.setExecutingMsid(null);
_jobDao.update(job.getId(), job);
- }
+ }
} else {
if(s_logger.isDebugEnabled()) {
@@ -653,7 +667,8 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
}
}
- public boolean waitAndCheck(String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds,
+ @Override
+ public boolean waitAndCheck(String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds,
long timeoutInMiliseconds, Predicate predicate) {
MessageDetector msgDetector = new MessageDetector();
@@ -724,7 +739,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
s_logger.error("Unexpected exception", e);
}
}
- }
+ }
};
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobMonitor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobMonitor.java b/server/src/com/cloud/async/AsyncJobMonitor.java
deleted file mode 100644
index 98c340b..0000000
--- a/server/src/com/cloud/async/AsyncJobMonitor.java
+++ /dev/null
@@ -1,179 +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.async;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.framework.messagebus.MessageBus;
-import org.apache.cloudstack.framework.messagebus.MessageDispatcher;
-import org.apache.cloudstack.framework.messagebus.MessageHandler;
-import org.apache.cloudstack.messagebus.TopicConstants;
-import org.apache.log4j.Logger;
-
-import com.cloud.utils.component.ManagerBase;
-
-public class AsyncJobMonitor extends ManagerBase {
- public static final Logger s_logger = Logger.getLogger(AsyncJobMonitor.class);
-
- @Inject private MessageBus _messageBus;
-
- private Map<Long, ActiveTaskRecord> _activeTasks = new HashMap<Long, ActiveTaskRecord>();
- private Timer _timer = new Timer();
-
- private volatile int _activePoolThreads = 0;
- private volatile int _activeInplaceThreads = 0;
-
- // configuration
- private long _inactivityCheckIntervalMs = 60000;
- private long _inactivityWarningThresholdMs = 90000;
-
- public AsyncJobMonitor() {
- }
-
- public long getInactivityCheckIntervalMs() {
- return _inactivityCheckIntervalMs;
- }
-
- public void setInactivityCheckIntervalMs(long intervalMs) {
- _inactivityCheckIntervalMs = intervalMs;
- }
-
- public long getInactivityWarningThresholdMs() {
- return _inactivityWarningThresholdMs;
- }
-
- public void setInactivityWarningThresholdMs(long thresholdMs) {
- _inactivityWarningThresholdMs = thresholdMs;
- }
-
- @MessageHandler(topic=TopicConstants.JOB_HEARTBEAT)
- public void onJobHeartbeatNotify(String subject, String senderAddress, Object args) {
- if(args != null && args instanceof Long) {
- synchronized(this) {
- ActiveTaskRecord record = _activeTasks.get((Long)args);
- if(record != null) {
- record.updateJobHeartbeatTick();
- }
- }
- }
- }
-
- private void heartbeat() {
- synchronized(this) {
- for(Map.Entry<Long, ActiveTaskRecord> entry : _activeTasks.entrySet()) {
- if(entry.getValue().millisSinceLastJobHeartbeat() > _inactivityWarningThresholdMs) {
- s_logger.warn("Task (job-" + entry.getValue().getJobId() + ") has been pending for "
- + entry.getValue().millisSinceLastJobHeartbeat()/1000 + " seconds");
- }
- }
- }
- }
-
- @Override
- public boolean configure(String name, Map<String, Object> params)
- throws ConfigurationException {
-
- _messageBus.subscribe(TopicConstants.JOB_HEARTBEAT, MessageDispatcher.getDispatcher(this));
- _timer.scheduleAtFixedRate(new TimerTask() {
-
- @Override
- public void run() {
- heartbeat();
- }
-
- }, _inactivityCheckIntervalMs, _inactivityCheckIntervalMs);
- return true;
- }
-
- public void registerActiveTask(long jobId) {
- synchronized(this) {
- assert(_activeTasks.get(jobId) == null);
-
- long threadId = Thread.currentThread().getId();
- boolean fromPoolThread = Thread.currentThread().getName().contains(AsyncJobConstants.JOB_POOL_THREAD_PREFIX);
- ActiveTaskRecord record = new ActiveTaskRecord(threadId, jobId, fromPoolThread);
- _activeTasks.put(jobId, record);
- if(fromPoolThread)
- _activePoolThreads++;
- else
- _activeInplaceThreads++;
- }
- }
-
- public void unregisterActiveTask(long jobId) {
- synchronized(this) {
- ActiveTaskRecord record = _activeTasks.get(jobId);
- assert(record != null);
- if(record != null) {
- if(record.isPoolThread())
- _activePoolThreads--;
- else
- _activeInplaceThreads--;
-
- _activeTasks.remove(jobId);
- }
- }
- }
-
- public int getActivePoolThreads() {
- return _activePoolThreads;
- }
-
- public int getActiveInplaceThread() {
- return _activeInplaceThreads;
- }
-
- private static class ActiveTaskRecord {
- long _jobId;
- long _threadId;
- boolean _fromPoolThread;
- long _jobLastHeartbeatTick;
-
- public ActiveTaskRecord(long jobId, long threadId, boolean fromPoolThread) {
- _threadId = threadId;
- _jobId = jobId;
- _fromPoolThread = fromPoolThread;
- _jobLastHeartbeatTick = System.currentTimeMillis();
- }
-
- public long getThreadId() {
- return _threadId;
- }
-
- public long getJobId() {
- return _jobId;
- }
-
- public boolean isPoolThread() {
- return _fromPoolThread;
- }
-
- public void updateJobHeartbeatTick() {
- _jobLastHeartbeatTick = System.currentTimeMillis();
- }
-
- public long millisSinceLastJobHeartbeat() {
- return System.currentTimeMillis() - _jobLastHeartbeatTick;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobResult.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobResult.java b/server/src/com/cloud/async/AsyncJobResult.java
index 7f3ab32..783655e 100644
--- a/server/src/com/cloud/async/AsyncJobResult.java
+++ b/server/src/com/cloud/async/AsyncJobResult.java
@@ -16,6 +16,8 @@
// under the License.
package com.cloud.async;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+
import com.cloud.api.ApiSerializerHelper;
public class AsyncJobResult {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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
deleted file mode 100644
index 93b72d6..0000000
--- a/server/src/com/cloud/async/AsyncJobVO.java
+++ /dev/null
@@ -1,382 +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.async;
-
-import java.util.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorColumn;
-import javax.persistence.DiscriminatorType;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name="async_job")
-@Inheritance(strategy=InheritanceType.JOINED)
-@DiscriminatorColumn(name="job_type", discriminatorType=DiscriminatorType.STRING, length=32)
-public class AsyncJobVO implements AsyncJob {
-
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id = null;
-
- @Column(name="job_type", length=32)
- protected String type;
-
- @Column(name="job_dispatcher", length=64)
- protected String dispatcher;
-
- @Column(name="job_pending_signals")
- protected int pendingSignals;
-
- @Column(name="user_id")
- private long userId;
-
- @Column(name="account_id")
- private long accountId;
-
- @Column(name="job_cmd")
- private String cmd;
-
- @Column(name="job_cmd_ver")
- private int cmdVersion;
-
- @Column(name="job_cmd_info", length=65535)
- private String cmdInfo;
-
- @Column(name="job_status")
- private int status;
-
- @Column(name="job_process_status")
- private int processStatus;
-
- @Column(name="job_result_code")
- private int resultCode;
-
- @Column(name="job_result", length=65535)
- private String result;
-
- @Column(name="instance_type", length=64)
- private String instanceType;
-
- @Column(name="instance_id", length=64)
- private Long instanceId;
-
- @Column(name="job_init_msid")
- private Long initMsid;
-
- @Column(name="job_complete_msid")
- private Long completeMsid;
-
- @Column(name="job_executing_msid")
- private Long executingMsid;
-
- @Column(name=GenericDao.CREATED_COLUMN)
- private Date created;
-
- @Column(name="last_updated")
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastUpdated;
-
- @Column(name="last_polled")
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastPolled;
-
- @Column(name=GenericDao.REMOVED_COLUMN)
- private Date removed;
-
- @Column(name="uuid")
- private String uuid;
-
- @Transient
- private SyncQueueItem syncSource = null;
-
- public AsyncJobVO() {
- this.uuid = UUID.randomUUID().toString();
- }
-
- public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId, String instanceType) {
- this.userId = userId;
- this.accountId = accountId;
- this.cmd = cmd;
- this.cmdInfo = cmdInfo;
- this.uuid = UUID.randomUUID().toString();
- this.instanceId = instanceId;
- this.instanceType = instanceType;
- }
-
- public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
- int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
-
- this.type ="AsyncJobVO";
- }
-
- @Override
- public long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- @Override
- public String getType() {
- return this.type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- @Override
- public String getDispatcher() {
- return this.dispatcher;
- }
-
- public void setDispatcher(String dispatcher) {
- this.dispatcher = dispatcher;
- }
-
- @Override
- public int getPendingSignals() {
- return this.pendingSignals;
- }
-
- public void setPendingSignals(int signals) {
- this.pendingSignals = signals;
- }
-
- @Override
- public long getUserId() {
- return userId;
- }
-
- public void setUserId(long userId) {
- this.userId = userId;
- }
-
- @Override
- public long getAccountId() {
- return accountId;
- }
-
- public void setAccountId(long accountId) {
- this.accountId = accountId;
- }
-
- @Override
- public String getCmd() {
- return cmd;
- }
-
- public void setCmd(String cmd) {
- this.cmd = cmd;
- }
-
- @Override
- public int getCmdVersion() {
- return cmdVersion;
- }
-
- public void setCmdVersion(int version) {
- cmdVersion = version;
- }
-
- @Override
- public String getCmdInfo() {
- return cmdInfo;
- }
-
- public void setCmdInfo(String cmdInfo) {
- this.cmdInfo = cmdInfo;
- }
-
- @Override
- public int getStatus() {
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-
- @Override
- public int getProcessStatus() {
- return processStatus;
- }
-
- public void setProcessStatus(int status) {
- processStatus = status;
- }
-
- @Override
- public int getResultCode() {
- return resultCode;
- }
-
- public void setResultCode(int resultCode) {
- this.resultCode = resultCode;
- }
-
- @Override
- public String getResult() {
- return result;
- }
-
- public void setResult(String result) {
- this.result = result;
- }
-
- @Override
- public Long getInitMsid() {
- return initMsid;
- }
-
- @Override
- public void setInitMsid(Long initMsid) {
- this.initMsid = initMsid;
- }
-
- @Override
- public Long getExecutingMsid() {
- return this.executingMsid;
- }
-
- public void setExecutingMsid(Long executingMsid) {
- this.executingMsid = executingMsid;
- }
-
- @Override
- public Long getCompleteMsid() {
- return completeMsid;
- }
-
- @Override
- public void setCompleteMsid(Long completeMsid) {
- this.completeMsid = completeMsid;
- }
-
- @Override
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- @Override
- public Date getLastUpdated() {
- return lastUpdated;
- }
-
- public void setLastUpdated(Date lastUpdated) {
- this.lastUpdated = lastUpdated;
- }
-
- @Override
- public Date getLastPolled() {
- return lastPolled;
- }
-
- public void setLastPolled(Date lastPolled) {
- this.lastPolled = lastPolled;
- }
-
- @Override
- public Date getRemoved() {
- return removed;
- }
-
- public void setRemoved(Date removed) {
- this.removed = removed;
- }
-
- @Override
- public String getInstanceType() {
- return instanceType;
- }
-
- public void setInstanceType(String instanceType) {
- this.instanceType = instanceType;
- }
-
- @Override
- public Long getInstanceId() {
- return instanceId;
- }
-
- public void setInstanceId(Long instanceId) {
- this.instanceId = instanceId;
- }
-
- @Override
- public SyncQueueItem getSyncSource() {
- return syncSource;
- }
-
- @Override
- public void setSyncSource(SyncQueueItem syncSource) {
- this.syncSource = syncSource;
- }
-
- @Override
- public String getUuid() {
- return this.uuid;
- }
-
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("AsyncJobVO {id:").append(getId());
- sb.append(", userId: ").append(getUserId());
- sb.append(", accountId: ").append(getAccountId());
- sb.append(", instanceType: ").append(getInstanceType());
- sb.append(", instanceId: ").append(getInstanceId());
- sb.append(", cmd: ").append(getCmd());
- sb.append(", cmdInfo: ").append(getCmdInfo());
- sb.append(", cmdVersion: ").append(getCmdVersion());
- sb.append(", status: ").append(getStatus());
- sb.append(", processStatus: ").append(getProcessStatus());
- sb.append(", resultCode: ").append(getResultCode());
- sb.append(", result: ").append(getResult());
- sb.append(", initMsid: ").append(getInitMsid());
- sb.append(", completeMsid: ").append(getCompleteMsid());
- sb.append(", lastUpdated: ").append(getLastUpdated());
- sb.append(", lastPolled: ").append(getLastPolled());
- sb.append(", created: ").append(getCreated());
- sb.append("}");
- return sb.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/SyncQueueItemVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/SyncQueueItemVO.java b/server/src/com/cloud/async/SyncQueueItemVO.java
deleted file mode 100644
index 21fbb91..0000000
--- a/server/src/com/cloud/async/SyncQueueItemVO.java
+++ /dev/null
@@ -1,142 +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.async;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-@Entity
-@Table(name="sync_queue_item")
-public class SyncQueueItemVO implements SyncQueueItem, InternalIdentity {
-
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id = null;
-
- @Column(name="queue_id")
- private Long queueId;
-
- @Column(name="content_type")
- private String contentType;
-
- @Column(name="content_id")
- private Long contentId;
-
- @Column(name="queue_proc_msid")
- private Long lastProcessMsid;
-
- @Column(name="queue_proc_number")
- private Long lastProcessNumber;
-
- @Column(name="queue_proc_time")
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastProcessTime;
-
- @Column(name="created")
- private Date created;
-
- public long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- @Override
- public Long getQueueId() {
- return queueId;
- }
-
- public void setQueueId(Long queueId) {
- this.queueId = queueId;
- }
-
- @Override
- public String getContentType() {
- return contentType;
- }
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
- @Override
- public Long getContentId() {
- return contentId;
- }
-
- public void setContentId(Long contentId) {
- this.contentId = contentId;
- }
-
- public Long getLastProcessMsid() {
- return lastProcessMsid;
- }
-
- public void setLastProcessMsid(Long lastProcessMsid) {
- this.lastProcessMsid = lastProcessMsid;
- }
-
- public Long getLastProcessNumber() {
- return lastProcessNumber;
- }
-
- public void setLastProcessNumber(Long lastProcessNumber) {
- this.lastProcessNumber = lastProcessNumber;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
- sb.append(", contentType: ").append(getContentType());
- sb.append(", contentId: ").append(getContentId());
- sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
- sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
- sb.append(", lastProcessTime: ").append(getLastProcessTime());
- sb.append(", created: ").append(getCreated());
- sb.append("}");
- return sb.toString();
- }
-
- public Date getLastProcessTime() {
- return lastProcessTime;
- }
-
- public void setLastProcessTime(Date lastProcessTime) {
- this.lastProcessTime = lastProcessTime;
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/SyncQueueManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/SyncQueueManager.java b/server/src/com/cloud/async/SyncQueueManager.java
deleted file mode 100644
index 80ca7a7..0000000
--- a/server/src/com/cloud/async/SyncQueueManager.java
+++ /dev/null
@@ -1,34 +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.async;
-
-import java.util.List;
-
-import com.cloud.utils.component.Manager;
-
-public interface SyncQueueManager extends Manager {
- public SyncQueueVO queue(String syncObjType, long syncObjId, String itemType, long itemId, long queueSizeLimit);
- public SyncQueueItemVO dequeueFromOne(long queueId, Long msid);
- public List<SyncQueueItemVO> dequeueFromAny(Long msid, int maxItems);
- public void purgeItem(long queueItemId);
- public void returnItem(long queueItemId);
-
- public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive);
- public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive);
-
- void purgeAsyncJobQueueItemId(long asyncJobId);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/SyncQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/SyncQueueManagerImpl.java b/server/src/com/cloud/async/SyncQueueManagerImpl.java
deleted file mode 100644
index ac41d87..0000000
--- a/server/src/com/cloud/async/SyncQueueManagerImpl.java
+++ /dev/null
@@ -1,257 +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.async;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.inject.Inject;
-import org.apache.log4j.Logger;
-
-import com.cloud.async.dao.SyncQueueDao;
-import com.cloud.async.dao.SyncQueueItemDao;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.component.ManagerBase;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-public class SyncQueueManagerImpl extends ManagerBase implements SyncQueueManager {
- public static final Logger s_logger = Logger.getLogger(SyncQueueManagerImpl.class.getName());
-
- @Inject private SyncQueueDao _syncQueueDao;
- @Inject private SyncQueueItemDao _syncQueueItemDao;
-
- @Override
- @DB
- public SyncQueueVO queue(String syncObjType, long syncObjId, String itemType, long itemId, long queueSizeLimit) {
- Transaction txn = Transaction.currentTxn();
- try {
- txn.start();
-
- _syncQueueDao.ensureQueue(syncObjType, syncObjId);
- SyncQueueVO queueVO = _syncQueueDao.find(syncObjType, syncObjId);
- if(queueVO == null)
- throw new CloudRuntimeException("Unable to queue item into DB, DB is full?");
-
- queueVO.setQueueSizeLimit(queueSizeLimit);
- _syncQueueDao.update(queueVO.getId(), queueVO);
-
- Date dt = DateUtil.currentGMTTime();
- SyncQueueItemVO item = new SyncQueueItemVO();
- item.setQueueId(queueVO.getId());
- item.setContentType(itemType);
- item.setContentId(itemId);
- item.setCreated(dt);
-
- _syncQueueItemDao.persist(item);
- txn.commit();
-
- return queueVO;
- } catch(Exception e) {
- s_logger.error("Unexpected exception: ", e);
- txn.rollback();
- }
- return null;
- }
-
- @Override
- @DB
- public SyncQueueItemVO dequeueFromOne(long queueId, Long msid) {
- Transaction txt = Transaction.currentTxn();
- try {
- txt.start();
-
- SyncQueueVO queueVO = _syncQueueDao.lockRow(queueId, true);
- if(queueVO == null) {
- s_logger.error("Sync queue(id: " + queueId + ") does not exist");
- txt.commit();
- return null;
- }
-
- if(queueReadyToProcess(queueVO)) {
- SyncQueueItemVO itemVO = _syncQueueItemDao.getNextQueueItem(queueVO.getId());
- if(itemVO != null) {
- Long processNumber = queueVO.getLastProcessNumber();
- if(processNumber == null)
- processNumber = new Long(1);
- else
- processNumber = processNumber + 1;
- Date dt = DateUtil.currentGMTTime();
- queueVO.setLastProcessNumber(processNumber);
- queueVO.setLastUpdated(dt);
- queueVO.setQueueSize(queueVO.getQueueSize() + 1);
- _syncQueueDao.update(queueVO.getId(), queueVO);
-
- itemVO.setLastProcessMsid(msid);
- itemVO.setLastProcessNumber(processNumber);
- itemVO.setLastProcessTime(dt);
- _syncQueueItemDao.update(itemVO.getId(), itemVO);
-
- txt.commit();
- return itemVO;
- } else {
- if(s_logger.isDebugEnabled())
- s_logger.debug("Sync queue (" + queueId + ") is currently empty");
- }
- } else {
- if(s_logger.isDebugEnabled())
- s_logger.debug("There is a pending process in sync queue(id: " + queueId + ")");
- }
- txt.commit();
- } catch(Exception e) {
- s_logger.error("Unexpected exception: ", e);
- txt.rollback();
- }
-
- return null;
- }
-
- @Override
- @DB
- public List<SyncQueueItemVO> dequeueFromAny(Long msid, int maxItems) {
-
- List<SyncQueueItemVO> resultList = new ArrayList<SyncQueueItemVO>();
- Transaction txt = Transaction.currentTxn();
- try {
- txt.start();
-
- List<SyncQueueItemVO> l = _syncQueueItemDao.getNextQueueItems(maxItems);
- if(l != null && l.size() > 0) {
- for(SyncQueueItemVO item : l) {
- SyncQueueVO queueVO = _syncQueueDao.lockRow(item.getQueueId(), true);
- SyncQueueItemVO itemVO = _syncQueueItemDao.lockRow(item.getId(), true);
- if(queueReadyToProcess(queueVO) && itemVO.getLastProcessNumber() == null) {
- Long processNumber = queueVO.getLastProcessNumber();
- if(processNumber == null)
- processNumber = new Long(1);
- else
- processNumber = processNumber + 1;
-
- Date dt = DateUtil.currentGMTTime();
- queueVO.setLastProcessNumber(processNumber);
- queueVO.setLastUpdated(dt);
- queueVO.setQueueSize(queueVO.getQueueSize() + 1);
- _syncQueueDao.update(queueVO.getId(), queueVO);
-
- itemVO.setLastProcessMsid(msid);
- itemVO.setLastProcessNumber(processNumber);
- itemVO.setLastProcessTime(dt);
- _syncQueueItemDao.update(item.getId(), itemVO);
-
- resultList.add(item);
- }
- }
- }
- txt.commit();
- return resultList;
- } catch(Exception e) {
- s_logger.error("Unexpected exception: ", e);
- txt.rollback();
- }
- return null;
- }
-
- @Override
- @DB
- public void purgeItem(long queueItemId) {
- Transaction txt = Transaction.currentTxn();
- try {
- txt.start();
-
- SyncQueueItemVO itemVO = _syncQueueItemDao.findById(queueItemId);
- if(itemVO != null) {
- SyncQueueVO queueVO = _syncQueueDao.lockRow(itemVO.getQueueId(), true);
-
- _syncQueueItemDao.expunge(itemVO.getId());
-
- // if item is active, reset queue information
- if (itemVO.getLastProcessMsid() != null) {
- queueVO.setLastUpdated(DateUtil.currentGMTTime());
- // decrement the count
- assert (queueVO.getQueueSize() > 0) : "Count reduce happens when it's already <= 0!";
- queueVO.setQueueSize(queueVO.getQueueSize() - 1);
- _syncQueueDao.update(queueVO.getId(), queueVO);
- }
- }
- txt.commit();
- } catch(Exception e) {
- s_logger.error("Unexpected exception: ", e);
- txt.rollback();
- }
- }
-
- @Override
- @DB
- public void returnItem(long queueItemId) {
- Transaction txt = Transaction.currentTxn();
- try {
- txt.start();
-
- SyncQueueItemVO itemVO = _syncQueueItemDao.findById(queueItemId);
- if(itemVO != null) {
- SyncQueueVO queueVO = _syncQueueDao.lockRow(itemVO.getQueueId(), true);
-
- itemVO.setLastProcessMsid(null);
- itemVO.setLastProcessNumber(null);
- itemVO.setLastProcessTime(null);
- _syncQueueItemDao.update(queueItemId, itemVO);
-
- queueVO.setLastUpdated(DateUtil.currentGMTTime());
- _syncQueueDao.update(queueVO.getId(), queueVO);
- }
- txt.commit();
- } catch(Exception e) {
- s_logger.error("Unexpected exception: ", e);
- txt.rollback();
- }
- }
-
- @Override
- public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
- return _syncQueueItemDao.getActiveQueueItems(msid, exclusive);
- }
-
- @Override
- public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive) {
- return _syncQueueItemDao.getBlockedQueueItems(thresholdMs, exclusive);
- }
-
- private boolean queueReadyToProcess(SyncQueueVO queueVO) {
- return true;
-
- //
- // TODO
- //
- // Need to disable concurrency disable at queue level due to the need to support
- // job wake-up dispatching task
- //
- // Concurrency control is better done at higher level and leave the job scheduling/serializing simpler
- //
-
- // return queueVO.getQueueSize() < queueVO.getQueueSizeLimit();
- }
-
- @Override
- public void purgeAsyncJobQueueItemId(long asyncJobId) {
- Long itemId = _syncQueueItemDao.getQueueItemIdByContentIdAndType(asyncJobId, SyncQueueItem.AsyncJobContentType);
- if (itemId != null) {
- purgeItem(itemId);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/SyncQueueVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/SyncQueueVO.java b/server/src/com/cloud/async/SyncQueueVO.java
deleted file mode 100644
index 4f2bc4f..0000000
--- a/server/src/com/cloud/async/SyncQueueVO.java
+++ /dev/null
@@ -1,137 +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.async;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-@Entity
-@Table(name="sync_queue")
-public class SyncQueueVO implements InternalIdentity {
-
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id;
-
- @Column(name="sync_objtype")
-
- private String syncObjType;
-
- @Column(name="sync_objid")
- private Long syncObjId;
-
- @Column(name="queue_proc_number")
- private Long lastProcessNumber;
-
- @Column(name="created")
- @Temporal(TemporalType.TIMESTAMP)
- private Date created;
-
- @Column(name="last_updated")
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastUpdated;
-
- @Column(name="queue_size")
- private long queueSize = 0;
-
- @Column(name="queue_size_limit")
- private long queueSizeLimit = 0;
-
- public long getId() {
- return id;
- }
-
- public String getSyncObjType() {
- return syncObjType;
- }
-
- public void setSyncObjType(String syncObjType) {
- this.syncObjType = syncObjType;
- }
-
- public Long getSyncObjId() {
- return syncObjId;
- }
-
- public void setSyncObjId(Long syncObjId) {
- this.syncObjId = syncObjId;
- }
-
- public Long getLastProcessNumber() {
- return lastProcessNumber;
- }
-
- public void setLastProcessNumber(Long number) {
- lastProcessNumber = number;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public Date getLastUpdated() {
- return lastUpdated;
- }
-
- public void setLastUpdated(Date lastUpdated) {
- this.lastUpdated = lastUpdated;
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("SyncQueueVO {id:").append(getId());
- sb.append(", syncObjType: ").append(getSyncObjType());
- sb.append(", syncObjId: ").append(getSyncObjId());
- sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
- sb.append(", lastUpdated: ").append(getLastUpdated());
- sb.append(", created: ").append(getCreated());
- sb.append(", count: ").append(getQueueSize());
- sb.append("}");
- return sb.toString();
- }
-
- public long getQueueSize() {
- return queueSize;
- }
-
- public void setQueueSize(long queueSize) {
- this.queueSize = queueSize;
- }
-
- public long getQueueSizeLimit() {
- return queueSizeLimit;
- }
-
- public void setQueueSizeLimit(long queueSizeLimit) {
- this.queueSizeLimit = queueSizeLimit;
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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
deleted file mode 100644
index f09dff5..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobDao.java
+++ /dev/null
@@ -1,34 +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.async.dao;
-
-import java.util.Date;
-import java.util.List;
-
-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(String instanceType, Long accountId);
-
- AsyncJobVO findPseudoJob(long threadId, long msid);
- void cleanupPseduoJobs(long msid);
-
- List<AsyncJobVO> getExpiredJobs(Date cutTime, int limit);
- void resetJobProcess(long msid, int jobResultCode, String jobResultMessage);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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
deleted file mode 100644
index b8ac12d..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobDaoImpl.java
+++ /dev/null
@@ -1,155 +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.async.dao;
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobVO;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.Filter;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long> implements AsyncJobDao {
- private static final Logger s_logger = Logger.getLogger(AsyncJobDaoImpl.class.getName());
-
- private final SearchBuilder<AsyncJobVO> pendingAsyncJobSearch;
- private final SearchBuilder<AsyncJobVO> pendingAsyncJobsSearch;
- private final SearchBuilder<AsyncJobVO> expiringAsyncJobSearch;
- private final SearchBuilder<AsyncJobVO> pseudoJobSearch;
- private final SearchBuilder<AsyncJobVO> pseudoJobCleanupSearch;
-
- public AsyncJobDaoImpl() {
- pendingAsyncJobSearch = createSearchBuilder();
- pendingAsyncJobSearch.and("instanceType", pendingAsyncJobSearch.entity().getInstanceType(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobSearch.and("instanceId", pendingAsyncJobSearch.entity().getInstanceId(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobSearch.and("status", pendingAsyncJobSearch.entity().getStatus(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobSearch.done();
-
- pendingAsyncJobsSearch = createSearchBuilder();
- pendingAsyncJobsSearch.and("instanceType", pendingAsyncJobsSearch.entity().getInstanceType(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobsSearch.and("accountId", pendingAsyncJobsSearch.entity().getAccountId(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobsSearch.and("status", pendingAsyncJobsSearch.entity().getStatus(),
- SearchCriteria.Op.EQ);
- pendingAsyncJobsSearch.done();
-
- expiringAsyncJobSearch = createSearchBuilder();
- expiringAsyncJobSearch.and("created", expiringAsyncJobSearch.entity().getCreated(),
- SearchCriteria.Op.LTEQ);
- expiringAsyncJobSearch.done();
-
- pseudoJobSearch = createSearchBuilder();
- pseudoJobSearch.and("jobDispatcher", pseudoJobSearch.entity().getDispatcher(), Op.EQ);
- pseudoJobSearch.and("instanceType", pseudoJobSearch.entity().getInstanceType(), Op.EQ);
- pseudoJobSearch.and("instanceId", pseudoJobSearch.entity().getInstanceId(), Op.EQ);
- pseudoJobSearch.done();
-
- pseudoJobCleanupSearch = createSearchBuilder();
- pseudoJobCleanupSearch.and("initMsid", pseudoJobCleanupSearch.entity().getInitMsid(), Op.EQ);
- pseudoJobCleanupSearch.done();
- }
-
- public AsyncJobVO findInstancePendingAsyncJob(String instanceType, long instanceId) {
- SearchCriteria<AsyncJobVO> sc = pendingAsyncJobSearch.create();
- sc.setParameters("instanceType", instanceType);
- sc.setParameters("instanceId", instanceId);
- sc.setParameters("status", AsyncJobConstants.STATUS_IN_PROGRESS);
-
- List<AsyncJobVO> l = listIncludingRemovedBy(sc);
- if(l != null && l.size() > 0) {
- if(l.size() > 1) {
- s_logger.warn("Instance " + instanceType + "-" + instanceId + " has multiple pending async-job");
- }
-
- return l.get(0);
- }
- return null;
- }
-
- public List<AsyncJobVO> findInstancePendingAsyncJobs(String instanceType, Long accountId) {
- SearchCriteria<AsyncJobVO> sc = pendingAsyncJobsSearch.create();
- sc.setParameters("instanceType", instanceType);
-
- if (accountId != null) {
- sc.setParameters("accountId", accountId);
- }
- sc.setParameters("status", AsyncJobConstants.STATUS_IN_PROGRESS);
-
- return listBy(sc);
- }
-
- public AsyncJobVO findPseudoJob(long threadId, long msid) {
- SearchCriteria<AsyncJobVO> sc = pseudoJobSearch.create();
- sc.setParameters("jobDispatcher", AsyncJobConstants.JOB_DISPATCHER_PSEUDO);
- sc.setParameters("instanceType", AsyncJobConstants.PSEUDO_JOB_INSTANCE_TYPE);
- sc.setParameters("instanceId", threadId);
-
- List<AsyncJobVO> result = listBy(sc);
- if(result != null && result.size() > 0) {
- assert(result.size() == 1);
- return result.get(0);
- }
-
- return null;
- }
-
- public void cleanupPseduoJobs(long msid) {
- SearchCriteria<AsyncJobVO> sc = pseudoJobCleanupSearch.create();
- sc.setParameters("initMsid", msid);
- this.expunge(sc);
- }
-
- public List<AsyncJobVO> getExpiredJobs(Date cutTime, int limit) {
- SearchCriteria<AsyncJobVO> sc = expiringAsyncJobSearch.create();
- sc.setParameters("created", cutTime);
- Filter filter = new Filter(AsyncJobVO.class, "created", true, 0L, (long)limit);
- return listIncludingRemovedBy(sc, filter);
- }
-
- @DB
- public void resetJobProcess(long msid, int jobResultCode, String jobResultMessage) {
- String sql = "UPDATE async_job SET job_status=" + AsyncJobConstants.STATUS_FAILED + ", job_result_code=" + jobResultCode
- + ", job_result='" + jobResultMessage + "' where job_status=0 AND (job_complete_msid=? OR (job_complete_msid IS NULL AND job_init_msid=?))";
-
- Transaction txn = Transaction.currentTxn();
- PreparedStatement pstmt = null;
- try {
- pstmt = txn.prepareAutoCloseStatement(sql);
- pstmt.setLong(1, msid);
- pstmt.setLong(2, msid);
- pstmt.execute();
- } catch (SQLException e) {
- s_logger.warn("Unable to reset job status for management server " + msid, e);
- } catch (Throwable e) {
- s_logger.warn("Unable to reset job status for management server " + msid, e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/AsyncJobJoinMapDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobJoinMapDao.java b/server/src/com/cloud/async/dao/AsyncJobJoinMapDao.java
deleted file mode 100644
index c3ee86a..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobJoinMapDao.java
+++ /dev/null
@@ -1,39 +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.async.dao;
-
-import java.util.List;
-
-import com.cloud.async.AsyncJobJoinMapVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface AsyncJobJoinMapDao extends GenericDao<AsyncJobJoinMapVO, Long> {
-
- Long joinJob(long jobId, long joinJobId, long joinMsid,
- long wakeupIntervalMs, long expirationMs,
- Long syncSourceId, String wakeupHandler, String wakeupDispatcher);
- void disjoinJob(long jobId, long joinedJobId);
- void disjoinAllJobs(long jobId);
-
- AsyncJobJoinMapVO getJoinRecord(long jobId, long joinJobId);
- List<AsyncJobJoinMapVO> listJoinRecords(long jobId);
-
- void completeJoin(long joinJobId, int joinStatus, String joinResult, long completeMsid);
-
- List<Long> wakeupScan();
- List<Long> wakeupByJoinedJobCompletion(long joinedJobId);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/AsyncJobJoinMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobJoinMapDaoImpl.java b/server/src/com/cloud/async/dao/AsyncJobJoinMapDaoImpl.java
deleted file mode 100644
index d69f343..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobJoinMapDaoImpl.java
+++ /dev/null
@@ -1,238 +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.async.dao;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.TimeZone;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobJoinMapVO;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.db.UpdateBuilder;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-public class AsyncJobJoinMapDaoImpl extends GenericDaoBase<AsyncJobJoinMapVO, Long> implements AsyncJobJoinMapDao {
- public static final Logger s_logger = Logger.getLogger(AsyncJobJoinMapDaoImpl.class);
-
- private final SearchBuilder<AsyncJobJoinMapVO> RecordSearch;
- private final SearchBuilder<AsyncJobJoinMapVO> RecordSearchByOwner;
- private final SearchBuilder<AsyncJobJoinMapVO> CompleteJoinSearch;
- private final SearchBuilder<AsyncJobJoinMapVO> WakeupSearch;
-
- public AsyncJobJoinMapDaoImpl() {
- RecordSearch = createSearchBuilder();
- RecordSearch.and("jobId", RecordSearch.entity().getJobId(), Op.EQ);
- RecordSearch.and("joinJobId", RecordSearch.entity().getJoinJobId(), Op.EQ);
- RecordSearch.done();
-
- RecordSearchByOwner = createSearchBuilder();
- RecordSearchByOwner.and("jobId", RecordSearchByOwner.entity().getJobId(), Op.EQ);
- RecordSearchByOwner.done();
-
- CompleteJoinSearch = createSearchBuilder();
- CompleteJoinSearch.and("joinJobId", CompleteJoinSearch.entity().getJoinJobId(), Op.EQ);
- CompleteJoinSearch.done();
-
- WakeupSearch = createSearchBuilder();
- WakeupSearch.and("nextWakeupTime", WakeupSearch.entity().getNextWakeupTime(), Op.LT);
- WakeupSearch.and("expiration", WakeupSearch.entity().getExpiration(), Op.GT);
- WakeupSearch.and("joinStatus", WakeupSearch.entity().getJoinStatus(), Op.EQ);
- WakeupSearch.done();
- }
-
- public Long joinJob(long jobId, long joinJobId, long joinMsid,
- long wakeupIntervalMs, long expirationMs,
- Long syncSourceId, String wakeupHandler, String wakeupDispatcher) {
-
- AsyncJobJoinMapVO record = new AsyncJobJoinMapVO();
- record.setJobId(jobId);
- record.setJoinJobId(joinJobId);
- record.setJoinMsid(joinMsid);
- record.setJoinStatus(AsyncJobConstants.STATUS_IN_PROGRESS);
- record.setSyncSourceId(syncSourceId);
- record.setWakeupInterval(wakeupIntervalMs / 1000); // convert millisecond to second
- record.setWakeupHandler(wakeupHandler);
- record.setWakeupDispatcher(wakeupDispatcher);
- if(wakeupHandler != null) {
- record.setNextWakeupTime(new Date(DateUtil.currentGMTTime().getTime() + wakeupIntervalMs));
- record.setExpiration(new Date(DateUtil.currentGMTTime().getTime() + expirationMs));
- }
-
- this.persist(record);
- return record.getId();
- }
-
- public void disjoinJob(long jobId, long joinedJobId) {
- SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearch.create();
- sc.setParameters("jobId", jobId);
- sc.setParameters("joinJobId", joinedJobId);
-
- this.expunge(sc);
- }
-
- public void disjoinAllJobs(long jobId) {
- SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearchByOwner.create();
- sc.setParameters("jobId", jobId);
-
- this.expunge(sc);
- }
-
- public AsyncJobJoinMapVO getJoinRecord(long jobId, long joinJobId) {
- SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearch.create();
- sc.setParameters("jobId", jobId);
- sc.setParameters("joinJobId", joinJobId);
-
- List<AsyncJobJoinMapVO> result = this.listBy(sc);
- if(result != null && result.size() > 0) {
- assert(result.size() == 1);
- return result.get(0);
- }
-
- return null;
- }
-
- public List<AsyncJobJoinMapVO> listJoinRecords(long jobId) {
- SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearchByOwner.create();
- sc.setParameters("jobId", jobId);
-
- return this.listBy(sc);
- }
-
- public void completeJoin(long joinJobId, int joinStatus, String joinResult, long completeMsid) {
- AsyncJobJoinMapVO record = createForUpdate();
- record.setJoinStatus(joinStatus);
- record.setJoinResult(joinResult);
- record.setCompleteMsid(completeMsid);
- record.setLastUpdated(DateUtil.currentGMTTime());
-
- UpdateBuilder ub = getUpdateBuilder(record);
-
- SearchCriteria<AsyncJobJoinMapVO> sc = CompleteJoinSearch.create();
- sc.setParameters("joinJobId", joinJobId);
- update(ub, sc, null);
- }
-
- public List<Long> wakeupScan() {
- List<Long> standaloneList = new ArrayList<Long>();
-
- Date cutDate = DateUtil.currentGMTTime();
-
- Transaction txn = Transaction.currentTxn();
- PreparedStatement pstmt = null;
- try {
- txn.start();
-
- //
- // performance sensitive processing, do it in plain SQL
- //
- String sql = "UPDATE async_job SET job_pending_signals=1 WHERE id IN " +
- "(SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ?)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.executeUpdate();
- pstmt.close();
-
- sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " +
- "(SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ?)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.executeUpdate();
- pstmt.close();
-
- sql = "SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- ResultSet rs = pstmt.executeQuery();
- while(rs.next()) {
- standaloneList.add(rs.getLong(1));
- }
- rs.close();
- pstmt.close();
-
- // update for next wake-up
- sql = "UPDATE async_job_join_map SET next_wakeup=DATE_ADD(next_wakeup, INTERVAL wakeup_interval SECOND) WHERE next_wakeup < ? AND expiration > ?";
- pstmt = txn.prepareStatement(sql);
- pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
- pstmt.executeUpdate();
- pstmt.close();
-
- txn.commit();
- } catch (SQLException e) {
- s_logger.error("Unexpected exception", e);
- }
-
- return standaloneList;
- }
-
- public List<Long> wakeupByJoinedJobCompletion(long joinedJobId) {
- List<Long> standaloneList = new ArrayList<Long>();
-
- Transaction txn = Transaction.currentTxn();
- PreparedStatement pstmt = null;
- try {
- txn.start();
-
- //
- // performance sensitive processing, do it in plain SQL
- //
- String sql = "UPDATE async_job SET job_pending_signals=1 WHERE id IN " +
- "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setLong(1, joinedJobId);
- pstmt.executeUpdate();
- pstmt.close();
-
- sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " +
- "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setLong(1, joinedJobId);
- pstmt.executeUpdate();
- pstmt.close();
-
- sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
- pstmt = txn.prepareStatement(sql);
- pstmt.setLong(1, joinedJobId);
- ResultSet rs = pstmt.executeQuery();
- while(rs.next()) {
- standaloneList.add(rs.getLong(1));
- }
- rs.close();
- pstmt.close();
-
- txn.commit();
- } catch (SQLException e) {
- s_logger.error("Unexpected exception", e);
- }
-
- return standaloneList;
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/AsyncJobJournalDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobJournalDao.java b/server/src/com/cloud/async/dao/AsyncJobJournalDao.java
deleted file mode 100644
index 6cfbe93..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobJournalDao.java
+++ /dev/null
@@ -1,26 +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.async.dao;
-
-import java.util.List;
-
-import com.cloud.async.AsyncJobJournalVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface AsyncJobJournalDao extends GenericDao<AsyncJobJournalVO, Long> {
- List<AsyncJobJournalVO> getJobJournal(long jobId);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/AsyncJobJournalDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/AsyncJobJournalDaoImpl.java b/server/src/com/cloud/async/dao/AsyncJobJournalDaoImpl.java
deleted file mode 100644
index 5dd0141..0000000
--- a/server/src/com/cloud/async/dao/AsyncJobJournalDaoImpl.java
+++ /dev/null
@@ -1,44 +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.async.dao;
-
-import java.util.List;
-
-import com.cloud.async.AsyncJobJournalVO;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-public class AsyncJobJournalDaoImpl extends GenericDaoBase<AsyncJobJournalVO, Long> implements AsyncJobJournalDao {
-
- private final SearchBuilder<AsyncJobJournalVO> JobJournalSearch;
-
- public AsyncJobJournalDaoImpl() {
- JobJournalSearch = createSearchBuilder();
- JobJournalSearch.and("jobId", JobJournalSearch.entity().getJobId(), Op.EQ);
- JobJournalSearch.done();
- }
-
- @Override
- public List<AsyncJobJournalVO> getJobJournal(long jobId) {
- SearchCriteria<AsyncJobJournalVO> sc = JobJournalSearch.create();
- sc.setParameters("jobId", jobId);
-
- return this.listBy(sc);
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/SyncQueueDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueDao.java b/server/src/com/cloud/async/dao/SyncQueueDao.java
deleted file mode 100644
index edd695c..0000000
--- a/server/src/com/cloud/async/dao/SyncQueueDao.java
+++ /dev/null
@@ -1,25 +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.async.dao;
-
-import com.cloud.async.SyncQueueVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface SyncQueueDao extends GenericDao<SyncQueueVO, Long>{
- public void ensureQueue(String syncObjType, long syncObjId);
- public SyncQueueVO find(String syncObjType, long syncObjId);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java b/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
deleted file mode 100644
index a1dc90a..0000000
--- a/server/src/com/cloud/async/dao/SyncQueueDaoImpl.java
+++ /dev/null
@@ -1,77 +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.async.dao;
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.async.SyncQueueVO;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-
-public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long> implements SyncQueueDao {
- private static final Logger s_logger = Logger.getLogger(SyncQueueDaoImpl.class.getName());
-
- SearchBuilder<SyncQueueVO> TypeIdSearch = createSearchBuilder();
-
- public SyncQueueDaoImpl() {
- super();
- TypeIdSearch = createSearchBuilder();
- TypeIdSearch.and("syncObjType", TypeIdSearch.entity().getSyncObjType(), SearchCriteria.Op.EQ);
- TypeIdSearch.and("syncObjId", TypeIdSearch.entity().getSyncObjId(), SearchCriteria.Op.EQ);
- TypeIdSearch.done();
- }
-
- @Override
- public void ensureQueue(String syncObjType, long syncObjId) {
- Date dt = DateUtil.currentGMTTime();
- String sql = "INSERT IGNORE INTO sync_queue(sync_objtype, sync_objid, created, last_updated)" +
- " values(?, ?, ?, ?)";
-
- Transaction txn = Transaction.currentTxn();
- PreparedStatement pstmt = null;
- try {
- pstmt = txn.prepareAutoCloseStatement(sql);
- pstmt.setString(1, syncObjType);
- pstmt.setLong(2, syncObjId);
- pstmt.setString(3, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
- pstmt.setString(4, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
- pstmt.execute();
- } catch (SQLException e) {
- s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
- } catch (Throwable e) {
- s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
- }
- }
-
- @Override
- public SyncQueueVO find(String syncObjType, long syncObjId) {
- SearchCriteria<SyncQueueVO> sc = TypeIdSearch.create();
- sc.setParameters("syncObjType", syncObjType);
- sc.setParameters("syncObjId", syncObjId);
- return findOneBy(sc);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/SyncQueueItemDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueItemDao.java b/server/src/com/cloud/async/dao/SyncQueueItemDao.java
deleted file mode 100644
index b5a4eab..0000000
--- a/server/src/com/cloud/async/dao/SyncQueueItemDao.java
+++ /dev/null
@@ -1,30 +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.async.dao;
-
-import java.util.List;
-
-import com.cloud.async.SyncQueueItemVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface SyncQueueItemDao extends GenericDao<SyncQueueItemVO, Long> {
- public SyncQueueItemVO getNextQueueItem(long queueId);
- public List<SyncQueueItemVO> getNextQueueItems(int maxItems);
- public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive);
- public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive);
- public Long getQueueItemIdByContentIdAndType(long contentId, String contentType);
-}
[10/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
index b049f66..f6c07ae 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainRouterResponse;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.router.VirtualRouter;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
index 67f0a4b..c043311 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CancelPrimaryStorageMaintenanceCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.storage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StoragePoolResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.storage.StoragePool;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
index 5178d68..136f136 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/CreateStoragePoolCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.storage;
import java.net.UnknownHostException;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.ClusterResponse;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ResourceInUseException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
index 6aaf53e..c558cb1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/DeletePoolCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.storage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
index edc5d6f..12bb6d0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStoragePoolsCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.storage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
@APICommand(name = "listStoragePools", description="Lists storage pools.", responseObject=StoragePoolResponse.class)
public class ListStoragePoolsCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
index 0dfc663..437b164 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListStorageProvidersCmd.java
@@ -20,6 +20,8 @@ package org.apache.cloudstack.api.command.admin.storage;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.StorageProviderResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
index b553748..269b0ab 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/PreparePrimaryStorageForMaintenanceCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.storage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StoragePoolResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
index 2ecb90f..283d911 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/UpdateStoragePoolCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.storage;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StoragePoolResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.StoragePool;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java b/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
index 364d916..3d330a5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/swift/AddSwiftCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.swift;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SwiftResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.DiscoveryException;
import com.cloud.storage.Swift;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
index 7cfe6e1..9e923d0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/swift/ListSwiftsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.swift;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SwiftResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.Swift;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
index 962cec2..392d13f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
index 82a2045..f3dad4d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.systemvm;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -30,9 +32,7 @@ import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.SystemVmResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
index 31871b9..923e6fd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SystemVmInstanceResponse;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
index b7d97e2..dba34e1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
index 622f7af..9917747 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
index fb87d02..396360f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
index e91d005..4b5feb8 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.systemvm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.SystemVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.offering.ServiceOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
index 7d41d10..12be54f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.template;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
index 48424fe..9bd5d50 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficMonitorCmd.java
@@ -16,7 +16,7 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
-import javax.inject.Inject;
+import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
index a5333dd..53cab0b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/AddTrafficTypeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.TrafficTypeResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.PhysicalNetworkTrafficType;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
index e3bb299..c7c3e1b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficMonitorCmd.java
@@ -16,7 +16,7 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
-import javax.inject.Inject;
+import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
index 007e01f..1696ef0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/DeleteTrafficTypeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.TrafficTypeResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
index 13710f9..57062f3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/GenerateUsageRecordsCmd.java
@@ -18,12 +18,17 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.Date;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
+
import com.cloud.user.Account;
@APICommand(name = "generateUsageRecords", description="Generates usage records. This will generate records only if there any records to be generated, i.e if the scheduled usage job was not run or failed", responseObject=SuccessResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
index f4960dd..26637b6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/GetUsageRecordsCmd.java
@@ -19,7 +19,8 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.TimeZone;
+
+import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -31,7 +32,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.UsageRecordResponse;
import org.apache.cloudstack.usage.Usage;
-import org.apache.log4j.Logger;
@APICommand(name = "listUsageRecords", description="Lists usage records for accounts", responseObject=UsageRecordResponse.class)
public class GetUsageRecordsCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
index e8e3b22..8468809 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficMonitorsCmd.java
@@ -19,7 +19,7 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.ArrayList;
import java.util.List;
-import javax.inject.Inject;
+import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +29,6 @@ import org.apache.cloudstack.api.command.user.offering.ListServiceOfferingsCmd;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TrafficMonitorResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.host.Host;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
index 14b69c3..296d0da 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TrafficTypeImplementorResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
index f239996..bc26526 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.cloudstack.api.response.TrafficTypeResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.PhysicalNetworkTrafficType;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
index bc02911..f0354f8 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListUsageTypesCmd.java
@@ -18,12 +18,13 @@ package org.apache.cloudstack.api.command.admin.usage;
import java.util.List;
-import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UsageTypeResponse;
+
import com.cloud.user.Account;
@APICommand(name = "listUsageTypes", description = "List Usage Types", responseObject = UsageTypeResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
index b6b9a05..2718066 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/usage/UpdateTrafficTypeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.usage;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TrafficTypeResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.PhysicalNetworkTrafficType;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
index 7b3f230..f9fc1ab 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
index 5683d58..2faa734 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/DeleteUserCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.user;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
index 65569d0..2e3c356 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/DisableUserCmd.java
@@ -18,19 +18,18 @@ package org.apache.cloudstack.api.command.admin.user;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
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;
-import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
index 382f67c..d3cef4b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/EnableUserCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.user;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
index c7b7e09..4243ed7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/GetUserCmd.java
@@ -16,12 +16,13 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.UserAccount;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
index c5c466c..e99c5f9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "listUsers", description="Lists user accounts", responseObject=UserResponse.class)
public class ListUsersCmd extends BaseListAccountResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
index dbe3303..3655bd5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/LockUserCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
index c92e65d..5e63ac1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/RegisterCmd.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.RegisterResponse;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java b/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
index 5ea2dbd..39acf4a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.user;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
index 541da1e..b5e70fb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vlan;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Vlan;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
index e7b1105..ba0c1d7 100755
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/DedicatePublicIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vlan;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,8 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
-import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Vlan;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
index 6023b3d6..99104ff 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/DeleteVlanIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vlan;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
index db6006a..0590487 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/ListVlanIpRangesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.vlan;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -31,7 +33,6 @@ import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Vlan;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
index 91cc7d3..2cf5359 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vlan/ReleasePublicIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vlan;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
index 152dd4e..662ca68 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.vm;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
index e9779ce..083b596 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
index b1eaf11..d38d13c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java
@@ -21,15 +21,17 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
-
-import org.apache.cloudstack.api.BaseCmd.CommandType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InvalidParameterValueException;
@@ -37,9 +39,7 @@ import com.cloud.exception.ManagementServerException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.exception.VirtualMachineMigrationException;
import com.cloud.host.Host;
-import com.cloud.storage.StoragePool;
import com.cloud.user.Account;
-import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
import com.cloud.vm.VirtualMachine;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
index 13e755c..0b88ef7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
index d68f82e..9cb8f18 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.PrivateGatewayResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
index 4a3a92a..49cf0a3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java
@@ -16,7 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vpc;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,7 +32,6 @@ import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VpcOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
index 035f499..bb43ef7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PrivateGatewayResponse;
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.ConcurrentOperationException;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
index 4b16fa5..4e8f529 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeleteVPCOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VpcOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
index 9bbae06..1072c98 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VpcOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.vpc.VpcOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
index 5cc9052..271cf41 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/CreateZoneCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.zone;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.DataCenter;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
index e3d14f7..aca1608 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/DeleteZoneCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.zone;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
index a76e7cf..c82d4a9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/MarkDefaultZoneForAccountCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.admin.zone;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse;
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.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
index 16c334e..e7d7497 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/zone/UpdateZoneCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.zone;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.DataCenter;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
index ebc2272..2149361 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/AddAccountToProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
index df6deae..da4ecc6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/DeleteAccountFromProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.user.project.DeleteProjectCmd;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
index ebf2e4b..7b34ca8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.user.account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListDomainResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "listAccounts", description="Lists accounts and provides detailed account information for listed accounts", responseObject=AccountResponse.class)
public class ListAccountsCmd extends BaseListDomainResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
index c91e2f2..63440a1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/account/ListProjectAccountsCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
index afb530b..2b35650 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.address;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -32,23 +34,21 @@ import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VpcResponse;
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.dc.DataCenter.NetworkType;
import com.cloud.event.EventTypes;
-import com.cloud.exception.*;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientAddressCapacityException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.IpAddress;
import com.cloud.network.Network;
import com.cloud.network.vpc.Vpc;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.*;
-import org.apache.log4j.Logger;
-
-import java.util.List;
@APICommand(name = "associateIpAddress", description="Acquires and associates a public IP to an account.", responseObject=IPAddressResponse.class)
public class AssociateIPAddrCmd extends BaseAsyncCreateCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
index 22d07ce..96e2657 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/DisassociateIPAddrCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.address;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
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.InsufficientAddressCapacityException;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
index 92a49b9..974447d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.address;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -31,9 +33,7 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.VlanIpRangeResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.network.IpAddress;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
index ce6e89a..483b150 100644
--- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupTypesCmd.java
@@ -19,11 +19,12 @@ package org.apache.cloudstack.api.command.user.affinitygroup;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.affinity.AffinityGroupTypeResponse;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
index cf22647..e3ad905 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.ConditionResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.domain.Domain;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
index af79091..85794bb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ 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.FirewallRuleResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
index 5189b25..84a6182 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.HashMap;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -31,9 +33,7 @@ import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserResponse;
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.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
index 3b36f81..293a054 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.cloudstack.api.response.CounterResponse;
import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.as.Condition;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
index b009085..6fd6960 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
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.network.as.AutoScalePolicy;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
index 035d073..a49a9f6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
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.network.as.AutoScaleVmGroup;
import com.cloud.user.Account;
[04/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManagerImpl.java
new file mode 100644
index 0000000..7c57076
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManagerImpl.java
@@ -0,0 +1,258 @@
+// 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.framework.jobs;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueDao;
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDao;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.component.ManagerBase;
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public class SyncQueueManagerImpl extends ManagerBase implements SyncQueueManager {
+ public static final Logger s_logger = Logger.getLogger(SyncQueueManagerImpl.class.getName());
+
+ @Inject private SyncQueueDao _syncQueueDao;
+ @Inject private SyncQueueItemDao _syncQueueItemDao;
+
+ @Override
+ @DB
+ public SyncQueueVO queue(String syncObjType, long syncObjId, String itemType, long itemId, long queueSizeLimit) {
+ Transaction txn = Transaction.currentTxn();
+ try {
+ txn.start();
+
+ _syncQueueDao.ensureQueue(syncObjType, syncObjId);
+ SyncQueueVO queueVO = _syncQueueDao.find(syncObjType, syncObjId);
+ if(queueVO == null)
+ throw new CloudRuntimeException("Unable to queue item into DB, DB is full?");
+
+ queueVO.setQueueSizeLimit(queueSizeLimit);
+ _syncQueueDao.update(queueVO.getId(), queueVO);
+
+ Date dt = DateUtil.currentGMTTime();
+ SyncQueueItemVO item = new SyncQueueItemVO();
+ item.setQueueId(queueVO.getId());
+ item.setContentType(itemType);
+ item.setContentId(itemId);
+ item.setCreated(dt);
+
+ _syncQueueItemDao.persist(item);
+ txn.commit();
+
+ return queueVO;
+ } catch(Exception e) {
+ s_logger.error("Unexpected exception: ", e);
+ txn.rollback();
+ }
+ return null;
+ }
+
+ @Override
+ @DB
+ public SyncQueueItemVO dequeueFromOne(long queueId, Long msid) {
+ Transaction txt = Transaction.currentTxn();
+ try {
+ txt.start();
+
+ SyncQueueVO queueVO = _syncQueueDao.lockRow(queueId, true);
+ if(queueVO == null) {
+ s_logger.error("Sync queue(id: " + queueId + ") does not exist");
+ txt.commit();
+ return null;
+ }
+
+ if(queueReadyToProcess(queueVO)) {
+ SyncQueueItemVO itemVO = _syncQueueItemDao.getNextQueueItem(queueVO.getId());
+ if(itemVO != null) {
+ Long processNumber = queueVO.getLastProcessNumber();
+ if(processNumber == null)
+ processNumber = new Long(1);
+ else
+ processNumber = processNumber + 1;
+ Date dt = DateUtil.currentGMTTime();
+ queueVO.setLastProcessNumber(processNumber);
+ queueVO.setLastUpdated(dt);
+ queueVO.setQueueSize(queueVO.getQueueSize() + 1);
+ _syncQueueDao.update(queueVO.getId(), queueVO);
+
+ itemVO.setLastProcessMsid(msid);
+ itemVO.setLastProcessNumber(processNumber);
+ itemVO.setLastProcessTime(dt);
+ _syncQueueItemDao.update(itemVO.getId(), itemVO);
+
+ txt.commit();
+ return itemVO;
+ } else {
+ if(s_logger.isDebugEnabled())
+ s_logger.debug("Sync queue (" + queueId + ") is currently empty");
+ }
+ } else {
+ if(s_logger.isDebugEnabled())
+ s_logger.debug("There is a pending process in sync queue(id: " + queueId + ")");
+ }
+ txt.commit();
+ } catch(Exception e) {
+ s_logger.error("Unexpected exception: ", e);
+ txt.rollback();
+ }
+
+ return null;
+ }
+
+ @Override
+ @DB
+ public List<SyncQueueItemVO> dequeueFromAny(Long msid, int maxItems) {
+
+ List<SyncQueueItemVO> resultList = new ArrayList<SyncQueueItemVO>();
+ Transaction txt = Transaction.currentTxn();
+ try {
+ txt.start();
+
+ List<SyncQueueItemVO> l = _syncQueueItemDao.getNextQueueItems(maxItems);
+ if(l != null && l.size() > 0) {
+ for(SyncQueueItemVO item : l) {
+ SyncQueueVO queueVO = _syncQueueDao.lockRow(item.getQueueId(), true);
+ SyncQueueItemVO itemVO = _syncQueueItemDao.lockRow(item.getId(), true);
+ if(queueReadyToProcess(queueVO) && itemVO.getLastProcessNumber() == null) {
+ Long processNumber = queueVO.getLastProcessNumber();
+ if(processNumber == null)
+ processNumber = new Long(1);
+ else
+ processNumber = processNumber + 1;
+
+ Date dt = DateUtil.currentGMTTime();
+ queueVO.setLastProcessNumber(processNumber);
+ queueVO.setLastUpdated(dt);
+ queueVO.setQueueSize(queueVO.getQueueSize() + 1);
+ _syncQueueDao.update(queueVO.getId(), queueVO);
+
+ itemVO.setLastProcessMsid(msid);
+ itemVO.setLastProcessNumber(processNumber);
+ itemVO.setLastProcessTime(dt);
+ _syncQueueItemDao.update(item.getId(), itemVO);
+
+ resultList.add(item);
+ }
+ }
+ }
+ txt.commit();
+ return resultList;
+ } catch(Exception e) {
+ s_logger.error("Unexpected exception: ", e);
+ txt.rollback();
+ }
+ return null;
+ }
+
+ @Override
+ @DB
+ public void purgeItem(long queueItemId) {
+ Transaction txt = Transaction.currentTxn();
+ try {
+ txt.start();
+
+ SyncQueueItemVO itemVO = _syncQueueItemDao.findById(queueItemId);
+ if(itemVO != null) {
+ SyncQueueVO queueVO = _syncQueueDao.lockRow(itemVO.getQueueId(), true);
+
+ _syncQueueItemDao.expunge(itemVO.getId());
+
+ // if item is active, reset queue information
+ if (itemVO.getLastProcessMsid() != null) {
+ queueVO.setLastUpdated(DateUtil.currentGMTTime());
+ // decrement the count
+ assert (queueVO.getQueueSize() > 0) : "Count reduce happens when it's already <= 0!";
+ queueVO.setQueueSize(queueVO.getQueueSize() - 1);
+ _syncQueueDao.update(queueVO.getId(), queueVO);
+ }
+ }
+ txt.commit();
+ } catch(Exception e) {
+ s_logger.error("Unexpected exception: ", e);
+ txt.rollback();
+ }
+ }
+
+ @Override
+ @DB
+ public void returnItem(long queueItemId) {
+ Transaction txt = Transaction.currentTxn();
+ try {
+ txt.start();
+
+ SyncQueueItemVO itemVO = _syncQueueItemDao.findById(queueItemId);
+ if(itemVO != null) {
+ SyncQueueVO queueVO = _syncQueueDao.lockRow(itemVO.getQueueId(), true);
+
+ itemVO.setLastProcessMsid(null);
+ itemVO.setLastProcessNumber(null);
+ itemVO.setLastProcessTime(null);
+ _syncQueueItemDao.update(queueItemId, itemVO);
+
+ queueVO.setLastUpdated(DateUtil.currentGMTTime());
+ _syncQueueDao.update(queueVO.getId(), queueVO);
+ }
+ txt.commit();
+ } catch(Exception e) {
+ s_logger.error("Unexpected exception: ", e);
+ txt.rollback();
+ }
+ }
+
+ @Override
+ public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
+ return _syncQueueItemDao.getActiveQueueItems(msid, exclusive);
+ }
+
+ @Override
+ public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive) {
+ return _syncQueueItemDao.getBlockedQueueItems(thresholdMs, exclusive);
+ }
+
+ private boolean queueReadyToProcess(SyncQueueVO queueVO) {
+ return true;
+
+ //
+ // TODO
+ //
+ // Need to disable concurrency disable at queue level due to the need to support
+ // job wake-up dispatching task
+ //
+ // Concurrency control is better done at higher level and leave the job scheduling/serializing simpler
+ //
+
+ // return queueVO.getQueueSize() < queueVO.getQueueSizeLimit();
+ }
+
+ @Override
+ public void purgeAsyncJobQueueItemId(long asyncJobId) {
+ Long itemId = _syncQueueItemDao.getQueueItemIdByContentIdAndType(asyncJobId, SyncQueueItem.AsyncJobContentType);
+ if (itemId != null) {
+ purgeItem(itemId);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueVO.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueVO.java
new file mode 100644
index 0000000..cad3462
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueVO.java
@@ -0,0 +1,137 @@
+// 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.framework.jobs;
+
+import org.apache.cloudstack.api.InternalIdentity;
+
+import java.util.Date;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+@Entity
+@Table(name="sync_queue")
+public class SyncQueueVO implements InternalIdentity {
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private Long id;
+
+ @Column(name="sync_objtype")
+
+ private String syncObjType;
+
+ @Column(name="sync_objid")
+ private Long syncObjId;
+
+ @Column(name="queue_proc_number")
+ private Long lastProcessNumber;
+
+ @Column(name="created")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @Column(name="last_updated")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastUpdated;
+
+ @Column(name="queue_size")
+ private long queueSize = 0;
+
+ @Column(name="queue_size_limit")
+ private long queueSizeLimit = 0;
+
+ public long getId() {
+ return id;
+ }
+
+ public String getSyncObjType() {
+ return syncObjType;
+ }
+
+ public void setSyncObjType(String syncObjType) {
+ this.syncObjType = syncObjType;
+ }
+
+ public Long getSyncObjId() {
+ return syncObjId;
+ }
+
+ public void setSyncObjId(Long syncObjId) {
+ this.syncObjId = syncObjId;
+ }
+
+ public Long getLastProcessNumber() {
+ return lastProcessNumber;
+ }
+
+ public void setLastProcessNumber(Long number) {
+ lastProcessNumber = number;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public Date getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("SyncQueueVO {id:").append(getId());
+ sb.append(", syncObjType: ").append(getSyncObjType());
+ sb.append(", syncObjId: ").append(getSyncObjId());
+ sb.append(", lastProcessNumber: ").append(getLastProcessNumber());
+ sb.append(", lastUpdated: ").append(getLastUpdated());
+ sb.append(", created: ").append(getCreated());
+ sb.append(", count: ").append(getQueueSize());
+ sb.append("}");
+ return sb.toString();
+ }
+
+ public long getQueueSize() {
+ return queueSize;
+ }
+
+ public void setQueueSize(long queueSize) {
+ this.queueSize = queueSize;
+ }
+
+ public long getQueueSizeLimit() {
+ return queueSizeLimit;
+ }
+
+ public void setQueueSizeLimit(long queueSizeLimit) {
+ this.queueSizeLimit = queueSizeLimit;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDao.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDao.java
new file mode 100644
index 0000000..ba28495
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDao.java
@@ -0,0 +1,35 @@
+// 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.framework.jobs.dao;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface AsyncJobDao extends GenericDao<AsyncJobVO, Long> {
+ AsyncJobVO findInstancePendingAsyncJob(String instanceType, long instanceId);
+ List<AsyncJobVO> findInstancePendingAsyncJobs(String instanceType, Long accountId);
+
+ AsyncJobVO findPseudoJob(long threadId, long msid);
+ void cleanupPseduoJobs(long msid);
+
+ List<AsyncJobVO> getExpiredJobs(Date cutTime, int limit);
+ void resetJobProcess(long msid, int jobResultCode, String jobResultMessage);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
new file mode 100644
index 0000000..9559b9c
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobDaoImpl.java
@@ -0,0 +1,156 @@
+// 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.framework.jobs.dao;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long> implements AsyncJobDao {
+ private static final Logger s_logger = Logger.getLogger(AsyncJobDaoImpl.class.getName());
+
+ private final SearchBuilder<AsyncJobVO> pendingAsyncJobSearch;
+ private final SearchBuilder<AsyncJobVO> pendingAsyncJobsSearch;
+ private final SearchBuilder<AsyncJobVO> expiringAsyncJobSearch;
+ private final SearchBuilder<AsyncJobVO> pseudoJobSearch;
+ private final SearchBuilder<AsyncJobVO> pseudoJobCleanupSearch;
+
+ public AsyncJobDaoImpl() {
+ pendingAsyncJobSearch = createSearchBuilder();
+ pendingAsyncJobSearch.and("instanceType", pendingAsyncJobSearch.entity().getInstanceType(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobSearch.and("instanceId", pendingAsyncJobSearch.entity().getInstanceId(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobSearch.and("status", pendingAsyncJobSearch.entity().getStatus(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobSearch.done();
+
+ pendingAsyncJobsSearch = createSearchBuilder();
+ pendingAsyncJobsSearch.and("instanceType", pendingAsyncJobsSearch.entity().getInstanceType(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobsSearch.and("accountId", pendingAsyncJobsSearch.entity().getAccountId(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobsSearch.and("status", pendingAsyncJobsSearch.entity().getStatus(),
+ SearchCriteria.Op.EQ);
+ pendingAsyncJobsSearch.done();
+
+ expiringAsyncJobSearch = createSearchBuilder();
+ expiringAsyncJobSearch.and("created", expiringAsyncJobSearch.entity().getCreated(),
+ SearchCriteria.Op.LTEQ);
+ expiringAsyncJobSearch.done();
+
+ pseudoJobSearch = createSearchBuilder();
+ pseudoJobSearch.and("jobDispatcher", pseudoJobSearch.entity().getDispatcher(), Op.EQ);
+ pseudoJobSearch.and("instanceType", pseudoJobSearch.entity().getInstanceType(), Op.EQ);
+ pseudoJobSearch.and("instanceId", pseudoJobSearch.entity().getInstanceId(), Op.EQ);
+ pseudoJobSearch.done();
+
+ pseudoJobCleanupSearch = createSearchBuilder();
+ pseudoJobCleanupSearch.and("initMsid", pseudoJobCleanupSearch.entity().getInitMsid(), Op.EQ);
+ pseudoJobCleanupSearch.done();
+ }
+
+ public AsyncJobVO findInstancePendingAsyncJob(String instanceType, long instanceId) {
+ SearchCriteria<AsyncJobVO> sc = pendingAsyncJobSearch.create();
+ sc.setParameters("instanceType", instanceType);
+ sc.setParameters("instanceId", instanceId);
+ sc.setParameters("status", AsyncJobConstants.STATUS_IN_PROGRESS);
+
+ List<AsyncJobVO> l = listIncludingRemovedBy(sc);
+ if(l != null && l.size() > 0) {
+ if(l.size() > 1) {
+ s_logger.warn("Instance " + instanceType + "-" + instanceId + " has multiple pending async-job");
+ }
+
+ return l.get(0);
+ }
+ return null;
+ }
+
+ public List<AsyncJobVO> findInstancePendingAsyncJobs(String instanceType, Long accountId) {
+ SearchCriteria<AsyncJobVO> sc = pendingAsyncJobsSearch.create();
+ sc.setParameters("instanceType", instanceType);
+
+ if (accountId != null) {
+ sc.setParameters("accountId", accountId);
+ }
+ sc.setParameters("status", AsyncJobConstants.STATUS_IN_PROGRESS);
+
+ return listBy(sc);
+ }
+
+ public AsyncJobVO findPseudoJob(long threadId, long msid) {
+ SearchCriteria<AsyncJobVO> sc = pseudoJobSearch.create();
+ sc.setParameters("jobDispatcher", AsyncJobConstants.JOB_DISPATCHER_PSEUDO);
+ sc.setParameters("instanceType", AsyncJobConstants.PSEUDO_JOB_INSTANCE_TYPE);
+ sc.setParameters("instanceId", threadId);
+
+ List<AsyncJobVO> result = listBy(sc);
+ if(result != null && result.size() > 0) {
+ assert(result.size() == 1);
+ return result.get(0);
+ }
+
+ return null;
+ }
+
+ public void cleanupPseduoJobs(long msid) {
+ SearchCriteria<AsyncJobVO> sc = pseudoJobCleanupSearch.create();
+ sc.setParameters("initMsid", msid);
+ this.expunge(sc);
+ }
+
+ public List<AsyncJobVO> getExpiredJobs(Date cutTime, int limit) {
+ SearchCriteria<AsyncJobVO> sc = expiringAsyncJobSearch.create();
+ sc.setParameters("created", cutTime);
+ Filter filter = new Filter(AsyncJobVO.class, "created", true, 0L, (long)limit);
+ return listIncludingRemovedBy(sc, filter);
+ }
+
+ @DB
+ public void resetJobProcess(long msid, int jobResultCode, String jobResultMessage) {
+ String sql = "UPDATE async_job SET job_status=" + AsyncJobConstants.STATUS_FAILED + ", job_result_code=" + jobResultCode
+ + ", job_result='" + jobResultMessage + "' where job_status=0 AND (job_complete_msid=? OR (job_complete_msid IS NULL AND job_init_msid=?))";
+
+ Transaction txn = Transaction.currentTxn();
+ PreparedStatement pstmt = null;
+ try {
+ pstmt = txn.prepareAutoCloseStatement(sql);
+ pstmt.setLong(1, msid);
+ pstmt.setLong(2, msid);
+ pstmt.execute();
+ } catch (SQLException e) {
+ s_logger.warn("Unable to reset job status for management server " + msid, e);
+ } catch (Throwable e) {
+ s_logger.warn("Unable to reset job status for management server " + msid, e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.java
new file mode 100644
index 0000000..acf1324
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDao.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 org.apache.cloudstack.framework.jobs.dao;
+
+import java.util.List;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobJoinMapVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface AsyncJobJoinMapDao extends GenericDao<AsyncJobJoinMapVO, Long> {
+
+ Long joinJob(long jobId, long joinJobId, long joinMsid,
+ long wakeupIntervalMs, long expirationMs,
+ Long syncSourceId, String wakeupHandler, String wakeupDispatcher);
+ void disjoinJob(long jobId, long joinedJobId);
+ void disjoinAllJobs(long jobId);
+
+ AsyncJobJoinMapVO getJoinRecord(long jobId, long joinJobId);
+ List<AsyncJobJoinMapVO> listJoinRecords(long jobId);
+
+ void completeJoin(long joinJobId, int joinStatus, String joinResult, long completeMsid);
+
+ List<Long> wakeupScan();
+ List<Long> wakeupByJoinedJobCompletion(long joinedJobId);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
new file mode 100644
index 0000000..0b41953
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJoinMapDaoImpl.java
@@ -0,0 +1,239 @@
+// 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.framework.jobs.dao;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobJoinMapVO;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.UpdateBuilder;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+public class AsyncJobJoinMapDaoImpl extends GenericDaoBase<AsyncJobJoinMapVO, Long> implements AsyncJobJoinMapDao {
+ public static final Logger s_logger = Logger.getLogger(AsyncJobJoinMapDaoImpl.class);
+
+ private final SearchBuilder<AsyncJobJoinMapVO> RecordSearch;
+ private final SearchBuilder<AsyncJobJoinMapVO> RecordSearchByOwner;
+ private final SearchBuilder<AsyncJobJoinMapVO> CompleteJoinSearch;
+ private final SearchBuilder<AsyncJobJoinMapVO> WakeupSearch;
+
+ public AsyncJobJoinMapDaoImpl() {
+ RecordSearch = createSearchBuilder();
+ RecordSearch.and("jobId", RecordSearch.entity().getJobId(), Op.EQ);
+ RecordSearch.and("joinJobId", RecordSearch.entity().getJoinJobId(), Op.EQ);
+ RecordSearch.done();
+
+ RecordSearchByOwner = createSearchBuilder();
+ RecordSearchByOwner.and("jobId", RecordSearchByOwner.entity().getJobId(), Op.EQ);
+ RecordSearchByOwner.done();
+
+ CompleteJoinSearch = createSearchBuilder();
+ CompleteJoinSearch.and("joinJobId", CompleteJoinSearch.entity().getJoinJobId(), Op.EQ);
+ CompleteJoinSearch.done();
+
+ WakeupSearch = createSearchBuilder();
+ WakeupSearch.and("nextWakeupTime", WakeupSearch.entity().getNextWakeupTime(), Op.LT);
+ WakeupSearch.and("expiration", WakeupSearch.entity().getExpiration(), Op.GT);
+ WakeupSearch.and("joinStatus", WakeupSearch.entity().getJoinStatus(), Op.EQ);
+ WakeupSearch.done();
+ }
+
+ public Long joinJob(long jobId, long joinJobId, long joinMsid,
+ long wakeupIntervalMs, long expirationMs,
+ Long syncSourceId, String wakeupHandler, String wakeupDispatcher) {
+
+ AsyncJobJoinMapVO record = new AsyncJobJoinMapVO();
+ record.setJobId(jobId);
+ record.setJoinJobId(joinJobId);
+ record.setJoinMsid(joinMsid);
+ record.setJoinStatus(AsyncJobConstants.STATUS_IN_PROGRESS);
+ record.setSyncSourceId(syncSourceId);
+ record.setWakeupInterval(wakeupIntervalMs / 1000); // convert millisecond to second
+ record.setWakeupHandler(wakeupHandler);
+ record.setWakeupDispatcher(wakeupDispatcher);
+ if(wakeupHandler != null) {
+ record.setNextWakeupTime(new Date(DateUtil.currentGMTTime().getTime() + wakeupIntervalMs));
+ record.setExpiration(new Date(DateUtil.currentGMTTime().getTime() + expirationMs));
+ }
+
+ this.persist(record);
+ return record.getId();
+ }
+
+ public void disjoinJob(long jobId, long joinedJobId) {
+ SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearch.create();
+ sc.setParameters("jobId", jobId);
+ sc.setParameters("joinJobId", joinedJobId);
+
+ this.expunge(sc);
+ }
+
+ public void disjoinAllJobs(long jobId) {
+ SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearchByOwner.create();
+ sc.setParameters("jobId", jobId);
+
+ this.expunge(sc);
+ }
+
+ public AsyncJobJoinMapVO getJoinRecord(long jobId, long joinJobId) {
+ SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearch.create();
+ sc.setParameters("jobId", jobId);
+ sc.setParameters("joinJobId", joinJobId);
+
+ List<AsyncJobJoinMapVO> result = this.listBy(sc);
+ if(result != null && result.size() > 0) {
+ assert(result.size() == 1);
+ return result.get(0);
+ }
+
+ return null;
+ }
+
+ public List<AsyncJobJoinMapVO> listJoinRecords(long jobId) {
+ SearchCriteria<AsyncJobJoinMapVO> sc = RecordSearchByOwner.create();
+ sc.setParameters("jobId", jobId);
+
+ return this.listBy(sc);
+ }
+
+ public void completeJoin(long joinJobId, int joinStatus, String joinResult, long completeMsid) {
+ AsyncJobJoinMapVO record = createForUpdate();
+ record.setJoinStatus(joinStatus);
+ record.setJoinResult(joinResult);
+ record.setCompleteMsid(completeMsid);
+ record.setLastUpdated(DateUtil.currentGMTTime());
+
+ UpdateBuilder ub = getUpdateBuilder(record);
+
+ SearchCriteria<AsyncJobJoinMapVO> sc = CompleteJoinSearch.create();
+ sc.setParameters("joinJobId", joinJobId);
+ update(ub, sc, null);
+ }
+
+ public List<Long> wakeupScan() {
+ List<Long> standaloneList = new ArrayList<Long>();
+
+ Date cutDate = DateUtil.currentGMTTime();
+
+ Transaction txn = Transaction.currentTxn();
+ PreparedStatement pstmt = null;
+ try {
+ txn.start();
+
+ //
+ // performance sensitive processing, do it in plain SQL
+ //
+ String sql = "UPDATE async_job SET job_pending_signals=1 WHERE id IN " +
+ "(SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ?)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.executeUpdate();
+ pstmt.close();
+
+ sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " +
+ "(SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ?)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.executeUpdate();
+ pstmt.close();
+
+ sql = "SELECT job_id FROM async_job_join_map WHERE next_wakeup < ? AND expiration > ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ ResultSet rs = pstmt.executeQuery();
+ while(rs.next()) {
+ standaloneList.add(rs.getLong(1));
+ }
+ rs.close();
+ pstmt.close();
+
+ // update for next wake-up
+ sql = "UPDATE async_job_join_map SET next_wakeup=DATE_ADD(next_wakeup, INTERVAL wakeup_interval SECOND) WHERE next_wakeup < ? AND expiration > ?";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setString(1, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.setString(2, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), cutDate));
+ pstmt.executeUpdate();
+ pstmt.close();
+
+ txn.commit();
+ } catch (SQLException e) {
+ s_logger.error("Unexpected exception", e);
+ }
+
+ return standaloneList;
+ }
+
+ public List<Long> wakeupByJoinedJobCompletion(long joinedJobId) {
+ List<Long> standaloneList = new ArrayList<Long>();
+
+ Transaction txn = Transaction.currentTxn();
+ PreparedStatement pstmt = null;
+ try {
+ txn.start();
+
+ //
+ // performance sensitive processing, do it in plain SQL
+ //
+ String sql = "UPDATE async_job SET job_pending_signals=1 WHERE id IN " +
+ "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setLong(1, joinedJobId);
+ pstmt.executeUpdate();
+ pstmt.close();
+
+ sql = "UPDATE sync_queue_item SET queue_proc_msid=NULL, queue_proc_number=NULL WHERE content_id IN " +
+ "(SELECT job_id FROM async_job_join_map WHERE join_job_id = ?)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setLong(1, joinedJobId);
+ pstmt.executeUpdate();
+ pstmt.close();
+
+ sql = "SELECT job_id FROM async_job_join_map WHERE join_job_id = ? AND job_id NOT IN (SELECT content_id FROM sync_queue_item)";
+ pstmt = txn.prepareStatement(sql);
+ pstmt.setLong(1, joinedJobId);
+ ResultSet rs = pstmt.executeQuery();
+ while(rs.next()) {
+ standaloneList.add(rs.getLong(1));
+ }
+ rs.close();
+ pstmt.close();
+
+ txn.commit();
+ } catch (SQLException e) {
+ s_logger.error("Unexpected exception", e);
+ }
+
+ return standaloneList;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDao.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDao.java
new file mode 100644
index 0000000..e8d8287
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDao.java
@@ -0,0 +1,27 @@
+// 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.framework.jobs.dao;
+
+import java.util.List;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobJournalVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface AsyncJobJournalDao extends GenericDao<AsyncJobJournalVO, Long> {
+ List<AsyncJobJournalVO> getJobJournal(long jobId);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDaoImpl.java
new file mode 100644
index 0000000..9d02307
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/AsyncJobJournalDaoImpl.java
@@ -0,0 +1,45 @@
+// 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.framework.jobs.dao;
+
+import java.util.List;
+
+import org.apache.cloudstack.framework.jobs.AsyncJobJournalVO;
+
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Op;
+
+public class AsyncJobJournalDaoImpl extends GenericDaoBase<AsyncJobJournalVO, Long> implements AsyncJobJournalDao {
+
+ private final SearchBuilder<AsyncJobJournalVO> JobJournalSearch;
+
+ public AsyncJobJournalDaoImpl() {
+ JobJournalSearch = createSearchBuilder();
+ JobJournalSearch.and("jobId", JobJournalSearch.entity().getJobId(), Op.EQ);
+ JobJournalSearch.done();
+ }
+
+ @Override
+ public List<AsyncJobJournalVO> getJobJournal(long jobId) {
+ SearchCriteria<AsyncJobJournalVO> sc = JobJournalSearch.create();
+ sc.setParameters("jobId", jobId);
+
+ return this.listBy(sc);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDao.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDao.java
new file mode 100644
index 0000000..f45245a
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDao.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.framework.jobs.dao;
+
+import org.apache.cloudstack.framework.jobs.SyncQueueVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface SyncQueueDao extends GenericDao<SyncQueueVO, Long>{
+ public void ensureQueue(String syncObjType, long syncObjId);
+ public SyncQueueVO find(String syncObjType, long syncObjId);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
new file mode 100644
index 0000000..05e2a73
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueDaoImpl.java
@@ -0,0 +1,78 @@
+// 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.framework.jobs.dao;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.TimeZone;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.SyncQueueVO;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.Transaction;
+
+public class SyncQueueDaoImpl extends GenericDaoBase<SyncQueueVO, Long> implements SyncQueueDao {
+ private static final Logger s_logger = Logger.getLogger(SyncQueueDaoImpl.class.getName());
+
+ SearchBuilder<SyncQueueVO> TypeIdSearch = createSearchBuilder();
+
+ public SyncQueueDaoImpl() {
+ super();
+ TypeIdSearch = createSearchBuilder();
+ TypeIdSearch.and("syncObjType", TypeIdSearch.entity().getSyncObjType(), SearchCriteria.Op.EQ);
+ TypeIdSearch.and("syncObjId", TypeIdSearch.entity().getSyncObjId(), SearchCriteria.Op.EQ);
+ TypeIdSearch.done();
+ }
+
+ @Override
+ public void ensureQueue(String syncObjType, long syncObjId) {
+ Date dt = DateUtil.currentGMTTime();
+ String sql = "INSERT IGNORE INTO sync_queue(sync_objtype, sync_objid, created, last_updated)" +
+ " values(?, ?, ?, ?)";
+
+ Transaction txn = Transaction.currentTxn();
+ PreparedStatement pstmt = null;
+ try {
+ pstmt = txn.prepareAutoCloseStatement(sql);
+ pstmt.setString(1, syncObjType);
+ pstmt.setLong(2, syncObjId);
+ pstmt.setString(3, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
+ pstmt.setString(4, DateUtil.getDateDisplayString(TimeZone.getTimeZone("GMT"), dt));
+ pstmt.execute();
+ } catch (SQLException e) {
+ s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
+ } catch (Throwable e) {
+ s_logger.warn("Unable to create sync queue " + syncObjType + "-" + syncObjId + ":" + e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public SyncQueueVO find(String syncObjType, long syncObjId) {
+ SearchCriteria<SyncQueueVO> sc = TypeIdSearch.create();
+ sc.setParameters("syncObjType", syncObjType);
+ sc.setParameters("syncObjId", syncObjId);
+ return findOneBy(sc);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDao.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDao.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDao.java
new file mode 100644
index 0000000..b78ccf7
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDao.java
@@ -0,0 +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.
+package org.apache.cloudstack.framework.jobs.dao;
+
+import java.util.List;
+
+import org.apache.cloudstack.framework.jobs.SyncQueueItemVO;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface SyncQueueItemDao extends GenericDao<SyncQueueItemVO, Long> {
+ public SyncQueueItemVO getNextQueueItem(long queueId);
+ public List<SyncQueueItemVO> getNextQueueItems(int maxItems);
+ public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive);
+ public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive);
+ public Long getQueueItemIdByContentIdAndType(long contentId, String contentType);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
new file mode 100644
index 0000000..08b777c
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/dao/SyncQueueItemDaoImpl.java
@@ -0,0 +1,155 @@
+// 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.framework.jobs.dao;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.TimeZone;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.jobs.SyncQueueItemVO;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.db.DB;
+import com.cloud.utils.db.Filter;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.GenericSearchBuilder;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.SearchCriteria.Op;
+import com.cloud.utils.db.Transaction;
+
+@DB
+public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO, Long> implements SyncQueueItemDao {
+ private static final Logger s_logger = Logger.getLogger(SyncQueueItemDaoImpl.class);
+ final GenericSearchBuilder<SyncQueueItemVO, Long> queueIdSearch;
+
+ public SyncQueueItemDaoImpl() {
+ super();
+ queueIdSearch = createSearchBuilder(Long.class);
+ queueIdSearch.and("contentId", queueIdSearch.entity().getContentId(), Op.EQ);
+ queueIdSearch.and("contentType", queueIdSearch.entity().getContentType(), Op.EQ);
+ queueIdSearch.selectField(queueIdSearch.entity().getId());
+ queueIdSearch.done();
+ }
+
+ @Override
+ public SyncQueueItemVO getNextQueueItem(long queueId) {
+
+ SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
+ sb.and("queueId", sb.entity().getQueueId(), SearchCriteria.Op.EQ);
+ sb.and("lastProcessNumber", sb.entity().getLastProcessNumber(), SearchCriteria.Op.NULL);
+ sb.done();
+
+ SearchCriteria<SyncQueueItemVO> sc = sb.create();
+ sc.setParameters("queueId", queueId);
+
+ Filter filter = new Filter(SyncQueueItemVO.class, "created", true, 0L, 1L);
+ List<SyncQueueItemVO> l = listBy(sc, filter);
+ if(l != null && l.size() > 0)
+ return l.get(0);
+
+ return null;
+ }
+
+ @Override
+ public List<SyncQueueItemVO> getNextQueueItems(int maxItems) {
+ List<SyncQueueItemVO> l = new ArrayList<SyncQueueItemVO>();
+
+ String sql = "SELECT i.id, i.queue_id, i.content_type, i.content_id, i.created " +
+ " FROM sync_queue AS q JOIN sync_queue_item AS i ON q.id = i.queue_id " +
+ " WHERE i.queue_proc_number IS NULL " +
+ " GROUP BY q.id " +
+ " ORDER BY i.id " +
+ " LIMIT 0, ?";
+
+ Transaction txn = Transaction.currentTxn();
+ PreparedStatement pstmt = null;
+ try {
+ pstmt = txn.prepareAutoCloseStatement(sql);
+ pstmt.setInt(1, maxItems);
+ ResultSet rs = pstmt.executeQuery();
+ while(rs.next()) {
+ SyncQueueItemVO item = new SyncQueueItemVO();
+ item.setId(rs.getLong(1));
+ item.setQueueId(rs.getLong(2));
+ item.setContentType(rs.getString(3));
+ item.setContentId(rs.getLong(4));
+ item.setCreated(DateUtil.parseDateString(TimeZone.getTimeZone("GMT"), rs.getString(5)));
+ l.add(item);
+ }
+ } catch (SQLException e) {
+ s_logger.error("Unexpected sql excetpion, ", e);
+ } catch (Throwable e) {
+ s_logger.error("Unexpected excetpion, ", e);
+ }
+ return l;
+ }
+
+ @Override
+ public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
+ SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
+ sb.and("lastProcessMsid", sb.entity().getLastProcessMsid(),
+ SearchCriteria.Op.EQ);
+ sb.done();
+
+ SearchCriteria<SyncQueueItemVO> sc = sb.create();
+ sc.setParameters("lastProcessMsid", msid);
+
+ Filter filter = new Filter(SyncQueueItemVO.class, "created", true, null, null);
+
+ if(exclusive)
+ return lockRows(sc, filter, true);
+ return listBy(sc, filter);
+ }
+
+ @Override
+ public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive) {
+ Date cutTime = DateUtil.currentGMTTime();
+
+ SearchBuilder<SyncQueueItemVO> sbItem = createSearchBuilder();
+ sbItem.and("lastProcessMsid", sbItem.entity().getLastProcessMsid(), SearchCriteria.Op.NNULL);
+ sbItem.and("lastProcessNumber", sbItem.entity().getLastProcessNumber(), SearchCriteria.Op.NNULL);
+ sbItem.and("lastProcessNumber", sbItem.entity().getLastProcessTime(), SearchCriteria.Op.NNULL);
+ sbItem.and("lastProcessTime2", sbItem.entity().getLastProcessTime(), SearchCriteria.Op.LT);
+
+ sbItem.done();
+
+ SearchCriteria<SyncQueueItemVO> sc = sbItem.create();
+ sc.setParameters("lastProcessTime2", new Date(cutTime.getTime() - thresholdMs));
+
+ if(exclusive)
+ return lockRows(sc, null, true);
+ return listBy(sc, null);
+ }
+
+ @Override
+ public Long getQueueItemIdByContentIdAndType(long contentId, String contentType) {
+ SearchCriteria<Long> sc = queueIdSearch.create();
+ sc.setParameters("contentId", contentId);
+ sc.setParameters("contentType", contentType);
+ List<Long> id = customSearch(sc, null);
+
+ return id.size() == 0 ? null : id.get(0);
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/pom.xml
----------------------------------------------------------------------
diff --git a/server/pom.xml b/server/pom.xml
index bc97b21..3a2b743 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -103,8 +103,6 @@
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
- <sourceDirectory>src</sourceDirectory>
- <testSourceDirectory>test</testSourceDirectory>
<resources>
<resource>
<directory>resources</directory>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/ApiAsyncJobDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiAsyncJobDispatcher.java b/server/src/com/cloud/api/ApiAsyncJobDispatcher.java
index 0984d25..331d90f 100644
--- a/server/src/com/cloud/api/ApiAsyncJobDispatcher.java
+++ b/server/src/com/cloud/api/ApiAsyncJobDispatcher.java
@@ -21,23 +21,25 @@ import java.util.Map;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ExceptionResponse;
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobDispatcher;
-import com.cloud.async.AsyncJobManager;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.user.dao.AccountDao;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.component.ComponentContext;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
public class ApiAsyncJobDispatcher extends AdapterBase implements AsyncJobDispatcher {
private static final Logger s_logger = Logger.getLogger(ApiAsyncJobDispatcher.class);
@@ -51,7 +53,7 @@ public class ApiAsyncJobDispatcher extends AdapterBase implements AsyncJobDispat
}
@Override
- public void runJob(AsyncJob job) {
+ public void runJob(AsyncJob job) {
BaseAsyncCmd cmdObj = null;
try {
Class<?> cmdClass = Class.forName(job.getCmd());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 f9bdcf3..5a86160 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -25,10 +25,12 @@ import java.util.Set;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
-import org.apache.cloudstack.api.ApiCommandJobType;
+import org.springframework.stereotype.Component;
+
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;
@@ -51,10 +53,12 @@ import org.apache.cloudstack.api.response.UserResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.springframework.stereotype.Component;
import com.cloud.api.query.dao.AccountJoinDao;
import com.cloud.api.query.dao.AffinityGroupJoinDao;
@@ -93,9 +97,6 @@ import com.cloud.api.query.vo.StoragePoolJoinVO;
import com.cloud.api.query.vo.UserAccountJoinVO;
import com.cloud.api.query.vo.UserVmJoinVO;
import com.cloud.api.query.vo.VolumeJoinVO;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobManager;
-import com.cloud.async.dao.AsyncJobDao;
import com.cloud.capacity.CapacityVO;
import com.cloud.capacity.dao.CapacityDao;
import com.cloud.capacity.dao.CapacityDaoImpl.SummedCapacity;
@@ -129,8 +130,6 @@ import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.host.dao.HostDetailsDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.network.dao.AccountGuestVlanMapDao;
-import com.cloud.network.dao.AccountGuestVlanMapVO;
import com.cloud.network.IpAddress;
import com.cloud.network.Network;
import com.cloud.network.Network.Capability;
@@ -1287,12 +1286,7 @@ public class ApiDBUtils {
return _vpcOfferingDao.findById(offeringId);
}
-
- public static AsyncJob findAsyncJobById(long jobId){
- return _asyncJobDao.findById(jobId);
- }
-
- public static String findJobInstanceUuid(AsyncJob job){
+ public static String findJobInstanceUuid(AsyncJob job) {
if ( job == null )
return null;
String jobInstanceId = null;
@@ -1605,7 +1599,7 @@ public class ApiDBUtils {
return _jobJoinDao.newAsyncJobResponse(ve);
}
- public static AsyncJobJoinVO newAsyncJobView(AsyncJob e){
+ public static AsyncJobJoinVO newAsyncJobView(AsyncJob e) {
return _jobJoinDao.newAsyncJobView(e);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index afcfda3..a1e467e 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -33,6 +33,9 @@ import java.util.regex.Matcher;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.acl.InfrastructureEntity;
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -52,11 +55,10 @@ import org.apache.cloudstack.api.Validate;
import org.apache.cloudstack.api.command.user.event.ArchiveEventsCmd;
import org.apache.cloudstack.api.command.user.event.DeleteEventsCmd;
import org.apache.cloudstack.api.command.user.event.ListEventsCmd;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import com.cloud.async.AsyncJobExecutionContext;
-import com.cloud.async.AsyncJobManager;
import com.cloud.dao.EntityManager;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
@@ -149,7 +151,7 @@ public class ApiDispatcher {
if (queueSizeLimit != null) {
if(AsyncJobExecutionContext.getCurrentExecutionContext() == null) {
// if we are not within async-execution context, enqueue the command
- _asyncMgr.syncAsyncJobExecution(asyncCmd.getJob(), asyncCmd.getSyncObjType(), asyncCmd.getSyncObjId().longValue(), queueSizeLimit);
+ _asyncMgr.syncAsyncJobExecution((AsyncJob)asyncCmd.getJob(), asyncCmd.getSyncObjType(), asyncCmd.getSyncObjId().longValue(), queueSizeLimit);
return;
}
} else {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index d5960ab..0934655 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -34,6 +34,9 @@ import java.util.TimeZone;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.affinity.AffinityGroup;
@@ -59,7 +62,6 @@ import org.apache.cloudstack.api.response.ConfigurationResponse;
import org.apache.cloudstack.api.response.ControlledEntityResponse;
import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
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;
@@ -134,14 +136,13 @@ 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.framework.jobs.AsyncJob;
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
import org.apache.cloudstack.region.Region;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.cloudstack.usage.Usage;
import org.apache.cloudstack.usage.UsageService;
import org.apache.cloudstack.usage.UsageTypes;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
import com.cloud.api.query.ViewResponseHelper;
import com.cloud.api.query.vo.AccountJoinVO;
@@ -163,8 +164,6 @@ import com.cloud.api.query.vo.StoragePoolJoinVO;
import com.cloud.api.query.vo.UserAccountJoinVO;
import com.cloud.api.query.vo.UserVmJoinVO;
import com.cloud.api.query.vo.VolumeJoinVO;
-import com.cloud.api.response.ApiResponseSerializer;
-import com.cloud.async.AsyncJob;
import com.cloud.capacity.Capacity;
import com.cloud.capacity.CapacityVO;
import com.cloud.capacity.dao.CapacityDaoImpl.SummedCapacity;
@@ -296,8 +295,8 @@ public class ApiResponseHelper implements ResponseGenerator {
public final Logger s_logger = Logger.getLogger(ApiResponseHelper.class);
private static final DecimalFormat s_percentFormat = new DecimalFormat("##.##");
- @Inject private EntityManager _entityMgr = null;
- @Inject private UsageService _usageSvc = null;
+ @Inject private final EntityManager _entityMgr = null;
+ @Inject private final UsageService _usageSvc = null;
@Inject NetworkModel _ntwkModel;
@Override
@@ -434,7 +433,7 @@ public class ApiResponseHelper implements ResponseGenerator {
DataCenter zone = ApiDBUtils.findZoneById(volume.getDataCenterId());
if (zone != null) {
snapshotResponse.setZoneName(zone.getName());
- snapshotResponse.setZoneType(zone.getNetworkType().toString());
+ snapshotResponse.setZoneType(zone.getNetworkType().toString());
}
}
snapshotResponse.setCreated(snapshot.getCreated());
@@ -827,7 +826,7 @@ public class ApiResponseHelper implements ResponseGenerator {
capacityResponse.setCapacityType(capacity.getCapacityType());
capacityResponse.setCapacityUsed(capacity.getUsedCapacity());
if (capacity.getCapacityType() == Capacity.CAPACITY_TYPE_CPU) {
- capacityResponse.setCapacityTotal(new Long((long) (capacity.getTotalCapacity())));
+ capacityResponse.setCapacityTotal(new Long((capacity.getTotalCapacity())));
} else if (capacity.getCapacityType() == Capacity.CAPACITY_TYPE_STORAGE_ALLOCATED) {
List<SummedCapacity> c = ApiDBUtils.findNonSharedStorageForClusterPodZone(null, pod.getId(), null);
capacityResponse.setCapacityTotal(capacity.getTotalCapacity() - c.get(0).getTotalCapacity());
@@ -1820,12 +1819,6 @@ public class ApiResponseHelper implements ResponseGenerator {
}
- @Override
- public String toSerializedString(CreateCmdResponse response, String responseType) {
- return ApiResponseSerializer.toSerializedString(response, responseType);
- }
-
- @Override
public AsyncJobResponse createAsyncJobResponse(AsyncJob job) {
AsyncJobJoinVO vJob = ApiDBUtils.newAsyncJobView(job);
return ApiDBUtils.newAsyncJobResponse(vJob);
@@ -2375,7 +2368,7 @@ public class ApiResponseHelper implements ResponseGenerator {
}
// populate network offering information
- NetworkOffering networkOffering = (NetworkOffering) ApiDBUtils.findNetworkOfferingById(network.getNetworkOfferingId());
+ NetworkOffering networkOffering = ApiDBUtils.findNetworkOfferingById(network.getNetworkOfferingId());
if (networkOffering != null) {
response.setNetworkOfferingId(networkOffering.getUuid());
response.setNetworkOfferingName(networkOffering.getName());
@@ -3665,6 +3658,7 @@ public class ApiResponseHelper implements ResponseGenerator {
return response;
}
+ @Override
public NicSecondaryIpResponse createSecondaryIPToNicResponse(NicSecondaryIp result) {
NicSecondaryIpResponse response = new NicSecondaryIpResponse();
NicVO nic = _entityMgr.findById(NicVO.class, result.getNicId());
@@ -3677,6 +3671,7 @@ public class ApiResponseHelper implements ResponseGenerator {
return response;
}
+ @Override
public NicResponse createNicResponse(Nic result) {
NicResponse response = new NicResponse();
NetworkVO network = _entityMgr.findById(NetworkVO.class, result.getNetworkId());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/ApiServer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java
index 0f375b8..0cd7201 100755
--- a/server/src/com/cloud/api/ApiServer.java
+++ b/server/src/com/cloud/api/ApiServer.java
@@ -109,17 +109,20 @@ import org.apache.cloudstack.api.command.user.vm.ListVMsCmd;
import org.apache.cloudstack.api.command.user.vmgroup.ListVMGroupsCmd;
import org.apache.cloudstack.api.command.user.volume.ListVolumesCmd;
import org.apache.cloudstack.api.command.user.zone.ListZonesByCmd;
+import org.apache.cloudstack.api.response.AsyncJobResponse;
+import org.apache.cloudstack.api.response.CreateCmdResponse;
import org.apache.cloudstack.api.response.ExceptionResponse;
import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
import org.apache.cloudstack.region.RegionManager;
import com.cloud.api.response.ApiResponseSerializer;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobManager;
-import com.cloud.async.AsyncJobVO;
import com.cloud.configuration.Config;
import com.cloud.configuration.ConfigurationVO;
import com.cloud.configuration.dao.ConfigurationDao;
+import com.cloud.dao.EntityManager;
import com.cloud.domain.Domain;
import com.cloud.domain.DomainVO;
import com.cloud.event.ActionEventUtils;
@@ -149,7 +152,7 @@ import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.Transaction;
import com.cloud.utils.exception.CloudRuntimeException;
-@Component
+@Component
public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiServerService {
private static final Logger s_logger = Logger.getLogger(ApiServer.class.getName());
private static final Logger s_accessLogger = Logger.getLogger("apiserver." + ApiServer.class.getName());
@@ -166,6 +169,9 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
@Inject List<PluggableService> _pluggableServices;
@Inject List<APIChecker> _apiAccessCheckers;
+ @Inject
+ private EntityManager _entityMgr;
+
@Inject private final RegionManager _regionMgr = null;
private static int _workerCount = 0;
@@ -444,6 +450,24 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
return response;
}
+ private String getBaseAsyncResponse(long jobId, BaseAsyncCmd cmd) {
+ AsyncJobResponse response = new AsyncJobResponse();
+
+ AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
+ response.setJobId(job.getUuid());
+ response.setResponseName(cmd.getCommandName());
+ return ApiResponseSerializer.toSerializedString(response, cmd.getResponseType());
+ }
+
+ private String getBaseAsyncCreateResponse(long jobId, BaseAsyncCreateCmd cmd, String objectUuid) {
+ CreateCmdResponse response = new CreateCmdResponse();
+ AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
+ response.setJobId(job.getUuid());
+ response.setId(objectUuid);
+ response.setResponseName(cmd.getCommandName());
+ return ApiResponseSerializer.toSerializedString(response, cmd.getResponseType());
+ }
+
private String queueCommand(BaseCmd cmdObj, Map<String, String> params) throws Exception {
UserContext ctx = UserContext.current();
Long callerUserId = ctx.getCallerUserId();
@@ -494,7 +518,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
Long instanceId = (objectId == null) ? asyncCmd.getInstanceId() : objectId;
AsyncJobVO job = new AsyncJobVO(callerUserId, caller.getId(), cmdObj.getClass().getName(),
- ApiGsonHelper.getBuilder().create().toJson(params), instanceId,
+ ApiGsonHelper.getBuilder().create().toJson(params), instanceId,
asyncCmd.getInstanceType() != null ? asyncCmd.getInstanceType().toString() : null);
long jobId = _asyncMgr.submitAsyncJob(job);
@@ -507,11 +531,11 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
if (objectId != null) {
String objUuid = (objectUuid == null) ? objectId.toString() : objectUuid;
- return ((BaseAsyncCreateCmd) asyncCmd).getResponse(jobId, objUuid);
+ return getBaseAsyncCreateResponse(jobId, (BaseAsyncCreateCmd)asyncCmd, objUuid);
+ } else {
+ SerializationContext.current().setUuidTranslation(true);
+ return getBaseAsyncResponse(jobId, asyncCmd);
}
-
- SerializationContext.current().setUuidTranslation(true);
- return ApiResponseSerializer.toSerializedString(asyncCmd.getResponse(jobId), asyncCmd.getResponseType());
} else {
_dispatcher.dispatch(cmdObj, params);
@@ -564,7 +588,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer
if (job.getInstanceId() == null) {
continue;
}
- String instanceUuid = ApiDBUtils.findJobInstanceUuid(job);
+ String instanceUuid = job.getUuid();
if (instanceUuid != null) {
objectJobMap.put(instanceUuid, job);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/query/dao/AsyncJobJoinDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/AsyncJobJoinDao.java b/server/src/com/cloud/api/query/dao/AsyncJobJoinDao.java
index f7a2c8c..756425f 100644
--- a/server/src/com/cloud/api/query/dao/AsyncJobJoinDao.java
+++ b/server/src/com/cloud/api/query/dao/AsyncJobJoinDao.java
@@ -16,12 +16,10 @@
// under the License.
package com.cloud.api.query.dao;
-import java.util.List;
-
import org.apache.cloudstack.api.response.AsyncJobResponse;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
import com.cloud.api.query.vo.AsyncJobJoinVO;
-import com.cloud.async.AsyncJob;
import com.cloud.utils.db.GenericDao;
public interface AsyncJobJoinDao extends GenericDao<AsyncJobJoinVO, Long> {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/api/query/dao/AsyncJobJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/AsyncJobJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/AsyncJobJoinDaoImpl.java
index fb5695b..5090475 100644
--- a/server/src/com/cloud/api/query/dao/AsyncJobJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/AsyncJobJoinDaoImpl.java
@@ -22,15 +22,15 @@ import java.util.List;
import javax.ejb.Local;
import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
-import com.cloud.api.ApiSerializerHelper;
-import com.cloud.api.SerializationContext;
-import com.cloud.api.query.vo.AsyncJobJoinVO;
-import com.cloud.async.AsyncJob;
import org.apache.cloudstack.api.ResponseObject;
import org.apache.cloudstack.api.response.AsyncJobResponse;
-import org.springframework.stereotype.Component;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import com.cloud.api.ApiSerializerHelper;
+import com.cloud.api.SerializationContext;
+import com.cloud.api.query.vo.AsyncJobJoinVO;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
@@ -40,7 +40,7 @@ import com.cloud.utils.db.SearchCriteria;
public class AsyncJobJoinDaoImpl extends GenericDaoBase<AsyncJobJoinVO, Long> implements AsyncJobJoinDao {
public static final Logger s_logger = Logger.getLogger(AsyncJobJoinDaoImpl.class);
- private SearchBuilder<AsyncJobJoinVO> jobIdSearch;
+ private final SearchBuilder<AsyncJobJoinVO> jobIdSearch;
protected AsyncJobJoinDaoImpl() {
@@ -49,7 +49,7 @@ public class AsyncJobJoinDaoImpl extends GenericDaoBase<AsyncJobJoinVO, Long> im
jobIdSearch.and("id", jobIdSearch.entity().getId(), SearchCriteria.Op.EQ);
jobIdSearch.done();
- this._count = "select count(distinct id) from async_job_view WHERE ";
+ _count = "select count(distinct id) from async_job_view WHERE ";
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobConstants.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobConstants.java b/server/src/com/cloud/async/AsyncJobConstants.java
deleted file mode 100644
index 6081d0c..0000000
--- a/server/src/com/cloud/async/AsyncJobConstants.java
+++ /dev/null
@@ -1,34 +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.async;
-
-public interface AsyncJobConstants {
- public static final int STATUS_IN_PROGRESS = 0;
- public static final int STATUS_SUCCEEDED = 1;
- public static final int STATUS_FAILED = 2;
-
- public static final String JOB_DISPATCHER_PSEUDO = "pseudoJobDispatcher";
- public static final String PSEUDO_JOB_INSTANCE_TYPE = "Thread";
-
- public static final String JOB_POOL_THREAD_PREFIX = "Job-Executor";
-
- // Although we may have detailed masks for each individual wakeup event, i.e.
- // periodical timer, matched topic from message bus, it seems that we don't
- // need to distinguish them to such level. Therefore, only one wakeup signal
- // is defined
- public static final int SIGNAL_MASK_WAKEUP = 1;
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobDispatcher.java b/server/src/com/cloud/async/AsyncJobDispatcher.java
deleted file mode 100644
index ed03d33..0000000
--- a/server/src/com/cloud/async/AsyncJobDispatcher.java
+++ /dev/null
@@ -1,23 +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.async;
-
-import com.cloud.utils.component.Adapter;
-
-public interface AsyncJobDispatcher extends Adapter {
- void runJob(AsyncJob job);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobExecutionContext.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobExecutionContext.java b/server/src/com/cloud/async/AsyncJobExecutionContext.java
index 988f4e6..e6efd03 100644
--- a/server/src/com/cloud/async/AsyncJobExecutionContext.java
+++ b/server/src/com/cloud/async/AsyncJobExecutionContext.java
@@ -18,7 +18,13 @@ package com.cloud.async;
import javax.inject.Inject;
-import com.cloud.async.dao.AsyncJobJoinMapDao;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobJoinMapVO;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.SyncQueueItem;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
+
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
@@ -26,7 +32,7 @@ import com.cloud.serializer.SerializerHelper;
import com.cloud.utils.component.ComponentContext;
public class AsyncJobExecutionContext {
- private AsyncJob _job;
+ private AsyncJob _job;
@Inject private AsyncJobManager _jobMgr;
@Inject private AsyncJobJoinMapDao _joinMapDao;
@@ -36,7 +42,7 @@ public class AsyncJobExecutionContext {
public AsyncJobExecutionContext() {
}
- public AsyncJobExecutionContext(AsyncJob job) {
+ public AsyncJobExecutionContext(AsyncJob job) {
_job = job;
}
@@ -48,7 +54,7 @@ public class AsyncJobExecutionContext {
_job.setSyncSource(null);
}
- public AsyncJob getJob() {
+ public AsyncJob getJob() {
if(_job == null) {
_job = _jobMgr.getPseudoJob();
}
@@ -56,7 +62,7 @@ public class AsyncJobExecutionContext {
return _job;
}
- public void setJob(AsyncJob job) {
+ public void setJob(AsyncJob job) {
_job = job;
}
@@ -75,7 +81,7 @@ public class AsyncJobExecutionContext {
_jobMgr.updateAsyncJobAttachment(_job.getId(), instanceType, instanceId);
}
- public void logJobJournal(AsyncJob.JournalType journalType, String
+ public void logJobJournal(AsyncJob.JournalType journalType, String
journalText, String journalObjJson) {
assert(_job != null);
_jobMgr.logJobJournal(_job.getId(), journalType, journalText, journalObjJson);
@@ -89,14 +95,14 @@ public class AsyncJobExecutionContext {
public void joinJob(long joinJobId, String wakeupHandler, String wakeupDispatcher,
String[] wakeupTopcisOnMessageBus, long wakeupIntervalInMilliSeconds, long timeoutInMilliSeconds) {
assert(_job != null);
- _jobMgr.joinJob(_job.getId(), joinJobId, wakeupHandler, wakeupDispatcher, wakeupTopcisOnMessageBus,
+ _jobMgr.joinJob(_job.getId(), joinJobId, wakeupHandler, wakeupDispatcher, wakeupTopcisOnMessageBus,
wakeupIntervalInMilliSeconds, timeoutInMilliSeconds);
}
//
// check failure exception before we disjoin the worker job
// TODO : it is ugly and this will become unnecessary after we switch to full-async mode
- //
+ //
public void disjoinJob(long joinedJobId) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException {
assert(_job != null);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/AsyncJobMBean.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/AsyncJobMBean.java b/server/src/com/cloud/async/AsyncJobMBean.java
deleted file mode 100644
index 15d6595..0000000
--- a/server/src/com/cloud/async/AsyncJobMBean.java
+++ /dev/null
@@ -1,37 +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.async;
-
-public interface AsyncJobMBean {
- public long getAccountId();
- public long getUserId();
- public String getCmd();
- public String getCmdInfo();
- public String getStatus();
- public int getProcessStatus();
- public int getResultCode();
- public String getResult();
- public String getInstanceType();
- public String getInstanceId();
- public String getInitMsid();
- public String getCreateTime();
- public String getLastUpdateTime();
- public String getLastPollTime();
- public String getSyncQueueId();
- public String getSyncQueueContentType();
- public String getSyncQueueContentId();
-}
[06/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java
index af3aea9..aee1e2c 100644
--- a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.GuestOS;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=GuestOS.class)
public class GuestOSResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/GuestVlanRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GuestVlanRangeResponse.java b/api/src/org/apache/cloudstack/api/response/GuestVlanRangeResponse.java
index bf19688..416bb47 100644
--- a/api/src/org/apache/cloudstack/api/response/GuestVlanRangeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GuestVlanRangeResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
-import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.GuestVlan;
+import com.cloud.serializer.Param;
@EntityReference(value=GuestVlan.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/HostForMigrationResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/HostForMigrationResponse.java b/api/src/org/apache/cloudstack/api/response/HostForMigrationResponse.java
index fde2440..6e96b2a 100644
--- a/api/src/org/apache/cloudstack/api/response/HostForMigrationResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HostForMigrationResponse.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -26,7 +28,6 @@ import com.cloud.host.Host;
import com.cloud.host.Status;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Host.class)
public class HostForMigrationResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/HostResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/HostResponse.java b/api/src/org/apache/cloudstack/api/response/HostResponse.java
index be1a4b4..e4eb01b 100644
--- a/api/src/org/apache/cloudstack/api/response/HostResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HostResponse.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -26,7 +28,6 @@ import com.cloud.host.Host;
import com.cloud.host.Status;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Host.class)
public class HostResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/HypervisorCapabilitiesResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/HypervisorCapabilitiesResponse.java b/api/src/org/apache/cloudstack/api/response/HypervisorCapabilitiesResponse.java
index 3602187..ea26a7e 100644
--- a/api/src/org/apache/cloudstack/api/response/HypervisorCapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HypervisorCapabilitiesResponse.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=HypervisorCapabilities.class)
public class HypervisorCapabilitiesResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/HypervisorResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/HypervisorResponse.java b/api/src/org/apache/cloudstack/api/response/HypervisorResponse.java
index 8bfb15e..4ff414f 100644
--- a/api/src/org/apache/cloudstack/api/response/HypervisorResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/HypervisorResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class HypervisorResponse extends BaseResponse {
@SerializedName(ApiConstants.NAME) @Param(description="Hypervisor name")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java b/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
index cede84f..b5cf445 100644
--- a/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/IPAddressResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.IpAddress;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=IpAddress.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/InstanceGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/InstanceGroupResponse.java b/api/src/org/apache/cloudstack/api/response/InstanceGroupResponse.java
index b04f2b8..ead6399 100644
--- a/api/src/org/apache/cloudstack/api/response/InstanceGroupResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/InstanceGroupResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.vm.InstanceGroup;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = InstanceGroup.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/InternalLoadBalancerElementResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/InternalLoadBalancerElementResponse.java b/api/src/org/apache/cloudstack/api/response/InternalLoadBalancerElementResponse.java
index b7e8634..08b9315 100644
--- a/api/src/org/apache/cloudstack/api/response/InternalLoadBalancerElementResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/InternalLoadBalancerElementResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.VirtualRouterProvider;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualRouterProvider.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/IpForwardingRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/IpForwardingRuleResponse.java b/api/src/org/apache/cloudstack/api/response/IpForwardingRuleResponse.java
index d6a42f7..5eb2140 100644
--- a/api/src/org/apache/cloudstack/api/response/IpForwardingRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/IpForwardingRuleResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class IpForwardingRuleResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the ID of the port forwarding rule")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/IsoVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/IsoVmResponse.java b/api/src/org/apache/cloudstack/api/response/IsoVmResponse.java
index 14803d5..c7f93d6 100644
--- a/api/src/org/apache/cloudstack/api/response/IsoVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/IsoVmResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class IsoVmResponse extends BaseResponse {
@SerializedName("id") @Param(description="the ISO ID")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/IsolationMethodResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/IsolationMethodResponse.java b/api/src/org/apache/cloudstack/api/response/IsolationMethodResponse.java
index 3aaa7a4..3f95d7c 100644
--- a/api/src/org/apache/cloudstack/api/response/IsolationMethodResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/IsolationMethodResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class IsolationMethodResponse extends BaseResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java b/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
index 5dd123c..406a8da 100644
--- a/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBHealthCheckPolicyResponse.java
@@ -16,11 +16,13 @@
// under the License.
package org.apache.cloudstack.api.response;
-import com.cloud.network.rules.HealthCheckPolicy;
-import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
+import com.cloud.network.rules.HealthCheckPolicy;
+import com.cloud.serializer.Param;
+
public class LBHealthCheckPolicyResponse extends BaseResponse {
@SerializedName("id")
@Param(description = "the LB HealthCheck policy ID")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LBHealthCheckResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBHealthCheckResponse.java b/api/src/org/apache/cloudstack/api/response/LBHealthCheckResponse.java
index 182013f..681d8a2 100644
--- a/api/src/org/apache/cloudstack/api/response/LBHealthCheckResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBHealthCheckResponse.java
@@ -16,15 +16,16 @@
// under the License.
package org.apache.cloudstack.api.response;
-import com.cloud.network.rules.HealthCheckPolicy;
-import org.apache.cloudstack.api.ApiConstants;
-import com.cloud.serializer.Param;
+import java.util.List;
+
import com.google.gson.annotations.SerializedName;
+
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import java.util.List;
-import java.util.UUID;
+import com.cloud.network.rules.HealthCheckPolicy;
+import com.cloud.serializer.Param;
@EntityReference(value=HealthCheckPolicy.class)
public class LBHealthCheckResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java b/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
index 626d0ea..9e47d5f 100644
--- a/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBStickinessPolicyResponse.java
@@ -20,12 +20,13 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.network.rules.StickinessPolicy;
import com.cloud.serializer.Param;
import com.cloud.utils.Pair;
-import com.google.gson.annotations.SerializedName;
public class LBStickinessPolicyResponse extends BaseResponse {
@SerializedName("id")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LBStickinessResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LBStickinessResponse.java b/api/src/org/apache/cloudstack/api/response/LBStickinessResponse.java
index cd44aa7..eff30d5 100644
--- a/api/src/org/apache/cloudstack/api/response/LBStickinessResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LBStickinessResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.rules.StickinessPolicy;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=StickinessPolicy.class)
public class LBStickinessResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java b/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
index bbeec63..c4ec9b7 100644
--- a/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LDAPConfigResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class LDAPConfigResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
index 79b01b1..d15fc04 100644
--- a/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/LoadBalancerResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class LoadBalancerResponse extends BaseResponse implements ControlledEntityResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NetworkACLResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkACLResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkACLResponse.java
index b45b43c..8f5f216 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkACLResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkACLResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class NetworkACLResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NetworkDeviceResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkDeviceResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkDeviceResponse.java
index 8eb3987..a991c7a 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkDeviceResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkDeviceResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class NetworkDeviceResponse extends BaseResponse {
@SerializedName(ApiConstants.ID)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
index 7a7e371..fddaa75 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java
@@ -20,13 +20,14 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.offering.NetworkOffering;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=NetworkOffering.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
index 3f366e2..9ad5718 100644
--- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.Network;
import com.cloud.projects.ProjectAccount;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = {Network.class, ProjectAccount.class})
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NicResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NicResponse.java b/api/src/org/apache/cloudstack/api/response/NicResponse.java
index a1ceaf6..13ffe6c 100644
--- a/api/src/org/apache/cloudstack/api/response/NicResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NicResponse.java
@@ -18,16 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
import com.cloud.vm.Nic;
-import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
-import org.apache.cloudstack.api.BaseResponse;
-import org.apache.cloudstack.api.EntityReference;
@SuppressWarnings("unused")
@EntityReference(value=Nic.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/NicSecondaryIpResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NicSecondaryIpResponse.java b/api/src/org/apache/cloudstack/api/response/NicSecondaryIpResponse.java
index 695468f..fd6180d 100644
--- a/api/src/org/apache/cloudstack/api/response/NicSecondaryIpResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NicSecondaryIpResponse.java
@@ -15,17 +15,14 @@
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.response;
-import java.util.Date;
-import java.util.List;
+import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import com.cloud.network.rules.FirewallRule;
import com.cloud.serializer.Param;
import com.cloud.vm.NicSecondaryIp;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=NicSecondaryIp.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java b/api/src/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java
index 1f93b46..f479a68 100644
--- a/api/src/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/PhysicalNetworkResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.PhysicalNetwork;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=PhysicalNetwork.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/PodResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/PodResponse.java b/api/src/org/apache/cloudstack/api/response/PodResponse.java
index 471cac1..8f78cb0 100644
--- a/api/src/org/apache/cloudstack/api/response/PodResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/PodResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.dc.Pod;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = Pod.class)
public class PodResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
index ca76062..a9ba88d 100644
--- a/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/PrivateGatewayResponse.java
@@ -15,13 +15,14 @@
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.vpc.VpcGateway;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VpcGateway.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ProjectAccountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ProjectAccountResponse.java b/api/src/org/apache/cloudstack/api/response/ProjectAccountResponse.java
index cb69ee5..aa73859 100644
--- a/api/src/org/apache/cloudstack/api/response/ProjectAccountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ProjectAccountResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.projects.ProjectAccount;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=ProjectAccount.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ProjectInvitationResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ProjectInvitationResponse.java b/api/src/org/apache/cloudstack/api/response/ProjectInvitationResponse.java
index 1ece690..140daae 100644
--- a/api/src/org/apache/cloudstack/api/response/ProjectInvitationResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ProjectInvitationResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.projects.ProjectInvitation;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=ProjectInvitation.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ProjectResponse.java b/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
index cff27e5..9775eb7 100644
--- a/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ProjectResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.ArrayList;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.projects.Project;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Project.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ProviderResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ProviderResponse.java b/api/src/org/apache/cloudstack/api/response/ProviderResponse.java
index fd09949..1dbdadb 100644
--- a/api/src/org/apache/cloudstack/api/response/ProviderResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ProviderResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.PhysicalNetworkServiceProvider;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=PhysicalNetworkServiceProvider.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/RegionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/RegionResponse.java b/api/src/org/apache/cloudstack/api/response/RegionResponse.java
index f8bfe53..e5b8b06 100644
--- a/api/src/org/apache/cloudstack/api/response/RegionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RegionResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.region.Region;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = Region.class)
public class RegionResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/RegisterResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/RegisterResponse.java b/api/src/org/apache/cloudstack/api/response/RegisterResponse.java
index c2bd2b5..a97686c 100644
--- a/api/src/org/apache/cloudstack/api/response/RegisterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RegisterResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class RegisterResponse extends BaseResponse {
@SerializedName("apikey") @Param(description="the api key of the registered user")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
index 5e08bca..1851e11 100644
--- a/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/RemoteAccessVpnResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.RemoteAccessVpn;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=RemoteAccessVpn.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
index 842eaa6..ad8b5dd 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceCountResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class ResourceCountResponse extends BaseResponse implements ControlledEntityResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
index e7735f5..005bdc6 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceLimitResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.configuration.ResourceLimit;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = ResourceLimit.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
index 47b0625..417cdf8 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceTagResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class ResourceTagResponse extends BaseResponse implements ControlledViewEntityResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/S3Response.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/S3Response.java b/api/src/org/apache/cloudstack/api/response/S3Response.java
index 259a308..db9efdb 100644
--- a/api/src/org/apache/cloudstack/api/response/S3Response.java
+++ b/api/src/org/apache/cloudstack/api/response/S3Response.java
@@ -28,10 +28,11 @@ import static org.apache.cloudstack.api.ApiConstants.S3_MAX_ERROR_RETRY;
import static org.apache.cloudstack.api.ApiConstants.S3_SECRET_KEY;
import static org.apache.cloudstack.api.ApiConstants.S3_SOCKET_TIMEOUT;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class S3Response extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java b/api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
index 2791853..5076ba3 100644
--- a/api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SSHKeyPairResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class SSHKeyPairResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java b/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
index 96a8bc2..f61f6db 100644
--- a/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SecurityGroupResponse.java
@@ -16,17 +16,17 @@
// under the License.
package org.apache.cloudstack.api.response;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.security.SecurityGroup;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = SecurityGroup.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java b/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
index 5aeee6f..1bd7072 100644
--- a/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SecurityGroupRuleResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.security.SecurityGroupRules;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = SecurityGroupRules.class)
public class SecurityGroupRuleResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
index f35e87e..a9bab87 100644
--- a/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.offering.ServiceOffering;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = ServiceOffering.class)
public class ServiceOfferingResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ServiceResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ServiceResponse.java b/api/src/org/apache/cloudstack/api/response/ServiceResponse.java
index c93c55e..cf206ab 100644
--- a/api/src/org/apache/cloudstack/api/response/ServiceResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ServiceResponse.java
@@ -16,12 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
-import com.cloud.serializer.Param;
+import java.util.List;
+
import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
-import java.util.List;
+import com.cloud.serializer.Param;
@SuppressWarnings("unused")
public class ServiceResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
index dbaa451..b8cf707 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteCustomerGatewayResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.Site2SiteCustomerGateway;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Site2SiteCustomerGateway.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
index 99075b5..6f1f233 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnConnectionResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.Site2SiteVpnConnection;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Site2SiteVpnConnection.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
index 06dbf37..49189b4 100644
--- a/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/Site2SiteVpnGatewayResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.Site2SiteVpnGateway;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Site2SiteVpnGateway.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SnapshotPolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SnapshotPolicyResponse.java b/api/src/org/apache/cloudstack/api/response/SnapshotPolicyResponse.java
index 2b7f9f4..9e3ec97 100644
--- a/api/src/org/apache/cloudstack/api/response/SnapshotPolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SnapshotPolicyResponse.java
@@ -16,12 +16,13 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.snapshot.SnapshotPolicy;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=SnapshotPolicy.class)
public class SnapshotPolicyResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
index 7484ac9..8043798 100644
--- a/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SnapshotResponse.java
@@ -19,22 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.Snapshot;
-import com.google.gson.annotations.SerializedName;
-import com.cloud.serializer.Param;
-import com.cloud.storage.Snapshot;
-import com.google.gson.annotations.SerializedName;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseResponse;
-import org.apache.cloudstack.api.EntityReference;
-
-import java.util.Date;
-import java.util.List;
@EntityReference(value=Snapshot.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SnapshotScheduleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SnapshotScheduleResponse.java b/api/src/org/apache/cloudstack/api/response/SnapshotScheduleResponse.java
index a25d02f..2e0b696 100644
--- a/api/src/org/apache/cloudstack/api/response/SnapshotScheduleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SnapshotScheduleResponse.java
@@ -18,10 +18,11 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class SnapshotScheduleResponse extends BaseResponse {
@SerializedName("id") @Param(description="the ID of the snapshot schedule")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java b/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
index 9001252..3b86460 100644
--- a/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StaticRouteResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.vpc.StaticRoute;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=StaticRoute.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StatusResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StatusResponse.java b/api/src/org/apache/cloudstack/api/response/StatusResponse.java
index 28776b7..9cf3510 100644
--- a/api/src/org/apache/cloudstack/api/response/StatusResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StatusResponse.java
@@ -16,10 +16,10 @@
// under the License.
package org.apache.cloudstack.api.response;
-import org.apache.cloudstack.api.BaseResponse;
-
import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
public class StatusResponse extends BaseResponse {
@SerializedName("status")
private Boolean status;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StorageNetworkIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StorageNetworkIpRangeResponse.java b/api/src/org/apache/cloudstack/api/response/StorageNetworkIpRangeResponse.java
index c72d1e2..aa0e0bb 100644
--- a/api/src/org/apache/cloudstack/api/response/StorageNetworkIpRangeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StorageNetworkIpRangeResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=StorageNetworkIpRange.class)
public class StorageNetworkIpRangeResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StoragePoolForMigrationResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolForMigrationResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolForMigrationResponse.java
index f0bbcb1..e0548f9 100644
--- a/api/src/org/apache/cloudstack/api/response/StoragePoolForMigrationResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StoragePoolForMigrationResponse.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=StoragePool.class)
public class StoragePoolForMigrationResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
index 4411ddc..af6f901 100644
--- a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.StoragePool;
import com.cloud.storage.StoragePoolStatus;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=StoragePool.class)
public class StoragePoolResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/StorageProviderResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/StorageProviderResponse.java b/api/src/org/apache/cloudstack/api/response/StorageProviderResponse.java
index 4baf486..a201347 100644
--- a/api/src/org/apache/cloudstack/api/response/StorageProviderResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/StorageProviderResponse.java
@@ -18,10 +18,11 @@
*/
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class StorageProviderResponse extends BaseResponse {
@SerializedName("name") @Param(description="the name of the storage provider")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SuccessResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SuccessResponse.java b/api/src/org/apache/cloudstack/api/response/SuccessResponse.java
index 8647d19..b26bfaf 100644
--- a/api/src/org/apache/cloudstack/api/response/SuccessResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SuccessResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class SuccessResponse extends BaseResponse {
@SerializedName("success") @Param(description="true if operation is executed successfully")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SwiftResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SwiftResponse.java b/api/src/org/apache/cloudstack/api/response/SwiftResponse.java
index 08b2609..85b2374 100644
--- a/api/src/org/apache/cloudstack/api/response/SwiftResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SwiftResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class SwiftResponse extends BaseResponse {
@SerializedName(ApiConstants.ID)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SystemVmInstanceResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SystemVmInstanceResponse.java b/api/src/org/apache/cloudstack/api/response/SystemVmInstanceResponse.java
index 43411c7..9814fc3 100644
--- a/api/src/org/apache/cloudstack/api/response/SystemVmInstanceResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SystemVmInstanceResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
/*
* This is the generic response for all types of System VMs (SSVM, consoleproxy, domain routers(router, LB, DHCP))
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java
index 3439dc0..aff5534 100644
--- a/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/SystemVmResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.vm.VirtualMachine;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualMachine.class)
public class SystemVmResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/TemplatePermissionsResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TemplatePermissionsResponse.java b/api/src/org/apache/cloudstack/api/response/TemplatePermissionsResponse.java
index c4b10ab..63d5faf 100644
--- a/api/src/org/apache/cloudstack/api/response/TemplatePermissionsResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TemplatePermissionsResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.template.VirtualMachineTemplate;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualMachineTemplate.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
index 896154a..8bbfe47 100644
--- a/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TemplateResponse.java
@@ -20,6 +20,8 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualMachineTemplate.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/TrafficMonitorResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TrafficMonitorResponse.java b/api/src/org/apache/cloudstack/api/response/TrafficMonitorResponse.java
index 7e0646e..2f54bea 100644
--- a/api/src/org/apache/cloudstack/api/response/TrafficMonitorResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TrafficMonitorResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class TrafficMonitorResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/TrafficTypeImplementorResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TrafficTypeImplementorResponse.java b/api/src/org/apache/cloudstack/api/response/TrafficTypeImplementorResponse.java
index 56beca5..3d2eced 100644
--- a/api/src/org/apache/cloudstack/api/response/TrafficTypeImplementorResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TrafficTypeImplementorResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class TrafficTypeImplementorResponse extends BaseResponse {
@SerializedName(ApiConstants.TRAFFIC_TYPE) @Param(description="network traffic type")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
index 494048e..609b55d 100644
--- a/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/TrafficTypeResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.PhysicalNetworkTrafficType;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=PhysicalNetworkTrafficType.class)
public class TrafficTypeResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/UpgradeVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UpgradeVmResponse.java b/api/src/org/apache/cloudstack/api/response/UpgradeVmResponse.java
index 544a9bb..cc2f19f 100644
--- a/api/src/org/apache/cloudstack/api/response/UpgradeVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UpgradeVmResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class UpgradeVmResponse extends BaseResponse {
@SerializedName("id")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java b/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java
index 4b355cb..4e78e13 100644
--- a/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class UsageRecordResponse extends BaseResponse implements ControlledEntityResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/UsageTypeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UsageTypeResponse.java b/api/src/org/apache/cloudstack/api/response/UsageTypeResponse.java
index 3dbb27a..74cf01e 100644
--- a/api/src/org/apache/cloudstack/api/response/UsageTypeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UsageTypeResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class UsageTypeResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/UserResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UserResponse.java b/api/src/org/apache/cloudstack/api/response/UserResponse.java
index e70a310..b6e929e 100644
--- a/api/src/org/apache/cloudstack/api/response/UserResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.user.User;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = User.class)
public class UserResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
index da08c94..5f51106 100644
--- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java
@@ -17,10 +17,11 @@
package org.apache.cloudstack.api.response;
import java.util.Date;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.affinity.AffinityGroupResponse;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
@@ -30,7 +31,6 @@ import com.cloud.network.router.VirtualRouter;
import com.cloud.serializer.Param;
import com.cloud.uservm.UserVm;
import com.cloud.vm.VirtualMachine;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value={VirtualMachine.class, UserVm.class, VirtualRouter.class})
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java b/api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java
index 3b30ab6..6d3e3cf 100644
--- a/api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VMSnapshotResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.vm.snapshot.VMSnapshot;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VMSnapshot.class)
public class VMSnapshotResponse extends BaseResponse implements ControlledEntityResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java b/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
index de355bd..47c1837 100644
--- a/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VirtualRouterProviderResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.VirtualRouterProvider;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualRouterProvider.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
index 6c5c364..6a0f8d8 100644
--- a/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VlanIpRangeResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.dc.Vlan;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Vlan.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
index b928fcd..7b7c805 100644
--- a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java
@@ -17,17 +17,17 @@
package org.apache.cloudstack.api.response;
import java.util.Date;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.Volume;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Volume.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
index 70120d1..c1edfd7 100644
--- a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.vpc.VpcOffering;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VpcOffering.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VpcResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
index 3dfd23b..b7d600b 100644
--- a/api/src/org/apache/cloudstack/api/response/VpcResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpcResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.vpc.Vpc;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Vpc.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
index c29a37e..9e21168 100644
--- a/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/VpnUsersResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.VpnUser;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = VpnUser.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ZoneResponse.java b/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
index 2ebb15a..14e9a1a 100644
--- a/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ZoneResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.dc.DataCenter;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = DataCenter.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/network/element/InternalLoadBalancerElementService.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/network/element/InternalLoadBalancerElementService.java b/api/src/org/apache/cloudstack/network/element/InternalLoadBalancerElementService.java
index 33a0c64..87590f1 100644
--- a/api/src/org/apache/cloudstack/network/element/InternalLoadBalancerElementService.java
+++ b/api/src/org/apache/cloudstack/network/element/InternalLoadBalancerElementService.java
@@ -18,7 +18,6 @@ package org.apache.cloudstack.network.element;
import java.util.List;
-
import com.cloud.network.VirtualRouterProvider;
import com.cloud.utils.component.PluggableService;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/usage/Usage.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/usage/Usage.java b/api/src/org/apache/cloudstack/usage/Usage.java
index c74d3b7..1f2cfc2 100644
--- a/api/src/org/apache/cloudstack/usage/Usage.java
+++ b/api/src/org/apache/cloudstack/usage/Usage.java
@@ -16,19 +16,8 @@
// under the License.
package org.apache.cloudstack.usage;
-import org.apache.cloudstack.api.InternalIdentity;
-
import java.util.Date;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
public interface Usage {
public long getId();
[08/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
index ca16cdc..738fc6b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListServiceOfferingsCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -25,8 +27,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-
@APICommand(name = "listServiceOfferings", description="Lists all available service offerings.", responseObject=ServiceOfferingResponse.class)
public class ListServiceOfferingsCmd extends BaseListCmd {
public static final Logger s_logger = Logger.getLogger(ListServiceOfferingsCmd.class.getName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
index 95889fe..4266e6b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ActivateProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
index 7515f05..789c0fe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/CreateProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
index 9b61b69..52fa478 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
index 27d1b50..b1c380a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/DeleteProjectInvitationCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectInvitationResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
index 6e8b2da..72528a8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectInvitationsCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectInvitationResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "listProjectInvitations", description = "Lists projects and provides detailed information for listed projects", responseObject = ProjectInvitationResponse.class, since = "3.0.0")
public class ListProjectInvitationsCmd extends BaseListAccountResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
index 08cef10..835be54 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/ListProjectsCmd.java
@@ -21,13 +21,14 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
index e2f4bd6..58c9772 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/SuspendProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
index e475bc7..62f8aef 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
index f34814a..fe9f709 100644
--- a/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/project/UpdateProjectInvitationCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.project;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
index 07f93a4..61a065c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ListRegionsCmd.java
@@ -21,6 +21,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.RegionResponse;
import org.apache.cloudstack.region.Region;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
@APICommand(name = "listRegions", description="Lists Regions", responseObject=RegionResponse.class)
public class ListRegionsCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
index 1c07a0a..e2845bd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java
@@ -17,6 +17,22 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.FirewallRuleResponse;
+import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.region.ha.GlobalLoadBalancerRule;
@@ -24,14 +40,6 @@ import com.cloud.region.ha.GlobalLoadBalancingRulesService;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.utils.StringUtils;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.FirewallRuleResponse;
-import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
-import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
-
-import javax.inject.Inject;
-import java.util.List;
@APICommand(name = "assignToGlobalLoadBalancerRule", description="Assign load balancer rule or list of load " +
"balancer rules to a global load balancer rules.", responseObject=SuccessResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
index 8802aac..720e6d0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/CreateGlobalLoadBalancerRuleCmd.java
@@ -17,20 +17,27 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
-import com.cloud.async.AsyncJob;
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
+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;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.DomainResponse;
+import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
+import org.apache.cloudstack.api.response.RegionResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.region.ha.GlobalLoadBalancerRule;
import com.cloud.region.ha.GlobalLoadBalancingRulesService;
import com.cloud.user.UserContext;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
-import org.apache.cloudstack.api.response.RegionResponse;
-import org.apache.log4j.Logger;
-
-import javax.inject.Inject;
@APICommand(name = "createGlobalLoadBalancerRule", description="Creates a global load balancer rule",
responseObject=GlobalLoadBalancerResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
index 032fd19..78659c9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java
@@ -17,18 +17,23 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
-import com.cloud.async.AsyncJob;
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiCommandJobType;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.region.ha.GlobalLoadBalancerRule;
import com.cloud.region.ha.GlobalLoadBalancingRulesService;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
-import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
-
-import javax.inject.Inject;
@APICommand(name = "deleteGlobalLoadBalancerRule", description="Deletes a global load balancer rule.", responseObject=SuccessResponse.class)
public class DeleteGlobalLoadBalancerRuleCmd extends BaseAsyncCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
index d75de57..4f44314 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/ListGlobalLoadBalancerRuleCmd.java
@@ -17,8 +17,13 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
-import com.cloud.region.ha.GlobalLoadBalancerRule;
-import com.cloud.region.ha.GlobalLoadBalancingRulesService;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -26,11 +31,9 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.RegionResponse;
-import org.apache.log4j.Logger;
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.List;
+import com.cloud.region.ha.GlobalLoadBalancerRule;
+import com.cloud.region.ha.GlobalLoadBalancingRulesService;
@APICommand(name = "listGlobalLoadBalancerRules", description = "Lists load balancer rules.", responseObject = GlobalLoadBalancerResponse.class)
public class ListGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
index fa051af..59c384e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/RemoveFromGlobalLoadBalancerRuleCmd.java
@@ -17,6 +17,22 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.FirewallRuleResponse;
+import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
+import org.apache.cloudstack.api.response.SuccessResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.region.ha.GlobalLoadBalancerRule;
@@ -24,14 +40,6 @@ import com.cloud.region.ha.GlobalLoadBalancingRulesService;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.utils.StringUtils;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.FirewallRuleResponse;
-import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
-import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
-
-import javax.inject.Inject;
-import java.util.List;
@APICommand(name = "removeFromGlobalLoadBalancerRule", description="Removes a load balancer rule association with" +
" global load balancer rule", responseObject=SuccessResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
index 10694e1..7d7eb25 100644
--- a/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/region/ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java
@@ -17,16 +17,18 @@
package org.apache.cloudstack.api.command.user.region.ha.gslb;
-import com.cloud.region.ha.GlobalLoadBalancingRulesService;
+import javax.inject.Inject;
+
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.GlobalLoadBalancerResponse;
import org.apache.cloudstack.api.response.LoadBalancerResponse;
-import org.apache.log4j.Logger;
-import javax.inject.Inject;
+import com.cloud.region.ha.GlobalLoadBalancingRulesService;
@APICommand(name = "updateGlobalLoadBalancerRule", description = "update global load balancer rules.", responseObject = LoadBalancerResponse.class)
public class UpdateGlobalLoadBalancerRuleCmd extends BaseListTaggedResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
index 716addb..7c432d7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/GetCloudIdentifierCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.resource;
import java.util.ArrayList;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.CloudIdentifierResponse;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
index fffd3ad..e397c0c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/ListHypervisorsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.resource;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.command.admin.router.UpgradeRouterCmd;
import org.apache.cloudstack.api.response.HypervisorResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
index 191e958..cb4be41 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/ListResourceLimitsCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.user.resource;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ResourceLimitResponse;
-import org.apache.log4j.Logger;
import com.cloud.configuration.ResourceLimit;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
index 0f4c932..791243a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceCountCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.resource;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.ResourceCountResponse;
-import org.apache.log4j.Logger;
import com.cloud.configuration.ResourceCount;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
index 826596c..038d06d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/resource/UpdateResourceLimitCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.resource;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.ResourceLimitResponse;
-import org.apache.log4j.Logger;
import com.cloud.configuration.ResourceLimit;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
index 5a4ff94..bfbd97c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java
@@ -22,6 +22,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -33,9 +35,7 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
import org.apache.cloudstack.api.response.SecurityGroupRuleResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.security.SecurityRule;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
index ff5d0f1..40e6620 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java
@@ -22,6 +22,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -33,9 +35,7 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
import org.apache.cloudstack.api.response.SecurityGroupRuleResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.security.SecurityRule;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
index 839afb2..fb7c2cc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.securitygroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.security.SecurityGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
index aa6ec2d..bc30b76 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.securitygroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceInUseException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
index fb1aa20..95f927a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.securitygroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SecurityGroupResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
@APICommand(name = "listSecurityGroups", description="Lists security groups", responseObject=SecurityGroupResponse.class)
public class ListSecurityGroupsCmd extends BaseListTaggedResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
index f24fc90..1123638 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.securitygroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SecurityGroupRuleResponse;
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.network.security.SecurityGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
index 1a5cda4..f2ad58f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.securitygroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SecurityGroupRuleResponse;
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.network.security.SecurityGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
index b915a25..c088811 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.snapshot;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
import org.apache.cloudstack.api.response.SnapshotResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
index 5a9ea2a..510cfa1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotPolicyCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.snapshot;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
index e7ae66a..bcd976d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.snapshot;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SnapshotResponse;
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.storage.Snapshot;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
index 5a75ea0..cc8f4a2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotPoliciesCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.snapshot;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
index f1c6010..e0df489 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotPoliciesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.snapshot;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SnapshotPolicyResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.snapshot.SnapshotPolicy;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
index fa71c05..ca169b7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.snapshot;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SnapshotResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.storage.Snapshot;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
index 56bec7e..d87cf9e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.ssh;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SSHKeyPairResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.SSHKeyPair;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
index b05a675..f40fa73 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.ssh;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
index e1788ce..3cfc77e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.user.ssh;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.SSHKeyPairResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.SSHKeyPair;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
index b05c6b1..feffda5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.ssh;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SSHKeyPairResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.SSHKeyPair;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
index a01bac3..0a98851 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
@@ -23,6 +23,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.server.ResourceTag;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
index a6ba0da..39d8117 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
@@ -23,6 +23,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.server.ResourceTag.TaggedResourceType;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
index b21db21..3f7030b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/CopyTemplateCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.template;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,11 +28,8 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.cloudstack.api.response.UserVmResponse;
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.exception.StorageUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
index f7282ca..cb83705 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/CreateTemplateCmd.java
@@ -20,6 +20,8 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -33,9 +35,7 @@ import org.apache.cloudstack.api.response.StoragePoolResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
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.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
index d649443..409425f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/DeleteTemplateCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.template;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,6 @@ import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
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.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
index b9553b9..b7597e4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ExtractTemplateCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.template;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,6 @@ import org.apache.cloudstack.api.response.ExtractResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
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.InternalErrorException;
import com.cloud.template.VirtualMachineTemplate;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
index d727a33..37bdbd2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatePermissionsCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.template;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd;
import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
index 9e1a0f6..2da3bf4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java
@@ -20,6 +20,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.template.VirtualMachineTemplate.TemplateFilter;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
index bca1e1d..a66acde 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
@@ -21,6 +21,8 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -34,9 +36,7 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
index 3987dbe..a888c3c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplateCmd.java
@@ -16,12 +16,13 @@
// under the License.
package org.apache.cloudstack.api.command.user.template;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoCmd;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
index e44969e..f1c6107 100644
--- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.template;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
index df4a6db..9c95a9e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java
@@ -16,7 +16,6 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
-import com.cloud.vm.NicSecondaryIp;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
@@ -29,7 +28,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NicResponse;
import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
-import com.cloud.async.AsyncJob;
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.event.EventTypes;
@@ -44,6 +42,7 @@ import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.utils.net.NetUtils;
import com.cloud.vm.Nic;
+import com.cloud.vm.NicSecondaryIp;
@APICommand(name = "addIpToNic", description = "Assigns secondary IP to NIC", responseObject = NicSecondaryIpResponse.class)
public class AddIpToVmNicCmd extends BaseAsyncCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
index 4334000..70cd828 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java
@@ -21,15 +21,17 @@ import java.util.EnumSet;
import org.apache.log4j.Logger;
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiConstants.VMDetails;
-import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkResponse;
+import org.apache.cloudstack.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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index ffed07e..b9d4740 100755
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -24,6 +24,8 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
import org.apache.cloudstack.affinity.AffinityGroupResponse;
import org.apache.cloudstack.api.ACL;
@@ -44,9 +46,7 @@ import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
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.dc.DataCenter.NetworkType;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
index e9a62eb..a8b79e5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,13 +26,10 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
index 839f937..bc867ea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.command.user.vm;
import java.security.InvalidParameterException;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.GetVMPasswordResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
index 2641947..1891365 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListNicsCmd.java
@@ -32,7 +32,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NicResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import com.cloud.async.AsyncJob;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceAllocationException;
@@ -40,7 +39,6 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.vm.Nic;
-import com.cloud.vm.NicSecondaryIp;
@APICommand(name = "listNics", description = "list the vm nics IP to NIC", responseObject = NicResponse.class)
public class ListNicsCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
index 0748209..c022382 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java
@@ -20,6 +20,8 @@ import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.affinity.AffinityGroupResponse;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
@@ -38,9 +40,7 @@ import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
index 10cd228..79c1517 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,13 +26,10 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
index 6adfc03..1a78f48 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java
@@ -27,16 +27,14 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NicSecondaryIpResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import com.cloud.async.AsyncJob;
+
import com.cloud.dc.DataCenter;
import com.cloud.dc.DataCenter.NetworkType;
import com.cloud.event.EventTypes;
-import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
-import com.cloud.vm.Nic;
import com.cloud.vm.NicSecondaryIp;
@APICommand(name = "removeIpFromNic", description="Assigns secondary IP to NIC.", responseObject=SuccessResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
index b1a870e..075f8d1 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java
@@ -21,15 +21,17 @@ import java.util.EnumSet;
import org.apache.log4j.Logger;
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiConstants.VMDetails;
-import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NicResponse;
+import org.apache.cloudstack.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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
index e041129..2c2cb89 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
index a29b0fd..1a32f7f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java
@@ -19,24 +19,23 @@ package org.apache.cloudstack.api.command.user.vm;
import org.apache.log4j.Logger;
+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;
-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.UserVmResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import com.cloud.async.AsyncJob;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
+import org.apache.cloudstack.api.response.UserVmResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.user.Account;
+import com.cloud.user.UserContext;
+import com.cloud.uservm.UserVm;
@APICommand(name = "resetSSHKeyForVirtualMachine", responseObject = UserVmResponse.class, description = "Resets the SSH Key for virtual machine. " +
"The virtual machine must be in a \"Stopped\" state. [async]")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
index 9c33f97..13d08df 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
index 4f2ac75..4316fed 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
@@ -16,15 +16,25 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
-import com.cloud.exception.*;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
-import com.cloud.uservm.UserVm;
-import org.apache.cloudstack.api.*;
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.api.ACL;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
+
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.ManagementServerException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.exception.VirtualMachineMigrationException;
+import com.cloud.user.Account;
+import com.cloud.uservm.UserVm;
@APICommand(name = "scaleVirtualMachine", description="Scales the virtual machine to a new service offering.", responseObject=SuccessResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
index ba92a53..4936e60 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,16 +27,13 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
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.exception.StorageUnavailableException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
[05/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 9e6748a..366a4c1 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -190,16 +190,16 @@
<bean id="dataCenterVnetDaoImpl" class="com.cloud.dc.dao.DataCenterVnetDaoImpl" />
<bean id="dataStoreProviderDaoImpl" class="org.apache.cloudstack.storage.datastore.db.DataStoreProviderDaoImpl" />
<bean id="dcDetailsDaoImpl" class="com.cloud.dc.dao.DcDetailsDaoImpl" />
- <bean id="engineDcDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.DcDetailsDaoImpl" />
+ <bean id="engineDcDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.DcDetailsDaoImpl" />
<bean id="diskOfferingJoinDaoImpl" class="com.cloud.api.query.dao.DiskOfferingJoinDaoImpl" />
<bean id="domainDaoImpl" class="com.cloud.domain.dao.DomainDaoImpl" />
<bean id="domainRouterDaoImpl" class="com.cloud.vm.dao.DomainRouterDaoImpl" />
<bean id="domainRouterJoinDaoImpl" class="com.cloud.api.query.dao.DomainRouterJoinDaoImpl" />
<bean id="elasticLbVmMapDaoImpl" class="com.cloud.network.lb.dao.ElasticLbVmMapDaoImpl" />
- <bean id="engineClusterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDaoImpl" />
- <bean id="engineDataCenterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDaoImpl" />
- <bean id="engineHostDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDaoImpl" />
- <bean id="engineHostPodDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDaoImpl" />
+ <bean id="engineClusterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.EngineClusterDaoImpl" />
+ <bean id="engineDataCenterDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.EngineDataCenterDaoImpl" />
+ <bean id="engineHostDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostDaoImpl" />
+ <bean id="engineHostPodDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostPodDaoImpl" />
<bean id="eventDaoImpl" class="com.cloud.event.dao.EventDaoImpl" />
<bean id="eventJoinDaoImpl" class="com.cloud.event.dao.EventJoinDaoImpl" />
<bean id="externalFirewallDeviceDaoImpl" class="com.cloud.network.dao.ExternalFirewallDeviceDaoImpl" />
@@ -213,10 +213,10 @@
<bean id="guestOSDaoImpl" class="com.cloud.storage.dao.GuestOSDaoImpl" />
<bean id="highAvailabilityDaoImpl" class="com.cloud.ha.dao.HighAvailabilityDaoImpl" />
<bean id="hostDaoImpl" class="com.cloud.host.dao.HostDaoImpl" />
- <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostDetailsDaoImpl" />
+ <bean id="engineHostDetailsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.HostDetailsDaoImpl" />
<bean id="hostDetailsDaoImpl" class="com.cloud.host.dao.HostDetailsDaoImpl" />
<bean id="hostJoinDaoImpl" class="com.cloud.api.query.dao.HostJoinDaoImpl" />
- <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.db.dao.HostTagsDaoImpl" />
+ <bean id="engineHostTagsDaoImpl" class="org.apache.cloudstack.engine.datacenter.entity.dao.HostTagsDaoImpl" />
<bean id="hostTagsDaoImpl" class="com.cloud.host.dao.HostTagsDaoImpl" />
<bean id="hostTransferMapDaoImpl" class="com.cloud.cluster.agentlb.dao.HostTransferMapDaoImpl" />
<bean id="iPAddressDaoImpl" class="com.cloud.network.dao.IPAddressDaoImpl" />
@@ -332,12 +332,12 @@
<bean id="userVmDaoImpl" class="com.cloud.vm.dao.UserVmDaoImpl" />
<bean id="userVmDetailsDaoImpl" class="com.cloud.vm.dao.UserVmDetailsDaoImpl" />
<bean id="userVmJoinDaoImpl" class="com.cloud.api.query.dao.UserVmJoinDaoImpl" />
- <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMComputeTagDaoImpl" />
- <bean id="vMEntityDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDaoImpl" />
+ <bean id="vMComputeTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VMComputeTagDaoImpl" />
+ <bean id="vMEntityDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VMEntityDaoImpl" />
<bean id="vMInstanceDaoImpl" class="com.cloud.vm.dao.VMInstanceDaoImpl" />
- <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMNetworkMapDaoImpl" />
- <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDaoImpl" />
- <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMRootDiskTagDaoImpl" />
+ <bean id="vMNetworkMapDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VMNetworkMapDaoImpl" />
+ <bean id="vMReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VMReservationDaoImpl" />
+ <bean id="vMRootDiskTagDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VMRootDiskTagDaoImpl" />
<bean id="vMSnapshotDaoImpl" class="com.cloud.vm.snapshot.dao.VMSnapshotDaoImpl" />
<bean id="vMTemplateDetailsDaoImpl" class="com.cloud.storage.dao.VMTemplateDetailsDaoImpl" />
<bean id="vMTemplateHostDaoImpl" class="com.cloud.storage.dao.VMTemplateHostDaoImpl" />
@@ -352,7 +352,7 @@
<bean id="volumeDaoImpl" class="com.cloud.storage.dao.VolumeDaoImpl" />
<bean id="volumeHostDaoImpl" class="com.cloud.storage.dao.VolumeHostDaoImpl" />
<bean id="volumeJoinDaoImpl" class="com.cloud.api.query.dao.VolumeJoinDaoImpl" />
- <bean id="volumeReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.api.db.dao.VolumeReservationDaoImpl" />
+ <bean id="volumeReservationDaoImpl" class="org.apache.cloudstack.engine.cloud.entity.dao.VolumeReservationDaoImpl" />
<bean id="vpcDaoImpl" class="com.cloud.network.vpc.dao.VpcDaoImpl" />
<bean id="vpcGatewayDaoImpl" class="com.cloud.network.vpc.dao.VpcGatewayDaoImpl" />
<bean id="vpcOfferingDaoImpl" class="com.cloud.network.vpc.dao.VpcOfferingDaoImpl" />
@@ -728,7 +728,7 @@
<bean id="cloudOrchestrator" class="org.apache.cloudstack.platform.orchestration.CloudOrchestrator" />
<bean id="clusterRestService" class="org.apache.cloudstack.engine.rest.service.api.ClusterRestService" />
<bean id="consoleProxyServlet" class="com.cloud.servlet.ConsoleProxyServlet" />
- <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceManagerImpl" />
+ <bean id="dataCenterResourceManagerImpl" class="org.apache.cloudstack.engine.datacenter.entity.DataCenterResourceManagerImpl" />
<bean id="dataDisk" class="org.apache.cloudstack.engine.subsystem.api.storage.type.DataDisk" />
<bean id="dataMotionServiceImpl" class="org.apache.cloudstack.storage.motion.DataMotionServiceImpl" />
<bean id="dataObjectManagerImpl" class="org.apache.cloudstack.storage.datastore.DataObjectManagerImpl" />
@@ -802,16 +802,17 @@
<!-- Async management -->
- <bean id="asyncJobDaoImpl" class="com.cloud.async.dao.AsyncJobDaoImpl" />
+ <bean id="asyncJobDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobDaoImpl" />
<bean id="asyncJobJoinDaoImpl" class="com.cloud.api.query.dao.AsyncJobJoinDaoImpl" />
- <bean id="asyncJobJournalDaoImpl" class="com.cloud.async.dao.AsyncJobJournalDaoImpl" />
- <bean id="asyncJobJoinMapDaoImpl" class="com.cloud.async.dao.AsyncJobJoinMapDaoImpl" />
+ <bean id="asyncJobJournalDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDaoImpl" />
+ <bean id="asyncJobJoinMapDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDaoImpl" />
<bean id="asyncJobManagerImpl" class="com.cloud.async.AsyncJobManagerImpl">
<property name="defaultDispatcher" value="ApiAsyncJobDispatcher" />
</bean>
- <bean id="syncQueueDaoImpl" class="com.cloud.async.dao.SyncQueueDaoImpl" />
- <bean id="syncQueueItemDaoImpl" class="com.cloud.async.dao.SyncQueueItemDaoImpl" />
- <bean id="syncQueueManagerImpl" class="com.cloud.async.SyncQueueManagerImpl" />
+ <bean id="asyncJobMonitor" class="org.apache.cloudstack.framework.jobs.AsyncJobMonitor"/>
+ <bean id="syncQueueDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.SyncQueueDaoImpl" />
+ <bean id="syncQueueItemDaoImpl" class="org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDaoImpl" />
+ <bean id="syncQueueManagerImpl" class="org.apache.cloudstack.framework.jobs.SyncQueueManagerImpl" />
<bean id="ApiAsyncJobDispatcher" class="com.cloud.api.ApiAsyncJobDispatcher">
<property name="name" value="ApiAsyncJobDispatcher" />
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/core/src/com/cloud/async/AsyncJobJoinMapVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/async/AsyncJobJoinMapVO.java b/core/src/com/cloud/async/AsyncJobJoinMapVO.java
deleted file mode 100644
index 68bf5d1..0000000
--- a/core/src/com/cloud/async/AsyncJobJoinMapVO.java
+++ /dev/null
@@ -1,210 +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.async;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name="async_job_join_map")
-public class AsyncJobJoinMapVO {
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id = null;
-
- @Column(name="job_id")
- private long jobId;
-
- @Column(name="join_job_id")
- private long joinJobId;
-
- @Column(name="join_status")
- private int joinStatus;
-
- @Column(name="join_result", length=1024)
- private String joinResult;
-
- @Column(name="join_msid")
- private long joinMsid;
-
- @Column(name="complete_msid")
- private Long completeMsid;
-
- @Column(name="sync_source_id")
- private Long syncSourceId;
-
- @Column(name="wakeup_handler")
- private String wakeupHandler;
-
- @Column(name="wakeup_dispatcher")
- private String wakeupDispatcher;
-
- @Column(name="wakeup_interval")
- private long wakeupInterval;
-
- @Column(name=GenericDao.CREATED_COLUMN)
- private Date created;
-
- @Column(name="last_updated")
- @Temporal(TemporalType.TIMESTAMP)
- private Date lastUpdated;
-
- @Column(name="next_wakeup")
- @Temporal(TemporalType.TIMESTAMP)
- private Date nextWakeupTime;
-
- @Column(name="expiration")
- @Temporal(TemporalType.TIMESTAMP)
- private Date expiration;
-
- public AsyncJobJoinMapVO() {
- created = DateUtil.currentGMTTime();
- lastUpdated = DateUtil.currentGMTTime();
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public long getJobId() {
- return jobId;
- }
-
- public void setJobId(long jobId) {
- this.jobId = jobId;
- }
-
- public long getJoinJobId() {
- return joinJobId;
- }
-
- public void setJoinJobId(long joinJobId) {
- this.joinJobId = joinJobId;
- }
-
- public int getJoinStatus() {
- return joinStatus;
- }
-
- public void setJoinStatus(int joinStatus) {
- this.joinStatus = joinStatus;
- }
-
- public String getJoinResult() {
- return joinResult;
- }
-
- public void setJoinResult(String joinResult) {
- this.joinResult = joinResult;
- }
-
- public long getJoinMsid() {
- return joinMsid;
- }
-
- public void setJoinMsid(long joinMsid) {
- this.joinMsid = joinMsid;
- }
-
- public Long getCompleteMsid() {
- return completeMsid;
- }
-
- public void setCompleteMsid(Long completeMsid) {
- this.completeMsid = completeMsid;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public Date getLastUpdated() {
- return lastUpdated;
- }
-
- public void setLastUpdated(Date lastUpdated) {
- this.lastUpdated = lastUpdated;
- }
-
- public Long getSyncSourceId() {
- return syncSourceId;
- }
-
- public void setSyncSourceId(Long syncSourceId) {
- this.syncSourceId = syncSourceId;
- }
-
- public String getWakeupHandler() {
- return wakeupHandler;
- }
-
- public void setWakeupHandler(String wakeupHandler) {
- this.wakeupHandler = wakeupHandler;
- }
-
- public String getWakeupDispatcher() {
- return wakeupDispatcher;
- }
-
- public void setWakeupDispatcher(String wakeupDispatcher) {
- this.wakeupDispatcher = wakeupDispatcher;
- }
-
- public long getWakeupInterval() {
- return wakeupInterval;
- }
-
- public void setWakeupInterval(long wakeupInterval) {
- this.wakeupInterval = wakeupInterval;
- }
-
- public Date getNextWakeupTime() {
- return nextWakeupTime;
- }
-
- public void setNextWakeupTime(Date nextWakeupTime) {
- this.nextWakeupTime = nextWakeupTime;
- }
-
- public Date getExpiration() {
- return expiration;
- }
-
- public void setExpiration(Date expiration) {
- this.expiration = expiration;
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/core/src/com/cloud/async/AsyncJobJournalVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/async/AsyncJobJournalVO.java b/core/src/com/cloud/async/AsyncJobJournalVO.java
deleted file mode 100644
index 1cf57e9..0000000
--- a/core/src/com/cloud/async/AsyncJobJournalVO.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.async;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name="async_job_journal")
-public class AsyncJobJournalVO {
- @Id
- @GeneratedValue(strategy=GenerationType.IDENTITY)
- @Column(name="id")
- private Long id = null;
-
- @Column(name="job_id")
- private long jobId;
-
- @Column(name="journal_type", updatable=false, nullable=false, length=32)
- @Enumerated(value=EnumType.STRING)
- private AsyncJob.JournalType journalType;
-
- @Column(name="journal_text", length=1024)
- private String journalText;
-
- @Column(name="journal_obj", length=1024)
- private String journalObjJsonString;
-
- @Column(name=GenericDao.CREATED_COLUMN)
- protected Date created;
-
- public AsyncJobJournalVO() {
- created = DateUtil.currentGMTTime();
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public long getJobId() {
- return jobId;
- }
-
- public void setJobId(long jobId) {
- this.jobId = jobId;
- }
-
- public AsyncJob.JournalType getJournalType() {
- return journalType;
- }
-
- public void setJournalType(AsyncJob.JournalType journalType) {
- this.journalType = journalType;
- }
-
- public String getJournalText() {
- return journalText;
- }
-
- public void setJournalText(String journalText) {
- this.journalText = journalText;
- }
-
- public String getJournalObjJsonString() {
- return journalObjJsonString;
- }
-
- public void setJournalObjJsonString(String journalObjJsonString) {
- this.journalObjJsonString = journalObjJsonString;
- }
-
- public Date getCreated() {
- return created;
- }
-
- public void setCreated(Date created) {
- this.created = created;
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/engine/api/src/org/apache/cloudstack/engine/service/api/OperationsServices.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/service/api/OperationsServices.java b/engine/api/src/org/apache/cloudstack/engine/service/api/OperationsServices.java
index 25a0b19..7b7abe8 100755
--- a/engine/api/src/org/apache/cloudstack/engine/service/api/OperationsServices.java
+++ b/engine/api/src/org/apache/cloudstack/engine/service/api/OperationsServices.java
@@ -22,18 +22,17 @@ import java.net.URL;
import java.util.List;
import com.cloud.alert.Alert;
-import com.cloud.async.AsyncJob;
public interface OperationsServices {
- List<AsyncJob> listJobs();
-
- List<AsyncJob> listJobsInProgress();
-
- List<AsyncJob> listJobsCompleted();
-
- List<AsyncJob> listJobsCompleted(Long from);
-
- List<AsyncJob> listJobsInWaiting();
+// List<AsyncJob> listJobs();
+//
+// List<AsyncJob> listJobsInProgress();
+//
+// List<AsyncJob> listJobsCompleted();
+//
+// List<AsyncJob> listJobsCompleted(Long from);
+//
+// List<AsyncJob> listJobsInWaiting();
void cancelJob(String job);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/engine/schema/src/com/cloud/network/dao/NetworkRuleConfigVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkRuleConfigVO.java b/engine/schema/src/com/cloud/network/dao/NetworkRuleConfigVO.java
index 542c0bb..f2ceee6 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkRuleConfigVO.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkRuleConfigVO.java
@@ -18,15 +18,11 @@ package com.cloud.network.dao;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
-import com.cloud.async.AsyncInstanceCreateStatus;
-import com.google.gson.annotations.Expose;
import org.apache.cloudstack.api.InternalIdentity;
@Entity
@@ -49,11 +45,6 @@ public class NetworkRuleConfigVO implements InternalIdentity {
@Column(name="protocol")
private String protocol;
- @Expose
- @Column(name="create_status", updatable = true, nullable=false)
- @Enumerated(value=EnumType.STRING)
- private AsyncInstanceCreateStatus createStatus;
-
public NetworkRuleConfigVO() {}
public NetworkRuleConfigVO(long securityGroupId, String publicPort, String privatePort, String protocol) {
@@ -63,6 +54,7 @@ public class NetworkRuleConfigVO implements InternalIdentity {
this.protocol = protocol;
}
+ @Override
public long getId() {
return id;
}
@@ -82,12 +74,4 @@ public class NetworkRuleConfigVO implements InternalIdentity {
public String getProtocol() {
return protocol;
}
-
- public AsyncInstanceCreateStatus getCreateStatus() {
- return createStatus;
- }
-
- public void setCreateStatus(AsyncInstanceCreateStatus createStatus) {
- this.createStatus = createStatus;
- }
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/engine/schema/src/com/cloud/network/security/SecurityGroupRuleVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/security/SecurityGroupRuleVO.java b/engine/schema/src/com/cloud/network/security/SecurityGroupRuleVO.java
index f01b50f..0d4abd7 100644
--- a/engine/schema/src/com/cloud/network/security/SecurityGroupRuleVO.java
+++ b/engine/schema/src/com/cloud/network/security/SecurityGroupRuleVO.java
@@ -20,17 +20,11 @@ import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
-import com.cloud.async.AsyncInstanceCreateStatus;
-import com.google.gson.annotations.Expose;
-import org.apache.cloudstack.api.InternalIdentity;
-
@Entity
@Table(name = ("security_group_rule"))
public class SecurityGroupRuleVO implements SecurityRule {
@@ -60,25 +54,20 @@ public class SecurityGroupRuleVO implements SecurityRule {
@Column(name = "allowed_ip_cidr", nullable = true)
private String allowedSourceIpCidr = null;
- @Expose
- @Column(name = "create_status", updatable = true, nullable = false)
- @Enumerated(value = EnumType.STRING)
- private AsyncInstanceCreateStatus createStatus;
-
@Column(name = "uuid")
private String uuid;
public SecurityGroupRuleVO() {
- this.uuid = UUID.randomUUID().toString();
+ uuid = UUID.randomUUID().toString();
}
public SecurityGroupRuleVO(SecurityRuleType type,long securityGroupId, int fromPort, int toPort, String protocol, long allowedNetworkId ) {
this.securityGroupId = securityGroupId;
- this.startPort = fromPort;
- this.endPort = toPort;
+ startPort = fromPort;
+ endPort = toPort;
this.protocol = protocol;
this.allowedNetworkId = allowedNetworkId;
- this.uuid = UUID.randomUUID().toString();
+ uuid = UUID.randomUUID().toString();
if (type == SecurityRuleType.IngressRule) {
this.type = SecurityRuleType.IngressRule.getType();
} else {
@@ -88,11 +77,11 @@ public class SecurityGroupRuleVO implements SecurityRule {
public SecurityGroupRuleVO(SecurityRuleType type,long securityGroupId, int fromPort, int toPort, String protocol, String allowedIpCidr) {
this.securityGroupId = securityGroupId;
- this.startPort = fromPort;
- this.endPort = toPort;
+ startPort = fromPort;
+ endPort = toPort;
this.protocol = protocol;
- this.allowedSourceIpCidr = allowedIpCidr;
- this.uuid = UUID.randomUUID().toString();
+ allowedSourceIpCidr = allowedIpCidr;
+ uuid = UUID.randomUUID().toString();
if (type == SecurityRuleType.IngressRule) {
this.type = SecurityRuleType.IngressRule.getType();
} else {
@@ -115,8 +104,9 @@ public class SecurityGroupRuleVO implements SecurityRule {
return securityGroupId;
}
+ @Override
public SecurityRuleType getRuleType() {
- if ("ingress".equalsIgnoreCase(this.type))
+ if ("ingress".equalsIgnoreCase(type))
return SecurityRuleType.IngressRule;
else
return SecurityRuleType.EgressRule;
@@ -138,15 +128,6 @@ public class SecurityGroupRuleVO implements SecurityRule {
}
@Override
- public AsyncInstanceCreateStatus getCreateStatus() {
- return createStatus;
- }
-
- public void setCreateStatus(AsyncInstanceCreateStatus createStatus) {
- this.createStatus = createStatus;
- }
-
- @Override
public Long getAllowedNetworkId() {
return allowedNetworkId;
}
@@ -158,7 +139,7 @@ public class SecurityGroupRuleVO implements SecurityRule {
@Override
public String getUuid() {
- return this.uuid;
+ return uuid;
}
public void setUuid(String uuid) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/pom.xml
----------------------------------------------------------------------
diff --git a/framework/jobs/pom.xml b/framework/jobs/pom.xml
index 5ae63af..a4e6eff 100644
--- a/framework/jobs/pom.xml
+++ b/framework/jobs/pom.xml
@@ -41,6 +41,11 @@
<artifactId>cloud-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.cloudstack</groupId>
+ <artifactId>cloud-framework-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/job/Job.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/job/Job.java b/framework/jobs/src/org/apache/cloudstack/framework/job/Job.java
deleted file mode 100755
index 62ed72f..0000000
--- a/framework/jobs/src/org/apache/cloudstack/framework/job/Job.java
+++ /dev/null
@@ -1,32 +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 org.apache.cloudstack.framework.job;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface Job {
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/job/JobInterceptor.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/job/JobInterceptor.java b/framework/jobs/src/org/apache/cloudstack/framework/job/JobInterceptor.java
deleted file mode 100755
index d81077d..0000000
--- a/framework/jobs/src/org/apache/cloudstack/framework/job/JobInterceptor.java
+++ /dev/null
@@ -1,23 +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 org.apache.cloudstack.framework.job;
-
-public class JobInterceptor {
-
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJob.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJob.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJob.java
new file mode 100644
index 0000000..b9ef36c
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJob.java
@@ -0,0 +1,115 @@
+// 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.framework.jobs;
+
+import java.util.Date;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+
+public interface AsyncJob extends Identity, InternalIdentity {
+
+ public static interface Topics {
+ public static final String JOB_HEARTBEAT = "job.heartbeat";
+ public static final String JOB_STATE = "job.state";
+ }
+
+ public enum JournalType {
+ SUCCESS, FAILURE
+ };
+
+ String getType();
+
+ String getDispatcher();
+
+ int getPendingSignals();
+ public enum Type {
+ None,
+ VirtualMachine,
+ DomainRouter,
+ Volume,
+ ConsoleProxy,
+ Snapshot,
+ Template,
+ Iso,
+ SystemVm,
+ Host,
+ StoragePool,
+ IpAddress,
+ SecurityGroup,
+ PhysicalNetwork,
+ TrafficType,
+ PhysicalNetworkServiceProvider,
+ FirewallRule,
+ Account,
+ User,
+ PrivateGateway,
+ StaticRoute,
+ Counter,
+ Condition,
+ AutoScalePolicy,
+ AutoScaleVmProfile,
+ AutoScaleVmGroup,
+ GlobalLoadBalancerRule,
+ LoadBalancerRule,
+ AffinityGroup,
+ InternalLbVm,
+ DedicatedGuestVlanRange
+ }
+
+ long getUserId();
+
+ long getAccountId();
+
+ String getCmd();
+
+ int getCmdVersion();
+
+ String getCmdInfo();
+
+ int getStatus();
+
+ int getProcessStatus();
+
+ int getResultCode();
+
+ String getResult();
+
+ Long getInitMsid();
+ void setInitMsid(Long msid);
+
+ Long getExecutingMsid();
+
+ Long getCompleteMsid();
+ void setCompleteMsid(Long msid);
+
+ Date getCreated();
+
+ Date getLastUpdated();
+
+ Date getLastPolled();
+
+ Date getRemoved();
+
+ String getInstanceType();
+
+ Long getInstanceId();
+
+ SyncQueueItem getSyncSource();
+ void setSyncSource(SyncQueueItem item);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobConstants.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobConstants.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobConstants.java
new file mode 100644
index 0000000..9568eb4
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobConstants.java
@@ -0,0 +1,34 @@
+// 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.framework.jobs;
+
+public interface AsyncJobConstants {
+ public static final int STATUS_IN_PROGRESS = 0;
+ public static final int STATUS_SUCCEEDED = 1;
+ public static final int STATUS_FAILED = 2;
+
+ public static final String JOB_DISPATCHER_PSEUDO = "pseudoJobDispatcher";
+ public static final String PSEUDO_JOB_INSTANCE_TYPE = "Thread";
+
+ public static final String JOB_POOL_THREAD_PREFIX = "Job-Executor";
+
+ // Although we may have detailed masks for each individual wakeup event, i.e.
+ // periodical timer, matched topic from message bus, it seems that we don't
+ // need to distinguish them to such level. Therefore, only one wakeup signal
+ // is defined
+ public static final int SIGNAL_MASK_WAKEUP = 1;
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobDispatcher.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobDispatcher.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobDispatcher.java
new file mode 100644
index 0000000..b46059c
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobDispatcher.java
@@ -0,0 +1,23 @@
+// 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.framework.jobs;
+
+import com.cloud.utils.component.Adapter;
+
+public interface AsyncJobDispatcher extends Adapter {
+ void runJob(AsyncJob job);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJoinMapVO.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJoinMapVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJoinMapVO.java
new file mode 100644
index 0000000..56eddf9
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJoinMapVO.java
@@ -0,0 +1,210 @@
+// 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.framework.jobs;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.db.GenericDao;
+
+@Entity
+@Table(name="async_job_join_map")
+public class AsyncJobJoinMapVO {
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private Long id = null;
+
+ @Column(name="job_id")
+ private long jobId;
+
+ @Column(name="join_job_id")
+ private long joinJobId;
+
+ @Column(name="join_status")
+ private int joinStatus;
+
+ @Column(name="join_result", length=1024)
+ private String joinResult;
+
+ @Column(name="join_msid")
+ private long joinMsid;
+
+ @Column(name="complete_msid")
+ private Long completeMsid;
+
+ @Column(name="sync_source_id")
+ private Long syncSourceId;
+
+ @Column(name="wakeup_handler")
+ private String wakeupHandler;
+
+ @Column(name="wakeup_dispatcher")
+ private String wakeupDispatcher;
+
+ @Column(name="wakeup_interval")
+ private long wakeupInterval;
+
+ @Column(name=GenericDao.CREATED_COLUMN)
+ private Date created;
+
+ @Column(name="last_updated")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastUpdated;
+
+ @Column(name="next_wakeup")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date nextWakeupTime;
+
+ @Column(name="expiration")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date expiration;
+
+ public AsyncJobJoinMapVO() {
+ created = DateUtil.currentGMTTime();
+ lastUpdated = DateUtil.currentGMTTime();
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public long getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(long jobId) {
+ this.jobId = jobId;
+ }
+
+ public long getJoinJobId() {
+ return joinJobId;
+ }
+
+ public void setJoinJobId(long joinJobId) {
+ this.joinJobId = joinJobId;
+ }
+
+ public int getJoinStatus() {
+ return joinStatus;
+ }
+
+ public void setJoinStatus(int joinStatus) {
+ this.joinStatus = joinStatus;
+ }
+
+ public String getJoinResult() {
+ return joinResult;
+ }
+
+ public void setJoinResult(String joinResult) {
+ this.joinResult = joinResult;
+ }
+
+ public long getJoinMsid() {
+ return joinMsid;
+ }
+
+ public void setJoinMsid(long joinMsid) {
+ this.joinMsid = joinMsid;
+ }
+
+ public Long getCompleteMsid() {
+ return completeMsid;
+ }
+
+ public void setCompleteMsid(Long completeMsid) {
+ this.completeMsid = completeMsid;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public Date getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ public Long getSyncSourceId() {
+ return syncSourceId;
+ }
+
+ public void setSyncSourceId(Long syncSourceId) {
+ this.syncSourceId = syncSourceId;
+ }
+
+ public String getWakeupHandler() {
+ return wakeupHandler;
+ }
+
+ public void setWakeupHandler(String wakeupHandler) {
+ this.wakeupHandler = wakeupHandler;
+ }
+
+ public String getWakeupDispatcher() {
+ return wakeupDispatcher;
+ }
+
+ public void setWakeupDispatcher(String wakeupDispatcher) {
+ this.wakeupDispatcher = wakeupDispatcher;
+ }
+
+ public long getWakeupInterval() {
+ return wakeupInterval;
+ }
+
+ public void setWakeupInterval(long wakeupInterval) {
+ this.wakeupInterval = wakeupInterval;
+ }
+
+ public Date getNextWakeupTime() {
+ return nextWakeupTime;
+ }
+
+ public void setNextWakeupTime(Date nextWakeupTime) {
+ this.nextWakeupTime = nextWakeupTime;
+ }
+
+ public Date getExpiration() {
+ return expiration;
+ }
+
+ public void setExpiration(Date expiration) {
+ this.expiration = expiration;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJournalVO.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJournalVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJournalVO.java
new file mode 100644
index 0000000..8cb5078
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobJournalVO.java
@@ -0,0 +1,108 @@
+// 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.framework.jobs;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import com.cloud.utils.DateUtil;
+import com.cloud.utils.db.GenericDao;
+
+@Entity
+@Table(name="async_job_journal")
+public class AsyncJobJournalVO {
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private Long id = null;
+
+ @Column(name="job_id")
+ private long jobId;
+
+ @Column(name="journal_type", updatable=false, nullable=false, length=32)
+ @Enumerated(value=EnumType.STRING)
+ private AsyncJob.JournalType journalType;
+
+ @Column(name="journal_text", length=1024)
+ private String journalText;
+
+ @Column(name="journal_obj", length=1024)
+ private String journalObjJsonString;
+
+ @Column(name=GenericDao.CREATED_COLUMN)
+ protected Date created;
+
+ public AsyncJobJournalVO() {
+ created = DateUtil.currentGMTTime();
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public long getJobId() {
+ return jobId;
+ }
+
+ public void setJobId(long jobId) {
+ this.jobId = jobId;
+ }
+
+ public AsyncJob.JournalType getJournalType() {
+ return journalType;
+ }
+
+ public void setJournalType(AsyncJob.JournalType journalType) {
+ this.journalType = journalType;
+ }
+
+ public String getJournalText() {
+ return journalText;
+ }
+
+ public void setJournalText(String journalText) {
+ this.journalText = journalText;
+ }
+
+ public String getJournalObjJsonString() {
+ return journalObjJsonString;
+ }
+
+ public void setJournalObjJsonString(String journalObjJsonString) {
+ this.journalObjJsonString = journalObjJsonString;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBean.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBean.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBean.java
new file mode 100644
index 0000000..8ba3c87
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBean.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.framework.jobs;
+
+public interface AsyncJobMBean {
+ public long getAccountId();
+ public long getUserId();
+ public String getCmd();
+ public String getCmdInfo();
+ public String getStatus();
+ public int getProcessStatus();
+ public int getResultCode();
+ public String getResult();
+ public String getInstanceType();
+ public String getInstanceId();
+ public String getInitMsid();
+ public String getCreateTime();
+ public String getLastUpdateTime();
+ public String getLastPollTime();
+ public String getSyncQueueId();
+ public String getSyncQueueContentType();
+ public String getSyncQueueContentId();
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBeanImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBeanImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBeanImpl.java
new file mode 100644
index 0000000..e420a90
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMBeanImpl.java
@@ -0,0 +1,143 @@
+// 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.framework.jobs;
+
+import java.util.Date;
+import java.util.TimeZone;
+
+import javax.management.StandardMBean;
+
+import com.cloud.utils.DateUtil;
+
+public class AsyncJobMBeanImpl extends StandardMBean implements AsyncJobMBean {
+ private AsyncJob _job;
+
+ public AsyncJobMBeanImpl(AsyncJob job) {
+ super(AsyncJobMBean.class, false);
+
+ _job = job;
+ }
+
+ public long getAccountId() {
+ return _job.getAccountId();
+ }
+
+ public long getUserId() {
+ return _job.getUserId();
+ }
+
+ public String getCmd() {
+ return _job.getCmd();
+ }
+
+ public String getCmdInfo() {
+ return _job.getCmdInfo();
+ }
+
+ public String getStatus() {
+ int jobStatus = _job.getStatus();
+ switch(jobStatus) {
+ case AsyncJobConstants.STATUS_SUCCEEDED :
+ return "Completed";
+
+ case AsyncJobConstants.STATUS_IN_PROGRESS:
+ return "In preogress";
+
+ case AsyncJobConstants.STATUS_FAILED:
+ return "failed";
+ }
+
+ return "Unknow";
+ }
+
+ public int getProcessStatus() {
+ return _job.getProcessStatus();
+ }
+
+ public int getResultCode() {
+ return _job.getResultCode();
+ }
+
+ public String getResult() {
+ return _job.getResult();
+ }
+
+ public String getInstanceType() {
+ if(_job.getInstanceType() != null)
+ return _job.getInstanceType().toString();
+ return "N/A";
+ }
+
+ public String getInstanceId() {
+ if(_job.getInstanceId() != null)
+ return String.valueOf(_job.getInstanceId());
+ return "N/A";
+ }
+
+ public String getInitMsid() {
+ if(_job.getInitMsid() != null) {
+ return String.valueOf(_job.getInitMsid());
+ }
+ return "N/A";
+ }
+
+ public String getCreateTime() {
+ Date time = _job.getCreated();
+ if(time != null)
+ return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
+ return "N/A";
+ }
+
+ public String getLastUpdateTime() {
+ Date time = _job.getLastUpdated();
+ if(time != null)
+ return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
+ return "N/A";
+ }
+
+ public String getLastPollTime() {
+ Date time = _job.getLastPolled();
+
+ if(time != null)
+ return DateUtil.getDateDisplayString(TimeZone.getDefault(), time);
+ return "N/A";
+ }
+
+ public String getSyncQueueId() {
+ SyncQueueItem item = _job.getSyncSource();
+ if(item != null && item.getQueueId() != null) {
+ return String.valueOf(item.getQueueId());
+ }
+ return "N/A";
+ }
+
+ public String getSyncQueueContentType() {
+ SyncQueueItem item = _job.getSyncSource();
+ if(item != null) {
+ return item.getContentType();
+ }
+ return "N/A";
+ }
+
+ public String getSyncQueueContentId() {
+ SyncQueueItem item = _job.getSyncSource();
+ if(item != null && item.getContentId() != null) {
+ return String.valueOf(item.getContentId());
+ }
+ return "N/A";
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java
new file mode 100644
index 0000000..86e48ed
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobManager.java
@@ -0,0 +1,129 @@
+// 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.framework.jobs;
+
+import java.util.List;
+
+import org.apache.cloudstack.api.command.user.job.QueryAsyncJobResultCmd;
+
+import com.cloud.utils.Predicate;
+import com.cloud.utils.component.Manager;
+
+public interface AsyncJobManager extends Manager {
+
+ AsyncJobVO getAsyncJob(long jobId);
+
+ List<? extends AsyncJob> findInstancePendingAsyncJobs(String instanceType, Long accountId);
+
+ long submitAsyncJob(AsyncJob job);
+ long submitAsyncJob(AsyncJob job, boolean scheduleJobExecutionInContext);
+ long submitAsyncJob(AsyncJob job, String syncObjType, long syncObjId);
+
+// AsyncJobResult queryAsyncJobResult(long jobId);
+
+ void completeAsyncJob(long jobId, int jobStatus, int resultCode, Object resultObject);
+ void updateAsyncJobStatus(long jobId, int processStatus, Object resultObject);
+ void updateAsyncJobAttachment(long jobId, String instanceType, Long instanceId);
+ void logJobJournal(long jobId, AsyncJob.JournalType journalType, String
+ journalText, String journalObjJson);
+
+ /**
+ * A running thread inside management server can have a 1:1 linked pseudo job.
+ * This is to help make some legacy code work without too dramatic changes.
+ *
+ * All pseudo jobs should be expunged upon management start event
+ *
+ * @return pseudo job for the thread
+ */
+ AsyncJob getPseudoJob();
+
+ /**
+ * Used by upper level job to wait for completion of a down-level job (usually VmWork jobs)
+ * in synchronized way. Caller needs to use waitAndCheck() to check the completion status
+ * of the down-level job
+ *
+ * Due to the amount of legacy code that relies on synchronized-call semantics, this form of joinJob
+ * is used mostly
+ *
+ *
+ * @param jobId upper job that is going to wait the completion of a down-level job
+ * @param joinJobId down-level job
+ */
+ void joinJob(long jobId, long joinJobId);
+
+ /**
+ * Used by upper level job to wait for completion of a down-level job (usually VmWork jobs)
+ * in asynchronized way, it will cause upper job to cease current execution, upper job will be
+ * rescheduled to execute periodically or on wakeup events detected from message bus
+ *
+ * @param jobId upper job that is going to wait the completion of a down-level job
+ * @param joinJobId down-level job
+ * @Param wakeupHandler wakeup handler
+ * @Param wakeupDispatcher wakeup dispatcher
+ * @param wakeupTopcisOnMessageBus
+ * @param wakeupIntervalInMilliSeconds
+ * @param timeoutInMilliSeconds
+ */
+ void joinJob(long jobId, long joinJobId, String wakeupHandler, String wakupDispatcher,
+ String[] wakeupTopcisOnMessageBus, long wakeupIntervalInMilliSeconds, long timeoutInMilliSeconds);
+
+ /**
+ * Dis-join two related jobs
+ *
+ * @param jobId
+ * @param joinedJobId
+ */
+ void disjoinJob(long jobId, long joinedJobId);
+
+ /**
+ * Used by down-level job to notify its completion to upper level jobs
+ *
+ * @param joinJobId down-level job for upper level job to join with
+ * @param joinStatus AsyncJobConstants status code to indicate success or failure of the
+ * down-level job
+ * @param joinResult object-stream serialized result object
+ * this is primarily used by down-level job to pass error exception objects
+ * for legacy code to work. To help pass exception object easier, we use
+ * object-stream based serialization instead of GSON
+ */
+ void completeJoin(long joinJobId, int joinStatus, String joinResult);
+
+ void releaseSyncSource();
+ void syncAsyncJobExecution(AsyncJob job, String syncObjType, long syncObjId, long queueSizeLimit);
+
+ /**
+ * This method will be deprecated after all code has been migrated to fully-asynchronized mode
+ * that uses async-feature of joinJob/disjoinJob
+ *
+ * @param wakupTopicsOnMessageBus topic on message bus to wakeup the wait
+ * @param checkIntervalInMilliSeconds time to break out wait for checking predicate condition
+ * @param timeoutInMiliseconds time out to break out the whole wait process
+ * @param predicate
+ * @return true, predicate condition is satisfied
+ * false, wait is timed out
+ */
+ @Deprecated
+ boolean waitAndCheck(String[] wakupTopicsOnMessageBus, long checkIntervalInMilliSeconds,
+ long timeoutInMiliseconds, Predicate predicate);
+
+ /**
+ * Queries for the status or final result of an async job.
+ * @param cmd the command that specifies the job id
+ * @return an async-call result object
+ */
+ AsyncJob queryAsyncJobResult(QueryAsyncJobResultCmd cmd);
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMonitor.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMonitor.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMonitor.java
new file mode 100644
index 0000000..ed2c943
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobMonitor.java
@@ -0,0 +1,179 @@
+// 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.framework.jobs;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+import javax.inject.Inject;
+import javax.naming.ConfigurationException;
+
+import org.apache.log4j.Logger;
+
+import org.apache.cloudstack.framework.messagebus.MessageBus;
+import org.apache.cloudstack.framework.messagebus.MessageDispatcher;
+import org.apache.cloudstack.framework.messagebus.MessageHandler;
+
+import com.cloud.utils.component.ManagerBase;
+
+public class AsyncJobMonitor extends ManagerBase {
+ public static final Logger s_logger = Logger.getLogger(AsyncJobMonitor.class);
+
+ @Inject private MessageBus _messageBus;
+
+ private final Map<Long, ActiveTaskRecord> _activeTasks = new HashMap<Long, ActiveTaskRecord>();
+ private final Timer _timer = new Timer();
+
+ private volatile int _activePoolThreads = 0;
+ private volatile int _activeInplaceThreads = 0;
+
+ // configuration
+ private long _inactivityCheckIntervalMs = 60000;
+ private long _inactivityWarningThresholdMs = 90000;
+
+ public AsyncJobMonitor() {
+ }
+
+ public long getInactivityCheckIntervalMs() {
+ return _inactivityCheckIntervalMs;
+ }
+
+ public void setInactivityCheckIntervalMs(long intervalMs) {
+ _inactivityCheckIntervalMs = intervalMs;
+ }
+
+ public long getInactivityWarningThresholdMs() {
+ return _inactivityWarningThresholdMs;
+ }
+
+ public void setInactivityWarningThresholdMs(long thresholdMs) {
+ _inactivityWarningThresholdMs = thresholdMs;
+ }
+
+ @MessageHandler(topic = AsyncJob.Topics.JOB_HEARTBEAT)
+ public void onJobHeartbeatNotify(String subject, String senderAddress, Object args) {
+ if(args != null && args instanceof Long) {
+ synchronized(this) {
+ ActiveTaskRecord record = _activeTasks.get(args);
+ if(record != null) {
+ record.updateJobHeartbeatTick();
+ }
+ }
+ }
+ }
+
+ private void heartbeat() {
+ synchronized(this) {
+ for(Map.Entry<Long, ActiveTaskRecord> entry : _activeTasks.entrySet()) {
+ if(entry.getValue().millisSinceLastJobHeartbeat() > _inactivityWarningThresholdMs) {
+ s_logger.warn("Task (job-" + entry.getValue().getJobId() + ") has been pending for "
+ + entry.getValue().millisSinceLastJobHeartbeat()/1000 + " seconds");
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean configure(String name, Map<String, Object> params)
+ throws ConfigurationException {
+
+ _messageBus.subscribe(AsyncJob.Topics.JOB_HEARTBEAT, MessageDispatcher.getDispatcher(this));
+ _timer.scheduleAtFixedRate(new TimerTask() {
+
+ @Override
+ public void run() {
+ heartbeat();
+ }
+
+ }, _inactivityCheckIntervalMs, _inactivityCheckIntervalMs);
+ return true;
+ }
+
+ public void registerActiveTask(long jobId) {
+ synchronized(this) {
+ assert(_activeTasks.get(jobId) == null);
+
+ long threadId = Thread.currentThread().getId();
+ boolean fromPoolThread = Thread.currentThread().getName().contains(AsyncJobConstants.JOB_POOL_THREAD_PREFIX);
+ ActiveTaskRecord record = new ActiveTaskRecord(threadId, jobId, fromPoolThread);
+ _activeTasks.put(jobId, record);
+ if(fromPoolThread)
+ _activePoolThreads++;
+ else
+ _activeInplaceThreads++;
+ }
+ }
+
+ public void unregisterActiveTask(long jobId) {
+ synchronized(this) {
+ ActiveTaskRecord record = _activeTasks.get(jobId);
+ assert(record != null);
+ if(record != null) {
+ if(record.isPoolThread())
+ _activePoolThreads--;
+ else
+ _activeInplaceThreads--;
+
+ _activeTasks.remove(jobId);
+ }
+ }
+ }
+
+ public int getActivePoolThreads() {
+ return _activePoolThreads;
+ }
+
+ public int getActiveInplaceThread() {
+ return _activeInplaceThreads;
+ }
+
+ private static class ActiveTaskRecord {
+ long _jobId;
+ long _threadId;
+ boolean _fromPoolThread;
+ long _jobLastHeartbeatTick;
+
+ public ActiveTaskRecord(long jobId, long threadId, boolean fromPoolThread) {
+ _threadId = threadId;
+ _jobId = jobId;
+ _fromPoolThread = fromPoolThread;
+ _jobLastHeartbeatTick = System.currentTimeMillis();
+ }
+
+ public long getThreadId() {
+ return _threadId;
+ }
+
+ public long getJobId() {
+ return _jobId;
+ }
+
+ public boolean isPoolThread() {
+ return _fromPoolThread;
+ }
+
+ public void updateJobHeartbeatTick() {
+ _jobLastHeartbeatTick = System.currentTimeMillis();
+ }
+
+ public long millisSinceLastJobHeartbeat() {
+ return System.currentTimeMillis() - _jobLastHeartbeatTick;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobVO.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobVO.java
new file mode 100644
index 0000000..c77a785
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobVO.java
@@ -0,0 +1,382 @@
+// 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.framework.jobs;
+
+import java.util.Date;
+import java.util.UUID;
+
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+
+import com.cloud.utils.db.GenericDao;
+
+@Entity
+@Table(name="async_job")
+@Inheritance(strategy=InheritanceType.JOINED)
+@DiscriminatorColumn(name="job_type", discriminatorType=DiscriminatorType.STRING, length=32)
+public class AsyncJobVO implements AsyncJob {
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private Long id = null;
+
+ @Column(name="job_type", length=32)
+ protected String type;
+
+ @Column(name="job_dispatcher", length=64)
+ protected String dispatcher;
+
+ @Column(name="job_pending_signals")
+ protected int pendingSignals;
+
+ @Column(name="user_id")
+ private long userId;
+
+ @Column(name="account_id")
+ private long accountId;
+
+ @Column(name="job_cmd")
+ private String cmd;
+
+ @Column(name="job_cmd_ver")
+ private int cmdVersion;
+
+ @Column(name="job_cmd_info", length=65535)
+ private String cmdInfo;
+
+ @Column(name="job_status")
+ private int status;
+
+ @Column(name="job_process_status")
+ private int processStatus;
+
+ @Column(name="job_result_code")
+ private int resultCode;
+
+ @Column(name="job_result", length=65535)
+ private String result;
+
+ @Column(name="instance_type", length=64)
+ private String instanceType;
+
+ @Column(name="instance_id", length=64)
+ private Long instanceId;
+
+ @Column(name="job_init_msid")
+ private Long initMsid;
+
+ @Column(name="job_complete_msid")
+ private Long completeMsid;
+
+ @Column(name="job_executing_msid")
+ private Long executingMsid;
+
+ @Column(name=GenericDao.CREATED_COLUMN)
+ private Date created;
+
+ @Column(name="last_updated")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastUpdated;
+
+ @Column(name="last_polled")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastPolled;
+
+ @Column(name=GenericDao.REMOVED_COLUMN)
+ private Date removed;
+
+ @Column(name="uuid")
+ private String uuid;
+
+ @Transient
+ private SyncQueueItem syncSource = null;
+
+ public AsyncJobVO() {
+ this.uuid = UUID.randomUUID().toString();
+ }
+
+ public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo, Long instanceId, String instanceType) {
+ this.userId = userId;
+ this.accountId = accountId;
+ this.cmd = cmd;
+ this.cmdInfo = cmdInfo;
+ this.uuid = UUID.randomUUID().toString();
+ this.instanceId = instanceId;
+ this.instanceType = instanceType;
+ }
+
+ public AsyncJobVO(long userId, long accountId, String cmd, String cmdInfo,
+ int callbackType, String callbackAddress, Long instanceId, Type instanceType) {
+
+ this.type ="AsyncJobVO";
+ }
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public String getType() {
+ return this.type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getDispatcher() {
+ return this.dispatcher;
+ }
+
+ public void setDispatcher(String dispatcher) {
+ this.dispatcher = dispatcher;
+ }
+
+ @Override
+ public int getPendingSignals() {
+ return this.pendingSignals;
+ }
+
+ public void setPendingSignals(int signals) {
+ this.pendingSignals = signals;
+ }
+
+ @Override
+ public long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(long userId) {
+ this.userId = userId;
+ }
+
+ @Override
+ public long getAccountId() {
+ return accountId;
+ }
+
+ public void setAccountId(long accountId) {
+ this.accountId = accountId;
+ }
+
+ @Override
+ public String getCmd() {
+ return cmd;
+ }
+
+ public void setCmd(String cmd) {
+ this.cmd = cmd;
+ }
+
+ @Override
+ public int getCmdVersion() {
+ return cmdVersion;
+ }
+
+ public void setCmdVersion(int version) {
+ cmdVersion = version;
+ }
+
+ @Override
+ public String getCmdInfo() {
+ return cmdInfo;
+ }
+
+ public void setCmdInfo(String cmdInfo) {
+ this.cmdInfo = cmdInfo;
+ }
+
+ @Override
+ public int getStatus() {
+ return status;
+ }
+
+ public void setStatus(int status) {
+ this.status = status;
+ }
+
+ @Override
+ public int getProcessStatus() {
+ return processStatus;
+ }
+
+ public void setProcessStatus(int status) {
+ processStatus = status;
+ }
+
+ @Override
+ public int getResultCode() {
+ return resultCode;
+ }
+
+ public void setResultCode(int resultCode) {
+ this.resultCode = resultCode;
+ }
+
+ @Override
+ public String getResult() {
+ return result;
+ }
+
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ @Override
+ public Long getInitMsid() {
+ return initMsid;
+ }
+
+ @Override
+ public void setInitMsid(Long initMsid) {
+ this.initMsid = initMsid;
+ }
+
+ @Override
+ public Long getExecutingMsid() {
+ return this.executingMsid;
+ }
+
+ public void setExecutingMsid(Long executingMsid) {
+ this.executingMsid = executingMsid;
+ }
+
+ @Override
+ public Long getCompleteMsid() {
+ return completeMsid;
+ }
+
+ @Override
+ public void setCompleteMsid(Long completeMsid) {
+ this.completeMsid = completeMsid;
+ }
+
+ @Override
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ @Override
+ public Date getLastUpdated() {
+ return lastUpdated;
+ }
+
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ @Override
+ public Date getLastPolled() {
+ return lastPolled;
+ }
+
+ public void setLastPolled(Date lastPolled) {
+ this.lastPolled = lastPolled;
+ }
+
+ @Override
+ public Date getRemoved() {
+ return removed;
+ }
+
+ public void setRemoved(Date removed) {
+ this.removed = removed;
+ }
+
+ @Override
+ public String getInstanceType() {
+ return instanceType;
+ }
+
+ public void setInstanceType(String instanceType) {
+ this.instanceType = instanceType;
+ }
+
+ @Override
+ public Long getInstanceId() {
+ return instanceId;
+ }
+
+ public void setInstanceId(Long instanceId) {
+ this.instanceId = instanceId;
+ }
+
+ @Override
+ public SyncQueueItem getSyncSource() {
+ return syncSource;
+ }
+
+ @Override
+ public void setSyncSource(SyncQueueItem syncSource) {
+ this.syncSource = syncSource;
+ }
+
+ @Override
+ public String getUuid() {
+ return this.uuid;
+ }
+
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("AsyncJobVO {id:").append(getId());
+ sb.append(", userId: ").append(getUserId());
+ sb.append(", accountId: ").append(getAccountId());
+ sb.append(", instanceType: ").append(getInstanceType());
+ sb.append(", instanceId: ").append(getInstanceId());
+ sb.append(", cmd: ").append(getCmd());
+ sb.append(", cmdInfo: ").append(getCmdInfo());
+ sb.append(", cmdVersion: ").append(getCmdVersion());
+ sb.append(", status: ").append(getStatus());
+ sb.append(", processStatus: ").append(getProcessStatus());
+ sb.append(", resultCode: ").append(getResultCode());
+ sb.append(", result: ").append(getResult());
+ sb.append(", initMsid: ").append(getInitMsid());
+ sb.append(", completeMsid: ").append(getCompleteMsid());
+ sb.append(", lastUpdated: ").append(getLastUpdated());
+ sb.append(", lastPolled: ").append(getLastPolled());
+ sb.append(", created: ").append(getCreated());
+ sb.append("}");
+ return sb.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItem.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItem.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItem.java
new file mode 100644
index 0000000..43aa0f6
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItem.java
@@ -0,0 +1,41 @@
+// 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.framework.jobs;
+
+public interface SyncQueueItem {
+ public final String AsyncJobContentType = "AsyncJob";
+
+ /**
+ * @return queue item id
+ */
+ long getId();
+
+ /**
+ * @return queue id
+ */
+ Long getQueueId();
+
+ /**
+ * @return subject object type pointed by the queue item
+ */
+ String getContentType();
+
+ /**
+ * @return subject object id pointed by the queue item
+ */
+ Long getContentId();
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItemVO.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItemVO.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItemVO.java
new file mode 100644
index 0000000..7a5d15f
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueItemVO.java
@@ -0,0 +1,143 @@
+// 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.framework.jobs;
+
+import org.apache.cloudstack.api.InternalIdentity;
+
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+@Entity
+@Table(name="sync_queue_item")
+public class SyncQueueItemVO implements SyncQueueItem, InternalIdentity {
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Column(name="id")
+ private Long id = null;
+
+ @Column(name="queue_id")
+ private Long queueId;
+
+ @Column(name="content_type")
+ private String contentType;
+
+ @Column(name="content_id")
+ private Long contentId;
+
+ @Column(name="queue_proc_msid")
+ private Long lastProcessMsid;
+
+ @Column(name="queue_proc_number")
+ private Long lastProcessNumber;
+
+ @Column(name="queue_proc_time")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastProcessTime;
+
+ @Column(name="created")
+ private Date created;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public Long getQueueId() {
+ return queueId;
+ }
+
+ public void setQueueId(Long queueId) {
+ this.queueId = queueId;
+ }
+
+ @Override
+ public String getContentType() {
+ return contentType;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+ @Override
+ public Long getContentId() {
+ return contentId;
+ }
+
+ public void setContentId(Long contentId) {
+ this.contentId = contentId;
+ }
+
+ public Long getLastProcessMsid() {
+ return lastProcessMsid;
+ }
+
+ public void setLastProcessMsid(Long lastProcessMsid) {
+ this.lastProcessMsid = lastProcessMsid;
+ }
+
+ public Long getLastProcessNumber() {
+ return lastProcessNumber;
+ }
+
+ public void setLastProcessNumber(Long lastProcessNumber) {
+ this.lastProcessNumber = lastProcessNumber;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("SyncQueueItemVO {id:").append(getId()).append(", queueId: ").append(getQueueId());
+ sb.append(", contentType: ").append(getContentType());
+ sb.append(", contentId: ").append(getContentId());
+ sb.append(", lastProcessMsid: ").append(getLastProcessMsid());
+ sb.append(", lastprocessNumber: ").append(getLastProcessNumber());
+ sb.append(", lastProcessTime: ").append(getLastProcessTime());
+ sb.append(", created: ").append(getCreated());
+ sb.append("}");
+ return sb.toString();
+ }
+
+ public Date getLastProcessTime() {
+ return lastProcessTime;
+ }
+
+ public void setLastProcessTime(Date lastProcessTime) {
+ this.lastProcessTime = lastProcessTime;
+ }
+}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManager.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManager.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManager.java
new file mode 100644
index 0000000..f0516c8
--- /dev/null
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/SyncQueueManager.java
@@ -0,0 +1,34 @@
+// 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.framework.jobs;
+
+import java.util.List;
+
+import com.cloud.utils.component.Manager;
+
+public interface SyncQueueManager extends Manager {
+ public SyncQueueVO queue(String syncObjType, long syncObjId, String itemType, long itemId, long queueSizeLimit);
+ public SyncQueueItemVO dequeueFromOne(long queueId, Long msid);
+ public List<SyncQueueItemVO> dequeueFromAny(Long msid, int maxItems);
+ public void purgeItem(long queueItemId);
+ public void returnItem(long queueItemId);
+
+ public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive);
+ public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive);
+
+ void purgeAsyncJobQueueItemId(long asyncJobId);
+}
[12/12] git commit: updated refs/heads/vmsync to cbdc406
Posted by ah...@apache.org.
Isolated the job queue work in its own project
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cbdc4063
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cbdc4063
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cbdc4063
Branch: refs/heads/vmsync
Commit: cbdc4063c80926e8bdbf453907905d6c5b8e3e39
Parents: bb242a8
Author: Alex Huang <al...@gmail.com>
Authored: Wed May 15 10:14:39 2013 -0700
Committer: Alex Huang <al...@gmail.com>
Committed: Wed May 15 10:14:39 2013 -0700
----------------------------------------------------------------------
api/src/com/cloud/agent/api/to/FirewallRuleTO.java | 1 -
.../com/cloud/async/AsyncInstanceCreateStatus.java | 24 -
api/src/com/cloud/async/AsyncJob.java | 109 ----
api/src/com/cloud/async/SyncQueueItem.java | 41 --
.../cloud/configuration/ConfigurationService.java | 10 +-
api/src/com/cloud/event/UsageEvent.java | 4 +-
.../exception/AgentControlChannelException.java | 1 -
api/src/com/cloud/network/NetworkService.java | 3 +-
api/src/com/cloud/network/NetworkUsageService.java | 5 +-
api/src/com/cloud/network/PhysicalNetwork.java | 3 +-
.../com/cloud/network/rules/HealthCheckPolicy.java | 3 -
.../network/security/SecurityGroupService.java | 1 -
.../com/cloud/network/security/SecurityRule.java | 8 +-
api/src/com/cloud/offering/NetworkOffering.java | 2 -
.../region/ha/GlobalLoadBalancingRulesService.java | 12 +-
.../cloud/resource/UnableDeleteHostException.java | 2 +-
api/src/com/cloud/storage/Snapshot.java | 5 +-
.../cloud/storage/snapshot/SnapshotSchedule.java | 4 +-
api/src/com/cloud/user/AccountService.java | 5 -
api/src/com/cloud/user/UserContext.java | 3 +-
api/src/com/cloud/vm/UserVmService.java | 1 +
api/src/com/cloud/vm/snapshot/VMSnapshot.java | 2 +-
.../cloudstack/affinity/AffinityGroupResponse.java | 9 +-
.../affinity/AffinityGroupTypeResponse.java | 7 +-
.../org/apache/cloudstack/api/BaseAsyncCmd.java | 18 +-
.../apache/cloudstack/api/BaseAsyncCreateCmd.java | 12 -
api/src/org/apache/cloudstack/api/BaseCmd.java | 3 +-
api/src/org/apache/cloudstack/api/BaseListCmd.java | 1 -
.../api/BaseListTemplateOrIsoPermissionsCmd.java | 3 +-
.../org/apache/cloudstack/api/BaseResponse.java | 3 +-
.../cloudstack/api/BaseUpdateTemplateOrIsoCmd.java | 3 +-
.../api/BaseUpdateTemplateOrIsoPermissionsCmd.java | 3 +-
.../apache/cloudstack/api/ResponseGenerator.java | 6 -
.../command/admin/account/CreateAccountCmd.java | 14 +-
.../command/admin/account/DeleteAccountCmd.java | 4 +-
.../command/admin/account/DisableAccountCmd.java | 4 +-
.../command/admin/account/EnableAccountCmd.java | 3 +-
.../api/command/admin/account/LockAccountCmd.java | 3 +-
.../command/admin/account/UpdateAccountCmd.java | 3 +-
.../command/admin/autoscale/CreateCounterCmd.java | 4 +-
.../command/admin/autoscale/DeleteCounterCmd.java | 4 +-
.../api/command/admin/cluster/AddClusterCmd.java | 4 +-
.../command/admin/cluster/DeleteClusterCmd.java | 3 +-
.../api/command/admin/cluster/ListClustersCmd.java | 3 +-
.../command/admin/cluster/UpdateClusterCmd.java | 3 +-
.../api/command/admin/config/ListCfgsByCmd.java | 10 +-
.../config/ListHypervisorCapabilitiesCmd.java | 3 +-
.../api/command/admin/config/UpdateCfgCmd.java | 9 +-
.../config/UpdateHypervisorCapabilitiesCmd.java | 3 +-
.../api/command/admin/domain/CreateDomainCmd.java | 3 +-
.../api/command/admin/domain/DeleteDomainCmd.java | 3 +-
.../admin/domain/ListDomainChildrenCmd.java | 3 +-
.../api/command/admin/domain/ListDomainsCmd.java | 3 +-
.../api/command/admin/domain/UpdateDomainCmd.java | 4 +-
.../api/command/admin/host/AddHostCmd.java | 3 +-
.../command/admin/host/AddSecondaryStorageCmd.java | 3 +-
.../command/admin/host/CancelMaintenanceCmd.java | 4 +-
.../api/command/admin/host/DeleteHostCmd.java | 3 +-
.../admin/host/FindHostsForMigrationCmd.java | 3 +-
.../api/command/admin/host/ListHostsCmd.java | 4 +-
.../admin/host/PrepareForMaintenanceCmd.java | 4 +-
.../api/command/admin/host/ReconnectHostCmd.java | 4 +-
.../api/command/admin/host/UpdateHostCmd.java | 3 +-
.../command/admin/host/UpdateHostPasswordCmd.java | 3 +-
.../ConfigureInternalLoadBalancerElementCmd.java | 3 +-
.../CreateInternalLoadBalancerElementCmd.java | 3 +-
.../ListInternalLoadBalancerElementsCmd.java | 3 +-
.../api/command/admin/ldap/LDAPConfigCmd.java | 5 +-
.../api/command/admin/ldap/LDAPRemoveCmd.java | 3 +-
.../command/admin/network/AddNetworkDeviceCmd.java | 3 +-
.../network/AddNetworkServiceProviderCmd.java | 4 +-
.../admin/network/CreateNetworkOfferingCmd.java | 3 +-
.../admin/network/CreatePhysicalNetworkCmd.java | 4 +-
.../network/CreateStorageNetworkIpRangeCmd.java | 3 +-
.../admin/network/DedicateGuestVlanRangeCmd.java | 12 +-
.../admin/network/DeleteNetworkDeviceCmd.java | 3 +-
.../admin/network/DeleteNetworkOfferingCmd.java | 3 +-
.../network/DeleteNetworkServiceProviderCmd.java | 4 +-
.../admin/network/DeletePhysicalNetworkCmd.java | 4 +-
.../network/DeleteStorageNetworkIpRangeCmd.java | 3 +-
.../network/ListDedicatedGuestVlanRangesCmd.java | 22 +-
.../admin/network/ListNetworkDeviceCmd.java | 3 +-
.../network/ListNetworkServiceProvidersCmd.java | 3 +-
.../admin/network/ListPhysicalNetworksCmd.java | 3 +-
.../network/ListStorageNetworkIpRangeCmd.java | 3 +-
.../network/ListSupportedNetworkServicesCmd.java | 3 +-
.../admin/network/UpdateNetworkOfferingCmd.java | 3 +-
.../network/UpdateNetworkServiceProviderCmd.java | 4 +-
.../admin/network/UpdatePhysicalNetworkCmd.java | 4 +-
.../network/UpdateStorageNetworkIpRangeCmd.java | 3 +-
.../admin/offering/CreateDiskOfferingCmd.java | 3 +-
.../admin/offering/CreateServiceOfferingCmd.java | 3 +-
.../admin/offering/DeleteDiskOfferingCmd.java | 3 +-
.../admin/offering/DeleteServiceOfferingCmd.java | 3 +-
.../admin/offering/UpdateDiskOfferingCmd.java | 3 +-
.../admin/offering/UpdateServiceOfferingCmd.java | 3 +-
.../api/command/admin/pod/CreatePodCmd.java | 3 +-
.../api/command/admin/pod/DeletePodCmd.java | 3 +-
.../api/command/admin/pod/ListPodsByCmd.java | 3 +-
.../api/command/admin/pod/UpdatePodCmd.java | 3 +-
.../api/command/admin/region/AddRegionCmd.java | 3 +-
.../api/command/admin/region/RemoveRegionCmd.java | 3 +-
.../api/command/admin/region/UpdateRegionCmd.java | 3 +-
.../command/admin/resource/ArchiveAlertsCmd.java | 4 +-
.../command/admin/resource/DeleteAlertsCmd.java | 3 +-
.../api/command/admin/resource/ListAlertsCmd.java | 3 +-
.../command/admin/resource/ListCapacityCmd.java | 3 +-
.../admin/resource/UploadCustomCertificateCmd.java | 3 +-
.../router/ConfigureVirtualRouterElementCmd.java | 4 +-
.../router/CreateVirtualRouterElementCmd.java | 3 +-
.../api/command/admin/router/DestroyRouterCmd.java | 4 +-
.../api/command/admin/router/ListRoutersCmd.java | 4 +-
.../admin/router/ListVirtualRouterElementsCmd.java | 3 +-
.../api/command/admin/router/RebootRouterCmd.java | 4 +-
.../api/command/admin/router/StartRouterCmd.java | 4 +-
.../api/command/admin/router/StopRouterCmd.java | 4 +-
.../api/command/admin/router/UpgradeRouterCmd.java | 3 +-
.../CancelPrimaryStorageMaintenanceCmd.java | 4 +-
.../admin/storage/CreateStoragePoolCmd.java | 3 +-
.../api/command/admin/storage/DeletePoolCmd.java | 3 +-
.../command/admin/storage/ListStoragePoolsCmd.java | 4 +-
.../admin/storage/ListStorageProvidersCmd.java | 3 +-
.../PreparePrimaryStorageForMaintenanceCmd.java | 4 +-
.../admin/storage/UpdateStoragePoolCmd.java | 3 +-
.../api/command/admin/swift/AddSwiftCmd.java | 3 +-
.../api/command/admin/swift/ListSwiftsCmd.java | 3 +-
.../command/admin/systemvm/DestroySystemVmCmd.java | 4 +-
.../command/admin/systemvm/ListSystemVMsCmd.java | 4 +-
.../command/admin/systemvm/MigrateSystemVMCmd.java | 3 +-
.../command/admin/systemvm/RebootSystemVmCmd.java | 4 +-
.../command/admin/systemvm/StartSystemVMCmd.java | 4 +-
.../command/admin/systemvm/StopSystemVmCmd.java | 4 +-
.../command/admin/systemvm/UpgradeSystemVMCmd.java | 3 +-
.../command/admin/template/PrepareTemplateCmd.java | 3 +-
.../command/admin/usage/AddTrafficMonitorCmd.java | 3 +-
.../api/command/admin/usage/AddTrafficTypeCmd.java | 4 +-
.../admin/usage/DeleteTrafficMonitorCmd.java | 3 +-
.../command/admin/usage/DeleteTrafficTypeCmd.java | 4 +-
.../admin/usage/GenerateUsageRecordsCmd.java | 9 +-
.../command/admin/usage/GetUsageRecordsCmd.java | 4 +-
.../admin/usage/ListTrafficMonitorsCmd.java | 3 +-
.../usage/ListTrafficTypeImplementorsCmd.java | 3 +-
.../command/admin/usage/ListTrafficTypesCmd.java | 3 +-
.../api/command/admin/usage/ListUsageTypesCmd.java | 3 +-
.../command/admin/usage/UpdateTrafficTypeCmd.java | 4 +-
.../api/command/admin/user/CreateUserCmd.java | 3 +-
.../api/command/admin/user/DeleteUserCmd.java | 3 +-
.../api/command/admin/user/DisableUserCmd.java | 5 +-
.../api/command/admin/user/EnableUserCmd.java | 3 +-
.../api/command/admin/user/GetUserCmd.java | 3 +-
.../api/command/admin/user/ListUsersCmd.java | 3 +-
.../api/command/admin/user/LockUserCmd.java | 3 +-
.../api/command/admin/user/RegisterCmd.java | 3 +-
.../api/command/admin/user/UpdateUserCmd.java | 3 +-
.../command/admin/vlan/CreateVlanIpRangeCmd.java | 3 +-
.../admin/vlan/DedicatePublicIpRangeCmd.java | 4 +-
.../command/admin/vlan/DeleteVlanIpRangeCmd.java | 3 +-
.../command/admin/vlan/ListVlanIpRangesCmd.java | 3 +-
.../admin/vlan/ReleasePublicIpRangeCmd.java | 3 +-
.../api/command/admin/vm/AssignVMCmd.java | 3 +-
.../api/command/admin/vm/MigrateVMCmd.java | 3 +-
.../vm/MigrateVirtualMachineWithVolumeCmd.java | 12 +-
.../api/command/admin/vm/RecoverVMCmd.java | 3 +-
.../command/admin/vpc/CreatePrivateGatewayCmd.java | 4 +-
.../command/admin/vpc/CreateVPCOfferingCmd.java | 10 +-
.../command/admin/vpc/DeletePrivateGatewayCmd.java | 4 +-
.../command/admin/vpc/DeleteVPCOfferingCmd.java | 3 +-
.../command/admin/vpc/UpdateVPCOfferingCmd.java | 3 +-
.../api/command/admin/zone/CreateZoneCmd.java | 3 +-
.../api/command/admin/zone/DeleteZoneCmd.java | 3 +-
.../admin/zone/MarkDefaultZoneForAccountCmd.java | 4 +-
.../api/command/admin/zone/UpdateZoneCmd.java | 3 +-
.../user/account/AddAccountToProjectCmd.java | 3 +-
.../user/account/DeleteAccountFromProjectCmd.java | 3 +-
.../api/command/user/account/ListAccountsCmd.java | 3 +-
.../user/account/ListProjectAccountsCmd.java | 3 +-
.../command/user/address/AssociateIPAddrCmd.java | 16 +-
.../user/address/DisassociateIPAddrCmd.java | 4 +-
.../user/address/ListPublicIpAddressesCmd.java | 4 +-
.../affinitygroup/ListAffinityGroupTypesCmd.java | 3 +-
.../user/autoscale/CreateAutoScalePolicyCmd.java | 4 +-
.../user/autoscale/CreateAutoScaleVmGroupCmd.java | 4 +-
.../autoscale/CreateAutoScaleVmProfileCmd.java | 4 +-
.../command/user/autoscale/CreateConditionCmd.java | 4 +-
.../user/autoscale/DeleteAutoScalePolicyCmd.java | 4 +-
.../user/autoscale/DeleteAutoScaleVmGroupCmd.java | 4 +-
.../autoscale/DeleteAutoScaleVmProfileCmd.java | 4 +-
.../command/user/autoscale/DeleteConditionCmd.java | 4 +-
.../user/autoscale/DisableAutoScaleVmGroupCmd.java | 4 +-
.../user/autoscale/EnableAutoScaleVmGroupCmd.java | 4 +-
.../user/autoscale/ListAutoScalePoliciesCmd.java | 3 +-
.../user/autoscale/ListAutoScaleVmGroupsCmd.java | 3 +-
.../user/autoscale/ListAutoScaleVmProfilesCmd.java | 3 +-
.../command/user/autoscale/ListConditionsCmd.java | 3 +-
.../command/user/autoscale/ListCountersCmd.java | 3 +-
.../user/autoscale/UpdateAutoScalePolicyCmd.java | 4 +-
.../user/autoscale/UpdateAutoScaleVmGroupCmd.java | 4 +-
.../autoscale/UpdateAutoScaleVmProfileCmd.java | 4 +-
.../command/user/config/ListCapabilitiesCmd.java | 3 +-
.../api/command/user/event/ArchiveEventsCmd.java | 4 +-
.../api/command/user/event/DeleteEventsCmd.java | 4 +-
.../api/command/user/event/ListEventTypesCmd.java | 3 +-
.../api/command/user/event/ListEventsCmd.java | 3 +-
.../user/firewall/CreateEgressFirewallRuleCmd.java | 3 +-
.../user/firewall/CreateFirewallRuleCmd.java | 3 +-
.../user/firewall/CreatePortForwardingRuleCmd.java | 4 +-
.../user/firewall/DeleteEgressFirewallRuleCmd.java | 5 +-
.../user/firewall/DeleteFirewallRuleCmd.java | 4 +-
.../user/firewall/DeletePortForwardingRuleCmd.java | 4 +-
.../user/firewall/ListEgressFirewallRulesCmd.java | 5 +-
.../user/firewall/ListFirewallRulesCmd.java | 3 +-
.../user/firewall/ListPortForwardingRulesCmd.java | 3 +-
.../user/firewall/UpdatePortForwardingRuleCmd.java | 3 +-
.../user/guest/ListGuestOsCategoriesCmd.java | 3 +-
.../api/command/user/guest/ListGuestOsCmd.java | 3 +-
.../api/command/user/iso/AttachIsoCmd.java | 3 +-
.../api/command/user/iso/CopyIsoCmd.java | 3 +-
.../api/command/user/iso/DeleteIsoCmd.java | 4 +-
.../api/command/user/iso/DetachIsoCmd.java | 4 +-
.../api/command/user/iso/ExtractIsoCmd.java | 4 +-
.../command/user/iso/ListIsoPermissionsCmd.java | 3 +-
.../api/command/user/iso/ListIsosCmd.java | 4 +-
.../api/command/user/iso/RegisterIsoCmd.java | 3 +-
.../api/command/user/iso/UpdateIsoCmd.java | 3 +-
.../command/user/iso/UpdateIsoPermissionsCmd.java | 3 +-
.../command/user/job/QueryAsyncJobResultCmd.java | 3 +-
.../loadbalancer/AssignToLoadBalancerRuleCmd.java | 3 +-
.../loadbalancer/CreateLBHealthCheckPolicyCmd.java | 7 +-
.../loadbalancer/CreateLBStickinessPolicyCmd.java | 3 +-
.../loadbalancer/CreateLoadBalancerRuleCmd.java | 4 +-
.../loadbalancer/DeleteLBHealthCheckPolicyCmd.java | 5 +-
.../loadbalancer/DeleteLBStickinessPolicyCmd.java | 3 +-
.../loadbalancer/DeleteLoadBalancerRuleCmd.java | 4 +-
.../ListApplicationLoadBalancersCmd.java | 3 +-
.../loadbalancer/ListLBHealthCheckPoliciesCmd.java | 7 +-
.../loadbalancer/ListLBStickinessPoliciesCmd.java | 3 +-
.../ListLoadBalancerRuleInstancesCmd.java | 3 +-
.../loadbalancer/ListLoadBalancerRulesCmd.java | 3 +-
.../RemoveFromLoadBalancerRuleCmd.java | 3 +-
.../loadbalancer/UpdateLoadBalancerRuleCmd.java | 3 +-
.../user/nat/CreateIpForwardingRuleCmd.java | 4 +-
.../user/nat/DeleteIpForwardingRuleCmd.java | 4 +-
.../api/command/user/nat/DisableStaticNatCmd.java | 3 +-
.../api/command/user/nat/EnableStaticNatCmd.java | 3 +-
.../command/user/nat/ListIpForwardingRulesCmd.java | 3 +-
.../command/user/network/CreateNetworkACLCmd.java | 4 +-
.../api/command/user/network/CreateNetworkCmd.java | 3 +-
.../command/user/network/DeleteNetworkACLCmd.java | 4 +-
.../api/command/user/network/DeleteNetworkCmd.java | 3 +-
.../command/user/network/ListNetworkACLsCmd.java | 3 +-
.../user/network/ListNetworkOfferingsCmd.java | 3 +-
.../api/command/user/network/ListNetworksCmd.java | 3 +-
.../command/user/network/RestartNetworkCmd.java | 3 +-
.../api/command/user/network/UpdateNetworkCmd.java | 3 +-
.../user/offering/ListDiskOfferingsCmd.java | 7 +-
.../user/offering/ListServiceOfferingsCmd.java | 4 +-
.../command/user/project/ActivateProjectCmd.java | 3 +-
.../api/command/user/project/CreateProjectCmd.java | 3 +-
.../api/command/user/project/DeleteProjectCmd.java | 3 +-
.../user/project/DeleteProjectInvitationCmd.java | 3 +-
.../user/project/ListProjectInvitationsCmd.java | 3 +-
.../api/command/user/project/ListProjectsCmd.java | 3 +-
.../command/user/project/SuspendProjectCmd.java | 3 +-
.../api/command/user/project/UpdateProjectCmd.java | 3 +-
.../user/project/UpdateProjectInvitationCmd.java | 3 +-
.../api/command/user/region/ListRegionsCmd.java | 3 +-
.../ha/gslb/AssignToGlobalLoadBalancerRuleCmd.java | 24 +-
.../ha/gslb/CreateGlobalLoadBalancerRuleCmd.java | 23 +-
.../ha/gslb/DeleteGlobalLoadBalancerRuleCmd.java | 19 +-
.../ha/gslb/ListGlobalLoadBalancerRuleCmd.java | 15 +-
.../gslb/RemoveFromGlobalLoadBalancerRuleCmd.java | 24 +-
.../ha/gslb/UpdateGlobalLoadBalancerRuleCmd.java | 8 +-
.../user/resource/GetCloudIdentifierCmd.java | 3 +-
.../command/user/resource/ListHypervisorsCmd.java | 3 +-
.../user/resource/ListResourceLimitsCmd.java | 3 +-
.../user/resource/UpdateResourceCountCmd.java | 3 +-
.../user/resource/UpdateResourceLimitCmd.java | 3 +-
.../AuthorizeSecurityGroupEgressCmd.java | 4 +-
.../AuthorizeSecurityGroupIngressCmd.java | 4 +-
.../user/securitygroup/CreateSecurityGroupCmd.java | 3 +-
.../user/securitygroup/DeleteSecurityGroupCmd.java | 3 +-
.../user/securitygroup/ListSecurityGroupsCmd.java | 4 +-
.../RevokeSecurityGroupEgressCmd.java | 4 +-
.../RevokeSecurityGroupIngressCmd.java | 4 +-
.../command/user/snapshot/CreateSnapshotCmd.java | 4 +-
.../user/snapshot/CreateSnapshotPolicyCmd.java | 3 +-
.../command/user/snapshot/DeleteSnapshotCmd.java | 4 +-
.../user/snapshot/DeleteSnapshotPoliciesCmd.java | 3 +-
.../user/snapshot/ListSnapshotPoliciesCmd.java | 3 +-
.../command/user/snapshot/ListSnapshotsCmd.java | 4 +-
.../api/command/user/ssh/CreateSSHKeyPairCmd.java | 3 +-
.../api/command/user/ssh/DeleteSSHKeyPairCmd.java | 3 +-
.../api/command/user/ssh/ListSSHKeyPairsCmd.java | 3 +-
.../command/user/ssh/RegisterSSHKeyPairCmd.java | 3 +-
.../api/command/user/tag/CreateTagsCmd.java | 3 +-
.../api/command/user/tag/DeleteTagsCmd.java | 3 +-
.../api/command/user/template/CopyTemplateCmd.java | 5 +-
.../command/user/template/CreateTemplateCmd.java | 4 +-
.../command/user/template/DeleteTemplateCmd.java | 5 +-
.../command/user/template/ExtractTemplateCmd.java | 5 +-
.../user/template/ListTemplatePermissionsCmd.java | 3 +-
.../command/user/template/ListTemplatesCmd.java | 4 +-
.../command/user/template/RegisterTemplateCmd.java | 4 +-
.../command/user/template/UpdateTemplateCmd.java | 3 +-
.../template/UpdateTemplatePermissionsCmd.java | 3 +-
.../api/command/user/vm/AddIpToVmNicCmd.java | 3 +-
.../api/command/user/vm/AddNicToVMCmd.java | 14 +-
.../api/command/user/vm/DeployVMCmd.java | 4 +-
.../api/command/user/vm/DestroyVMCmd.java | 5 +-
.../api/command/user/vm/GetVMPasswordCmd.java | 3 +-
.../api/command/user/vm/ListNicsCmd.java | 2 -
.../cloudstack/api/command/user/vm/ListVMsCmd.java | 4 +-
.../api/command/user/vm/RebootVMCmd.java | 5 +-
.../api/command/user/vm/RemoveIpFromVmNicCmd.java | 4 +-
.../api/command/user/vm/RemoveNicFromVMCmd.java | 14 +-
.../api/command/user/vm/ResetVMPasswordCmd.java | 4 +-
.../api/command/user/vm/ResetVMSSHKeyCmd.java | 13 +-
.../api/command/user/vm/RestoreVMCmd.java | 3 +-
.../cloudstack/api/command/user/vm/ScaleVMCmd.java | 22 +-
.../cloudstack/api/command/user/vm/StartVMCmd.java | 5 +-
.../cloudstack/api/command/user/vm/StopVMCmd.java | 5 +-
.../command/user/vm/UpdateDefaultNicForVMCmd.java | 14 +-
.../api/command/user/vm/UpdateVMCmd.java | 3 +-
.../api/command/user/vm/UpgradeVMCmd.java | 3 +-
.../api/command/user/vmgroup/CreateVMGroupCmd.java | 3 +-
.../api/command/user/vmgroup/DeleteVMGroupCmd.java | 3 +-
.../api/command/user/vmgroup/ListVMGroupsCmd.java | 3 +-
.../api/command/user/vmgroup/UpdateVMGroupCmd.java | 3 +-
.../user/vmsnapshot/DeleteVMSnapshotCmd.java | 3 +-
.../api/command/user/volume/AttachVolumeCmd.java | 4 +-
.../api/command/user/volume/CreateVolumeCmd.java | 4 +-
.../api/command/user/volume/DeleteVolumeCmd.java | 3 +-
.../api/command/user/volume/DetachVolumeCmd.java | 4 +-
.../api/command/user/volume/ExtractVolumeCmd.java | 4 +-
.../api/command/user/volume/ListVolumesCmd.java | 4 +-
.../api/command/user/volume/ResizeVolumeCmd.java | 4 +-
.../api/command/user/volume/UploadVolumeCmd.java | 3 +-
.../api/command/user/vpc/CreateStaticRouteCmd.java | 4 +-
.../api/command/user/vpc/CreateVPCCmd.java | 3 +-
.../api/command/user/vpc/DeleteStaticRouteCmd.java | 4 +-
.../api/command/user/vpc/DeleteVPCCmd.java | 3 +-
.../command/user/vpc/ListPrivateGatewaysCmd.java | 3 +-
.../api/command/user/vpc/ListVPCOfferingsCmd.java | 3 +-
.../api/command/user/vpc/ListVPCsCmd.java | 4 +-
.../api/command/user/vpc/RestartVPCCmd.java | 3 +-
.../api/command/user/vpc/UpdateVPCCmd.java | 3 +-
.../api/command/user/vpn/AddVpnUserCmd.java | 3 +-
.../command/user/vpn/CreateRemoteAccessVpnCmd.java | 3 +-
.../command/user/vpn/CreateVpnConnectionCmd.java | 3 +-
.../user/vpn/CreateVpnCustomerGatewayCmd.java | 3 +-
.../api/command/user/vpn/CreateVpnGatewayCmd.java | 3 +-
.../command/user/vpn/DeleteRemoteAccessVpnCmd.java | 3 +-
.../command/user/vpn/DeleteVpnConnectionCmd.java | 3 +-
.../user/vpn/DeleteVpnCustomerGatewayCmd.java | 3 +-
.../api/command/user/vpn/DeleteVpnGatewayCmd.java | 3 +-
.../command/user/vpn/ListRemoteAccessVpnsCmd.java | 3 +-
.../command/user/vpn/ListVpnConnectionsCmd.java | 3 +-
.../user/vpn/ListVpnCustomerGatewaysCmd.java | 3 +-
.../api/command/user/vpn/ListVpnGatewaysCmd.java | 3 +-
.../api/command/user/vpn/ListVpnUsersCmd.java | 3 +-
.../api/command/user/vpn/RemoveVpnUserCmd.java | 3 +-
.../command/user/vpn/ResetVpnConnectionCmd.java | 3 +-
.../user/vpn/UpdateVpnCustomerGatewayCmd.java | 3 +-
.../api/command/user/zone/ListZonesByCmd.java | 8 +-
.../cloudstack/api/response/AccountResponse.java | 3 +-
.../api/response/AddIpToVmNicResponse.java | 4 +-
.../cloudstack/api/response/AlertResponse.java | 3 +-
.../ApplicationLoadBalancerInstanceResponse.java | 3 +-
.../response/ApplicationLoadBalancerResponse.java | 5 +-
.../ApplicationLoadBalancerRuleResponse.java | 3 +-
.../cloudstack/api/response/AsyncJobResponse.java | 7 +-
.../api/response/AutoScalePolicyResponse.java | 3 +-
.../api/response/AutoScaleVmGroupResponse.java | 3 +-
.../api/response/AutoScaleVmProfileResponse.java | 3 +-
.../api/response/CapabilitiesResponse.java | 3 +-
.../api/response/CapabilityResponse.java | 3 +-
.../cloudstack/api/response/CapacityResponse.java | 3 +-
.../api/response/CloudIdentifierResponse.java | 3 +-
.../cloudstack/api/response/ClusterResponse.java | 3 +-
.../cloudstack/api/response/ConditionResponse.java | 3 +-
.../api/response/ConfigurationResponse.java | 3 +-
.../cloudstack/api/response/CounterResponse.java | 3 +-
.../api/response/CustomCertificateResponse.java | 3 +-
.../api/response/DeploymentPlannersResponse.java | 3 +-
.../api/response/DiskOfferingResponse.java | 3 +-
.../cloudstack/api/response/DomainResponse.java | 3 +-
.../api/response/DomainRouterResponse.java | 4 +-
.../cloudstack/api/response/EventResponse.java | 3 +-
.../cloudstack/api/response/EventTypeResponse.java | 3 +-
.../cloudstack/api/response/ExceptionResponse.java | 3 +-
.../api/response/ExternalFirewallResponse.java | 3 +-
.../api/response/ExternalLoadBalancerResponse.java | 3 +-
.../cloudstack/api/response/ExtractResponse.java | 3 +-
.../cloudstack/api/response/FirewallResponse.java | 3 +-
.../api/response/FirewallRuleResponse.java | 3 +-
.../api/response/GetVMPasswordResponse.java | 3 +-
.../api/response/GlobalLoadBalancerResponse.java | 8 +-
.../api/response/GuestOSCategoryResponse.java | 3 +-
.../cloudstack/api/response/GuestOSResponse.java | 3 +-
.../api/response/GuestVlanRangeResponse.java | 3 +-
.../api/response/HostForMigrationResponse.java | 3 +-
.../cloudstack/api/response/HostResponse.java | 3 +-
.../response/HypervisorCapabilitiesResponse.java | 3 +-
.../api/response/HypervisorResponse.java | 3 +-
.../cloudstack/api/response/IPAddressResponse.java | 3 +-
.../api/response/InstanceGroupResponse.java | 3 +-
.../InternalLoadBalancerElementResponse.java | 3 +-
.../api/response/IpForwardingRuleResponse.java | 3 +-
.../cloudstack/api/response/IsoVmResponse.java | 3 +-
.../api/response/IsolationMethodResponse.java | 3 +-
.../api/response/LBHealthCheckPolicyResponse.java | 6 +-
.../api/response/LBHealthCheckResponse.java | 11 +-
.../api/response/LBStickinessPolicyResponse.java | 3 +-
.../api/response/LBStickinessResponse.java | 3 +-
.../api/response/LDAPConfigResponse.java | 3 +-
.../api/response/LoadBalancerResponse.java | 3 +-
.../api/response/NetworkACLResponse.java | 3 +-
.../api/response/NetworkDeviceResponse.java | 3 +-
.../api/response/NetworkOfferingResponse.java | 3 +-
.../cloudstack/api/response/NetworkResponse.java | 3 +-
.../cloudstack/api/response/NicResponse.java | 8 +-
.../api/response/NicSecondaryIpResponse.java | 5 +-
.../api/response/PhysicalNetworkResponse.java | 3 +-
.../cloudstack/api/response/PodResponse.java | 3 +-
.../api/response/PrivateGatewayResponse.java | 3 +-
.../api/response/ProjectAccountResponse.java | 3 +-
.../api/response/ProjectInvitationResponse.java | 3 +-
.../cloudstack/api/response/ProjectResponse.java | 3 +-
.../cloudstack/api/response/ProviderResponse.java | 3 +-
.../cloudstack/api/response/RegionResponse.java | 3 +-
.../cloudstack/api/response/RegisterResponse.java | 3 +-
.../api/response/RemoteAccessVpnResponse.java | 3 +-
.../api/response/ResourceCountResponse.java | 3 +-
.../api/response/ResourceLimitResponse.java | 3 +-
.../api/response/ResourceTagResponse.java | 3 +-
.../apache/cloudstack/api/response/S3Response.java | 3 +-
.../api/response/SSHKeyPairResponse.java | 3 +-
.../api/response/SecurityGroupResponse.java | 4 +-
.../api/response/SecurityGroupRuleResponse.java | 3 +-
.../api/response/ServiceOfferingResponse.java | 3 +-
.../cloudstack/api/response/ServiceResponse.java | 6 +-
.../response/Site2SiteCustomerGatewayResponse.java | 3 +-
.../response/Site2SiteVpnConnectionResponse.java | 3 +-
.../api/response/Site2SiteVpnGatewayResponse.java | 3 +-
.../api/response/SnapshotPolicyResponse.java | 3 +-
.../cloudstack/api/response/SnapshotResponse.java | 12 +-
.../api/response/SnapshotScheduleResponse.java | 3 +-
.../api/response/StaticRouteResponse.java | 3 +-
.../cloudstack/api/response/StatusResponse.java | 4 +-
.../response/StorageNetworkIpRangeResponse.java | 3 +-
.../response/StoragePoolForMigrationResponse.java | 3 +-
.../api/response/StoragePoolResponse.java | 3 +-
.../api/response/StorageProviderResponse.java | 3 +-
.../cloudstack/api/response/SuccessResponse.java | 3 +-
.../cloudstack/api/response/SwiftResponse.java | 3 +-
.../api/response/SystemVmInstanceResponse.java | 3 +-
.../cloudstack/api/response/SystemVmResponse.java | 3 +-
.../api/response/TemplatePermissionsResponse.java | 3 +-
.../cloudstack/api/response/TemplateResponse.java | 3 +-
.../api/response/TrafficMonitorResponse.java | 3 +-
.../response/TrafficTypeImplementorResponse.java | 3 +-
.../api/response/TrafficTypeResponse.java | 3 +-
.../cloudstack/api/response/UpgradeVmResponse.java | 3 +-
.../api/response/UsageRecordResponse.java | 3 +-
.../cloudstack/api/response/UsageTypeResponse.java | 3 +-
.../cloudstack/api/response/UserResponse.java | 3 +-
.../cloudstack/api/response/UserVmResponse.java | 4 +-
.../api/response/VMSnapshotResponse.java | 3 +-
.../response/VirtualRouterProviderResponse.java | 3 +-
.../api/response/VlanIpRangeResponse.java | 3 +-
.../cloudstack/api/response/VolumeResponse.java | 4 +-
.../api/response/VpcOfferingResponse.java | 3 +-
.../cloudstack/api/response/VpcResponse.java | 3 +-
.../cloudstack/api/response/VpnUsersResponse.java | 3 +-
.../cloudstack/api/response/ZoneResponse.java | 3 +-
.../InternalLoadBalancerElementService.java | 1 -
api/src/org/apache/cloudstack/usage/Usage.java | 11 -
client/tomcatconf/applicationContext.xml.in | 41 +-
core/src/com/cloud/async/AsyncJobJoinMapVO.java | 210 --------
core/src/com/cloud/async/AsyncJobJournalVO.java | 108 ----
.../engine/service/api/OperationsServices.java | 19 +-
.../com/cloud/network/dao/NetworkRuleConfigVO.java | 18 +-
.../network/security/SecurityGroupRuleVO.java | 41 +--
framework/jobs/pom.xml | 5 +
.../org/apache/cloudstack/framework/job/Job.java | 32 --
.../cloudstack/framework/job/JobInterceptor.java | 23 -
.../apache/cloudstack/framework/jobs/AsyncJob.java | 115 +++++
.../framework/jobs/AsyncJobConstants.java | 34 ++
.../framework/jobs/AsyncJobDispatcher.java | 23 +
.../framework/jobs/AsyncJobJoinMapVO.java | 210 ++++++++
.../framework/jobs/AsyncJobJournalVO.java | 108 ++++
.../cloudstack/framework/jobs/AsyncJobMBean.java | 37 ++
.../framework/jobs/AsyncJobMBeanImpl.java | 143 ++++++
.../cloudstack/framework/jobs/AsyncJobManager.java | 129 +++++
.../cloudstack/framework/jobs/AsyncJobMonitor.java | 179 +++++++
.../cloudstack/framework/jobs/AsyncJobVO.java | 382 +++++++++++++++
.../cloudstack/framework/jobs/SyncQueueItem.java | 41 ++
.../cloudstack/framework/jobs/SyncQueueItemVO.java | 143 ++++++
.../framework/jobs/SyncQueueManager.java | 34 ++
.../framework/jobs/SyncQueueManagerImpl.java | 258 ++++++++++
.../cloudstack/framework/jobs/SyncQueueVO.java | 137 +++++
.../cloudstack/framework/jobs/dao/AsyncJobDao.java | 35 ++
.../framework/jobs/dao/AsyncJobDaoImpl.java | 156 ++++++
.../framework/jobs/dao/AsyncJobJoinMapDao.java | 40 ++
.../framework/jobs/dao/AsyncJobJoinMapDaoImpl.java | 239 +++++++++
.../framework/jobs/dao/AsyncJobJournalDao.java | 27 +
.../framework/jobs/dao/AsyncJobJournalDaoImpl.java | 45 ++
.../framework/jobs/dao/SyncQueueDao.java | 26 +
.../framework/jobs/dao/SyncQueueDaoImpl.java | 78 +++
.../framework/jobs/dao/SyncQueueItemDao.java | 31 ++
.../framework/jobs/dao/SyncQueueItemDaoImpl.java | 155 ++++++
server/pom.xml | 2 -
.../src/com/cloud/api/ApiAsyncJobDispatcher.java | 18 +-
server/src/com/cloud/api/ApiDBUtils.java | 22 +-
server/src/com/cloud/api/ApiDispatcher.java | 10 +-
server/src/com/cloud/api/ApiResponseHelper.java | 27 +-
server/src/com/cloud/api/ApiServer.java | 44 ++-
.../com/cloud/api/query/dao/AsyncJobJoinDao.java | 4 +-
.../cloud/api/query/dao/AsyncJobJoinDaoImpl.java | 14 +-
server/src/com/cloud/async/AsyncJobConstants.java | 34 --
server/src/com/cloud/async/AsyncJobDispatcher.java | 23 -
.../com/cloud/async/AsyncJobExecutionContext.java | 22 +-
server/src/com/cloud/async/AsyncJobMBean.java | 37 --
server/src/com/cloud/async/AsyncJobMBeanImpl.java | 143 ------
server/src/com/cloud/async/AsyncJobManager.java | 128 -----
.../src/com/cloud/async/AsyncJobManagerImpl.java | 51 ++-
server/src/com/cloud/async/AsyncJobMonitor.java | 179 -------
server/src/com/cloud/async/AsyncJobResult.java | 2 +
server/src/com/cloud/async/AsyncJobVO.java | 382 ---------------
server/src/com/cloud/async/SyncQueueItemVO.java | 142 ------
server/src/com/cloud/async/SyncQueueManager.java | 34 --
.../src/com/cloud/async/SyncQueueManagerImpl.java | 257 ----------
server/src/com/cloud/async/SyncQueueVO.java | 137 -----
server/src/com/cloud/async/dao/AsyncJobDao.java | 34 --
.../src/com/cloud/async/dao/AsyncJobDaoImpl.java | 155 ------
.../com/cloud/async/dao/AsyncJobJoinMapDao.java | 39 --
.../cloud/async/dao/AsyncJobJoinMapDaoImpl.java | 238 ---------
.../com/cloud/async/dao/AsyncJobJournalDao.java | 26 -
.../cloud/async/dao/AsyncJobJournalDaoImpl.java | 44 --
server/src/com/cloud/async/dao/SyncQueueDao.java | 25 -
.../src/com/cloud/async/dao/SyncQueueDaoImpl.java | 77 ---
.../src/com/cloud/async/dao/SyncQueueItemDao.java | 30 --
.../com/cloud/async/dao/SyncQueueItemDaoImpl.java | 154 ------
.../consoleproxy/ConsoleProxyManagerImpl.java | 2 +-
.../src/com/cloud/server/ManagementServerImpl.java | 8 +-
.../src/com/cloud/storage/StorageManagerImpl.java | 2 +-
.../src/com/cloud/storage/VolumeManagerImpl.java | 107 ++--
.../secondary/SecondaryStorageManagerImpl.java | 3 +-
.../storage/snapshot/SnapshotSchedulerImpl.java | 9 +-
.../com/cloud/storage/upload/UploadListener.java | 4 +-
.../com/cloud/storage/upload/UploadMonitor.java | 3 +-
.../cloud/storage/upload/UploadMonitorImpl.java | 3 +-
.../com/cloud/template/TemplateManagerImpl.java | 4 +-
server/src/com/cloud/vm/UserVmManagerImpl.java | 2 +-
.../com/cloud/vm/VirtualMachineManagerImpl.java | 6 +-
server/src/com/cloud/vm/VmWorkJobDaoImpl.java | 3 +-
server/src/com/cloud/vm/VmWorkJobDispatcher.java | 13 +-
server/src/com/cloud/vm/VmWorkJobVO.java | 3 +-
.../com/cloud/vm/VmWorkJobWakeupDispatcher.java | 15 +-
.../vm/VmWorkMockVirtualMachineManagerImpl.java | 2 +-
server/test/com/cloud/vm/VmWorkTest.java | 5 +-
.../com/cloud/vm/VmWorkTestApiJobDispatcher.java | 15 +-
.../test/com/cloud/vm/VmWorkTestConfiguration.java | 27 +-
.../com/cloud/vm/VmWorkTestWorkJobDispatcher.java | 9 +-
564 files changed, 4199 insertions(+), 3962 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
index f296aa4..de73076 100644
--- a/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
+++ b/api/src/com/cloud/agent/api/to/FirewallRuleTO.java
@@ -23,7 +23,6 @@ import org.apache.cloudstack.api.InternalIdentity;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.FirewallRule.State;
-import com.cloud.network.rules.FirewallRule.TrafficType;
import com.cloud.utils.net.NetUtils;
/**
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/async/AsyncInstanceCreateStatus.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/AsyncInstanceCreateStatus.java b/api/src/com/cloud/async/AsyncInstanceCreateStatus.java
deleted file mode 100644
index a085fb6..0000000
--- a/api/src/com/cloud/async/AsyncInstanceCreateStatus.java
+++ /dev/null
@@ -1,24 +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.async;
-
-public enum AsyncInstanceCreateStatus {
- Creating,
- Created,
- Corrupted,
- Failed;
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/async/AsyncJob.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/AsyncJob.java b/api/src/com/cloud/async/AsyncJob.java
deleted file mode 100644
index 41afb79..0000000
--- a/api/src/com/cloud/async/AsyncJob.java
+++ /dev/null
@@ -1,109 +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.async;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-import java.util.Date;
-
-public interface AsyncJob extends Identity, InternalIdentity {
-
- public enum JournalType {
- SUCCESS, FAILURE
- };
-
- String getType();
-
- String getDispatcher();
-
- int getPendingSignals();
- public enum Type {
- None,
- VirtualMachine,
- DomainRouter,
- Volume,
- ConsoleProxy,
- Snapshot,
- Template,
- Iso,
- SystemVm,
- Host,
- StoragePool,
- IpAddress,
- SecurityGroup,
- PhysicalNetwork,
- TrafficType,
- PhysicalNetworkServiceProvider,
- FirewallRule,
- Account,
- User,
- PrivateGateway,
- StaticRoute,
- Counter,
- Condition,
- AutoScalePolicy,
- AutoScaleVmProfile,
- AutoScaleVmGroup,
- GlobalLoadBalancerRule,
- LoadBalancerRule,
- AffinityGroup,
- InternalLbVm,
- DedicatedGuestVlanRange
- }
-
- long getUserId();
-
- long getAccountId();
-
- String getCmd();
-
- int getCmdVersion();
-
- String getCmdInfo();
-
- int getStatus();
-
- int getProcessStatus();
-
- int getResultCode();
-
- String getResult();
-
- Long getInitMsid();
- void setInitMsid(Long msid);
-
- Long getExecutingMsid();
-
- Long getCompleteMsid();
- void setCompleteMsid(Long msid);
-
- Date getCreated();
-
- Date getLastUpdated();
-
- Date getLastPolled();
-
- Date getRemoved();
-
- String getInstanceType();
-
- Long getInstanceId();
-
- SyncQueueItem getSyncSource();
- void setSyncSource(SyncQueueItem item);
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/async/SyncQueueItem.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/async/SyncQueueItem.java b/api/src/com/cloud/async/SyncQueueItem.java
deleted file mode 100644
index b8232f4..0000000
--- a/api/src/com/cloud/async/SyncQueueItem.java
+++ /dev/null
@@ -1,41 +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.async;
-
-public interface SyncQueueItem {
- public final String AsyncJobContentType = "AsyncJob";
-
- /**
- * @return queue item id
- */
- long getId();
-
- /**
- * @return queue id
- */
- Long getQueueId();
-
- /**
- * @return subject object type pointed by the queue item
- */
- String getContentType();
-
- /**
- * @return subject object id pointed by the queue item
- */
- Long getContentId();
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/configuration/ConfigurationService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/configuration/ConfigurationService.java b/api/src/com/cloud/configuration/ConfigurationService.java
index fdbd9d6..fcd5b1a 100644
--- a/api/src/com/cloud/configuration/ConfigurationService.java
+++ b/api/src/com/cloud/configuration/ConfigurationService.java
@@ -20,11 +20,6 @@ import java.util.List;
import javax.naming.NamingException;
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.InsufficientCapacityException;
-import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.exception.ResourceAllocationException;
import org.apache.cloudstack.api.command.admin.config.UpdateCfgCmd;
import org.apache.cloudstack.api.command.admin.ldap.LDAPConfigCmd;
import org.apache.cloudstack.api.command.admin.ldap.LDAPRemoveCmd;
@@ -51,6 +46,11 @@ import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
import com.cloud.dc.DataCenter;
import com.cloud.dc.Pod;
import com.cloud.dc.Vlan;
+import com.cloud.exception.ConcurrentOperationException;
+import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.Networks.TrafficType;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.NetworkOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/event/UsageEvent.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/event/UsageEvent.java b/api/src/com/cloud/event/UsageEvent.java
index 0d4ef17..cef796e 100644
--- a/api/src/com/cloud/event/UsageEvent.java
+++ b/api/src/com/cloud/event/UsageEvent.java
@@ -16,10 +16,10 @@
// under the License.
package com.cloud.event;
-import org.apache.cloudstack.api.InternalIdentity;
-
import java.util.Date;
+import org.apache.cloudstack.api.InternalIdentity;
+
public interface UsageEvent extends InternalIdentity {
String getType();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/exception/AgentControlChannelException.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/exception/AgentControlChannelException.java b/api/src/com/cloud/exception/AgentControlChannelException.java
index 50b84d4..7db9b83 100644
--- a/api/src/com/cloud/exception/AgentControlChannelException.java
+++ b/api/src/com/cloud/exception/AgentControlChannelException.java
@@ -16,7 +16,6 @@
// under the License.
package com.cloud.exception;
-import com.cloud.exception.CloudException;
public class AgentControlChannelException extends CloudException {
private static final long serialVersionUID = -310647782960500466L;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/NetworkService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java
index 5d4fd67..5410af0 100755
--- a/api/src/com/cloud/network/NetworkService.java
+++ b/api/src/com/cloud/network/NetworkService.java
@@ -21,9 +21,9 @@ import java.util.List;
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
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 org.apache.cloudstack.api.command.user.network.RestartNetworkCmd;
import org.apache.cloudstack.api.command.user.vm.ListNicsCmd;
import com.cloud.exception.ConcurrentOperationException;
@@ -31,7 +31,6 @@ import com.cloud.exception.InsufficientAddressCapacityException;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.GuestVlan;
import com.cloud.network.Network.Service;
import com.cloud.network.Networks.TrafficType;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/NetworkUsageService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/NetworkUsageService.java b/api/src/com/cloud/network/NetworkUsageService.java
index 1cfea24..71a2f49 100644
--- a/api/src/com/cloud/network/NetworkUsageService.java
+++ b/api/src/com/cloud/network/NetworkUsageService.java
@@ -18,12 +18,11 @@ package com.cloud.network;
import java.util.List;
-import com.cloud.host.Host;
-
import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd;
import org.apache.cloudstack.api.command.admin.usage.ListTrafficMonitorsCmd;
-import org.apache.cloudstack.api.response.TrafficMonitorResponse;
+
+import com.cloud.host.Host;
import com.cloud.utils.component.Manager;
public interface NetworkUsageService extends Manager {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/PhysicalNetwork.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/PhysicalNetwork.java b/api/src/com/cloud/network/PhysicalNetwork.java
index c521dc4..cfe8c72 100644
--- a/api/src/com/cloud/network/PhysicalNetwork.java
+++ b/api/src/com/cloud/network/PhysicalNetwork.java
@@ -18,10 +18,11 @@ package com.cloud.network;
import java.util.List;
-import com.cloud.utils.Pair;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
+import com.cloud.utils.Pair;
+
/**
*
*/
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/rules/HealthCheckPolicy.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/rules/HealthCheckPolicy.java b/api/src/com/cloud/network/rules/HealthCheckPolicy.java
index 96bb282..6157bd4 100644
--- a/api/src/com/cloud/network/rules/HealthCheckPolicy.java
+++ b/api/src/com/cloud/network/rules/HealthCheckPolicy.java
@@ -16,9 +16,6 @@
// under the License.
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/security/SecurityGroupService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/security/SecurityGroupService.java b/api/src/com/cloud/network/security/SecurityGroupService.java
index 397de1c..96b8680 100644
--- a/api/src/com/cloud/network/security/SecurityGroupService.java
+++ b/api/src/com/cloud/network/security/SecurityGroupService.java
@@ -24,7 +24,6 @@ import org.apache.cloudstack.api.command.user.securitygroup.CreateSecurityGroupC
import org.apache.cloudstack.api.command.user.securitygroup.DeleteSecurityGroupCmd;
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupEgressCmd;
import org.apache.cloudstack.api.command.user.securitygroup.RevokeSecurityGroupIngressCmd;
-import org.apache.cloudstack.api.command.user.vm.AddIpToVmNicCmd;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.PermissionDeniedException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/network/security/SecurityRule.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/network/security/SecurityRule.java b/api/src/com/cloud/network/security/SecurityRule.java
index 350b52d..ff28a2a 100644
--- a/api/src/com/cloud/network/security/SecurityRule.java
+++ b/api/src/com/cloud/network/security/SecurityRule.java
@@ -19,8 +19,6 @@ package com.cloud.network.security;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
-import com.cloud.async.AsyncInstanceCreateStatus;
-
public interface SecurityRule extends Identity, InternalIdentity {
public static class SecurityRuleType {
@@ -28,13 +26,13 @@ public interface SecurityRule extends Identity, InternalIdentity {
public static final SecurityRuleType EgressRule = new SecurityRuleType("egress");
public SecurityRuleType(String type) {
- this._type = type;
+ _type = type;
}
public String getType(){
return _type;
}
- private String _type;
+ private final String _type;
}
long getSecurityGroupId();
@@ -49,8 +47,6 @@ public interface SecurityRule extends Identity, InternalIdentity {
String getProtocol();
- AsyncInstanceCreateStatus getCreateStatus();
-
Long getAllowedNetworkId();
String getAllowedSourceIpCidr();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/offering/NetworkOffering.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java
index 72e2a2b..dc39464 100644
--- a/api/src/com/cloud/offering/NetworkOffering.java
+++ b/api/src/com/cloud/offering/NetworkOffering.java
@@ -16,8 +16,6 @@
// under the License.
package com.cloud.offering;
-import java.util.Map;
-
import org.apache.cloudstack.acl.InfrastructureEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/region/ha/GlobalLoadBalancingRulesService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/region/ha/GlobalLoadBalancingRulesService.java b/api/src/com/cloud/region/ha/GlobalLoadBalancingRulesService.java
index 186faf7..4cdf808 100644
--- a/api/src/com/cloud/region/ha/GlobalLoadBalancingRulesService.java
+++ b/api/src/com/cloud/region/ha/GlobalLoadBalancingRulesService.java
@@ -17,11 +17,17 @@
package com.cloud.region.ha;
-import com.cloud.network.rules.LoadBalancer;
-import org.apache.cloudstack.api.command.user.region.ha.gslb.*;
-
import java.util.List;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.AssignToGlobalLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.CreateGlobalLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.DeleteGlobalLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.ListGlobalLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.RemoveFromGlobalLoadBalancerRuleCmd;
+import org.apache.cloudstack.api.command.user.region.ha.gslb.UpdateGlobalLoadBalancerRuleCmd;
+
+import com.cloud.network.rules.LoadBalancer;
+
public interface GlobalLoadBalancingRulesService {
/*
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/resource/UnableDeleteHostException.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/resource/UnableDeleteHostException.java b/api/src/com/cloud/resource/UnableDeleteHostException.java
index 154147c..8583468 100755
--- a/api/src/com/cloud/resource/UnableDeleteHostException.java
+++ b/api/src/com/cloud/resource/UnableDeleteHostException.java
@@ -16,8 +16,8 @@
// under the License.
package com.cloud.resource;
-import com.cloud.utils.SerialVersionUID;
import com.cloud.exception.CloudException;
+import com.cloud.utils.SerialVersionUID;
public class UnableDeleteHostException extends CloudException {
private static final long serialVersionUID = SerialVersionUID.UnableDeleteHostException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/storage/Snapshot.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/Snapshot.java b/api/src/com/cloud/storage/Snapshot.java
index f71265c..842843e 100644
--- a/api/src/com/cloud/storage/Snapshot.java
+++ b/api/src/com/cloud/storage/Snapshot.java
@@ -18,12 +18,13 @@ package com.cloud.storage;
import java.util.Date;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.utils.fsm.StateObject;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.fsm.StateObject;
+
public interface Snapshot extends ControlledEntity, Identity, InternalIdentity, StateObject<Snapshot.State> {
public enum Type {
MANUAL,
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java b/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java
index 6f3d2ce..db6087a 100644
--- a/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java
+++ b/api/src/com/cloud/storage/snapshot/SnapshotSchedule.java
@@ -16,11 +16,11 @@
// under the License.
package com.cloud.storage.snapshot;
+import java.util.Date;
+
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
-import java.util.Date;
-
public interface SnapshotSchedule extends InternalIdentity, Identity {
Long getVolumeId();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/user/AccountService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/user/AccountService.java b/api/src/com/cloud/user/AccountService.java
index 903eebc..b8a0b7f 100755
--- a/api/src/com/cloud/user/AccountService.java
+++ b/api/src/com/cloud/user/AccountService.java
@@ -22,11 +22,6 @@ import java.util.Map;
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.account.UpdateAccountCmd;
-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.user.RegisterCmd;
import com.cloud.domain.Domain;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/user/UserContext.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/user/UserContext.java b/api/src/com/cloud/user/UserContext.java
index bcb33b5..f14e6cd 100644
--- a/api/src/com/cloud/user/UserContext.java
+++ b/api/src/com/cloud/user/UserContext.java
@@ -16,9 +16,10 @@
// under the License.
package com.cloud.user;
-import com.cloud.utils.component.ComponentContext;
import javax.inject.Inject;
+import com.cloud.utils.component.ComponentContext;
+
public class UserContext {
private static ThreadLocal<UserContext> s_currentContext = new ThreadLocal<UserContext>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/vm/UserVmService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/UserVmService.java b/api/src/com/cloud/vm/UserVmService.java
index fa89521..b840e5e 100755
--- a/api/src/com/cloud/vm/UserVmService.java
+++ b/api/src/com/cloud/vm/UserVmService.java
@@ -39,6 +39,7 @@ import org.apache.cloudstack.api.command.user.vm.UpdateVMCmd;
import org.apache.cloudstack.api.command.user.vm.UpgradeVMCmd;
import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
+
import com.cloud.dc.DataCenter;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/com/cloud/vm/snapshot/VMSnapshot.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/vm/snapshot/VMSnapshot.java b/api/src/com/cloud/vm/snapshot/VMSnapshot.java
index f0ee7ee..cbf0c57 100644
--- a/api/src/com/cloud/vm/snapshot/VMSnapshot.java
+++ b/api/src/com/cloud/vm/snapshot/VMSnapshot.java
@@ -19,10 +19,10 @@ package com.cloud.vm.snapshot;
import java.util.Date;
+import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;
-import org.apache.cloudstack.acl.ControlledEntity;
import com.cloud.utils.fsm.StateMachine2;
import com.cloud.utils.fsm.StateObject;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java b/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
index b6d4ff6..75f9a03 100644
--- a/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
+++ b/api/src/org/apache/cloudstack/affinity/AffinityGroupResponse.java
@@ -17,21 +17,16 @@
package org.apache.cloudstack.affinity;
import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Set;
+
+import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import org.apache.cloudstack.api.response.ControlledEntityResponse;
import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
-import org.apache.cloudstack.api.response.UserVmResponse;
-import com.cloud.network.security.SecurityGroup;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = AffinityGroup.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/affinity/AffinityGroupTypeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/affinity/AffinityGroupTypeResponse.java b/api/src/org/apache/cloudstack/affinity/AffinityGroupTypeResponse.java
index 2d1cd25..e400b6f 100644
--- a/api/src/org/apache/cloudstack/affinity/AffinityGroupTypeResponse.java
+++ b/api/src/org/apache/cloudstack/affinity/AffinityGroupTypeResponse.java
@@ -16,18 +16,13 @@
// under the License.
package org.apache.cloudstack.affinity;
-import java.util.HashSet;
-import java.util.Set;
+import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import org.apache.cloudstack.api.response.ControlledEntityResponse;
-import org.apache.cloudstack.api.response.ControlledViewEntityResponse;
-import com.cloud.network.security.SecurityGroup;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = AffinityGroup.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
index 022157a..56e2ba1 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java
@@ -16,9 +16,6 @@
// under the License.
package org.apache.cloudstack.api;
-import org.apache.cloudstack.api.response.AsyncJobResponse;
-
-import com.cloud.async.AsyncJob;
import com.cloud.user.User;
import com.cloud.user.UserContext;
@@ -33,7 +30,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
public static final String snapshotHostSyncObject = "snapshothost";
public static final String gslbSyncObject = "globalserverloadbalacner";
- private AsyncJob job;
+ private Object job;
@Parameter(name = "starteventid", type = CommandType.LONG)
private Long startEventId;
@@ -56,16 +53,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
*/
public abstract String getEventDescription();
- public ResponseObject getResponse(long jobId) {
- AsyncJobResponse response = new AsyncJobResponse();
-
- AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
- response.setJobId(job.getUuid());
- response.setResponseName(getCommandName());
- return response;
- }
-
- public void setJob(AsyncJob job) {
+ public void setJob(Object job) {
this.job = job;
}
@@ -100,7 +88,7 @@ public abstract class BaseAsyncCmd extends BaseCmd {
return null;
}
- public AsyncJob getJob() {
+ public Object getJob() {
return job;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
index 1f2d3f1..55d73b4 100644
--- a/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseAsyncCreateCmd.java
@@ -16,9 +16,6 @@
// under the License.
package org.apache.cloudstack.api;
-import org.apache.cloudstack.api.response.CreateCmdResponse;
-
-import com.cloud.async.AsyncJob;
import com.cloud.exception.ResourceAllocationException;
public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
@@ -45,15 +42,6 @@ public abstract class BaseAsyncCreateCmd extends BaseAsyncCmd {
this.uuid = uuid;
}
- public String getResponse(long jobId, String objectUuid) {
- CreateCmdResponse response = new CreateCmdResponse();
- AsyncJob job = _entityMgr.findById(AsyncJob.class, jobId);
- response.setJobId(job.getUuid());
- response.setId(objectUuid);
- response.setResponseName(getCommandName());
- return _responseGenerator.toSerializedString(response, getResponseType());
- }
-
public String getCreateEventType() {
return null;
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java
index 8d66a83..17a1ec5 100644
--- a/api/src/org/apache/cloudstack/api/BaseCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseCmd.java
@@ -27,13 +27,14 @@ import java.util.regex.Pattern;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.affinity.AffinityGroupService;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerService;
import org.apache.cloudstack.network.lb.InternalLoadBalancerVMService;
import org.apache.cloudstack.query.QueryService;
import org.apache.cloudstack.usage.UsageService;
-import org.apache.log4j.Logger;
import com.cloud.configuration.ConfigurationService;
import com.cloud.dao.EntityManager;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseListCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListCmd.java b/api/src/org/apache/cloudstack/api/BaseListCmd.java
index 5a57af2..4d9b350 100644
--- a/api/src/org/apache/cloudstack/api/BaseListCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListCmd.java
@@ -16,7 +16,6 @@
// under the License.
package org.apache.cloudstack.api;
-import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
public abstract class BaseListCmd extends BaseCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
index 47aa679..1c94e10 100644
--- a/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListTemplateOrIsoPermissionsCmd.java
@@ -18,9 +18,10 @@ package org.apache.cloudstack.api;
import java.util.List;
-import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
+
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseResponse.java b/api/src/org/apache/cloudstack/api/BaseResponse.java
index 187ad94..5f3f7a1 100644
--- a/api/src/org/apache/cloudstack/api/BaseResponse.java
+++ b/api/src/org/apache/cloudstack/api/BaseResponse.java
@@ -16,9 +16,10 @@
// under the License.
package org.apache.cloudstack.api;
-import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
+import com.cloud.serializer.Param;
+
public abstract class BaseResponse implements ResponseObject {
private transient String responseName;
private transient String objectName;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
index 6fd9773..75a722e 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api;
+import org.apache.log4j.Logger;
+
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;
public abstract class BaseUpdateTemplateOrIsoCmd extends BaseCmd {
public static final Logger s_logger = Logger.getLogger(UpdateIsoCmd.class.getName());
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
index 5cd4881..8f6a812 100644
--- a/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseUpdateTemplateOrIsoPermissionsCmd.java
@@ -18,10 +18,11 @@ package org.apache.cloudstack.api;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/ResponseGenerator.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ResponseGenerator.java b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
index ab8f995..33b4458 100644
--- a/api/src/org/apache/cloudstack/api/ResponseGenerator.java
+++ b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
@@ -37,7 +37,6 @@ 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;
@@ -113,7 +112,6 @@ import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
import org.apache.cloudstack.region.Region;
import org.apache.cloudstack.usage.Usage;
-import com.cloud.async.AsyncJob;
import com.cloud.capacity.Capacity;
import com.cloud.configuration.Configuration;
import com.cloud.configuration.ResourceCount;
@@ -291,10 +289,6 @@ public interface ResponseGenerator {
ExtractResponse createExtractResponse(Long uploadId, Long id, Long zoneId, Long accountId, String mode);
- String toSerializedString(CreateCmdResponse response, String responseType);
-
- AsyncJobResponse createAsyncJobResponse(AsyncJob job);
-
EventResponse createEventResponse(Event event);
//List<EventResponse> createEventResponse(EventJoinVO... events);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
index cc74eb2..9f3624b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java
@@ -16,9 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.admin.account;
-import com.cloud.user.Account;
-import com.cloud.user.UserAccount;
-import com.cloud.user.UserContext;
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,10 +29,10 @@ 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 org.apache.log4j.Logger;
-import java.util.Collection;
-import java.util.Map;
+import com.cloud.user.Account;
+import com.cloud.user.UserAccount;
+import com.cloud.user.UserContext;
@APICommand(name = "createAccount", description="Creates an account", responseObject=AccountResponse.class)
public class CreateAccountCmd extends BaseCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
index 7b7bc9a..a283365 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.user.User;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
index 07abd21..c01433e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
index b9a9f6d..0fd2e60 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.account;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
index f4aa3af..a0ffd5f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.admin.account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
index 60d1a97..2fc144c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
@@ -21,6 +21,8 @@ import java.util.Map;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
index b94ff10..179fd03 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/CreateCounterCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.admin.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.BaseAsyncCreateCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.CounterResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.Counter;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
index 81eaa9b..a063769 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/autoscale/DeleteCounterCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.admin.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ 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 org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceInUseException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
index d55ccd7..6252f6b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/AddClusterCmd.java
@@ -20,8 +20,6 @@ package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList;
import java.util.List;
-import com.cloud.exception.InvalidParameterValueException;
-import org.apache.cloudstack.api.*;
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
@@ -34,9 +32,9 @@ 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 org.apache.log4j.Logger;
import com.cloud.exception.DiscoveryException;
+import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceInUseException;
import com.cloud.org.Cluster;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
index 4fece0c..1f51b90 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/DeleteClusterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.cluster;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ 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 org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
index f2dd349..1283f2c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/ListClustersCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.cluster;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -28,7 +30,6 @@ 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 org.apache.log4j.Logger;
import com.cloud.org.Cluster;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
index c513058..8d49a8c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/cluster/UpdateClusterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.cluster;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ClusterResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.org.Cluster;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
index a11904e..5a3d22f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListCfgsByCmd.java
@@ -19,12 +19,18 @@ package org.apache.cloudstack.api.command.admin.config;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.*;
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.configuration.Configuration;
import com.cloud.utils.Pair;
[09/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
index c11bbdb..9b37e6d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
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.network.as.AutoScaleVmProfile;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
index fbc0683..6ef96ac 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ConditionResponse;
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.ResourceInUseException;
import com.cloud.network.as.Condition;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
index 04d9b8e..c090670 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.AutoScaleVmGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
index b8b3a48..815e6bb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.user.autoscale;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.AutoScaleVmGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
index 8426db8..e5d7971 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.as.AutoScalePolicy;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
index 5b3ee42..5595eb3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.as.AutoScaleVmGroup;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
index 8afdf02..b9ef781 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.as.AutoScaleVmProfile;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
index 1c94923..9ad7b8e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListConditionsCmd.java
@@ -20,6 +20,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.cloudstack.api.response.CounterResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.as.Condition;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
index bd6790d..c444dfe 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListCountersCmd.java
@@ -20,13 +20,14 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.CounterResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.as.Counter;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
index 59afe39..426bae2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.ConditionResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.AutoScalePolicy;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
index ccff796..b921311 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScalePolicyResponse;
import org.apache.cloudstack.api.response.AutoScaleVmGroupResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.AutoScaleVmGroup;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
index eff38b2..8f1c858 100644
--- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.autoscale;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AutoScaleVmProfileResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.as.AutoScaleVmProfile;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
index a30e26c..9da6d7c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/config/ListCapabilitiesCmd.java
@@ -18,10 +18,11 @@ package org.apache.cloudstack.api.command.user.config;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.CapabilitiesResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
index 481607c..cfff73b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java
@@ -19,16 +19,16 @@ package org.apache.cloudstack.api.command.user.event;
import java.util.Date;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.AlertResponse;
import org.apache.cloudstack.api.response.EventResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
index 55ca92a..324c7b2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java
@@ -19,16 +19,16 @@ package org.apache.cloudstack.api.command.user.event;
import java.util.Date;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.AlertResponse;
import org.apache.cloudstack.api.response.EventResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
index 9cbc204..55bda09 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventTypesCmd.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.command.user.event;
import java.util.ArrayList;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.EventTypeResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
index 63fa194..05f26b4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.command.user.event;
import java.util.Date;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.EventResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "listEvents", description="A command to list events.", responseObject=EventResponse.class)
public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
index f1a53b1..a1279a9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.ArrayList;
import java.util.List;
+
import org.apache.log4j.Logger;
import org.apache.cloudstack.api.APICommand;
@@ -27,13 +28,11 @@ import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
-import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.NetworkRuleConflictException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
index b94ea17..c6cbe09 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index 1a15561..815af7d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -30,9 +32,7 @@ import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
index f738349..541ce60 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java
@@ -17,20 +17,19 @@
package org.apache.cloudstack.api.command.user.firewall;
-import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
+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;
-import org.apache.cloudstack.api.BaseCmd;
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.FirewallRuleResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import com.cloud.async.AsyncJob;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
index d1b8afc..3ef1f86 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.firewall;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
index f64db9f..3809b8f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.firewall;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
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.network.rules.PortForwardingRule;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
index b5eed75..a19bbb5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java
@@ -20,17 +20,16 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.ArrayList;
import java.util.List;
-import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.FirewallResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
+
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
index c2aee55..5754019 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.FirewallResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
index 9fd4e45..62a352b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.firewall;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.PortForwardingRule;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 2a8b900..66ef97f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.firewall;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.IpAddress;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
index 19d2341..814d399 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCategoriesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.guest;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.command.user.iso.ListIsosCmd;
import org.apache.cloudstack.api.response.GuestOSCategoryResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.GuestOsCategory;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
index 1b050b8..3b3861f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/guest/ListGuestOsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.guest;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.command.user.iso.ListIsosCmd;
import org.apache.cloudstack.api.response.GuestOSCategoryResponse;
import org.apache.cloudstack.api.response.GuestOSResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.GuestOS;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
index 933ee8b..b5ebae8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/AttachIsoCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
index 89aa71f..9fae6a2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.command.user.template.CopyTemplateCmd;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "copyIso", description="Copies an iso from one zone to another.", responseObject=TemplateResponse.class)
public class CopyIsoCmd extends CopyTemplateCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
index 7f1c3bf..5f9eaad 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DeleteIsoCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
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.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
index c04fba5..8d24454 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/DetachIsoCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,9 +25,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.user.vm.DeployVMCmd;
-import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
index 69b7f61..af07c70 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ExtractIsoCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ExtractResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
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.InternalErrorException;
import com.cloud.template.VirtualMachineTemplate;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
index faa4f60..d568ec5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsoPermissionsCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd;
import org.apache.cloudstack.api.response.TemplatePermissionsResponse;
-import org.apache.log4j.Logger;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.template.VirtualMachineTemplate;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
index e8dc8fb..d70375a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java
@@ -20,6 +20,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.template.VirtualMachineTemplate.TemplateFilter;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
index 284d553..ec08db0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/RegisterIsoCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.iso;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.TemplateResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.template.VirtualMachineTemplate;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
index 37294e3..74c3ca4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoCmd.java
@@ -16,12 +16,13 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoCmd;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.TemplateResponse;
-import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
index 5e884df..10b7dcf 100644
--- a/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/iso/UpdateIsoPermissionsCmd.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.command.user.iso;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
index 5d2ef68..424f579 100644
--- a/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java
@@ -16,12 +16,13 @@
// under the License.
package org.apache.cloudstack.api.command.user.job;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AsyncJobResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
index e0f9bcd..65e89be 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
index ac0ec3a..4a87652 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java
@@ -17,21 +17,22 @@
package org.apache.cloudstack.api.command.user.loadbalancer;
-import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCreateCmd;
-import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.FirewallRuleResponse;
+import org.apache.cloudstack.api.response.LBHealthCheckResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
import com.cloud.network.rules.HealthCheckPolicy;
-import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
index 02b253a..648983b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.LBStickinessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.NetworkRuleConflictException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
index 157e83b..46dd9b7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -30,9 +32,7 @@ import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.LoadBalancerResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
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.dc.DataCenter.NetworkType;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
index bf91da5..968dee9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBHealthCheckPolicyCmd.java
@@ -16,16 +16,17 @@
// under the License.
package org.apache.cloudstack.api.command.user.loadbalancer;
-import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
-import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.LBHealthCheckResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
+
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.rules.HealthCheckPolicy;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
index fc7be24..32b1649 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLBStickinessPolicyCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.loadbalancer;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.LBStickinessResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
index ec31f16..b2adc54 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/DeleteLoadBalancerRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.loadbalancer;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
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.network.rules.LoadBalancer;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
index 8e5df31..c44a6f4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListApplicationLoadBalancersCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.network.lb.ApplicationLoadBalancerRule;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.rules.LoadBalancerContainer.Scheme;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
index cf5ea32..f922390 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java
@@ -19,21 +19,18 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
-import org.apache.cloudstack.api.APICommand;
-import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.log4j.Logger;
+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.FirewallRuleResponse;
import org.apache.cloudstack.api.response.LBHealthCheckResponse;
-import org.apache.cloudstack.api.response.LBStickinessResponse;
import org.apache.cloudstack.api.response.ListResponse;
import com.cloud.network.rules.HealthCheckPolicy;
import com.cloud.network.rules.LoadBalancer;
-import com.cloud.user.Account;
-import com.cloud.user.UserContext;
@APICommand(name = "listLBHealthCheckPolicies", description = "Lists load balancer HealthCheck policies.", responseObject = LBHealthCheckResponse.class, since="4.2.0")
public class ListLBHealthCheckPoliciesCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
index 9456a15..19ac447 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.LBStickinessResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.network.rules.StickinessPolicy;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
index 49ab42c..477b667 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRuleInstancesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
index e022cc7..3f9f93d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.LoadBalancerResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.LoadBalancer;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
index 92a05d6..33556f9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/RemoveFromLoadBalancerRuleCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.loadbalancer;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
index c296057..9423230 100644
--- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/UpdateLoadBalancerRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.loadbalancer;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.LoadBalancerResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.rules.LoadBalancer;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
index dfb99b9..cb9df7e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.nat;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
-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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
index 04a5421..65dd0f0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/DeleteIpForwardingRuleCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.nat;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
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.network.rules.FirewallRule;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
index 9bd769a..84a1006 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.nat;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.user.firewall.DeletePortForwardingRuleCmd;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InsufficientAddressCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
index 902dbae..96d4cee 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.nat;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.NetworkRuleConflictException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
index 776639b..9390ba2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/nat/ListIpForwardingRulesCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.nat;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.IpForwardingRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.StaticNatRule;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
index ac889c0..289b2b9 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkACLResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
-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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
index fc7bd9f..e4f5961 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
index 59cd6bc..9c3cfb0 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkACLCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.FirewallRuleResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
index 954146e..8cae7ea 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.admin.network.DeleteNetworkOfferingCmd;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
index d166974..1709432 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkACLsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.FirewallRuleResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkACLResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.rules.FirewallRule;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
index e2c9701..cb3aefc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.NetworkOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
index d25e2c0..55e5bdb 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.Network;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
index b054781..eb79fcc 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
index a61474e..8844f1c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
import org.apache.cloudstack.api.response.NetworkResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
index eb48d81..1f51cef 100644
--- a/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/offering/ListDiskOfferingsCmd.java
@@ -16,20 +16,15 @@
// under the License.
package org.apache.cloudstack.api.command.user.offering;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.log4j.Logger;
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.AsyncJobResponse;
import org.apache.cloudstack.api.response.DiskOfferingResponse;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
-
-import com.cloud.offering.DiskOffering;
@APICommand(name = "listDiskOfferings", description="Lists all available disk offerings.", responseObject=DiskOfferingResponse.class)
public class ListDiskOfferingsCmd extends BaseListCmd {
[11/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
index f222027..50f7949 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/ListHypervisorCapabilitiesCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.admin.config;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.HypervisorCapabilitiesResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.hypervisor.HypervisorCapabilities;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
index deb61d3..2aaaa18 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateCfgCmd.java
@@ -16,14 +16,19 @@
// under the License.
package org.apache.cloudstack.api.command.admin.config;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.response.*;
-import org.apache.log4j.Logger;
+import org.apache.cloudstack.api.response.AccountResponse;
+import org.apache.cloudstack.api.response.ClusterResponse;
+import org.apache.cloudstack.api.response.ConfigurationResponse;
+import org.apache.cloudstack.api.response.StoragePoolResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
import com.cloud.configuration.Configuration;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
index e2fe8a7..7aacf45 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/config/UpdateHypervisorCapabilitiesCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.config;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ 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 org.apache.log4j.Logger;
import com.cloud.hypervisor.HypervisorCapabilities;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
index 91d61cc..bf3be09 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/CreateDomainCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.domain;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
index 488a758..e6c9d88 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/DeleteDomainCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.domain;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
index 26d8bbf..97a70e5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainChildrenCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.admin.domain;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
index ed14194..6ab5b28 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/ListDomainsCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.admin.domain;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
index e658f49..65d833c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/domain/UpdateDomainCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.domain;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,11 +28,9 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.user.Account;
-import com.cloud.user.UserAccount;
import com.cloud.user.UserContext;
@APICommand(name = "updateDomain", description="Updates a domain with a new name", responseObject=DomainResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
index 3a2f414..4621e42 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddHostCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.host;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -30,7 +32,6 @@ 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 org.apache.log4j.Logger;
import com.cloud.exception.DiscoveryException;
import com.cloud.host.Host;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
index f1d12b3..d876bae 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.host;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.DiscoveryException;
import com.cloud.host.Host;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
index 431f961..b4023d9 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/CancelMaintenanceCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.host.Host;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
index e1cef62..8bc0624 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/DeleteHostCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
index e6e45cc..a4ac01d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java
@@ -20,15 +20,16 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import org.apache.cloudstack.api.APICommand;
import org.apache.log4j.Logger;
+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.HostForMigrationResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
+
import com.cloud.host.Host;
import com.cloud.utils.Pair;
import com.cloud.utils.Ternary;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
index ee78442..18a153c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ListHostsCmd.java
@@ -21,6 +21,8 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -33,9 +35,7 @@ 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 org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
index f198bea..e55680a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/PrepareForMaintenanceCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.host.Host;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
index 2633914..f96d9b1 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/ReconnectHostCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.host.Host;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
index 3bf95db..fa78a81 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.host;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.GuestOSCategoryResponse;
import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.log4j.Logger;
import com.cloud.host.Host;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
index c4420bd..284b9d3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/UpdateHostPasswordCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -23,7 +25,6 @@ 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.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
index 7c3d1e9..d8bdcc4 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ConfigureInternalLoadBalancerElementCmd.java
@@ -21,6 +21,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
index 2902f7a..53a193b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/CreateInternalLoadBalancerElementCmd.java
@@ -20,6 +20,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
index 1853619..a033533 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java
@@ -21,6 +21,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.response.InternalLoadBalancerElementResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.cloudstack.network.element.InternalLoadBalancerElementService;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
index 2976de4..9eaecca 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPConfigCmd.java
@@ -19,19 +19,20 @@ package org.apache.cloudstack.api.command.admin.ldap;
import javax.naming.NamingException;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.LDAPConfigResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
+import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
@APICommand(name = "ldapConfig", description="Configure the LDAP context for this site.", responseObject=LDAPConfigResponse.class, since="3.0.0")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPRemoveCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPRemoveCmd.java b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPRemoveCmd.java
index 5159fba..755a597 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPRemoveCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/ldap/LDAPRemoveCmd.java
@@ -17,11 +17,12 @@
package org.apache.cloudstack.api.command.admin.ldap;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.LDAPConfigResponse;
import org.apache.cloudstack.api.response.LDAPRemoveResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
index 4983255..2aedd9f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkDeviceCmd.java
@@ -20,6 +20,8 @@ import java.util.Map;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkDeviceResponse;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
index 50ebd26..c4cf96c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/AddNetworkServiceProviderCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceAllocationException;
import com.cloud.network.PhysicalNetworkServiceProvider;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
index 6410715..e563077 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java
@@ -23,6 +23,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +33,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network.Capability;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
index 5b1e530..103a8f4 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreatePhysicalNetworkCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
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.network.PhysicalNetwork;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
index 008fa32..4ee522c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateStorageNetworkIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
index ec14360..e7fdde5 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DedicateGuestVlanRangeCmd.java
@@ -18,10 +18,8 @@
*/
package org.apache.cloudstack.api.command.admin.network;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.GuestVlan;
-import com.cloud.user.Account;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -32,7 +30,11 @@ import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.GuestVlanRangeResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
-import org.apache.log4j.Logger;
+
+import com.cloud.exception.ResourceAllocationException;
+import com.cloud.exception.ResourceUnavailableException;
+import com.cloud.network.GuestVlan;
+import com.cloud.user.Account;
@APICommand(name = "dedicateGuestVlanRange", description="Dedicates a guest vlan range to an account", responseObject=GuestVlanRangeResponse.class)
public class DedicateGuestVlanRangeCmd extends BaseCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
index 2ca618c..0e6640c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkDeviceCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.network;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
index 69f34e8..2cbb0e6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
index ecaa075..f6a10c2 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteNetworkServiceProviderCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProviderResponse;
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.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
index 04cc9a2..9307abb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeletePhysicalNetworkCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
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.user.Account;
import com.cloud.user.UserContext;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
index b2dcfa5..752c81f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/DeleteStorageNetworkIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
index 7f93efc..42e37d7 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListDedicatedGuestVlanRangesCmd.java
@@ -16,15 +16,25 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+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.DomainResponse;
+import org.apache.cloudstack.api.response.GuestVlanRangeResponse;
+import org.apache.cloudstack.api.response.ListResponse;
+import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
+import org.apache.cloudstack.api.response.ProjectResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+
import com.cloud.network.GuestVlan;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
-import org.apache.cloudstack.api.*;
-import org.apache.cloudstack.api.response.*;
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.List;
@APICommand(name = "listDedicatedGuestVlanRanges", description="Lists dedicated guest vlan ranges", responseObject=GuestVlanRangeResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
index 0b7836d..69ae6e3 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkDeviceCmd.java
@@ -22,6 +22,8 @@ import java.util.Map;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -31,7 +33,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.NetworkDeviceResponse;
import org.apache.cloudstack.network.ExternalNetworkDeviceManager;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
index e51c47e..10c2e85 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListNetworkServiceProvidersCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.PhysicalNetworkServiceProvider;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
index f7794c3..71bfceb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListPhysicalNetworksCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.PhysicalNetwork;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
index 46af6a6..7810953 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListStorageNetworkIpRangeCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
index 85ae139..57bf95b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.ServiceResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.network.Network;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
index ba685a9..16a4a7c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NetworkOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
index 67f9585..bd00d83 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkServiceProviderCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProviderResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.PhysicalNetworkServiceProvider;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
index c3c0946..d1f35ca 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java
@@ -18,15 +18,15 @@ package org.apache.cloudstack.api.command.admin.network;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.PhysicalNetworkResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.network.PhysicalNetwork;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
index 613e4c0..8918794 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateStorageNetworkIpRangeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.network;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.StorageNetworkIpRangeResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.StorageNetworkIpRange;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
index 68d5dd4..e7ab6bd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateDiskOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DiskOfferingResponse;
import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.DiskOffering;
import com.cloud.offering.ServiceOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
index 0e35276..8f82292 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.ServiceOffering;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
index f8e27fb..99ed6da 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteDiskOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DiskOfferingResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
index e3664de..c25a73f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/DeleteServiceOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
index 1e421a1..aab25ee 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateDiskOfferingCmd.java
@@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -22,7 +24,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DiskOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.DiskOffering;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
index a8de074..9f7f155 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/offering/UpdateServiceOfferingCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.offering;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.offering.ServiceOffering;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
index a110b50..8627897 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/CreatePodCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.pod;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Pod;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
index f663633..1f9dbfc 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/DeletePodCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.pod;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
index db233ae..c7dd344 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/ListPodsByCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.pod;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Pod;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java b/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
index a71c362..8817942 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/pod/UpdatePodCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.pod;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.PodResponse;
-import org.apache.log4j.Logger;
import com.cloud.dc.Pod;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
index dce1e8b..e53a4cd 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/AddRegionCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.region;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.RegionResponse;
import org.apache.cloudstack.region.Region;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
index d2b696d..62c5172 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/RemoveRegionCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.region;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java b/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
index 79890d0..80c22e0 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/region/UpdateRegionCmd.java
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.admin.region;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.RegionResponse;
import org.apache.cloudstack.region.Region;
import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
index 2a1a47a..d86c51c 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ArchiveAlertsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.resource;
import java.util.Date;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AlertResponse;
-import org.apache.cloudstack.api.response.ConditionResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
index f03793c..6c4c39f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/DeleteAlertsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.resource;
import java.util.Date;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AlertResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
index 015d82b..c23c1ac 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ListAlertsCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.admin.resource;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.AlertResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
import com.cloud.alert.Alert;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
index b0badb8..772a44d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/ListCapacityCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.admin.resource;
import java.text.DecimalFormat;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -28,7 +30,6 @@ 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 org.apache.log4j.Logger;
import com.cloud.capacity.Capacity;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
index 9704c64..bc9976d 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/resource/UploadCustomCertificateCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.resource;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.CustomCertificateResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
index dd55969..4ad6aa6 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ConfigureVirtualRouterElementCmd.java
@@ -20,6 +20,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
index b3fca5a..d77fc53 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/CreateVirtualRouterElementCmd.java
@@ -20,6 +20,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -28,7 +30,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
index 20d8e97..932becb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainRouterResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
index c21102c..ce5a130 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.network.router.VirtualRouter.Role;
@APICommand(name = "listRouters", description="List routers.", responseObject=DomainRouterResponse.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
index 9420473..4565cbb 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java
@@ -21,6 +21,8 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListCmd;
@@ -30,7 +32,6 @@ import org.apache.cloudstack.api.command.user.network.ListNetworkOfferingsCmd;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ProviderResponse;
import org.apache.cloudstack.api.response.VirtualRouterProviderResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
index 508e56f..bcb0068 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainRouterResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
index f2d1198..bdbb79e 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainRouterResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InsufficientCapacityException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
index 457ff2b..503e73a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.admin.router;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -24,9 +26,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainRouterResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.exception.InvalidParameterValueException;
[02/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java b/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
deleted file mode 100644
index 287ec10..0000000
--- a/server/src/com/cloud/async/dao/SyncQueueItemDaoImpl.java
+++ /dev/null
@@ -1,154 +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.async.dao;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.TimeZone;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.async.SyncQueueItemVO;
-import com.cloud.utils.DateUtil;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.Filter;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.Transaction;
-
-@DB
-public class SyncQueueItemDaoImpl extends GenericDaoBase<SyncQueueItemVO, Long> implements SyncQueueItemDao {
- private static final Logger s_logger = Logger.getLogger(SyncQueueItemDaoImpl.class);
- final GenericSearchBuilder<SyncQueueItemVO, Long> queueIdSearch;
-
- public SyncQueueItemDaoImpl() {
- super();
- queueIdSearch = createSearchBuilder(Long.class);
- queueIdSearch.and("contentId", queueIdSearch.entity().getContentId(), Op.EQ);
- queueIdSearch.and("contentType", queueIdSearch.entity().getContentType(), Op.EQ);
- queueIdSearch.selectField(queueIdSearch.entity().getId());
- queueIdSearch.done();
- }
-
- @Override
- public SyncQueueItemVO getNextQueueItem(long queueId) {
-
- SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
- sb.and("queueId", sb.entity().getQueueId(), SearchCriteria.Op.EQ);
- sb.and("lastProcessNumber", sb.entity().getLastProcessNumber(), SearchCriteria.Op.NULL);
- sb.done();
-
- SearchCriteria<SyncQueueItemVO> sc = sb.create();
- sc.setParameters("queueId", queueId);
-
- Filter filter = new Filter(SyncQueueItemVO.class, "created", true, 0L, 1L);
- List<SyncQueueItemVO> l = listBy(sc, filter);
- if(l != null && l.size() > 0)
- return l.get(0);
-
- return null;
- }
-
- @Override
- public List<SyncQueueItemVO> getNextQueueItems(int maxItems) {
- List<SyncQueueItemVO> l = new ArrayList<SyncQueueItemVO>();
-
- String sql = "SELECT i.id, i.queue_id, i.content_type, i.content_id, i.created " +
- " FROM sync_queue AS q JOIN sync_queue_item AS i ON q.id = i.queue_id " +
- " WHERE i.queue_proc_number IS NULL " +
- " GROUP BY q.id " +
- " ORDER BY i.id " +
- " LIMIT 0, ?";
-
- Transaction txn = Transaction.currentTxn();
- PreparedStatement pstmt = null;
- try {
- pstmt = txn.prepareAutoCloseStatement(sql);
- pstmt.setInt(1, maxItems);
- ResultSet rs = pstmt.executeQuery();
- while(rs.next()) {
- SyncQueueItemVO item = new SyncQueueItemVO();
- item.setId(rs.getLong(1));
- item.setQueueId(rs.getLong(2));
- item.setContentType(rs.getString(3));
- item.setContentId(rs.getLong(4));
- item.setCreated(DateUtil.parseDateString(TimeZone.getTimeZone("GMT"), rs.getString(5)));
- l.add(item);
- }
- } catch (SQLException e) {
- s_logger.error("Unexpected sql excetpion, ", e);
- } catch (Throwable e) {
- s_logger.error("Unexpected excetpion, ", e);
- }
- return l;
- }
-
- @Override
- public List<SyncQueueItemVO> getActiveQueueItems(Long msid, boolean exclusive) {
- SearchBuilder<SyncQueueItemVO> sb = createSearchBuilder();
- sb.and("lastProcessMsid", sb.entity().getLastProcessMsid(),
- SearchCriteria.Op.EQ);
- sb.done();
-
- SearchCriteria<SyncQueueItemVO> sc = sb.create();
- sc.setParameters("lastProcessMsid", msid);
-
- Filter filter = new Filter(SyncQueueItemVO.class, "created", true, null, null);
-
- if(exclusive)
- return lockRows(sc, filter, true);
- return listBy(sc, filter);
- }
-
- @Override
- public List<SyncQueueItemVO> getBlockedQueueItems(long thresholdMs, boolean exclusive) {
- Date cutTime = DateUtil.currentGMTTime();
-
- SearchBuilder<SyncQueueItemVO> sbItem = createSearchBuilder();
- sbItem.and("lastProcessMsid", sbItem.entity().getLastProcessMsid(), SearchCriteria.Op.NNULL);
- sbItem.and("lastProcessNumber", sbItem.entity().getLastProcessNumber(), SearchCriteria.Op.NNULL);
- sbItem.and("lastProcessNumber", sbItem.entity().getLastProcessTime(), SearchCriteria.Op.NNULL);
- sbItem.and("lastProcessTime2", sbItem.entity().getLastProcessTime(), SearchCriteria.Op.LT);
-
- sbItem.done();
-
- SearchCriteria<SyncQueueItemVO> sc = sbItem.create();
- sc.setParameters("lastProcessTime2", new Date(cutTime.getTime() - thresholdMs));
-
- if(exclusive)
- return lockRows(sc, null, true);
- return listBy(sc, null);
- }
-
- @Override
- public Long getQueueItemIdByContentIdAndType(long contentId, String contentType) {
- SearchCriteria<Long> sc = queueIdSearch.create();
- sc.setParameters("contentId", contentId);
- sc.setParameters("contentType", contentType);
- List<Long> id = customSearch(sc, null);
-
- return id.size() == 0 ? null : id.get(0);
- }
-}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index 5950a99..b7cfaca 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -33,6 +33,7 @@ import org.apache.log4j.Logger;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
@@ -49,7 +50,6 @@ import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.manager.Commands;
-import com.cloud.async.AsyncJobConstants;
import com.cloud.async.AsyncJobExecutionContext;
import com.cloud.certificate.dao.CertificateDao;
import com.cloud.cluster.ClusterManager;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 612a4a0..aeb5d64 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -406,6 +406,9 @@ import org.apache.cloudstack.api.command.user.zone.ListZonesByCmd;
import org.apache.cloudstack.api.response.ExtractResponse;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
@@ -422,10 +425,7 @@ import com.cloud.alert.AlertManager;
import com.cloud.alert.AlertVO;
import com.cloud.alert.dao.AlertDao;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobConstants;
import com.cloud.async.AsyncJobExecutionContext;
-import com.cloud.async.AsyncJobManager;
import com.cloud.capacity.Capacity;
import com.cloud.capacity.CapacityVO;
import com.cloud.capacity.dao.CapacityDao;
@@ -3425,7 +3425,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
s_logger.debug("Extract Mode - " + uploadJob.getMode());
uploadJob = _uploadDao.createForUpdate(uploadJob.getId());
- // Update the async Job
+ // Update the async AsyncJob
ExtractResponse resultObj = new ExtractResponse(ApiDBUtils.findVolumeById(volumeId).getUuid(),
volume.getName(), ApiDBUtils.findAccountById(accountId).getUuid(), UploadVO.Status.COPY_IN_PROGRESS.toString(),
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 1d4dcef..80f0712 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -64,6 +64,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.framework.async.AsyncCallFuture;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.log4j.Logger;
@@ -81,7 +82,6 @@ import com.cloud.agent.api.storage.DeleteVolumeCommand;
import com.cloud.agent.manager.Commands;
import com.cloud.alert.AlertManager;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJobManager;
import com.cloud.capacity.Capacity;
import com.cloud.capacity.CapacityManager;
import com.cloud.capacity.CapacityState;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/VolumeManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java
index dfeb84d..e27d222 100644
--- a/server/src/com/cloud/storage/VolumeManagerImpl.java
+++ b/server/src/com/cloud/storage/VolumeManagerImpl.java
@@ -25,10 +25,10 @@ import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
@@ -36,6 +36,9 @@ import java.util.concurrent.ExecutionException;
import javax.inject.Inject;
import javax.naming.ConfigurationException;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd;
@@ -61,10 +64,10 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
import org.apache.cloudstack.framework.async.AsyncCallFuture;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
@@ -74,8 +77,6 @@ import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.api.to.VolumeTO;
import com.cloud.alert.AlertManager;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobManager;
import com.cloud.async.AsyncJobExecutionContext;
import com.cloud.capacity.CapacityManager;
import com.cloud.capacity.dao.CapacityDao;
@@ -108,9 +109,9 @@ import com.cloud.host.Host;
import com.cloud.host.HostVO;
import com.cloud.host.dao.HostDao;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.hypervisor.HypervisorCapabilitiesVO;
import com.cloud.hypervisor.HypervisorGuruManager;
import com.cloud.hypervisor.dao.HypervisorCapabilitiesDao;
-import com.cloud.hypervisor.HypervisorCapabilitiesVO;
import com.cloud.network.NetworkModel;
import com.cloud.org.Grouping;
import com.cloud.resource.ResourceManager;
@@ -321,7 +322,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
@Inject
StorageManager storageMgr;
private int _customDiskOfferingMinSize = 1;
- private int _customDiskOfferingMaxSize = 1024;
+ private final int _customDiskOfferingMaxSize = 1024;
private long _maxVolumeSizeInGb;
private boolean _recreateSystemVmEnabled;
protected SearchBuilder<VMTemplateHostVO> HostTemplateStatesSearch;
@@ -358,7 +359,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
Volume newVol = migrateVolume(volume, destPool);
- return this.volFactory.getVolume(newVol.getId());
+ return volFactory.getVolume(newVol.getId());
}
/*
@@ -376,20 +377,20 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
String url = cmd.getUrl();
String format = cmd.getFormat();
String imageStoreUuid = cmd.getImageStoreUuid();
- DataStore store = this._tmpltMgr.getImageStore(imageStoreUuid, zoneId);
+ DataStore store = _tmpltMgr.getImageStore(imageStoreUuid, zoneId);
validateVolume(caller, ownerId, zoneId, volumeName, url, format);
VolumeVO volume = persistVolume(caller, ownerId, zoneId, volumeName,
url, cmd.getFormat());
- VolumeInfo vol = this.volFactory.getVolume(volume.getId());
+ VolumeInfo vol = volFactory.getVolume(volume.getId());
RegisterVolumePayload payload = new RegisterVolumePayload(cmd.getUrl(), cmd.getChecksum(),
cmd.getFormat());
vol.addPayload(payload);
- this.volService.registerVolume(vol, store);
+ volService.registerVolume(vol, store);
return volume;
}
@@ -532,10 +533,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
}
- VolumeInfo vol = this.volFactory.getVolume(volume.getId());
- DataStore store = this.dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
- SnapshotInfo snapInfo = this.snapshotFactory.getSnapshot(snapshot.getId());
- AsyncCallFuture<VolumeApiResult> future = this.volService.createVolumeFromSnapshot(vol, store, snapInfo);
+ VolumeInfo vol = volFactory.getVolume(volume.getId());
+ DataStore store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
+ SnapshotInfo snapInfo = snapshotFactory.getSnapshot(snapshot.getId());
+ AsyncCallFuture<VolumeApiResult> future = volService.createVolumeFromSnapshot(vol, store, snapInfo);
try {
VolumeApiResult result = future.get();
if (result.isFailed()) {
@@ -592,7 +593,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
protected VolumeVO createVolumeFromSnapshot(VolumeVO volume, long snapshotId) {
VolumeInfo createdVolume = null;
- SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
+ SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
createdVolume = createVolumeFromSnapshot(volume,
snapshot);
@@ -604,7 +605,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
null, createdVolume.getSize());
_usageEventDao.persist(usageEvent);
- return this._volsDao.findById(createdVolume.getId());
+ return _volsDao.findById(createdVolume.getId());
}
@DB
@@ -622,15 +623,15 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
// Find a suitable storage to create volume on
StoragePool destPool = storageMgr.findStoragePool(dskCh, dc, pod,
clusterId, null, vm, avoidPools);
- DataStore destStore = this.dataStoreMgr.getDataStore(destPool.getId(), DataStoreRole.Primary);
- AsyncCallFuture<VolumeApiResult> future = this.volService.copyVolume(volume, destStore);
+ DataStore destStore = dataStoreMgr.getDataStore(destPool.getId(), DataStoreRole.Primary);
+ AsyncCallFuture<VolumeApiResult> future = volService.copyVolume(volume, destStore);
try {
VolumeApiResult result = future.get();
if (result.isFailed()) {
s_logger.debug("copy volume failed: " + result.getResult());
throw new CloudRuntimeException("copy volume failed: " + result.getResult());
- }
+ }
return result.getVolume();
} catch (InterruptedException e) {
s_logger.debug("Failed to copy volume: " + volume.getId(), e);
@@ -678,14 +679,14 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Trying to create " + volume + " on " + pool);
}
- DataStore store = this.dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
+ DataStore store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
AsyncCallFuture<VolumeApiResult> future = null;
boolean isNotCreatedFromTemplate = volume.getTemplateId() == null ? true : false;
if (isNotCreatedFromTemplate) {
- future = this.volService.createVolumeAsync(volume, store);
+ future = volService.createVolumeAsync(volume, store);
} else {
- TemplateInfo templ = this.tmplFactory.getTemplate(template.getId());
- future = this.volService.createVolumeFromTemplateAsync(volume, store.getId(), templ);
+ TemplateInfo templ = tmplFactory.getTemplate(template.getId());
+ future = volService.createVolumeFromTemplateAsync(volume, store.getId(), templ);
}
try {
VolumeApiResult result = future.get();
@@ -1155,7 +1156,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
UserVmVO userVm = _userVmDao.findById(volume.getInstanceId());
- PrimaryDataStoreInfo pool = (PrimaryDataStoreInfo)this.dataStoreMgr.getDataStore(volume.getPoolId(), DataStoreRole.Primary);
+ PrimaryDataStoreInfo pool = (PrimaryDataStoreInfo)dataStoreMgr.getDataStore(volume.getPoolId(), DataStoreRole.Primary);
long currentSize = volume.getSize();
/*
@@ -1206,10 +1207,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
ResizeVolumePayload payload = new ResizeVolumePayload(newSize, shrinkOk, instanceName, hosts);
try {
- VolumeInfo vol = this.volFactory.getVolume(volume.getId());
+ VolumeInfo vol = volFactory.getVolume(volume.getId());
vol.addPayload(payload);
- AsyncCallFuture<VolumeApiResult> future = this.volService.resize(vol);
+ AsyncCallFuture<VolumeApiResult> future = volService.resize(vol);
future.get();
volume = _volsDao.findById(volume.getId());
@@ -1274,11 +1275,11 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
try {
if (volume.getState() != Volume.State.Destroy && volume.getState() != Volume.State.Expunging && volume.getState() != Volume.State.Expunging) {
Long instanceId = volume.getInstanceId();
- if (!this.volService.destroyVolume(volume.getId())) {
+ if (!volService.destroyVolume(volume.getId())) {
return false;
}
- VMInstanceVO vmInstance = this._vmInstanceDao.findById(instanceId);
+ VMInstanceVO vmInstance = _vmInstanceDao.findById(instanceId);
if (instanceId == null
|| (vmInstance.getType().equals(VirtualMachine.Type.User))) {
// Decrement the resource count for volumes and primary storage belonging user VM's only
@@ -1301,7 +1302,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
_usageEventDao.persist(usageEvent);
}
}
- AsyncCallFuture<VolumeApiResult> future = this.volService.expungeVolumeAsync(this.volFactory.getVolume(volume.getId()));
+ AsyncCallFuture<VolumeApiResult> future = volService.expungeVolumeAsync(volFactory.getVolume(volume.getId()));
future.get();
} catch (Exception e) {
@@ -1377,7 +1378,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
VMTemplateVO template, VMInstanceVO vm, Account owner) {
assert (template.getFormat() != ImageFormat.ISO) : "ISO is not a template really....";
- Long size = this._tmpltMgr.getTemplateSize(template.getId(), vm.getDataCenterId());
+ Long size = _tmpltMgr.getTemplateSize(template.getId(), vm.getDataCenterId());
VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(),
owner.getDomainId(), owner.getId(), offering.getId(), size);
@@ -1499,8 +1500,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
private boolean needMoveVolume(VolumeVO rootVolumeOfVm, VolumeInfo volume) {
- DataStore storeForRootVol = this.dataStoreMgr.getPrimaryDataStore(rootVolumeOfVm.getPoolId());
- DataStore storeForDataVol = this.dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
+ DataStore storeForRootVol = dataStoreMgr.getPrimaryDataStore(rootVolumeOfVm.getPoolId());
+ DataStore storeForDataVol = dataStoreMgr.getPrimaryDataStore(volume.getPoolId());
Scope storeForRootStoreScope = storeForRootVol.getScope();
if (storeForRootStoreScope == null) {
@@ -1681,7 +1682,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vmId);
if(vmSnapshots.size() > 0){
throw new InvalidParameterValueException(
- "Unable to attach volume, please specify a VM that does not have VM snapshots");
+ "Unable to attach volume, please specify a VM that does not have VM snapshots");
}
// permission check
@@ -1834,7 +1835,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
// Check that the VM is in the correct state
- UserVmVO vm = this._userVmDao.findById(vmId);
+ UserVmVO vm = _userVmDao.findById(vmId);
if (vm.getState() != State.Running && vm.getState() != State.Stopped
&& vm.getState() != State.Destroyed) {
throw new InvalidParameterValueException(
@@ -1970,7 +1971,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
// This check is for VM in Error state (volume is already
// destroyed)
if (!vol.getState().equals(Volume.State.Destroy)) {
- this.volService.destroyVolume(vol.getId());
+ volService.destroyVolume(vol.getId());
}
toBeExpunged.add(vol);
} else {
@@ -1983,7 +1984,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
txn.commit();
AsyncCallFuture<VolumeApiResult> future = null;
for (VolumeVO expunge : toBeExpunged) {
- future = this.volService.expungeVolumeAsync(this.volFactory.getVolume(expunge.getId()));
+ future = volService.expungeVolumeAsync(volFactory.getVolume(expunge.getId()));
try {
future.get();
} catch (InterruptedException e) {
@@ -2046,7 +2047,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
"the parameter livemigrate should be specified");
}
- StoragePool destPool = (StoragePool)this.dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary);
+ StoragePool destPool = (StoragePool)dataStoreMgr.getDataStore(storagePoolId, DataStoreRole.Primary);
if (destPool == null) {
throw new InvalidParameterValueException(
"Failed to find the destination storage pool: "
@@ -2069,8 +2070,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
@DB
protected Volume migrateVolume(Volume volume, StoragePool destPool) {
- VolumeInfo vol = this.volFactory.getVolume(volume.getId());
- AsyncCallFuture<VolumeApiResult> future = this.volService.copyVolume(vol, (DataStore)destPool);
+ VolumeInfo vol = volFactory.getVolume(volume.getId());
+ AsyncCallFuture<VolumeApiResult> future = volService.copyVolume(vol, (DataStore)destPool);
try {
VolumeApiResult result = future.get();
if (result.isFailed()) {
@@ -2089,8 +2090,8 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
@DB
protected Volume liveMigrateVolume(Volume volume, StoragePool destPool) {
- VolumeInfo vol = this.volFactory.getVolume(volume.getId());
- AsyncCallFuture<VolumeApiResult> future = this.volService.migrateVolume(vol, (DataStore)destPool);
+ VolumeInfo vol = volFactory.getVolume(volume.getId());
+ AsyncCallFuture<VolumeApiResult> future = volService.migrateVolume(vol, (DataStore)destPool);
try {
VolumeApiResult result = future.get();
if (result.isFailed()) {
@@ -2117,7 +2118,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
for (Map.Entry<VolumeVO, StoragePoolVO> entry : volumeToPool.entrySet()) {
VolumeVO volume = entry.getKey();
StoragePoolVO storagePool = entry.getValue();
- StoragePool destPool = (StoragePool)this.dataStoreMgr.getDataStore(storagePool.getId(),
+ StoragePool destPool = (StoragePool)dataStoreMgr.getDataStore(storagePool.getId(),
DataStoreRole.Primary);
if (volume.getInstanceId() != vm.getId()) {
@@ -2129,10 +2130,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
throw new CloudRuntimeException("Failed to find the destination storage pool " + storagePool.getId());
}
- volumeMap.put(this.volFactory.getVolume(volume.getId()), (DataStore)destPool);
+ volumeMap.put(volFactory.getVolume(volume.getId()), (DataStore)destPool);
}
- AsyncCallFuture<CommandResult> future = this.volService.migrateVolumes(volumeMap, vmTo, srcHost, destHost);
+ AsyncCallFuture<CommandResult> future = volService.migrateVolumes(volumeMap, vmTo, srcHost, destHost);
try {
CommandResult result = future.get();
if (result.isFailed()) {
@@ -2195,14 +2196,14 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
}
for (VolumeVO vol : vols) {
- PrimaryDataStoreInfo pool = (PrimaryDataStoreInfo)this.dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
+ PrimaryDataStoreInfo pool = (PrimaryDataStoreInfo)dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
vm.addDisk(new VolumeTO(vol, pool));
}
if (vm.getType() == VirtualMachine.Type.User) {
UserVmVO userVM = (UserVmVO) vm.getVirtualMachine();
if (userVM.getIsoId() != null) {
- Pair<String, String> isoPathPair = this._tmpltMgr.getAbsoluteIsoPath(
+ Pair<String, String> isoPathPair = _tmpltMgr.getAbsoluteIsoPath(
userVM.getIsoId(), userVM.getDataCenterId());
if (isoPathPair != null) {
String isoPath = isoPathPair.first();
@@ -2324,7 +2325,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
return tasks;
}
- private Pair<VolumeVO, DataStore> recreateVolume(VolumeVO vol, VirtualMachineProfile<? extends VirtualMachine> vm,
+ private Pair<VolumeVO, DataStore> recreateVolume(VolumeVO vol, VirtualMachineProfile<? extends VirtualMachine> vm,
DeployDestination dest) throws StorageUnavailableException {
VolumeVO newVol;
boolean recreate = _recreateSystemVmEnabled;
@@ -2362,10 +2363,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
Long templateId = newVol.getTemplateId();
AsyncCallFuture<VolumeApiResult> future = null;
if (templateId == null) {
- future = this.volService.createVolumeAsync(volume, destPool);
+ future = volService.createVolumeAsync(volume, destPool);
} else {
- TemplateInfo templ = this.tmplFactory.getTemplate(templateId);
- future = this.volService.createVolumeFromTemplateAsync(volume, destPool.getId(), templ);
+ TemplateInfo templ = tmplFactory.getTemplate(templateId);
+ future = volService.createVolumeFromTemplateAsync(volume, destPool.getId(), templ);
}
VolumeApiResult result = null;
try {
@@ -2376,7 +2377,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
throw new StorageUnavailableException("Unable to create "
+ newVol + ":" + result.getResult(), destPool.getId());
}
- newVol = this._volsDao.findById(newVol.getId());
+ newVol = _volsDao.findById(newVol.getId());
} catch (InterruptedException e) {
s_logger.error("Unable to create " + newVol, e);
throw new StorageUnavailableException("Unable to create "
@@ -2575,7 +2576,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
@Override
public void destroyVolume(VolumeVO volume) {
try {
- this.volService.destroyVolume(volume.getId());
+ volService.destroyVolume(volume.getId());
} catch (ConcurrentOperationException e) {
s_logger.debug("Failed to destroy volume" + volume.getId(), e);
throw new CloudRuntimeException("Failed to destroy volume" + volume.getId(), e);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index c12d035..5dc66f9 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -31,6 +31,8 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+
import com.cloud.agent.AgentManager;
import com.cloud.agent.api.Answer;
import com.cloud.agent.api.Command;
@@ -49,7 +51,6 @@ import com.cloud.agent.api.check.CheckSshCommand;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
import com.cloud.agent.manager.Commands;
-import com.cloud.async.AsyncJobConstants;
import com.cloud.async.AsyncJobExecutionContext;
import com.cloud.async.AsyncJobResult;
import com.cloud.capacity.dao.CapacityDao;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
index b8b0195..851ec86 100644
--- a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java
@@ -33,14 +33,15 @@ import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
+
import com.cloud.api.ApiDispatcher;
import com.cloud.api.ApiGsonHelper;
import com.cloud.user.Account;
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobManager;
import com.cloud.async.AsyncJobResult;
-import com.cloud.async.AsyncJobVO;
-import com.cloud.async.dao.AsyncJobDao;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.event.EventTypes;
import com.cloud.storage.Snapshot;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/upload/UploadListener.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadListener.java b/server/src/com/cloud/storage/upload/UploadListener.java
index c333789..b66624d 100755
--- a/server/src/com/cloud/storage/upload/UploadListener.java
+++ b/server/src/com/cloud/storage/upload/UploadListener.java
@@ -42,10 +42,10 @@ import com.cloud.agent.api.storage.UploadProgressCommand;
import com.cloud.agent.api.storage.UploadProgressCommand.RequestType;
import org.apache.cloudstack.api.command.user.template.ExtractTemplateCmd;
import org.apache.cloudstack.api.response.ExtractResponse;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobManager;
import com.cloud.async.AsyncJobResult;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.host.HostVO;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/upload/UploadMonitor.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitor.java b/server/src/com/cloud/storage/upload/UploadMonitor.java
index 1c3590e..d4f5762 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitor.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitor.java
@@ -17,7 +17,8 @@
package com.cloud.storage.upload;
-import com.cloud.async.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+
import com.cloud.host.HostVO;
import com.cloud.storage.Upload.Mode;
import com.cloud.storage.Upload.Status;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
index 77f0d20..103766e 100755
--- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
+++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java
@@ -35,6 +35,8 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+
import com.cloud.agent.AgentManager;
import com.cloud.agent.Listener;
import com.cloud.agent.api.Command;
@@ -44,7 +46,6 @@ import com.cloud.agent.api.storage.UploadCommand;
import com.cloud.agent.api.storage.UploadProgressCommand.RequestType;
import com.cloud.agent.manager.Commands;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJobManager;
import com.cloud.configuration.dao.ConfigurationDao;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.host.Host;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index a8729e1..747ed25 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -66,6 +66,8 @@ import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
import org.apache.cloudstack.framework.async.AsyncCallFuture;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.log4j.Logger;
@@ -83,8 +85,6 @@ import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
import com.cloud.agent.api.to.SwiftTO;
import com.cloud.api.ApiDBUtils;
-import com.cloud.async.AsyncJobManager;
-import com.cloud.async.AsyncJobVO;
import com.cloud.configuration.Config;
import com.cloud.configuration.Resource.ResourceType;
import com.cloud.configuration.dao.ConfigurationDao;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 245e804..28cdb7c 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -57,6 +57,7 @@ import org.apache.cloudstack.api.command.user.vmgroup.CreateVMGroupCmd;
import org.apache.cloudstack.api.command.user.vmgroup.DeleteVMGroupCmd;
import org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntity;
import org.apache.cloudstack.engine.service.api.OrchestrationService;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import org.apache.commons.codec.binary.Base64;
@@ -82,7 +83,6 @@ import com.cloud.alert.AlertManager;
import com.cloud.api.ApiDBUtils;
import com.cloud.api.query.dao.UserVmJoinDao;
import com.cloud.api.query.vo.UserVmJoinVO;
-import com.cloud.async.AsyncJobManager;
import com.cloud.capacity.CapacityManager;
import com.cloud.configuration.Config;
import com.cloud.configuration.ConfigurationManager;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 752eb73..28b7d9c 100755
--- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -37,6 +37,9 @@ import org.apache.log4j.Logger;
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.messagebus.TopicConstants;
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -67,10 +70,7 @@ import com.cloud.agent.manager.Commands;
import com.cloud.agent.manager.allocator.HostAllocator;
import com.cloud.alert.AlertManager;
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobConstants;
import com.cloud.async.AsyncJobExecutionContext;
-import com.cloud.async.AsyncJobManager;
import com.cloud.capacity.CapacityManager;
import com.cloud.cluster.ClusterManager;
import com.cloud.configuration.Config;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/VmWorkJobDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VmWorkJobDaoImpl.java b/server/src/com/cloud/vm/VmWorkJobDaoImpl.java
index 641d9d9..53c76ed 100644
--- a/server/src/com/cloud/vm/VmWorkJobDaoImpl.java
+++ b/server/src/com/cloud/vm/VmWorkJobDaoImpl.java
@@ -21,7 +21,8 @@ import java.util.List;
import javax.annotation.PostConstruct;
-import com.cloud.async.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+
import com.cloud.utils.DateUtil;
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GenericDaoBase;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/VmWorkJobDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VmWorkJobDispatcher.java b/server/src/com/cloud/vm/VmWorkJobDispatcher.java
index 8742169..6303ab5 100644
--- a/server/src/com/cloud/vm/VmWorkJobDispatcher.java
+++ b/server/src/com/cloud/vm/VmWorkJobDispatcher.java
@@ -24,11 +24,12 @@ import javax.inject.Inject;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobDispatcher;
-import com.cloud.async.AsyncJobManager;
import com.cloud.user.AccountVO;
import com.cloud.user.UserContext;
import com.cloud.user.dao.AccountDao;
@@ -43,10 +44,10 @@ public class VmWorkJobDispatcher extends AdapterBase implements AsyncJobDispatch
@Inject private AccountDao _accountDao;
@Inject private VMInstanceDao _instanceDao;
- private Map<String, Method> _handlerMap = new HashMap<String, Method>();
+ private final Map<String, Method> _handlerMap = new HashMap<String, Method>();
@Override
- public void runJob(AsyncJob job) {
+ public void runJob(AsyncJob job) {
try {
String cmd = job.getCmd();
assert(cmd != null);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/VmWorkJobVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VmWorkJobVO.java b/server/src/com/cloud/vm/VmWorkJobVO.java
index 1fc89a9..8cea54f 100644
--- a/server/src/com/cloud/vm/VmWorkJobVO.java
+++ b/server/src/com/cloud/vm/VmWorkJobVO.java
@@ -24,7 +24,8 @@ import javax.persistence.Enumerated;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
-import com.cloud.async.AsyncJobVO;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+
@Entity
@Table(name="vm_work_job")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java b/server/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
index 7447df6..08584ed 100644
--- a/server/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
+++ b/server/src/com/cloud/vm/VmWorkJobWakeupDispatcher.java
@@ -26,11 +26,12 @@ import javax.inject.Inject;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJobJoinMapVO;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
+
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobDispatcher;
-import com.cloud.async.AsyncJobJoinMapVO;
-import com.cloud.async.dao.AsyncJobJoinMapDao;
import com.cloud.user.AccountVO;
import com.cloud.user.UserContext;
import com.cloud.user.dao.AccountDao;
@@ -46,14 +47,14 @@ public class VmWorkJobWakeupDispatcher extends AdapterBase implements AsyncJobDi
@Inject private VMInstanceDao _instanceDao;
@Inject private VirtualMachineManager _vmMgr;
- private Map<String, Method> _handlerMap = new HashMap<String, Method>();
+ private final Map<String, Method> _handlerMap = new HashMap<String, Method>();
@Override
- public void runJob(AsyncJob job) {
+ public void runJob(AsyncJob job) {
try {
List<AsyncJobJoinMapVO> joinRecords =_joinMapDao.listJoinRecords(job.getId());
if(joinRecords.size() != 1) {
- s_logger.warn("Job-" + job.getId()
+ s_logger.warn("AsyncJob-" + job.getId()
+ " received wakeup call with un-supported joining job number: " + joinRecords.size());
// if we fail wakeup-execution for any reason, avoid release sync-source if there is any
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java b/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
index 4f992d9..681b6b3 100644
--- a/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
+++ b/server/test/com/cloud/vm/VmWorkMockVirtualMachineManagerImpl.java
@@ -26,12 +26,12 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
import com.cloud.agent.api.to.NicTO;
import com.cloud.agent.api.to.VirtualMachineTO;
-import com.cloud.async.AsyncJobConstants;
import com.cloud.async.AsyncJobExecutionContext;
import com.cloud.deploy.DeployDestination;
import com.cloud.deploy.DeploymentPlan;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/test/com/cloud/vm/VmWorkTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VmWorkTest.java b/server/test/com/cloud/vm/VmWorkTest.java
index 7c427b2..4f91aba 100644
--- a/server/test/com/cloud/vm/VmWorkTest.java
+++ b/server/test/com/cloud/vm/VmWorkTest.java
@@ -35,8 +35,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import junit.framework.TestCase;
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.AsyncJobManager;
-import com.cloud.async.AsyncJobVO;
import com.cloud.cluster.ClusterManager;
import com.cloud.deploy.DataCenterDeployment;
import com.cloud.deploy.DeploymentPlan;
@@ -51,6 +49,9 @@ import com.cloud.utils.db.Transaction;
import com.cloud.vm.VmWorkJobVO.Step;
import com.google.gson.Gson;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+import org.apache.cloudstack.framework.jobs.AsyncJobVO;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations="classpath:/VmWorkTestContext.xml")
public class VmWorkTest extends TestCase {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/test/com/cloud/vm/VmWorkTestApiJobDispatcher.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VmWorkTestApiJobDispatcher.java b/server/test/com/cloud/vm/VmWorkTestApiJobDispatcher.java
index 02d634c..5166372 100644
--- a/server/test/com/cloud/vm/VmWorkTestApiJobDispatcher.java
+++ b/server/test/com/cloud/vm/VmWorkTestApiJobDispatcher.java
@@ -22,11 +22,12 @@ import java.sql.Statement;
import javax.inject.Inject;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJobManager;
+
import com.cloud.api.ApiSerializerHelper;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobDispatcher;
import com.cloud.async.AsyncJobExecutionContext;
-import com.cloud.async.AsyncJobManager;
import com.cloud.utils.component.AdapterBase;
import com.cloud.utils.db.Transaction;
@@ -35,7 +36,7 @@ public class VmWorkTestApiJobDispatcher extends AdapterBase implements AsyncJobD
@Inject AsyncJobManager _jobMgr;
@Override
- public void runJob(AsyncJob job) {
+ public void runJob(AsyncJob job) {
// drop constraint check in order to do single table test
Statement stat = null;
@@ -74,9 +75,9 @@ public class VmWorkTestApiJobDispatcher extends AdapterBase implements AsyncJobD
_jobMgr.submitAsyncJob(workJob, VmWorkConstants.VM_WORK_QUEUE, 1L);
- _jobMgr.joinJob(job.getId(), workJob.getId(), "processVmStartWakeup",
- VmWorkConstants.VM_WORK_JOB_WAKEUP_DISPATCHER,
- new String[] {},
+ _jobMgr.joinJob(job.getId(), workJob.getId(), "processVmStartWakeup",
+ VmWorkConstants.VM_WORK_JOB_WAKEUP_DISPATCHER,
+ new String[] {},
3000, 120000);
AsyncJobExecutionContext.getCurrentExecutionContext().resetSyncSource();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/test/com/cloud/vm/VmWorkTestConfiguration.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VmWorkTestConfiguration.java b/server/test/com/cloud/vm/VmWorkTestConfiguration.java
index 93aa41a..9db06f8 100644
--- a/server/test/com/cloud/vm/VmWorkTestConfiguration.java
+++ b/server/test/com/cloud/vm/VmWorkTestConfiguration.java
@@ -20,20 +20,21 @@ import org.mockito.Mockito;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.apache.cloudstack.framework.jobs.AsyncJobMonitor;
+import org.apache.cloudstack.framework.jobs.SyncQueueManager;
+import org.apache.cloudstack.framework.jobs.SyncQueueManagerImpl;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobDaoImpl;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDao;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJoinMapDaoImpl;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDao;
+import org.apache.cloudstack.framework.jobs.dao.AsyncJobJournalDaoImpl;
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueDao;
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueDaoImpl;
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDao;
+import org.apache.cloudstack.framework.jobs.dao.SyncQueueItemDaoImpl;
+
import com.cloud.api.ApiDispatcher;
-import com.cloud.async.AsyncJobMonitor;
-import com.cloud.async.SyncQueueManager;
-import com.cloud.async.SyncQueueManagerImpl;
-import com.cloud.async.dao.AsyncJobDao;
-import com.cloud.async.dao.AsyncJobDaoImpl;
-import com.cloud.async.dao.AsyncJobJoinMapDao;
-import com.cloud.async.dao.AsyncJobJoinMapDaoImpl;
-import com.cloud.async.dao.AsyncJobJournalDao;
-import com.cloud.async.dao.AsyncJobJournalDaoImpl;
-import com.cloud.async.dao.SyncQueueDao;
-import com.cloud.async.dao.SyncQueueDaoImpl;
-import com.cloud.async.dao.SyncQueueItemDao;
-import com.cloud.async.dao.SyncQueueItemDaoImpl;
import com.cloud.cluster.ClusterManager;
import com.cloud.configuration.ConfigurationManager;
import com.cloud.configuration.dao.ConfigurationDao;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/server/test/com/cloud/vm/VmWorkTestWorkJobDispatcher.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/VmWorkTestWorkJobDispatcher.java b/server/test/com/cloud/vm/VmWorkTestWorkJobDispatcher.java
index 8e9990b..288b793 100644
--- a/server/test/com/cloud/vm/VmWorkTestWorkJobDispatcher.java
+++ b/server/test/com/cloud/vm/VmWorkTestWorkJobDispatcher.java
@@ -2,9 +2,10 @@ package com.cloud.vm;
import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
-import com.cloud.async.AsyncJobConstants;
-import com.cloud.async.AsyncJobDispatcher;
+import org.apache.cloudstack.framework.jobs.AsyncJob;
+import org.apache.cloudstack.framework.jobs.AsyncJobConstants;
+import org.apache.cloudstack.framework.jobs.AsyncJobDispatcher;
+
import com.cloud.async.AsyncJobExecutionContext;
import com.cloud.utils.component.AdapterBase;
@@ -12,7 +13,7 @@ public class VmWorkTestWorkJobDispatcher extends AdapterBase implements AsyncJob
public static final Logger s_logger = Logger.getLogger(VmWorkTestWorkJobDispatcher.class);
@Override
- public void runJob(AsyncJob job) {
+ public void runJob(AsyncJob job) {
s_logger.info("Begin work job execution. job-" + job.getId());
try {
Thread.sleep(120000);
[07/12] Isolated the job queue work in its own project
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
index 6cb75c7..1464a25 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
@@ -25,12 +27,9 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
-import com.cloud.async.AsyncJob;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.user.Account;
import com.cloud.user.UserContext;
import com.cloud.uservm.UserVm;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
index 07518c9..a4cd25f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java
@@ -21,15 +21,17 @@ import java.util.EnumSet;
import org.apache.log4j.Logger;
-import org.apache.cloudstack.api.*;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiConstants.VMDetails;
-import org.apache.cloudstack.api.response.UserVmResponse;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseAsyncCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.NicResponse;
+import org.apache.cloudstack.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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
index bbf9b25..e14db7f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.GuestOSResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InsufficientCapacityException;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
index fb62000..2718238 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vm;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceAllocationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
index bcb7bda..24aad77 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vmgroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.InstanceGroupResponse;
import org.apache.cloudstack.api.response.ProjectAccountResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.UserContext;
import com.cloud.vm.InstanceGroup;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
index 641b6ce..889f0a5 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vmgroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.InstanceGroupResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.vm.InstanceGroup;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
index 5a7ce27..dc21aa8 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.command.user.vmgroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.InstanceGroupResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.log4j.Logger;
@APICommand(name = "listInstanceGroups", description="Lists vm groups", responseObject=InstanceGroupResponse.class)
public class ListVMGroupsCmd extends BaseListProjectAndAccountResourcesCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
index 83a1a1d..29b1364 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vmgroup;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.InstanceGroupResponse;
-import org.apache.log4j.Logger;
import com.cloud.user.Account;
import com.cloud.vm.InstanceGroup;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
index bda84c8..d00bed6 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.api.command.user.vmsnapshot;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VMSnapshotResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 43ce96e..4632165 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 ba5e4f5..8117f38 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -29,9 +31,7 @@ import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SnapshotResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
index 394b009..ead687e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
-import org.apache.log4j.Logger;
import com.cloud.exception.ConcurrentOperationException;
import com.cloud.storage.Volume;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 c7f9621..2afaf96 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 6d07338..e59e70d 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
@@ -18,6 +18,8 @@ package org.apache.cloudstack.api.command.user.volume;
import java.net.URISyntaxException;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -28,9 +30,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.ExtractResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 b1feb6f..723b9a9 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -27,9 +29,7 @@ import org.apache.cloudstack.api.response.PodResponse;
import org.apache.cloudstack.api.response.UserVmResponse;
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)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 f11727e..3373ce1 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -25,9 +27,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
index 3b00ba0..bd64c1c 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.volume;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.VolumeResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 ebdedf6..871aa35 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
index 04a7788..20a29d4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -27,7 +29,6 @@ import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VpcOfferingResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/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 45b543f..5c3d688 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
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
@@ -26,9 +28,7 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.AccountResponse;
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;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
index 18866be..7d5da26 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
index 12b5822..71cb092 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.vpc;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.PrivateGatewayResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.vpc.PrivateGateway;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
index ddae799..6ab3908 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.user.vpc;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
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.VpcOfferingResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.vpc.VpcOffering;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
index b6bc68f..8c01463 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java
@@ -19,16 +19,16 @@ package org.apache.cloudstack.api.command.user.vpc;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListTaggedResourcesCmd;
import org.apache.cloudstack.api.Parameter;
-import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.VpcOfferingResponse;
import org.apache.cloudstack.api.response.VpcResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.vpc.Vpc;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
index bd56c74..d5abc03 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
index 2cc3c98..ba2cc6d 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpc;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.vpc.Vpc;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
index 0618e34..2f30091 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.VpnUsersResponse;
-import org.apache.log4j.Logger;
import com.cloud.domain.Domain;
import com.cloud.event.EventTypes;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
index ff681a9..5106e02 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
index fee0325..c6b79c4 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.NetworkRuleConflictException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
index 38b40b5..3546267 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.Site2SiteCustomerGateway;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
index 4cc650f..5191dd2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.Site2SiteVpnGateway;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
index 5b1c5c6..38fea37 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -23,7 +25,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.AccountResponse;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.InvalidParameterValueException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
index 667e179..f82bf81 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
index a239bdf..25d0bcd 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.Site2SiteCustomerGateway;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
index fa4c1df..6a839db 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.Site2SiteVpnGateway;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
index 12ee95b..ab9251e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.vpn;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.IPAddressResponse;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.RemoteAccessVpnResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.RemoteAccessVpn;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
index 6fb7d73..44db96f 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.vpn;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.Site2SiteVpnConnection;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
index 418cad5..39c515e 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.user.vpn;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.Site2SiteCustomerGateway;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
index 41981df..3f43222 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java
@@ -19,6 +19,8 @@ package org.apache.cloudstack.api.command.user.vpn;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
@@ -26,7 +28,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse;
import org.apache.cloudstack.api.response.VpcResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.Site2SiteVpnGateway;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
index 8a36f4b..85c2309 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.command.user.vpn;
import java.util.ArrayList;
import java.util.List;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.VpnUsersResponse;
-import org.apache.log4j.Logger;
import com.cloud.network.VpnUser;
import com.cloud.utils.Pair;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
index 9520e80..12ef712 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -25,7 +27,6 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.SuccessResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
index d9f38d2..5043ff3 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.Site2SiteVpnConnectionResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.exception.ResourceUnavailableException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
index 3aca5cd..12ed65b 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java
@@ -16,6 +16,8 @@
// under the License.
package org.apache.cloudstack.api.command.user.vpn;
+import org.apache.log4j.Logger;
+
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -24,7 +26,6 @@ import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.Site2SiteCustomerGatewayResponse;
-import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.network.Site2SiteCustomerGateway;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesByCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesByCmd.java b/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesByCmd.java
index ed31037..88b507a 100644
--- a/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesByCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/zone/ListZonesByCmd.java
@@ -16,21 +16,15 @@
// under the License.
package org.apache.cloudstack.api.command.user.zone;
-import java.util.ArrayList;
-import java.util.List;
+import org.apache.log4j.Logger;
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.BaseCmd.CommandType;
import org.apache.cloudstack.api.response.DomainResponse;
import org.apache.cloudstack.api.response.ListResponse;
-import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
-import org.apache.log4j.Logger;
-
-import com.cloud.dc.DataCenter;
@APICommand(name = "listZones", description="Lists zones", responseObject=ZoneResponse.class)
public class ListZonesByCmd extends BaseListCmd {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AccountResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/org/apache/cloudstack/api/response/AccountResponse.java
index 1e59822..e3ce512 100644
--- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
import java.util.Map;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.user.Account;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value = Account.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java b/api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java
index 9af20b2..5257483 100644
--- a/api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AddIpToVmNicResponse.java
@@ -15,14 +15,12 @@
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.api.response;
-import java.util.Date;
-import java.util.List;
+import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class AddIpToVmNicResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AlertResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AlertResponse.java b/api/src/org/apache/cloudstack/api/response/AlertResponse.java
index f3755e5..03261b7 100644
--- a/api/src/org/apache/cloudstack/api/response/AlertResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AlertResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.alert.Alert;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Alert.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerInstanceResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerInstanceResponse.java b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerInstanceResponse.java
index 2d6614d..641aab1 100644
--- a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerInstanceResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerInstanceResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
/**
*
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerResponse.java
index de9bce6..70768da 100644
--- a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerResponse.java
@@ -17,15 +17,14 @@
package org.apache.cloudstack.api.response;
-import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Set;
+
+import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class ApplicationLoadBalancerResponse extends BaseResponse implements ControlledEntityResponse{
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerRuleResponse.java b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerRuleResponse.java
index ffc64d5..b2a6b27 100644
--- a/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ApplicationLoadBalancerRuleResponse.java
@@ -17,11 +17,12 @@
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
/**
* Subobject of the load balancer container response
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java b/api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java
index a237714..34a1b8d 100644
--- a/api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AsyncJobResponse.java
@@ -18,16 +18,17 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.amazonaws.services.importexport.model.Job;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.api.ResponseObject;
-import com.cloud.async.AsyncJob;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
-@EntityReference(value=AsyncJob.class)
+@EntityReference(value=Job.class)
@SuppressWarnings("unused")
public class AsyncJobResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
index 6a2bfbe..a9f380d 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScalePolicyResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.as.AutoScalePolicy;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=AutoScalePolicy.class)
public class AutoScalePolicyResponse extends BaseResponse implements ControlledEntityResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
index 98fdcad..db1caae 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScaleVmGroupResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.as.AutoScaleVmGroup;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=AutoScaleVmGroup.class)
public class AutoScaleVmGroupResponse extends BaseResponse implements ControlledEntityResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java b/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
index 4c97adf..b88f9a1 100644
--- a/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/AutoScaleVmProfileResponse.java
@@ -20,6 +20,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd.CommandType;
import org.apache.cloudstack.api.BaseResponse;
@@ -29,7 +31,6 @@ import org.apache.cloudstack.api.Parameter;
import com.cloud.network.as.AutoScaleVmProfile;
import com.cloud.serializer.Param;
import com.cloud.utils.Pair;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=AutoScaleVmProfile.class)
public class AutoScaleVmProfileResponse extends BaseResponse implements ControlledEntityResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
index c2996f0..6fa2181 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilitiesResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class CapabilitiesResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CapabilityResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapabilityResponse.java b/api/src/org/apache/cloudstack/api/response/CapabilityResponse.java
index e960c2d..20053e2 100644
--- a/api/src/org/apache/cloudstack/api/response/CapabilityResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapabilityResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class CapabilityResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CapacityResponse.java b/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
index c1ef62c..6695615 100644
--- a/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CapacityResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class CapacityResponse extends BaseResponse {
@SerializedName(ApiConstants.TYPE) @Param(description="the capacity type")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java b/api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java
index 5e74486..b6796b1 100644
--- a/api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CloudIdentifierResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class CloudIdentifierResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ClusterResponse.java b/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
index cfd772d..5ea9325 100644
--- a/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ClusterResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.ArrayList;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.org.Cluster;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = Cluster.class)
public class ClusterResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ConditionResponse.java b/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
index ccdd278..27420db 100644
--- a/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ConditionResponse.java
@@ -19,13 +19,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.as.Condition;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Condition.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ConfigurationResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ConfigurationResponse.java b/api/src/org/apache/cloudstack/api/response/ConfigurationResponse.java
index fa0d4b4..5394243 100644
--- a/api/src/org/apache/cloudstack/api/response/ConfigurationResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ConfigurationResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class ConfigurationResponse extends BaseResponse {
@SerializedName(ApiConstants.CATEGORY) @Param(description="the category of the configuration")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CounterResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CounterResponse.java b/api/src/org/apache/cloudstack/api/response/CounterResponse.java
index 4f5784a..8f61a99 100644
--- a/api/src/org/apache/cloudstack/api/response/CounterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CounterResponse.java
@@ -17,13 +17,14 @@
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.as.Counter;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
@EntityReference(value=Counter.class)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/CustomCertificateResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/CustomCertificateResponse.java b/api/src/org/apache/cloudstack/api/response/CustomCertificateResponse.java
index 59c108e..b72b5f0 100644
--- a/api/src/org/apache/cloudstack/api/response/CustomCertificateResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/CustomCertificateResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class CustomCertificateResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/DeploymentPlannersResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/DeploymentPlannersResponse.java b/api/src/org/apache/cloudstack/api/response/DeploymentPlannersResponse.java
index a37800f..c04af8d 100644
--- a/api/src/org/apache/cloudstack/api/response/DeploymentPlannersResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/DeploymentPlannersResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class DeploymentPlannersResponse extends BaseResponse {
@SerializedName(ApiConstants.NAME)
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java
index 04c318f..0b217c7 100644
--- a/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.offering.DiskOffering;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=DiskOffering.class)
public class DiskOfferingResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/DomainResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/DomainResponse.java b/api/src/org/apache/cloudstack/api/response/DomainResponse.java
index 736a96c..ac060ec 100644
--- a/api/src/org/apache/cloudstack/api/response/DomainResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/DomainResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.domain.Domain;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value = Domain.class)
public class DomainResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
index 852d988..2161ac5 100644
--- a/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/DomainRouterResponse.java
@@ -17,10 +17,11 @@
package org.apache.cloudstack.api.response;
import java.util.Date;
-import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
@@ -28,7 +29,6 @@ import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.vm.VirtualMachine;
import com.cloud.vm.VirtualMachine.State;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=VirtualMachine.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/EventResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/EventResponse.java b/api/src/org/apache/cloudstack/api/response/EventResponse.java
index c2bf757..cf1826e 100644
--- a/api/src/org/apache/cloudstack/api/response/EventResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/EventResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.event.Event;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=Event.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/EventTypeResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/EventTypeResponse.java b/api/src/org/apache/cloudstack/api/response/EventTypeResponse.java
index b526435..7318ec1 100644
--- a/api/src/org/apache/cloudstack/api/response/EventTypeResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/EventTypeResponse.java
@@ -16,11 +16,12 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class EventTypeResponse extends BaseResponse {
@SerializedName(ApiConstants.NAME) @Param(description="Event Type")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ExceptionResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ExceptionResponse.java b/api/src/org/apache/cloudstack/api/response/ExceptionResponse.java
index 3afd516..e0bde45 100644
--- a/api/src/org/apache/cloudstack/api/response/ExceptionResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ExceptionResponse.java
@@ -18,10 +18,11 @@ package org.apache.cloudstack.api.response;
import java.util.ArrayList;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class ExceptionResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ExternalFirewallResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ExternalFirewallResponse.java b/api/src/org/apache/cloudstack/api/response/ExternalFirewallResponse.java
index 50f5233..05d85f4 100644
--- a/api/src/org/apache/cloudstack/api/response/ExternalFirewallResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ExternalFirewallResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class ExternalFirewallResponse extends NetworkDeviceResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ExternalLoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ExternalLoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/ExternalLoadBalancerResponse.java
index 5a323a7..55766db 100644
--- a/api/src/org/apache/cloudstack/api/response/ExternalLoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ExternalLoadBalancerResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class ExternalLoadBalancerResponse extends NetworkDeviceResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/ExtractResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ExtractResponse.java b/api/src/org/apache/cloudstack/api/response/ExtractResponse.java
index f5595f9..ca918e2 100644
--- a/api/src/org/apache/cloudstack/api/response/ExtractResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ExtractResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.Date;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class ExtractResponse extends BaseResponse {
@SerializedName(ApiConstants.ID) @Param(description="the id of extracted object")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/FirewallResponse.java b/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
index 26d2433..75ac75f 100644
--- a/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/FirewallResponse.java
@@ -18,11 +18,12 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@SuppressWarnings("unused")
public class FirewallResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
index 787410a..de39f3c 100644
--- a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
@@ -18,13 +18,14 @@ package org.apache.cloudstack.api.response;
import java.util.List;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.network.rules.FirewallRule;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=FirewallRule.class)
@SuppressWarnings("unused")
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/GetVMPasswordResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GetVMPasswordResponse.java b/api/src/org/apache/cloudstack/api/response/GetVMPasswordResponse.java
index 56ced5b..3bc3696 100644
--- a/api/src/org/apache/cloudstack/api/response/GetVMPasswordResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GetVMPasswordResponse.java
@@ -16,10 +16,11 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
public class GetVMPasswordResponse extends BaseResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java b/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
index 9f5139d..73eff0f 100644
--- a/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GlobalLoadBalancerResponse.java
@@ -16,14 +16,16 @@
// under the License.
package org.apache.cloudstack.api.response;
-import com.cloud.region.ha.GlobalLoadBalancerRule;
-import com.cloud.serializer.Param;
+import java.util.List;
+
import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
-import java.util.List;
+import com.cloud.region.ha.GlobalLoadBalancerRule;
+import com.cloud.serializer.Param;
@EntityReference(value= GlobalLoadBalancerRule.class)
public class GlobalLoadBalancerResponse extends BaseResponse implements ControlledEntityResponse {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cbdc4063/api/src/org/apache/cloudstack/api/response/GuestOSCategoryResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/GuestOSCategoryResponse.java b/api/src/org/apache/cloudstack/api/response/GuestOSCategoryResponse.java
index eab6bba..4dbfb2a 100644
--- a/api/src/org/apache/cloudstack/api/response/GuestOSCategoryResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/GuestOSCategoryResponse.java
@@ -16,13 +16,14 @@
// under the License.
package org.apache.cloudstack.api.response;
+import com.google.gson.annotations.SerializedName;
+
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import com.cloud.serializer.Param;
import com.cloud.storage.GuestOsCategory;
-import com.google.gson.annotations.SerializedName;
@EntityReference(value=GuestOsCategory.class)
public class GuestOSCategoryResponse extends BaseResponse {