import net.pterodactylus.xdcc.data.Pack;
import net.pterodactylus.xdcc.data.Server;
+import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
}
/**
+ * Returns all connected networks.
+ *
+ * @return All connected networks
+ */
+ public Collection<Network> connectedNetworks() {
+ return Lists.newArrayList(Optional.presentInstances(FluentIterable.from(networkConnections.values()).transform(new Function<Connection, Optional<Network>>() {
+ @Override
+ public Optional<Network> apply(Connection connection) {
+ return getNetwork(connection);
+ }
+ })));
+ }
+
+ /**
* Returns all configured channels. Due to various circumstances, configured
* channels might not actually be joined.
*