Package iqq.im

Examples of iqq.im.QQException


        account.getUin(), verifyCode, new QQActionListener() {
          public void onActionEvent(QQActionEvent event) {
            if (event.getType() == QQActionEvent.Type.EVT_OK) {
              doCheckLoginSig( (String) event.getTarget(),future);
            } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
              QQException ex = (QQException) (event.getTarget());
              if(ex.getError()==QQErrorCode.WRONG_CAPTCHA){
                doGetVerify(ex.getMessage(), future);
              }else{
                future.notifyActionEvent(
                    QQActionEvent.Type.EVT_ERROR,
                    (QQException) event.getTarget());
              }
View Full Code Here


          QQSession session = getContext().getSession();
          QQAccount account = getContext().getAccount();
          session.setState(QQSession.State.OFFLINE);
          account.setStatus(QQStatus.OFFLINE);
          //因为自带了错误重试机制,如果出现了错误回调,表明已经超时多次均失败,这里直接返回网络错误的异常
          QQException ex = (QQException) event.getTarget();
          QQErrorCode code = ex.getError();
          if(code == QQErrorCode.INVALID_LOGIN_AUTH) {
            relogin();
          } else if(code == QQErrorCode.IO_ERROR || code == QQErrorCode.IO_TIMEOUT){
            //粗线了IO异常,直接报网络错误
            getContext().fireNotify(new QQNotifyEvent(QQNotifyEvent.Type.NET_ERROR, ex));
View Full Code Here

    if (json.getInt("retcode") == 0) {
      getContext().getAccount().setStatus(status);
      notifyActionEvent(QQActionEvent.Type.EVT_OK, status);
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
        new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString()));
    }
  }
View Full Code Here

    JSONObject obj = null;
   
    if (!m.find()) {
      pic.setSuccess(false);
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
          new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString() ));
    }
   
    String regResult = m.group().replaceAll("[\\r]?[\\n]", " ")
      .replaceAll("[\r]?[\n]", " ");
    obj = new JSONObject(regResult);
   
    int retcode = obj.getInt("retcode");
    if (retcode == 0) {
      pic.setSuccess(obj.getInt("progress") == 100 ? true : false);
      pic.setFileSize(obj.getInt("filesize"));
      pic.setFileName(obj.getString("filename"));
      pic.setFilePath(obj.getString("filepath"));
      notifyActionEvent(QQActionEvent.Type.EVT_OK, pic);
      return;
    }

    // 失败后返回路径
    pic.setFilePath(file.getPath());
    pic.setSuccess(false);
    notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
        new QQException(QQErrorCode.UNEXPECTED_RESPONSE, response.getResponseString() ));
   
  }
View Full Code Here

      QQSession session = getContext().getSession();
      session.setLoginSig(mc.group(1));
      LOG.info("loginSig = " + session.getLoginSig());
      notifyActionEvent(QQActionEvent.Type.EVT_OK, session.getLoginSig());
    }else{
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.INVALID_RESPONSE, "Login Sig Not Found!!"));
    }
  }
View Full Code Here

    } else if (retcode == 121 || retcode == 120 || retcode == 100) {  // 121,120 : ReLinkFailure    100 : NotReLogin
      // 服务器需求重新认证
      // {"retcode":121,"t":"0"}
      LOG.info("**** NEED_REAUTH retcode: " + retcode + " ****");
      getContext().getSession().setState(QQSession.State.OFFLINE);
      QQException ex = new QQException(QQException.QQErrorCode.INVALID_LOGIN_AUTH);
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR, ex);
      return ;
      //notifyEvents.add(new QQNotifyEvent(QQNotifyEvent.Type.NEED_REAUTH, null));
    } else {
     
View Full Code Here

    BufferedImage image = null;
    try {
      image = ImageIO.read(in);
      group.setFace(image);
    } catch (IOException e) {
      new QQException(QQErrorCode.IO_ERROR, e);
    }
    notifyActionEvent(QQActionEvent.Type.EVT_OK, group);
  }
View Full Code Here

      if (result.equals("ok")) {
        notifyActionEvent(QQActionEvent.Type.EVT_OK, msg);
        return;
      }
    }
    notifyActionEvent(QQActionEvent.Type.EVT_ERROR, new QQException(QQErrorCode.UNEXPECTED_RESPONSE, json.toString()));

    System.out.println("send Msg result: " + json.toString());
  }
View Full Code Here

    BufferedImage image = null;
    try {
      image = ImageIO.read(in);
      user.setFace(image);
    } catch (IOException e) {
      new QQException(QQErrorCode.IO_ERROR, e);
    }
    notifyActionEvent(QQActionEvent.Type.EVT_OK, user);
  }
View Full Code Here

      JSONArray json = new JSONArray(text);
      JSONObject pic = json.getJSONObject(1);
      isSuccess = pic.getInt("success") == 1 ? true : false;
      filePath = pic.getString("file_path");
    } catch (JSONException e) {
      throw new QQException(QQErrorCode.JSON_ERROR, e);
    }
   
  }
View Full Code Here

TOP

Related Classes of iqq.im.QQException

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.