+ private String display(boolean whitelist, boolean blacklist, boolean rw) {
+ String mode = "";
+ if (!rw) {
+ mode += "RO: ";
+ }
+ if (whitelist) {
+ mode += "WL: ";
+ }
+ if (blacklist) {
+ mode += "BL: ";
+ }
+
+ return mode;
+ }
+
+ @Override
+ protected void onRequestDone(long id, long bytesReceived, long bytesSent) {
+ boolean whitelist = wls.get(id);
+ boolean blacklist = bls.get(id);
+ boolean rw = rws.get(id);
+ wls.remove(id);
+ bls.remove(id);
+ rws.remove(id);
+
+ String rec = StringUtils.formatNumber(bytesReceived) + "b";
+ String sent = StringUtils.formatNumber(bytesSent) + "b";
+ long now = System.currentTimeMillis();
+ System.out.println(StringUtils.fromTime(now) + ": "
+ + String.format("%s[>%s]: (%s sent, %s rec) in %d ms",
+ display(whitelist, blacklist, rw), commands.get(id),
+ sent, rec, times.get(id)));
+
+ commands.remove(id);
+ times.remove(id);
+ }
+