// Path: localnet/src/main/java/dev/jokr/localnet/discovery/models/DiscoveryReply.java
// public class DiscoveryReply implements Serializable {
// 
//     private String ip;
//     private int port;
// 
//     public DiscoveryReply(String ip, int port) {
//         this.ip = ip;
//         this.port = port;
//     }
// 
//     public String getIp() {
//         return ip;
//     }
// 
//     public int getPort() {
//         return port;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/IncomingServerMessage.java
// public class IncomingServerMessage implements Serializable {
// 
//     private String type;
//     private Object message;
// 
//     public IncomingServerMessage(String type, Object message) {
//         this.type = type;
//         this.message = message;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public Object getMessage() {
//         return message;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/Payload.java
// public class Payload<T> implements Serializable {
// 
//     private T payload;
// 
//     public Payload(T payload) {
//         this.payload = payload;
//     }
// 
//     public T getPayload() {
//         return payload;
//     }
// 
// 
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/RegisterMessage.java
// public class RegisterMessage implements Serializable {
// 
//     private Payload<?> payload;
//     private String ip;
//     private int port;
// 
//     public RegisterMessage(Payload<?> payload, String ip, int port) {
//         this.payload = payload;
//         this.ip = ip;
//         this.port = port;
//     }
// 
//     public String getIp() {
//         return ip;
//     }
// 
//     public int getPort() {
//         return port;
//     }
// 
//     public Payload<?> getPayload() {
//         return payload;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/SessionMessage.java
// public class SessionMessage implements Serializable {
// 
//     public static final int NONE = 0;
//     public static final int START = 1;
//     public static final int END = 2;
// 
//     private Payload<?> payload;
//     private int signal;
// 
// 
//     public SessionMessage(Payload<?> payload) {
//         this.payload = payload;
//         this.signal = NONE;
//     }
// 
//     public SessionMessage(Payload<?> payload, int signal) {
//         this.payload = payload;
//         this.signal = signal;
//     }
// 
//     public int getSignal() {
//         return signal;
//     }
// 
//     public Payload<?> getPayload() {
//         return payload;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/utils/MessageType.java
// public class MessageType {
// 
//     public static final String REGISTER = "register";
//     public static final String SESSION = "session";
// 
// }


import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.NotificationCompat;
import android.text.format.Formatter;
import dev.jokr.localnet.discovery.models.DiscoveryReply;
import dev.jokr.localnet.models.IncomingServerMessage;
import dev.jokr.localnet.models.Payload;
import dev.jokr.localnet.models.RegisterMessage;
import dev.jokr.localnet.models.SessionMessage;
import dev.jokr.localnet.utils.MessageType;
package dev.jokr.localnet;



/**
 * Created by JoKr on 8/29/2016.
 */
public class ClientService extends Service implements ClientSocketThread.ServiceCallback {

    public static final String ACTION = "action";
    public static final String DISCOVERY_REPLY = "reply";
    public static final int NOTIFICATION_ID = 521;

    // Keys for extras
    public static final String PAYLOAD = "payload";

    // Possible service actions:
    public static final int DISCOVERY_REQUEST = 1;
    public static final int SESSION_MESSAGE = 2;

    private Payload<?> registerPayload;
    private ClientSocketThread clientSocketThread;
    private SendHandler sendHandler;

// Path: localnet/src/main/java/dev/jokr/localnet/discovery/models/DiscoveryReply.java
// public class DiscoveryReply implements Serializable {
// 
//     private String ip;
//     private int port;
// 
//     public DiscoveryReply(String ip, int port) {
//         this.ip = ip;
//         this.port = port;
//     }
// 
//     public String getIp() {
//         return ip;
//     }
// 
//     public int getPort() {
//         return port;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/IncomingServerMessage.java
// public class IncomingServerMessage implements Serializable {
// 
//     private String type;
//     private Object message;
// 
//     public IncomingServerMessage(String type, Object message) {
//         this.type = type;
//         this.message = message;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public Object getMessage() {
//         return message;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/Payload.java
// public class Payload<T> implements Serializable {
// 
//     private T payload;
// 
//     public Payload(T payload) {
//         this.payload = payload;
//     }
// 
//     public T getPayload() {
//         return payload;
//     }
// 
// 
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/RegisterMessage.java
// public class RegisterMessage implements Serializable {
// 
//     private Payload<?> payload;
//     private String ip;
//     private int port;
// 
//     public RegisterMessage(Payload<?> payload, String ip, int port) {
//         this.payload = payload;
//         this.ip = ip;
//         this.port = port;
//     }
// 
//     public String getIp() {
//         return ip;
//     }
// 
//     public int getPort() {
//         return port;
//     }
// 
//     public Payload<?> getPayload() {
//         return payload;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/models/SessionMessage.java
// public class SessionMessage implements Serializable {
// 
//     public static final int NONE = 0;
//     public static final int START = 1;
//     public static final int END = 2;
// 
//     private Payload<?> payload;
//     private int signal;
// 
// 
//     public SessionMessage(Payload<?> payload) {
//         this.payload = payload;
//         this.signal = NONE;
//     }
// 
//     public SessionMessage(Payload<?> payload, int signal) {
//         this.payload = payload;
//         this.signal = signal;
//     }
// 
//     public int getSignal() {
//         return signal;
//     }
// 
//     public Payload<?> getPayload() {
//         return payload;
//     }
// }
// 
// Path: localnet/src/main/java/dev/jokr/localnet/utils/MessageType.java
// public class MessageType {
// 
//     public static final String REGISTER = "register";
//     public static final String SESSION = "session";
// 
// }


// Path: localnet/src/main/java/dev/jokr/localnet/ClientService.java
import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.NotificationCompat;
import android.text.format.Formatter;
import dev.jokr.localnet.discovery.models.DiscoveryReply;
import dev.jokr.localnet.models.IncomingServerMessage;
import dev.jokr.localnet.models.Payload;
import dev.jokr.localnet.models.RegisterMessage;
import dev.jokr.localnet.models.SessionMessage;
import dev.jokr.localnet.utils.MessageType;

package dev.jokr.localnet;



/**
 * Created by JoKr on 8/29/2016.
 */
public class ClientService extends Service implements ClientSocketThread.ServiceCallback {

    public static final String ACTION = "action";
    public static final String DISCOVERY_REPLY = "reply";
    public static final int NOTIFICATION_ID = 521;

    // Keys for extras
    public static final String PAYLOAD = "payload";

    // Possible service actions:
    public static final int DISCOVERY_REQUEST = 1;
    public static final int SESSION_MESSAGE = 2;

    private Payload<?> registerPayload;
    private ClientSocketThread clientSocketThread;
    private SendHandler sendHandler;

    private DiscoveryReply reply;