mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-03-29 14:09:57 +00:00
Transports: Add method to get connected transport for peer
currently unused, for debugging only
This commit is contained in:
@@ -108,6 +108,14 @@ public abstract class CommSystemFacade implements Service {
|
||||
public abstract boolean isEstablished(Hash peer);
|
||||
public byte[] getIP(Hash dest) { return null; }
|
||||
public void queueLookup(byte[] ip) {}
|
||||
|
||||
/**
|
||||
* For debugging
|
||||
*
|
||||
* @return the identifier for the transport if connected, or null
|
||||
* @since 0.9.69
|
||||
*/
|
||||
public String getTransport(Hash peer) { return null; }
|
||||
|
||||
/**
|
||||
* Tell the comm system that we may disconnect from this peer.
|
||||
|
||||
@@ -186,6 +186,17 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
|
||||
public boolean isEstablished(Hash peer) {
|
||||
return _manager.isEstablished(peer);
|
||||
}
|
||||
|
||||
/**
|
||||
* For debugging
|
||||
*
|
||||
* @return the identifier for the transport if connected, or null
|
||||
* @since 0.9.69
|
||||
*/
|
||||
@Override
|
||||
public String getTransport(Hash peer) {
|
||||
return _manager.getTransport(peer);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new list, may be modified
|
||||
|
||||
@@ -638,6 +638,20 @@ public class TransportManager implements TransportEventListener {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* For debugging
|
||||
*
|
||||
* @return the identifier for the transport if connected, or null
|
||||
* @since 0.9.69
|
||||
*/
|
||||
String getTransport(Hash peer) {
|
||||
for (Transport t : _transports.values()) {
|
||||
if (t.isEstablished(peer))
|
||||
return t.getStyle();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a new list, may be modified
|
||||
* @since 0.9.34
|
||||
|
||||
Reference in New Issue
Block a user