@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof PingCommand)) return false; if (!super.equals(o)) return false; PingCommand that = (PingCommand) o; if (hostId != that.hostId) return false; if (hostType != that.hostType) return false; return true; }
@Override public int hashCode() { int result1 = super.hashCode(); result1 = 31 * result1 + (result ? 1 : 0); result1 = 31 * result1 + (details != null ? details.hashCode() : 0); return result1; } }
public static UnsupportedAnswer createUnsupportedCommandAnswer(final Command cmd) { return new UnsupportedAnswer(cmd, "Unsupported command issued: " + cmd.toString() + ". Are you sure you got the right type of server?"); }
Answer answer; try { if (cmd.getContextParam("logid") != null) { MDC.put("logcontextid", cmd.getContextParam("logid")); s_logger.debug("Processing command: " + cmd.toString()); s_logger.warn("No handler found to process cmd: " + cmd.toString()); answer = new AgentControlAnswer(cmd); s_logger.debug("Response: unsupported command" + cmd.toString()); answer = Answer.createUnsupportedCommandAnswer(cmd);
Answer answer = null; Command currentCmd = cmds[i]; if (currentCmd.getContextParam("logid") != null) { MDC.put("logcontextid", currentCmd.getContextParam("logid"));
@Override public Answer executeRequest(final Command cmd) { final NuageVspRequestWrapper wrapper = NuageVspRequestWrapper.getInstance(); try { return wrapper.execute(cmd, this); } catch (final Exception e) { if (s_logger.isDebugEnabled()) { s_logger.debug("Received unsupported command " + cmd.toString(), e); } return Answer.createUnsupportedCommandAnswer(cmd); } }
Answer answer = null; Command currentCmd = cmds[i]; if (currentCmd.getContextParam("logid") != null) { MDC.put("logcontextid", currentCmd.getContextParam("logid"));
@Override public Answer executeRequest(Command cmd) { if (cmd instanceof CheckNetworkCommand) { return new CheckNetworkAnswer((CheckNetworkCommand)cmd, true, null); } System.out.println("Received Command: " + cmd.toString()); Answer answer = new Answer(cmd, !_negative, "response"); System.out.println("Replying with: " + answer.toString()); return answer; }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof SyncNuageVspCmsIdCommand)) return false; if (!super.equals(o)) return false; SyncNuageVspCmsIdCommand that = (SyncNuageVspCmsIdCommand) o; return super.equals(that) && Objects.equals(_syncType, that._syncType) && Objects.equals(_nuageVspCmsId, that._nuageVspCmsId); }
@Override public int hashCode() { return new HashCodeBuilder() .appendSuper(super.hashCode()) .append(_network) .append(_dhcpOption) .toHashCode(); }
final Request req = (Request)obj; final Command command = req.getCommand(); if (command.getContextParam("logid") != null) { MDC.put("logcontextid", command.getContextParam("logid"));
@Override public Answer sendMessage(Command cmd) { if ((cmd instanceof CopyCommand) || (cmd instanceof DownloadCommand)) { return resource.executeRequest(cmd); } // TODO Auto-generated method stub return new Answer(cmd, false, "unsupported command:" + cmd.toString()); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TrashNetworkVspCommand)) { return false; } TrashNetworkVspCommand that = (TrashNetworkVspCommand) o; return super.equals(that) && Objects.equals(_network, that._network); }
@Override public int hashCode() { return new HashCodeBuilder() .appendSuper(super.hashCode()) .append(_syncType) .append(_nuageVspCmsId) .toHashCode(); } }
@Override public Answer executeRequest(final Command cmd) { final NiciraNvpRequestWrapper wrapper = NiciraNvpRequestWrapper.getInstance(); try { return wrapper.execute(cmd, this); } catch (final Exception e) { s_logger.debug("Received unsupported command " + cmd.toString()); return Answer.createUnsupportedCommandAnswer(cmd); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Answer)) return false; if (!super.equals(o)) return false; Answer answer = (Answer) o; if (result != answer.result) return false; if (details != null ? !details.equals(answer.details) : answer.details != null) return false; return true; }
@Override public int hashCode() { return new HashCodeBuilder() .appendSuper(super.hashCode()) .append(_domain) .append(_action) .toHashCode(); } }
private Answer[] sendRebalanceCommand(final long peer, final long agentId, final long currentOwnerId, final long futureOwnerId, final Event event) { final TransferAgentCommand transfer = new TransferAgentCommand(agentId, currentOwnerId, futureOwnerId, event); final Commands commands = new Commands(Command.OnError.Stop); commands.addCommand(transfer); final Command[] cmds = commands.toCommands(); try { if (s_logger.isDebugEnabled()) { s_logger.debug("Forwarding " + cmds[0].toString() + " to " + peer); } final String peerName = Long.toString(peer); final String cmdStr = _gson.toJson(cmds); final String ansStr = _clusterMgr.execute(peerName, agentId, cmdStr, true); final Answer[] answers = _gson.fromJson(ansStr, Answer[].class); return answers; } catch (final Exception e) { s_logger.warn("Caught exception while talking to " + currentOwnerId, e); return null; } }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof CleanUpDomainCommand)) { return false; } CleanUpDomainCommand that = (CleanUpDomainCommand) o; return super.equals(that) && Objects.equals(_domainCleanUp, that._domainCleanUp); }