Android Open Source - msghandle Abstract Msg Handle






From Project

Back to project page msghandle.

License

The source code is released under:

GNU General Public License

If you think the Android project msghandle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.anlong.msghandle.interfac;
//from   w w w  .  ja  va  2s . c  om
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import com.anlong.msghandle.common.HandleStaticValue;
import com.anlong.msghandle.impl.AppParamImpl;
import com.anlong.msghandle.impl.AppSystemMessageReportImpl;
import com.anlong.msghandle.impl.AuthenticationImpl;
import com.anlong.msghandle.impl.BroadcastImpl;
import com.anlong.msghandle.impl.CommonContactImpl;
import com.anlong.msghandle.impl.DepInfoListImpl;
import com.anlong.msghandle.impl.EditGroupImpl;
import com.anlong.msghandle.impl.EditGroupUserImpl;
import com.anlong.msghandle.impl.EditUserInfoImpl;
import com.anlong.msghandle.impl.ExitPreventGroupImpl;
import com.anlong.msghandle.impl.GetGroupInfoImpl;
import com.anlong.msghandle.impl.GetHistoryMessageImpl;
import com.anlong.msghandle.impl.GetUserInfoImpl105;
import com.anlong.msghandle.impl.GroupInfoListImpl;
import com.anlong.msghandle.impl.GroupShareImpl;
import com.anlong.msghandle.impl.HeartImpl103;
import com.anlong.msghandle.impl.LocationImpl;
import com.anlong.msghandle.impl.LoginImpl101;
import com.anlong.msghandle.impl.MessageStateReportImpl;
import com.anlong.msghandle.impl.OnlineStateImpl102;
import com.anlong.msghandle.impl.OnlineUserListImpl110;
import com.anlong.msghandle.impl.SendImageFile;
import com.anlong.msghandle.impl.SendMessageImpl203;
import com.anlong.msghandle.impl.SystemParaImpl;
import com.anlong.msghandle.impl.UnreadMessageImpl;
import com.anlong.msghandle.impl.UpdatePasswordImpl;
import com.anlong.msghandle.impl.UserInfoListImpl;
import com.anlong.msghandle.request.Request100;
import com.anlong.msghandle.request.Request101;
import com.anlong.msghandle.request.Request102;
import com.anlong.msghandle.request.Request103;
import com.anlong.msghandle.request.Request105;
import com.anlong.msghandle.request.Request110;
import com.anlong.msghandle.request.Request203;
import com.anlong.msghandle.util.IMLog;
import com.anlong.msghandle.util.Utils;

/**
 * ????setContext();??,
 * @ClassName: AbstractMsgHandle 
 * @Package: com.anlong.imsghandle
 * @company ShenZhen anlong Technology CO.,LTD.  
 * @Description: TODO ????????? 
 * @author anlong 
 * @date 2013-6-1 ????1:39:51 
 * @version V1.0
 */
public class AbstractMsgHandle implements MsgHandle {
  
  public AbstractMsgHandle() {
    // TODO Auto-generated constructor stub
  }
  
  public AbstractMsgHandle(Context context) {
    if (Utils.isNull(context)) {
      IMLog.e("????????,????????!");
      return;
    }
    //?????????????wifi
    if(!Utils.isNetworkConnected(context)){
      // TODO ????????????
      Utils.notifyMessage(3,HandleStaticValue.BCODE1000);
      return;
    } else {
      // TODO ????????????
      Utils.notifyMessage(5,HandleStaticValue.BCODE1000);
    }
      
    // ????IP??????????
    SharedPreferences settings =context.getSharedPreferences(HandleStaticValue.SHAREDPREFERENCES_im_sharedfile_ipinfo,Context.MODE_WORLD_READABLE);
    HandleStaticValue.SERVER_IP = settings.getString(HandleStaticValue.SHAREDPREFERENCES_KEY_SERVER_IP, "121.15.130.218");
    HandleStaticValue.SERVER_PORT = Integer.parseInt(settings.getString(HandleStaticValue.SHAREDPREFERENCES_KEY_SERVER_PORT, "8680")); 
       Log.e("MainActivity", "   ??id=="+HandleStaticValue.SERVER_IP+"     ???????"+HandleStaticValue.SERVER_PORT);
  }  
  
   
  @Override
  public void execute(Request101 request101) throws Exception {
    new LoginImpl101().execute(request101);
  }

