/** * @since Jetty 7 */ public void info(String msg, Throwable th) { _log.info(msg,th); }
/** this does nothing but logging */ public void gotChoke(Peer peer, boolean choke) { if (_log.shouldLog(Log.INFO)) _log.info("Got choke(" + choke + "): " + peer); //if (listener != null) // listener.peerChange(this, peer); }
/** * Handlers must call on startup * @since 0.9.20 */ public void register(Handler handler) { if (_log.shouldInfo()) _log.info("Register " + handler); synchronized (_handlers) { _handlers.add(handler); } }
public synchronized void stopTesting() { _keepTesting = false; if (_log.shouldLog(Log.INFO)) _log.info("Stop testing peers"); }
/** * @param nInfo who to send it to * @return success */ private boolean sendPong(NodeInfo nInfo, MsgID msgID) { if (_log.shouldLog(Log.INFO)) _log.info("Sending pong to: " + nInfo); Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> resps = new HashMap<String, Object>(); map.put("r", resps); return sendResponse(nInfo, msgID, map); }
@Override public void close() throws IOException { if (_log.shouldLog(Log.INFO)) _log.info("Closing " + out + " threaded?? " + shouldCompress(), new Exception("I did it")); synchronized(this) { // synch with changing out field below super.close(); } }
/** * @param session null ok */ void addSession(I2PSession session) { if (session == null) return; boolean added = _sessions.add(session); if (added && _log.shouldLog(Log.INFO)) _log.info(getPrefix() + " session added: " + session, new Exception()); }
private void clearStates() { if (_sendingStates == null) // only null if overridden by I2PSimpleSession return; for (MessageState state : _sendingStates.values()) { state.cancel(); } if (_log.shouldLog(Log.INFO)) _log.info(getPrefix() + "Disconnecting " + _sendingStates.size() + " states"); _sendingStates.clear(); } }
public void gotTermination(int reason, long lastReceived) { if (_log.shouldInfo()) _log.info("Got Termination: " + reason + " total rcvd: " + lastReceived + " on " + NTCPConnection.this); // close() calls destroy() sets _terminated close(); }
/** * Reduce to 1 in / 1 out tunnel */ private void reduceTunnels() { _isIdle = true; if (_log.shouldLog(Log.INFO)) _log.info("Reducing tunnels on idle"); setTunnels("1", "1", "0", "0"); }
public void runJob() { Set<Hash> toExpire = selectKeysToExpire(); _log.info("Leases to expire: " + toExpire); for (Hash key : toExpire) { _facade.fail(key); //_log.info("Lease " + key + " is expiring, so lets look for it again", new Exception("Expire and search")); //_facade.lookupLeaseSet(key, null, null, RERUN_DELAY_MS); } //_facade.queueForExploration(toExpire); // don't do explicit searches, just explore passively requeue(RERUN_DELAY_MS); }
/** client */ public void registerKeys(Destination dest, SigningPrivateKey leaseRevocationPrivateKey, PrivateKey endpointDecryptionKey) { if (_log.shouldLog(Log.INFO)) _log.info("Registering keys for destination " + dest.calculateHash().toBase64()); LeaseSetKeys keys = new LeaseSetKeys(dest, leaseRevocationPrivateKey, endpointDecryptionKey); _leaseSetKeys.put(dest.calculateHash(), keys); }
/** * We sent a message which was ACKed containing the given # of bytes. */ private void messageACKed(int bytesACKed, long lifetime, int numSends) { synchronized(this) { locked_messageACKed(bytesACKed, lifetime, numSends); } if (numSends >= 2 && _log.shouldLog(Log.INFO)) _log.info("acked after numSends=" + numSends + " w/ lifetime=" + lifetime + " and size=" + bytesACKed); _context.statManager().addRateData("udp.sendBps", _sendBps); }
public synchronized void startup() { _log.info("Starting up the peer manager"); _manager = new PeerManager(_context); _persistenceHelper.setUs(_context.routerHash()); _testJob.startTesting(_manager); }
/** * Same as above but for internal use, returns OutboundSession so we don't have * to do a subsequent getSession() * */ private OutboundSession createAndReturnSession(PublicKey target, SessionKey key) { if (_log.shouldLog(Log.INFO)) _log.info("New OB session, sesskey: " + key + " target: " + toString(target)); OutboundSession sess = new OutboundSession(_context, _log, target, key); addSession(sess); return sess; }
public void runJob() { Log log = getContext().logManager().getLog(getClass()); if (log.shouldLog(Log.INFO)) log.info(_search.getJobId() + ": search timed out"); _search.failed(); }
void replyVerified() { if (_log.shouldLog(Log.INFO)) _log.info("Peer reply from " + _peer.toBase64()); _repliesPendingVerification--; getContext().statManager().addRateData("netDb.searchReplyValidated", 1); } void replyNotVerified() {
void replyNotVerified() { if (_log.shouldLog(Log.INFO)) _log.info("Peer reply from " + _peer.toBase64()); _repliesPendingVerification--; _invalidPeers++; getContext().statManager().addRateData("netDb.searchReplyNotValidated", 1); } }
public void runJob() { if (_startedOn <= 0) _startedOn = getContext().clock().now(); if (_log.shouldLog(Log.INFO)) _log.info(getJobId() + ": Searching for " + _state.getTarget()); // , getAddedBy()); searchNext(); }
public synchronized void startTesting(PeerManager manager) { _manager = manager; _keepTesting = true; this.getTiming().setStartAfter(getContext().clock().now() + DEFAULT_PEER_TEST_DELAY); getContext().jobQueue().addJob(this); if (_log.shouldLog(Log.INFO)) _log.info("Start testing peers"); }