@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; }
notification.getId().toBase64String(), " type ", notification.getType().name());
@Override protected void readFrom(Boss.Reader br) throws IOException { id = HashId.withDigest(br.readBinary()); signature = br.readBinary(); type = CallbackNotificationType.values()[br.readInt()]; state = CallbackService.FollowerCallbackState.values()[br.readInt()]; }
@Override protected void writeTo(Boss.Writer bw) throws IOException { bw.writeObject(id.getDigest()); bw.writeObject(signature); bw.writeObject(type.ordinal()); bw.writeObject(state.ordinal()); }
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(); } }