// Path: sdk/src/com/sharethis/loopy/sdk/net/HttpClientFactory.java
// public class HttpClientFactory {
// 
//     public static final int DEFAULT_CONNECTION_TIMEOUT = 1000;
//     public static final int DEFAULT_READ_TIMEOUT = 1000;
// 
//     private HttpParams params;
//     private ClientConnectionManager connectionManager;
//     private DefaultHttpClient client; // This should be thread safe
//     private IdleConnectionMonitorThread monitor;
//     private boolean initialized = false;
// 
//     private int connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
//     private int readTimeout = DEFAULT_READ_TIMEOUT;
// 
//     public void start(int timeout) {
//         setConnectionTimeout(timeout);
//         setReadTimeout(timeout);
//         init();
//     }
// 
//     public void stop() {
//         destroy();
//     }
// 
//     void init()  {
//         if(!initialized) {
// 
//             params = new BasicHttpParams();
// 
//             HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
//             HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);
//             HttpConnectionParams.setConnectionTimeout(params, connectionTimeout);
//             HttpConnectionParams.setSoTimeout(params, readTimeout);
// 
//             SchemeRegistry registry = new SchemeRegistry();
//             registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
//             registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
// 
//             connectionManager = new ThreadSafeClientConnManager(params, registry);
// 
//             monitor = new IdleConnectionMonitorThread(connectionManager);
//             monitor.setDaemon(true);
//             monitor.start();
//         }
//     }
// 
//     void destroy() {
//         if(initialized) {
//             initialized = false;
//             if(monitor != null) {
//                 monitor.shutdown();
//             }
//             if(connectionManager != null) {
//                 connectionManager.shutdown();
//             }
//         }
//     }
// 
//     public synchronized HttpClient getClient() {
//         if(client == null) {
//             client = new DefaultHttpClient(connectionManager, params);
//         }
//         else {
//             monitor.trigger();
//         }
// 
//         return client;
//     }
// 
//     public int getConnectionTimeout() {
//         return connectionTimeout;
//     }
// 
//     public void setConnectionTimeout(int connectionTimeout) {
//         this.connectionTimeout = connectionTimeout;
//     }
// 
//     public int getReadTimeout() {
//         return readTimeout;
//     }
// 
//     public void setReadTimeout(int readTimeout) {
//         this.readTimeout = readTimeout;
//     }
// }


import com.sharethis.loopy.sdk.net.HttpClientFactory;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Map;
package com.sharethis.loopy.sdk;



/**
 * @author Jason Polites
 */
public class LoopyAccess {
    public static Loopy getLoopy() {
        return Loopy.getInstance();
    }

    public static ApiClient getApiClient() {
        return Loopy.getInstance().getApiClient();
    }

    public static void setApiClient(ApiClient client) {
        Loopy.getInstance().setApiClient(client);
    }

// Path: sdk/src/com/sharethis/loopy/sdk/net/HttpClientFactory.java
// public class HttpClientFactory {
// 
//     public static final int DEFAULT_CONNECTION_TIMEOUT = 1000;
//     public static final int DEFAULT_READ_TIMEOUT = 1000;
// 
//     private HttpParams params;
//     private ClientConnectionManager connectionManager;
//     private DefaultHttpClient client; // This should be thread safe
//     private IdleConnectionMonitorThread monitor;
//     private boolean initialized = false;
// 
//     private int connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
//     private int readTimeout = DEFAULT_READ_TIMEOUT;
// 
//     public void start(int timeout) {
//         setConnectionTimeout(timeout);
//         setReadTimeout(timeout);
//         init();
//     }
// 
//     public void stop() {
//         destroy();
//     }
// 
//     void init()  {
//         if(!initialized) {
// 
//             params = new BasicHttpParams();
// 
//             HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
//             HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);
//             HttpConnectionParams.setConnectionTimeout(params, connectionTimeout);
//             HttpConnectionParams.setSoTimeout(params, readTimeout);
// 
//             SchemeRegistry registry = new SchemeRegistry();
//             registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
//             registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
// 
//             connectionManager = new ThreadSafeClientConnManager(params, registry);
// 
//             monitor = new IdleConnectionMonitorThread(connectionManager);
//             monitor.setDaemon(true);
//             monitor.start();
//         }
//     }
// 
//     void destroy() {
//         if(initialized) {
//             initialized = false;
//             if(monitor != null) {
//                 monitor.shutdown();
//             }
//             if(connectionManager != null) {
//                 connectionManager.shutdown();
//             }
//         }
//     }
// 
//     public synchronized HttpClient getClient() {
//         if(client == null) {
//             client = new DefaultHttpClient(connectionManager, params);
//         }
//         else {
//             monitor.trigger();
//         }
// 
//         return client;
//     }
// 
//     public int getConnectionTimeout() {
//         return connectionTimeout;
//     }
// 
//     public void setConnectionTimeout(int connectionTimeout) {
//         this.connectionTimeout = connectionTimeout;
//     }
// 
//     public int getReadTimeout() {
//         return readTimeout;
//     }
// 
//     public void setReadTimeout(int readTimeout) {
//         this.readTimeout = readTimeout;
//     }
// }


// Path: test/src/com/sharethis/loopy/sdk/LoopyAccess.java
import com.sharethis.loopy.sdk.net.HttpClientFactory;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Map;

package com.sharethis.loopy.sdk;



/**
 * @author Jason Polites
 */
public class LoopyAccess {
    public static Loopy getLoopy() {
        return Loopy.getInstance();
    }

    public static ApiClient getApiClient() {
        return Loopy.getInstance().getApiClient();
    }

    public static void setApiClient(ApiClient client) {
        Loopy.getInstance().setApiClient(client);
    }

    public static void setHttpClientFactory(HttpClientFactory factory) {