Package net.solosky.maplefetion.event.action

Examples of net.solosky.maplefetion.event.action.ActionEventFuture.clear()


      //注册服务器
      serverDialog.register(presence, listener);
      Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
     
      //用户验证
      future.clear();
      serverDialog.userAuth(presence, listener);
      ActionEvent event = future.waitActionEventWithoutException();
      if(event.getEventType()==ActionEventType.SUCCESS){
        this.updateLoginState(LoginState.SIPC_REGISGER_SUCCESS, null);
      }else if(event.getEventType()==ActionEventType.FAILURE){
View Full Code Here


    this.updateLoginState(LoginState.GET_CONTACTS_INFO_DOING, null);
   
       
        //订阅异步通知
    if(this.context.getFetionStore().getBuddyList().size()>0){
          future.clear();
          dialog.subscribeBuddyNotify(listener);
          Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
    }
       
        this.updateLoginState(LoginState.GET_CONTACTS_INFO_SUCCESS, null);
View Full Code Here

      StoreVersion storeVersion   = this.context.getFetionStore().getStoreVersion();
      StoreVersion userVersion    = this.context.getFetionUser().getStoreVersion();

      this.updateLoginState(LoginState.GET_GROUPS_INFO_DOING, null);
        //获取群列表
        future.clear();
        dialog.getGroupList(listener);
        Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
       
    //如果群列表为空,就不发送下面的一些请求了
    FetionStore store = this.context.getFetionStore();
View Full Code Here

        logger.debug("GroupListVersion: server="+userVersion.getGroupVersion()+", local="+storeVersion.getGroupVersion());
        if(storeVersion.getGroupVersion()!=userVersion.getGroupVersion()) {
      //更新存储版本
      storeVersion.setGroupVersion(userVersion.getGroupVersion());
          //获取群信息
          future.clear();
          dialog.getGroupsInfo(this.context.getFetionStore().getGroupList(), listener);
          Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
       
          //获取群成员
          future.clear();
View Full Code Here

          future.clear();
          dialog.getGroupsInfo(this.context.getFetionStore().getGroupList(), listener);
          Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
       
          //获取群成员
          future.clear();
          dialog.getMemberList(this.context.getFetionStore().getGroupList(), listener);
          Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
         
          storeVersion.setGroupVersion(userVersion.getGroupVersion());
        }
View Full Code Here

    //迭代所有的定时短信列表,并在每20个发起一次获取定时短信详细内容的请求
    while(it.hasNext()){
      ScheduleSMS sc = it.next();
      readyList.add(sc);
      if(readyList.size()==20){
        future.clear();
        dialog.getScheduleSMSInfo(readyList, future);
        ActionEvent event = future.waitActionEventWithoutException();
        if(event.getEventType()==ActionEventType.SUCCESS){
          readyList.clear();    //成功继续下一次请求
        }else{
View Full Code Here

      }
    }
   
    //迭代完了,可能仍有部分短信没有请求,检查下请求列表,如果不为空,则继续请求
    if(readyList.size()>0){
      future.clear();
      dialog.getScheduleSMSInfo(readyList, future);
      return future.waitActionEventWithoutException();
    }else{
      return new SuccessEvent();    //成功
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.