  @Override
  public void execute(Request102 request102) throws Exception {
    OnlineStateImpl102.getInstance().execute(request102);
  }
  
  @Override
  public void execute(Request103 request103) throws Exception {
    HeartImpl103.getInstance().execute(request103);
  }

  /*@Override
  public void execute(Request104 request104) throws Exception {
    new UpdatePasswordImpl().execute(request104);
  }*/

  @Override
  public void execute(Request105 request105) throws Exception {
    GetUserInfoImpl105.getInstance().execute(request105);
  }

  /*@Override
  public void execute(Request106 request106) throws Exception {
    UserInfoListImpl.getInstance().execute(request106);
  }*/
  
  /*@Override
  public void execute(Request107 request107) throws Exception {
    DepInfoListImpl.getInstance().execute(request107);
  }*/

  /*@Override
  public void execute(Request108 request108) throws Exception {
    new GetGroupInfoImpl().execute(request108);
  }*/

  /*@Override
  public void execute(Request109 request109) throws Exception {
    GroupInfoListImpl.getInstance().execute(request109);
  }*/

  @Override
  public void execute(Request110 request110) throws Exception {
    OnlineUserListImpl110.getInstance().execute(request110);
  }

  /*@Override
  public void execute(Request111 request111) throws Exception {
    new EditGroupImpl().execute(request111);
  }*/

  /*@Override
  public void execute(Request112 request112) throws Exception {
    new EditGroupUserImpl().execute(request112);
  }*/

  /*@Override
  public void execute(Request113 request113) throws Exception {
    new ExitPreventGroupImpl().execute(request113);
  }*/

  /*@Override
  public void execute(Request114 request114) throws Exception {
    new EditUserInfoImpl().execute(request114);
  }*/

  /*@Override
  public void execute(Request202 request202) throws Exception {
    new GetHistoryMessageImpl().execute(request202);
  }*/

  @Override
  public void execute(Request203 request203) throws Exception {
    SendMessageImpl203.getInstance().execute(request203);    
  }

  /*@Override
  public void execute(Request204 request204) throws Exception {
    MessageStateReportImpl.getInstance().execute(request204);
  }*/

  /*@Override
  public void execute(Request401 request401) throws Exception {
    new SystemParaImpl().execute(request401);
  }*/

  /*@Override
  public void execute(Request201 request201) throws Exception {
    new UnreadMessageImpl().execute(request201);
  }*/

  public void execute(Request100 request100) throws Exception {
    new SendImageFile().execute(request100);
  }

  /*@Override
  public void execute(Request115 request115) throws Exception {
    new CommonContactImpl().execute(request115);
  }*/

  /*@Override
  public void execute(Request116 request116) throws Exception {
    new LocationImpl().execute(request116);
  }*/

  /*@Override
  public void execute(Request205 request205) throws Exception {
    new BroadcastImpl().execute(request205);
  }*/

  /*@Override
  public void execute(Request402 request402) throws Exception {
    new AppParamImpl().execute(request402);
  }*/

  /*@Override
  public void execute(Request501 request501) throws Exception {
    new AuthenticationImpl().execute(request501);
  }*/

  /*@Override
  public void execute(Request117 request117) throws Exception {
    new GroupShareImpl().execute(request117); 
  }*/
  
  /*@Override
  public void execute(Request207 request207) throws Exception {
    new AppSystemMessageReportImpl().execute(request207); 
  }*/
}




Java Source Code List

