docs: public TrackedPeer update(RequestEvent event, ByteBuffer peerId,
                              String hexPeerId, String ip, int port, long uploaded, long downloaded,
                              long left) throws UnsupportedEncodingException {
      logger.trace("event {}, Peer: {}:{}", new Object[]{event.getEventName(), ip, port});
      TrackedPeer peer = null;
      TrackedPeer.PeerState state = TrackedPeer.PeerState.UNKNOWN;
  
      PeerUID peerUID = new PeerUID(new InetSocketAddress(ip, port), getHexInfoHash());
      if (RequestEvent.STARTED.equals(event)) {
        state = TrackedPeer.PeerState.STARTED;
      } else if (RequestEvent.STOPPED.equals(event)) {
        peer = this.removePeer(peerUID);
        state = TrackedPeer.PeerState.STOPPED;
      } else if (RequestEvent.COMPLETED.equals(event)) {
        peer = this.getPeer(peerUID);
        state = TrackedPeer.PeerState.COMPLETED;
      } else if (RequestEvent.NONE.equals(event)) {
        peer = this.getPeer(peerUID);
        state = TrackedPeer.PeerState.STARTED;
      } else {
        throw new IllegalArgumentException("Unexpected announce event type!");
      }
  
      if (peer == null) {
        peer = new TrackedPeer(this, ip, port, peerId);
        this.addPeer(peer);
      }
      peer.update(state, uploaded, downloaded, left);
      return peer;
    }