Package net.solosky.maplefetion.event.action

Examples of net.solosky.maplefetion.event.action.ActionEventFuture


     * @throws TransferException
     * @throws SystemException
     */
    private void invite() throws IllegalResponseException, RequestTimeoutException, InterruptedException, TransferException, SystemException
    {
      ActionEventFuture future = new ActionEventFuture();
      this.inviteBuddy(this.mainBuddy, new FutureActionEventListener(future));
      assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
    }
View Full Code Here


   * @return        操作等待对象
   * @throws TransferException
   */
  public ActionEventFuture sendChatMessage(Message message)
  {
    ActionEventFuture future = new ActionEventFuture();
    this.sendChatMessage(message, new FutureActionEventListener(future));
    return future;
  }
View Full Code Here

   *            消息正文
   * @return 操作等待对象
   */
  public ActionEventFuture sendSMSMessage(Message message)
  {
    ActionEventFuture future = new ActionEventFuture();
    this.sendSMSMessage(message, new FutureActionEventListener(future));
    return future;
  }
View Full Code Here

    @Override
    protected void doCloseDialog() throws Exception
    {
    if(!this.processorChain.isChainClosed()) {
          //注销请求
          ActionEventFuture future = new ActionEventFuture();
          this.logout(future);
          //future.waitActionEventWithoutException();
         
          //停止处理链
          this.processorChain.stopProcessorChain();
View Full Code Here

     * @return
     * @see net.solosky.maplefetion.client.dialog.ChatDialog#sendChatMessage(net.solosky.maplefetion.bean.Message)
     */
    public ActionEventFuture sendChatMessage(Message message)
    {
      ActionEventFuture future = new ActionEventFuture();
      this.sendChatMessage(message, new FutureActionEventListener(future));
      return future;
    }
View Full Code Here

     
      this.updateLoginState(LoginState.SIPC_REGISTER_DOING, null);
    ServerDialog serverDialog = this.context.getDialogFactory().createServerDialog();
        serverDialog.openDialog();
       
        ActionEventFuture future = new ActionEventFuture();
      ActionEventListener listener = new FutureActionEventListener(future);
     
      //注册服务器
      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){
        FailureEvent evt = (FailureEvent) event;
        FailureType type =  evt.getFailureType();
View Full Code Here

     * @throws RequestTimeoutException
     * @throws IllegalResponseException
     */
    private void getContactsInfo() throws IllegalResponseException, RequestTimeoutException, TransferException, SystemException, InterruptedException
    {
      ActionEventFuture future = new ActionEventFuture();
      ActionEventListener listener = new FutureActionEventListener(future);
      ServerDialog dialog = this.context.getDialogFactory().getServerDialog();
    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

     * @throws RequestTimeoutException
     * @throws IllegalResponseException
     */
    private void getGroupsInfo() throws IllegalResponseException, RequestTimeoutException, TransferException, SystemException, InterruptedException
    {
      ActionEventFuture future = new ActionEventFuture();
      ActionEventListener listener = new FutureActionEventListener(future);
      ServerDialog dialog = this.context.getDialogFactory().getServerDialog();
      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();
    if(store.getGroupList().size()==0){
      logger.debug("The group list is empty, group dialog login is skipped.");
      return;
    }

        //如果当前存储版本和服务器相同,就不获取群信息和群成员列表,
        //TODO ..这里只是解决了重新登录的问题,事实上这里问题很大,群信息分成很多
        //用户加入的群列表 groupListVersion
        //某群的信息      groupInfoVersion
        //群成员列表      groupMemberListVersion
        //暂时就这样,逐步完善中.....
        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();
          dialog.getMemberList(this.context.getFetionStore().getGroupList(), listener);
          Dialog.assertActionEvent(future.waitActionEventWithException(), ActionEventType.SUCCESS);
         
          storeVersion.setGroupVersion(userVersion.getGroupVersion());
        }
       
      this.updateLoginState(LoginState.GET_GROUPS_INFO_SUCCESS,null);
View Full Code Here

   * 获取定时短信列表
   * @return
   */
  private ActionEvent getScheduleSMSList()
  {
    ActionEventFuture future = new ActionEventFuture();
    this.context.getDialogFactory().getServerDialog().getScheduleSMSList(future);
    return future.waitActionEventWithoutException();
  }
View Full Code Here

  /**
   * 获取一组定时短信的详细信息
   */
  private ActionEvent getScheduleSMSInfo(Collection<ScheduleSMS> list)
  {
    ActionEventFuture future = new ActionEventFuture();
    this.context.getDialogFactory().getServerDialog().getScheduleSMSInfo(list, future);
    return future.waitActionEventWithoutException();
  }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.event.action.ActionEventFuture

Copyright © 2018 www.massapicom. 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.