mirror of https://github.com/apache/cloudstack.git
QuickCloud: Remove reference to unused code
QuickCloud: remove some dead code in ConsoleProxyManager
This commit is contained in:
parent
bf0c901e95
commit
7415eb71a4
|
|
@ -17,14 +17,12 @@
|
|||
package com.cloud.api.commands;
|
||||
|
||||
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.SuccessResponse;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.exception.UnsupportedServiceException;
|
||||
import com.cloud.user.Account;
|
||||
import com.cloud.user.UserContext;
|
||||
|
||||
|
|
@ -82,12 +80,6 @@ public class DestroyConsoleProxyCmd extends BaseAsyncCmd {
|
|||
|
||||
@Override
|
||||
public void execute(){
|
||||
boolean result = _consoleProxyService.destroyConsoleProxy(this);
|
||||
if (result) {
|
||||
SuccessResponse response = new SuccessResponse(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
} else {
|
||||
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy console proxy");
|
||||
}
|
||||
throw new UnsupportedServiceException("Use destroySystemVm API instead");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.consoleproxy;
|
||||
|
||||
import com.cloud.api.commands.DestroyConsoleProxyCmd;
|
||||
|
||||
public interface ConsoleProxyService {
|
||||
boolean destroyConsoleProxy(DestroyConsoleProxyCmd cmd);
|
||||
}
|
||||
|
|
@ -32,7 +32,6 @@ import org.apache.cloudstack.usage.UsageService;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.cloud.configuration.ConfigurationService;
|
||||
import com.cloud.consoleproxy.ConsoleProxyService;
|
||||
import com.cloud.dao.EntityManager;
|
||||
import com.cloud.domain.Domain;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
|
|
@ -109,7 +108,6 @@ public abstract class BaseCmd {
|
|||
@Inject public TemplateService _templateService;
|
||||
@Inject public SecurityGroupService _securityGroupService;
|
||||
@Inject public SnapshotService _snapshotService;
|
||||
@Inject public ConsoleProxyService _consoleProxyService;
|
||||
@Inject public VpcVirtualNetworkApplianceService _routerService;
|
||||
@Inject public ResponseGenerator _responseGenerator;
|
||||
@Inject public EntityManager _entityMgr;
|
||||
|
|
|
|||
|
|
@ -16,17 +16,9 @@
|
|||
// under the License.
|
||||
package com.cloud.consoleproxy;
|
||||
|
||||
import com.cloud.agent.api.AgentControlAnswer;
|
||||
import com.cloud.agent.api.ConsoleAccessAuthenticationCommand;
|
||||
import com.cloud.agent.api.ConsoleProxyLoadReportCommand;
|
||||
import com.cloud.agent.api.StartupCommand;
|
||||
import com.cloud.host.HostVO;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.host.Host.Type;
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.vm.ConsoleProxyVO;
|
||||
public interface ConsoleProxyManager extends Manager {
|
||||
public interface ConsoleProxyManager extends Manager, ConsoleProxyService {
|
||||
|
||||
public static final int DEFAULT_PROXY_CAPACITY = 50;
|
||||
public static final int DEFAULT_STANDBY_CAPACITY = 10;
|
||||
|
|
@ -45,16 +37,9 @@ public interface ConsoleProxyManager extends Manager {
|
|||
public ConsoleProxyManagementState getManagementState();
|
||||
public void resumeLastManagementState();
|
||||
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId);
|
||||
|
||||
public ConsoleProxyVO startProxy(long proxyVmId);
|
||||
public boolean stopProxy(long proxyVmId);
|
||||
public boolean rebootProxy(long proxyVmId);
|
||||
public boolean destroyProxy(long proxyVmId);
|
||||
|
||||
public void onLoadReport(ConsoleProxyLoadReportCommand cmd);
|
||||
public AgentControlAnswer onConsoleAccessAuthentication(ConsoleAccessAuthenticationCommand cmd);
|
||||
|
||||
public void onAgentConnect(HostVO host, StartupCommand cmd);
|
||||
public void onAgentDisconnect(long agentId, Status state);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ import javax.ejb.Local;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.api.ServerApiException;
|
||||
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
|
||||
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -54,7 +53,6 @@ import com.cloud.agent.api.proxy.StartConsoleProxyAgentHttpHandlerCommand;
|
|||
import com.cloud.agent.api.to.NicTO;
|
||||
import com.cloud.agent.api.to.VirtualMachineTO;
|
||||
import com.cloud.agent.manager.Commands;
|
||||
import com.cloud.api.commands.DestroyConsoleProxyCmd;
|
||||
import com.cloud.certificate.dao.CertificateDao;
|
||||
import com.cloud.cluster.ClusterManager;
|
||||
import com.cloud.configuration.Config;
|
||||
|
|
@ -71,7 +69,6 @@ import com.cloud.deploy.DeployDestination;
|
|||
import com.cloud.exception.AgentUnavailableException;
|
||||
import com.cloud.exception.ConcurrentOperationException;
|
||||
import com.cloud.exception.InsufficientCapacityException;
|
||||
import com.cloud.exception.InvalidParameterValueException;
|
||||
import com.cloud.exception.OperationTimedoutException;
|
||||
import com.cloud.exception.ResourceUnavailableException;
|
||||
import com.cloud.exception.StorageUnavailableException;
|
||||
|
|
@ -113,8 +110,8 @@ import com.cloud.servlet.ConsoleProxyServlet;
|
|||
import com.cloud.storage.StorageManager;
|
||||
import com.cloud.storage.StoragePoolStatus;
|
||||
import com.cloud.storage.VMTemplateHostVO;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
|
||||
import com.cloud.storage.VMTemplateVO;
|
||||
import com.cloud.storage.dao.DiskOfferingDao;
|
||||
import com.cloud.storage.dao.VMTemplateDao;
|
||||
import com.cloud.storage.dao.VMTemplateHostDao;
|
||||
|
|
@ -127,7 +124,6 @@ import com.cloud.utils.DateUtil;
|
|||
import com.cloud.utils.NumbersUtil;
|
||||
import com.cloud.utils.Pair;
|
||||
import com.cloud.utils.Ternary;
|
||||
import com.cloud.utils.component.Manager;
|
||||
import com.cloud.utils.component.ManagerBase;
|
||||
import com.cloud.utils.db.DB;
|
||||
import com.cloud.utils.db.GlobalLock;
|
||||
|
|
@ -170,7 +166,8 @@ import com.google.gson.GsonBuilder;
|
|||
// because sooner or later, it will be driven into Running state
|
||||
//
|
||||
@Local(value = { ConsoleProxyManager.class, ConsoleProxyService.class })
|
||||
public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager, ConsoleProxyService, AgentHook, VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
|
||||
public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager,
|
||||
AgentHook, VirtualMachineGuru<ConsoleProxyVO>, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
|
||||
private static final Logger s_logger = Logger.getLogger(ConsoleProxyManagerImpl.class);
|
||||
|
||||
private static final int DEFAULT_CAPACITY_SCAN_INTERVAL = 30000; // 30 seconds
|
||||
|
|
@ -1549,18 +1546,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean destroyConsoleProxy(DestroyConsoleProxyCmd cmd) throws ServerApiException {
|
||||
Long proxyId = cmd.getId();
|
||||
|
||||
// verify parameters
|
||||
ConsoleProxyVO proxy = _consoleProxyDao.findById(proxyId);
|
||||
if (proxy == null) {
|
||||
throw new InvalidParameterValueException("unable to find a console proxy with id " + proxyId);
|
||||
}
|
||||
|
||||
return destroyProxy(proxyId);
|
||||
}
|
||||
|
||||
protected ConsoleProxyManagerImpl() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.cloud.consoleproxy;
|
||||
|
||||
import com.cloud.info.ConsoleProxyInfo;
|
||||
|
||||
public interface ConsoleProxyService {
|
||||
|
||||
public abstract ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId);
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue