/*
 * Copyright (c) 2015. Ncomz. All Rights Reserved
 */

package com.ntels.onecable.admin.common.broadcast;

import com.ntels.onecable.admin.common.util.Dlog;

import android.content.Context;
import android.content.Intent;

/**
 * <pre>
 * 1. ClassName :   KneetMessageLocalBroadCast
 * 2. FileName  :   KneetMessageLocalBroadCast.java
 * 3. Package   :   com.ntels.onecable.admin.common.gcm.support
 * 4. Date      :   2016-12-05
 * 5. Author    :   aaron
 * 6. Comment   :   Pooling & GCM 메시지 전달 로컬 브로드캐스트
 * </pre>
 */
public abstract class KneetMessageLocalBroadCast extends DefaultLocalBroadCast {



    @Override
    public void onReceive(Context context, Intent intent) {

        super.onReceive(context, intent);

        if (intent.hasExtra(INTENT_NAME_TYPE)) {
            String nameType = intent.getStringExtra(INTENT_NAME_TYPE);
            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent);
        } else  {

        }
//        if (intent.hasExtra(INTENT_DUPLICATE_LOGIN)) {
//            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent.getStringExtra(INTENT_NAME_MESSAGE), intent.getBooleanExtra(INTENT_DUPLICATE_LOGIN, false));
//        } else if (intent.hasExtra(INTENT_ACTION_APP_EXIT)) {
//            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent.getStringExtra(INTENT_NAME_MESSAGE), intent.getBooleanExtra(INTENT_ACTION_APP_EXIT, false));
//        } else if (intent.hasExtra(INTENT_ACTION_HOMEHUB_STATE_CHANGE)) {
//            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent.getStringExtra(INTENT_NAME_MESSAGE), intent.getBooleanExtra(INTENT_ACTION_HOMEHUB_STATE_CHANGE, false));
//        } else if (intent.hasExtra(INTENT_ACTION_WEBSOCKET_MSG_RECEIVED)) {
//            Dlog.v("jino");
//            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent.getStringExtra(INTENT_NAME_MESSAGE), intent);
//        } else if (intent.hasExtra(INTENT_NAME_TYPE)) {
//            onMessage(intent.getStringExtra(INTENT_NAME_TYPE), intent.getStringExtra(INTENT_NAME_MESSAGE));
//        } else {
//            onMessage(intent.getStringExtra(INTENT_NAME_MESSAGE));
//        }
    }

//    @Override
//    public void onMessage(String msg) {
//
//        super.onMessage(msg);
//    }
//
//    public void onMessage(String messageType, String msg) {
//        onMessage(msg);
//    }
//
//    public void onMessage(String messageType, String msg, Boolean bVal) {
//        onMessage(msg);
//        onMessage(messageType, msg);
//    }

    public void onMessage(String messageType, Intent intent) {

        Dlog.v("jino");
    }

}
