164164//
165165@ Local (value = { ConsoleProxyManager .class , ConsoleProxyService .class })
166166public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxyManager ,
167- VirtualMachineGuru < ConsoleProxyVO > , SystemVmLoadScanHandler <Long >, ResourceStateAdapter {
167+ VirtualMachineGuru , SystemVmLoadScanHandler <Long >, ResourceStateAdapter {
168168 private static final Logger s_logger = Logger .getLogger (ConsoleProxyManagerImpl .class );
169169
170170 private static final int DEFAULT_CAPACITY_SCAN_INTERVAL = 30000 ; // 30 seconds
@@ -1023,13 +1023,13 @@ public boolean stop() {
10231023 return true ;
10241024 }
10251025
1026- @ Override
1027- public Long convertToId (String vmName ) {
1028- if (!VirtualMachineName .isValidConsoleProxyName (vmName , _instance )) {
1029- return null ;
1030- }
1031- return VirtualMachineName .getConsoleProxyId (vmName );
1032- }
1026+ // @Override
1027+ // public Long convertToId(String vmName) {
1028+ // if (!VirtualMachineName.isValidConsoleProxyName(vmName, _instance)) {
1029+ // return null;
1030+ // }
1031+ // return VirtualMachineName.getConsoleProxyId(vmName);
1032+ // }
10331033
10341034 @ Override
10351035 public boolean stopProxy (long proxyVmId ) {
@@ -1429,7 +1429,6 @@ public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile profile,
14291429 return true ;
14301430 }
14311431
1432- @ Override
14331432 public boolean finalizeCommandsOnStart (Commands cmds , VirtualMachineProfile profile ) {
14341433
14351434 NicProfile managementNic = null ;
@@ -1487,7 +1486,8 @@ public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Command
14871486 }
14881487
14891488 @ Override
1490- public void finalizeExpunge (ConsoleProxyVO proxy ) {
1489+ public void finalizeExpunge (VirtualMachine vm ) {
1490+ ConsoleProxyVO proxy = _consoleProxyDao .findById (vm .getId ());
14911491 proxy .setPublicIpAddress (null );
14921492 proxy .setPublicMacAddress (null );
14931493 proxy .setPublicNetmask (null );
@@ -1498,23 +1498,23 @@ public void finalizeExpunge(ConsoleProxyVO proxy) {
14981498
14991499
15001500
1501- @ Override
1502- public ConsoleProxyVO persist (ConsoleProxyVO proxy ) {
1503- return _consoleProxyDao .persist (proxy );
1504- }
1505-
1506- @ Override
1507- public ConsoleProxyVO findById (long id ) {
1508- return _consoleProxyDao .findById (id );
1509- }
1510-
1511- @ Override
1512- public ConsoleProxyVO findByName (String name ) {
1513- if (!VirtualMachineName .isValidConsoleProxyName (name )) {
1514- return null ;
1515- }
1516- return findById (VirtualMachineName .getConsoleProxyId (name ));
1517- }
1501+ // @Override
1502+ // public ConsoleProxyVO persist(ConsoleProxyVO proxy) {
1503+ // return _consoleProxyDao.persist(proxy);
1504+ // }
1505+ //
1506+ // @Override
1507+ // public ConsoleProxyVO findById(long id) {
1508+ // return _consoleProxyDao.findById(id);
1509+ // }
1510+ //
1511+ // @Override
1512+ // public ConsoleProxyVO findByName(String name) {
1513+ // if (!VirtualMachineName.isValidConsoleProxyName(name)) {
1514+ // return null;
1515+ // }
1516+ // return findById(VirtualMachineName.getConsoleProxyId(name));
1517+ // }
15181518
15191519 @ Override
15201520 public void finalizeStop (VirtualMachineProfile profile , StopAnswer answer ) {
@@ -1726,7 +1726,7 @@ public void prepareStop(VirtualMachineProfile profile) {
17261726 public void vmWorkStart (VmWork work ) {
17271727 assert (work instanceof VmWorkStart );
17281728
1729- ConsoleProxyVO vm = findById (work .getVmId ());
1729+ ConsoleProxyVO vm = _consoleProxyDao . findById (work .getVmId ());
17301730
17311731 UserVO user = _entityMgr .findById (UserVO .class , work .getUserId ());
17321732 AccountVO account = _entityMgr .findById (AccountVO .class , work .getAccountId ());
@@ -1747,7 +1747,7 @@ public void vmWorkStart(VmWork work) {
17471747 public void vmWorkStop (VmWork work ) {
17481748 assert (work instanceof VmWorkStop );
17491749
1750- ConsoleProxyVO vm = findById (work .getVmId ());
1750+ ConsoleProxyVO vm = _consoleProxyDao . findById (work .getVmId ());
17511751
17521752 UserVO user = _entityMgr .findById (UserVO .class , work .getUserId ());
17531753 AccountVO account = _entityMgr .findById (AccountVO .class , work .getAccountId ());
0 commit comments