// Path: BoincRpc/src/main/java/edu/berkeley/boinc/NetStats.java
// public interface NetStats {
//     public abstract void connectionOpened();
//     public abstract void bytesReceived(int numBytes);
//     public abstract void bytesTransferred(int numBytes);
//     public abstract void connectionClosed();
// }


import android.content.Context;
import android.os.Handler;
import android.util.Log;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import sk.boinc.androboinc.BuildConfig;
import sk.boinc.androboinc.clientconnection.ClientReplyReceiver;
import sk.boinc.androboinc.clientconnection.ConnectionManager;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback;
import sk.boinc.androboinc.clientconnection.ConnectivityListener;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.DisconnectCause;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.ProgressInd;
import sk.boinc.androboinc.clientconnection.StatusNotifier;
import sk.boinc.androboinc.clientconnection.VersionInfo;
import edu.berkeley.boinc.NetStats;
import sk.boinc.androboinc.util.ClientId;
/* 
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010, Pavol Michalec
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package sk.boinc.androboinc.bridge;



/**
 * Manager for client bridge connections.
 * The service which created this manager should call {@link #cleanup()} method
 * before the service is terminated to ensure that connection is closed properly.
 *
 * @see sk.boinc.androboinc.clientconnection.ConnectionManager
 */
public class BridgeManager implements ConnectionManager, ClientBridgeCallback, ConnectivityListener {
	private static final String TAG = "BridgeManager";

	private final Context mContext;
	private final StatusNotifier mNotifier;
// Path: BoincRpc/src/main/java/edu/berkeley/boinc/NetStats.java
// public interface NetStats {
//     public abstract void connectionOpened();
//     public abstract void bytesReceived(int numBytes);
//     public abstract void bytesTransferred(int numBytes);
//     public abstract void connectionClosed();
// }


// Path: AndroBOINC/src/main/java/sk/boinc/androboinc/bridge/BridgeManager.java
import android.content.Context;
import android.os.Handler;
import android.util.Log;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import sk.boinc.androboinc.BuildConfig;
import sk.boinc.androboinc.clientconnection.ClientReplyReceiver;
import sk.boinc.androboinc.clientconnection.ConnectionManager;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback;
import sk.boinc.androboinc.clientconnection.ConnectivityListener;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.DisconnectCause;
import sk.boinc.androboinc.clientconnection.ConnectionManagerCallback.ProgressInd;
import sk.boinc.androboinc.clientconnection.StatusNotifier;
import sk.boinc.androboinc.clientconnection.VersionInfo;
import edu.berkeley.boinc.NetStats;
import sk.boinc.androboinc.util.ClientId;

/* 
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010, Pavol Michalec
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package sk.boinc.androboinc.bridge;



/**
 * Manager for client bridge connections.
 * The service which created this manager should call {@link #cleanup()} method
 * before the service is terminated to ensure that connection is closed properly.
 *
 * @see sk.boinc.androboinc.clientconnection.ConnectionManager
 */
public class BridgeManager implements ConnectionManager, ClientBridgeCallback, ConnectivityListener {
	private static final String TAG = "BridgeManager";

	private final Context mContext;
	private final StatusNotifier mNotifier;
	private final NetStats mNetStats;