Examples of PingRoutingCommand


Examples of com.cloud.agent.api.PingRoutingCommand

        return new StartupCommand[] {startCmd, storePoolCmd};
    }

    @Override
    public final PingCommand getCurrentStatus(final long id) {
        PingCommand pingCmd = new PingRoutingCommand(getType(), id, null, getHostVmStateReport());

        if (s_logger.isDebugEnabled()) {
            s_logger.debug("Ping host " + _name + " (IP " + _agentIp + ")");
        }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    }

    @Override
    public PingCommand getCurrentStatus(long id) {
        //TODO: check server
        return new PingRoutingCommand(getType(), id, new HashMap<String, State>(), new HashMap<String, HostVmStateReportEntry>());
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

        }

        if (hostId != null) {
            final List<? extends VMInstanceVO> vms = vmDao.listByHostId(hostId);
            if (vms.isEmpty()) {
                return new PingRoutingCommand(getType(), id, deltaSync(), getHostVmStateReport());
            } else {
                VMInstanceVO vm = vms.get(0);
                SecurityGroupHttpClient client = new SecurityGroupHttpClient();
                HashMap<String, Pair<Long, Long>> nwGrpStates = client.sync(vm.getInstanceName(), vm.getId(), vm.getPrivateIpAddress());
                return new PingRoutingWithNwGroupsCommand(getType(), id, null, getHostVmStateReport(), nwGrpStates);
            }
        } else {
            return new PingRoutingCommand(getType(), id, deltaSync(), getHostVmStateReport());
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

        com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password);
        if (sshConnection == null) {
            return null;
        } else {
            SSHCmdHelper.releaseSshConnection(sshConnection);
            return new PingRoutingCommand(getType(), id, new HashMap<String, State>(), new HashMap<String, HostVmStateReportEntry>());
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

        com.trilead.ssh2.Connection sshConnection = SSHCmdHelper.acquireAuthorizedConnection(_ip, _username, _password);
        if (sshConnection == null) {
            return null;
        } else {
            SSHCmdHelper.releaseSshConnection(sshConnection);
            return new PingRoutingCommand(getType(), id, new HashMap<String, State>(), new HashMap<String, HostVmStateReportEntry>());
        }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public boolean processCommands(long agentId, long seq, Command[] cmds) {
        boolean processed = false;
        for (Command cmd : cmds) {
            if (cmd instanceof PingRoutingCommand) {
                PingRoutingCommand ping = (PingRoutingCommand) cmd;
                if (ping.getNewStates() != null && ping.getNewStates().size() > 0) {
                    Commands commands = deltaHostSync(agentId, ping.getNewStates());
                    if (commands.size() > 0) {
                        try {
                            _agentMgr.send(agentId, commands, this);
                        } catch (final AgentUnavailableException e) {
                            s_logger.warn("Agent is now unavailable", e);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

                  invalidateServiceContext();
                  return null;
              }
          }
 
          return new PingRoutingCommand(getType(), id, newStates);
       
      } finally {
        recycleServiceContext();
      }
    }
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

    @Override
    public PingCommand getCurrentStatus(long id) {
        final HashMap<String, State> newStates = sync();

        if (!_can_bridge_firewall) {
            return new PingRoutingCommand(com.cloud.host.Host.Type.Routing, id,
                    newStates);
        } else {
            HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(id);
            return new PingRoutingWithNwGroupsCommand(getType(), id, newStates,
                    nwGrpStates);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

                    return null;
                }
            }
            Connection conn = getConnection();
            if (!_canBridgeFirewall && !_isOvs) {
                return new PingRoutingCommand(getType(), id, null);
            } else if (_isOvs) {
                List<Pair<String, Long>>ovsStates = ovsFullSyncStates();
                return new PingRoutingWithOvsCommand(getType(), id, null, ovsStates);
            }else {
                HashMap<String, Pair<Long, Long>> nwGrpStates = syncNetworkGroups(conn, id);
View Full Code Here

Examples of com.cloud.agent.api.PingRoutingCommand

  @Override
  public PingCommand getCurrentStatus(long id) {
    try {
      OvmHost.ping(_conn);
      HashMap<String, State> newStates = sync();
      return new PingRoutingCommand(getType(), id, newStates);
    } catch (XmlRpcException e) {
      s_logger.debug("Check agent status failed", e);
      return null;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.