i2ptunnel: Add hooks to get the session from the contoller

This commit is contained in:
zzz
2022-01-02 11:23:23 -05:00
parent 2d42541b79
commit 13f910be70
2 changed files with 11 additions and 1 deletions

View File

@@ -354,8 +354,9 @@ public class I2PTunnel extends EventDispatcherImpl implements Logging {
/**
* @return A copy, unmodifiable, non-null
* @since public since 0.9.53 for advanced plugin usage, was package private
*/
List<I2PSession> getSessions() {
public List<I2PSession> getSessions() {
if (_sessions.isEmpty())
return Collections.emptyList();
return new ArrayList<I2PSession>(_sessions);

View File

@@ -234,6 +234,15 @@ public class TunnelController implements Logging {
_state = keyOK && getStartOnLoad() ? TunnelState.START_ON_LOAD : TunnelState.STOPPED;
}
/**
* The I2PTunnel
*
* @since 0.9.53 for advanced plugin usage
*/
public I2PTunnel getTunnel() {
return _tunnel;
}
/**
* @return success
*/