com.anlong.msghandle.common.BaseMessage.java
com.anlong.msghandle.common.HandleStaticValue.java
com.anlong.msghandle.common.HandleTimer.java
com.anlong.msghandle.common.MessageTimer.java
com.anlong.msghandle.event.MessageEventListener.java
com.anlong.msghandle.event.MessageEventSource.java
com.anlong.msghandle.event.MessageEvent.java
com.anlong.msghandle.file.InitImageFileServer.java
com.anlong.msghandle.handle.ImageRequestHandle.java
com.anlong.msghandle.handle.ImageResponseHandle.java
com.anlong.msghandle.handle.MsgRequestHandle.java
com.anlong.msghandle.handle.MsgResponseHandle.java
com.anlong.msghandle.impl.AppParamImpl.java
com.anlong.msghandle.impl.AppSystemMessageReportImpl.java
com.anlong.msghandle.impl.AuthenticationImpl.java
com.anlong.msghandle.impl.BroadcastImpl.java
com.anlong.msghandle.impl.CommonContactImpl.java
com.anlong.msghandle.impl.DepImpl.java
com.anlong.msghandle.impl.DepInfoListImpl.java
com.anlong.msghandle.impl.EditGroupImpl.java
com.anlong.msghandle.impl.EditGroupUserImpl.java
com.anlong.msghandle.impl.EditUserInfoImpl.java
com.anlong.msghandle.impl.ExitPreventGroupImpl.java
com.anlong.msghandle.impl.GetGroupInfoImpl.java
com.anlong.msghandle.impl.GetHistoryMessageImpl.java
com.anlong.msghandle.impl.GetUserInfoImpl105.java
com.anlong.msghandle.impl.GroupInfoListImpl.java
com.anlong.msghandle.impl.GroupShareImpl.java
com.anlong.msghandle.impl.HeartImpl103.java
com.anlong.msghandle.impl.LocationImpl.java
com.anlong.msghandle.impl.LoginImpl101.java
com.anlong.msghandle.impl.MessageStateReportImpl.java
com.anlong.msghandle.impl.OnlineStateImpl102.java
com.anlong.msghandle.impl.OnlineUserListImpl110.java
com.anlong.msghandle.impl.SendImageFile.java
com.anlong.msghandle.impl.SendMessageImpl203.java
com.anlong.msghandle.impl.SystemParaImpl.java
com.anlong.msghandle.impl.UnreadMessageImpl.java
com.anlong.msghandle.impl.UpdatePasswordImpl.java
com.anlong.msghandle.impl.UserInfoListImpl.java
com.anlong.msghandle.interfac.AbstractMsgHandle.java
com.anlong.msghandle.interfac.BaseActivity.java
com.anlong.msghandle.interfac.MessageHandleActivity.java
com.anlong.msghandle.interfac.MsgHandle.java
com.anlong.msghandle.message.InitRequMessageServer.java
com.anlong.msghandle.message.InitRespMessageServer.java
com.anlong.msghandle.request.BaseRequest.java
com.anlong.msghandle.request.Request100.java
com.anlong.msghandle.request.Request101.java
com.anlong.msghandle.request.Request102.java
com.anlong.msghandle.request.Request103.java
com.anlong.msghandle.request.Request105.java
com.anlong.msghandle.request.Request110.java
com.anlong.msghandle.request.Request203.java
com.anlong.msghandle.request.Request301.java
com.anlong.msghandle.response.BaseResponse.java
com.anlong.msghandle.response.Response1000.java
com.anlong.msghandle.response.Response1010.java
com.anlong.msghandle.response.Response1020.java
com.anlong.msghandle.response.Response1030.java
com.anlong.msghandle.response.Response1050.java
com.anlong.msghandle.response.Response1100.java
com.anlong.msghandle.response.Response2030.java
com.anlong.msghandle.response.Response3010.java
com.anlong.msghandle.service.InitServerManager.java
com.anlong.msghandle.service.ServerManager.java
com.anlong.msghandle.socket.InitFileSocketServer.java
com.anlong.msghandle.socket.InitMsgSocketServer.java
com.anlong.msghandle.util.ByteAndInt.java
com.anlong.msghandle.util.FormatTransfer.java
com.anlong.msghandle.util.IMLog.java
com.anlong.msghandle.util.ReflectionUtil.java
com.anlong.msghandle.util.Utils.java
com.anlong.msghandle.vo.AppMessage.java
com.anlong.msghandle.vo.Application.java
com.anlong.msghandle.vo.BroadcastMessage.java
com.anlong.msghandle.vo.DepInfo.java
com.anlong.msghandle.vo.GroupInfo.java
com.anlong.msghandle.vo.GroupShare.java
com.anlong.msghandle.vo.OnlineUser.java
com.anlong.msghandle.vo.ReportState.java
com.anlong.msghandle.vo.SimpleUserInfo.java
com.anlong.msghandle.vo.UserInfo.java
com.anlong.msghandle.vo.UserMessage.java