package com.team5.aLife.BaseStation;

import com.google.gson.Gson;

public abstract class AbstractRequest {
	
	final static protected int LOGIN_REQUEST = 1;
	final static protected int GET_ALL_DEVICES_REQUEST = 2;
	final static protected int ADD_DEVICE_REQUEST = 3;
	final static protected int GET_ALL_USERS_REQUEST = 4;
	final static protected int DELETE_USER_REQUEST = 5;
	final static protected int ADD_USER_REQUEST = 6;
	final static protected int GET_USER_REQUEST = 7;
	final static protected int UPDATE_USER_REQUEST = 8;
	final static protected int UPDATE_DEVICE_REQUEST = 9;
	final static protected int DELETE_DEVICE_REQUEST = 10;
	final static protected int BACKGROUND_SERVICE_ON_START_REQUEST = 11;
	final static protected int GET_ALL_NOTIFICATIONS_REQUEST = 	12;
	final static protected int DELETE_NOTIFICATION_REQUEST = 13;
	final static protected int GET_DEVICE_REQUEST = 14;
	final static protected int GET_DEVICE_STATE = 15;
	final static protected int UPDATE_DEVICE_STATE = 16;
	final static protected int GET_USERS_NOTIFICATION_REQUEST = 17;
	final static protected int UPDATE_NOTIFICATION_REQUEST = 18;
	final static protected int INSERT_NOTIFICATION_REQUEST = 19;
	
	int requestType;
	
	public String encodeToRequestString(){
		Gson gson = new Gson();
		
		String delimiter = "&";
		
		return getRequestType() + delimiter + gson.toJson(this);
	}
	
	public abstract int getRequestType();
}
