Search in sources :

Example 1 with TunnelControllerGroup

use of net.i2p.i2ptunnel.TunnelControllerGroup in project i2p.i2p by i2p.

the class EditBean method staticIsClient.

/**
 *  Is it a client or server in the UI and I2P side?
 *  Note that a streamr client is a UI and I2P client but a server on the localhost side.
 *  Note that a streamr server is a UI and I2P server but a client on the localhost side.
 */
public static boolean staticIsClient(int tunnel) {
    TunnelControllerGroup group = TunnelControllerGroup.getInstance();
    if (group == null)
        return false;
    List<TunnelController> controllers = group.getControllers();
    if (controllers.size() > tunnel) {
        TunnelController cur = controllers.get(tunnel);
        if (cur == null)
            return false;
        return isClient(cur.getType());
    } else {
        return false;
    }
}
Also used : TunnelController(net.i2p.i2ptunnel.TunnelController) TunnelControllerGroup(net.i2p.i2ptunnel.TunnelControllerGroup)

Aggregations

TunnelController (net.i2p.i2ptunnel.TunnelController)1 TunnelControllerGroup (net.i2p.i2ptunnel.TunnelControllerGroup)1