// Path: src/main/java/com/alwaysallthetime/messagebeast/model/FullSyncState.java
// public enum FullSyncState {
//     NOT_STARTED,
//     STARTED,
//     COMPLETE;
// 
//     public static FullSyncState fromOrdinal(int ordinal) {
//         if(ordinal == 0) {
//             return NOT_STARTED;
//         } else if(ordinal == 1) {
//             return STARTED;
//         }
//         return COMPLETE;
//     }
// }


import android.util.Log;
import com.alwaysallthetime.adnlib.AppDotNetClient;
import com.alwaysallthetime.adnlib.GeneralParameter;
import com.alwaysallthetime.adnlib.QueryParameters;
import com.alwaysallthetime.adnlib.data.Annotation;
import com.alwaysallthetime.adnlib.data.Channel;
import com.alwaysallthetime.adnlib.data.ChannelList;
import com.alwaysallthetime.adnlib.data.User;
import com.alwaysallthetime.adnlib.response.ChannelListResponseHandler;
import com.alwaysallthetime.adnlib.response.ChannelResponseHandler;
import com.alwaysallthetime.messagebeast.model.FullSyncState;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
        c.setReaders(reader);

        for(Annotation a : channelAnnotations) {
            c.addAnnotation(a);
        }

        final QueryParameters params = new QueryParameters(GeneralParameter.INCLUDE_CHANNEL_ANNOTATIONS);
        client.createChannel(c, params, new ChannelResponseHandler() {
            @Override
            public void onSuccess(final Channel responseData) {
                client.subscribeChannel(responseData, params, new ChannelResponseHandler() {
                    @Override
                    public void onSuccess(Channel responseData) {
                        ADNSharedPreferences.setFullSyncState(responseData.getId(), FullSyncState.COMPLETE);
                        handler.onResponse(responseData);
                    }
                });
            }

            @Override
            public void onError(Exception error) {
                handler.onError(error);
            }
        });
    }

    private static Channel getOldestPrivateChannel(ChannelList responseData) {
        Channel theChannel = null;
        if(responseData.size() == 1) {
            theChannel = responseData.get(0);
// Path: src/main/java/com/alwaysallthetime/messagebeast/model/FullSyncState.java
// public enum FullSyncState {
//     NOT_STARTED,
//     STARTED,
//     COMPLETE;
// 
//     public static FullSyncState fromOrdinal(int ordinal) {
//         if(ordinal == 0) {
//             return NOT_STARTED;
//         } else if(ordinal == 1) {
//             return STARTED;
//         }
//         return COMPLETE;
//     }
// }


// Path: src/main/java/com/alwaysallthetime/messagebeast/PrivateChannelUtility.java
import android.util.Log;
import com.alwaysallthetime.adnlib.AppDotNetClient;
import com.alwaysallthetime.adnlib.GeneralParameter;
import com.alwaysallthetime.adnlib.QueryParameters;
import com.alwaysallthetime.adnlib.data.Annotation;
import com.alwaysallthetime.adnlib.data.Channel;
import com.alwaysallthetime.adnlib.data.ChannelList;
import com.alwaysallthetime.adnlib.data.User;
import com.alwaysallthetime.adnlib.response.ChannelListResponseHandler;
import com.alwaysallthetime.adnlib.response.ChannelResponseHandler;
import com.alwaysallthetime.messagebeast.model.FullSyncState;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

        c.setReaders(reader);

        for(Annotation a : channelAnnotations) {
            c.addAnnotation(a);
        }

        final QueryParameters params = new QueryParameters(GeneralParameter.INCLUDE_CHANNEL_ANNOTATIONS);
        client.createChannel(c, params, new ChannelResponseHandler() {
            @Override
            public void onSuccess(final Channel responseData) {
                client.subscribeChannel(responseData, params, new ChannelResponseHandler() {
                    @Override
                    public void onSuccess(Channel responseData) {
                        ADNSharedPreferences.setFullSyncState(responseData.getId(), FullSyncState.COMPLETE);
                        handler.onResponse(responseData);
                    }
                });
            }

            @Override
            public void onError(Exception error) {
                handler.onError(error);
            }
        });
    }

    private static Channel getOldestPrivateChannel(ChannelList responseData) {
        Channel theChannel = null;
        if(responseData.size() == 1) {
            theChannel = responseData.get(0);
        } else if(responseData.size() > 1) {