public String toString() { return "[CallbackNotification from " + getFrom() + " with id: " + getId() + "]"; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CallbackNotification that = (CallbackNotification) o; NodeInfo from = getFrom(); if (!from.equals(that.getFrom())) return false; if (!id.equals(that.id)) return false; if (!type.equals(that.type)) return false; if (!state.equals(that.state)) return false; return Arrays.equals(signature, that.signature); }
@Override public int hashCode() { NodeInfo from = getFrom(); int result = from.hashCode(); result = 31 * result + id.hashCode(); result = 31 * result + Arrays.hashCode(signature); result = 31 * result + type.hashCode(); result = 31 * result + state.hashCode(); return result; }
public void obtainNotification(CallbackNotification notification) { node.report(DatagramAdapter.VerboseLevel.DETAILED, "Notify callback ", notification.getId().toBase64String(), " type ", notification.getType().name(), " from node ", notification.getFrom().getName()); if (notification.getType() == CallbackNotification.CallbackNotificationType.COMPLETED) { if (checkCallbackSignature(notification.getSignature())) complete(); } else if (notification.getType() == CallbackNotification.CallbackNotificationType.NOT_RESPONDING) { addNodeToSended(notification.getFrom().getNumber()); checkForComplete(); } }
network.deliver(notification.getFrom(), new CallbackNotification(myInfo, notification.getId(), CallbackNotification.CallbackNotificationType.RETURN_STATE, null, ledger.getFollowerCallbackStateById(notification.getId())));