ConnectivityManagerApi.java 614 Bytes
Newer Older
1 2 3 4 5
package chat.rocket.android.service;

import android.support.annotation.Nullable;

import java.util.List;
Tiago Cunha's avatar
Tiago Cunha committed
6
import chat.rocket.core.models.ServerInfo;
7
import rx.Observable;
Yusuke Iwaki's avatar
Yusuke Iwaki committed
8
import rx.Single;
9 10 11 12 13 14 15

/**
 * interfaces used for Activity/Fragment and other UI-related logic.
 */
public interface ConnectivityManagerApi {
  void keepAliveServer();

Yusuke Iwaki's avatar
Yusuke Iwaki committed
16
  void addOrUpdateServer(String hostname, @Nullable String name, boolean insecure);
17 18 19

  void removeServer(String hostname);

Yusuke Iwaki's avatar
Yusuke Iwaki committed
20
  Single<Boolean> connect(String hostname);
21 22 23 24 25

  List<ServerInfo> getServerList();

  Observable<ServerConnectivity> getServerConnectivityAsObservable();
}