Package iqq.im

Examples of iqq.im.QQException


          String qqHex = m.group(2);
          notifyActionEvent(QQActionEvent.Type.EVT_OK, qqHex);
          LOG.info("GetPT4Auth: " + qqHex);
        }else{
          notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
              new QQException(QQException.QQErrorCode.INVALID_LOGIN_AUTH));
        }
  }
View Full Code Here


       LOG.info("WebLogin: " + response.getResponseString());
       if(mc.find()){
        int ret = Integer.parseInt(mc.group(1));
        switch(ret){
          case 0: notifyActionEvent(QQActionEvent.Type.EVT_OK, mc.group(3)); break
          case 3: throw new QQException(QQErrorCode.WRONG_PASSWORD, mc.group(5));
          case 4: throw new QQException(QQErrorCode.WRONG_CAPTCHA, mc.group(5));
          case 7: throw new QQException(QQErrorCode.IO_ERROR, mc.group(5));
          default: throw new QQException(QQErrorCode.INVALID_USER, mc.group(5));
        }
       }else{
         throw new QQException(QQErrorCode.UNEXPECTED_RESPONSE);
       }   
  }
View Full Code Here

        return asyncHttpClient.execute(new QQHttpGetRequestProducer(httphost, httpget),
            new QQHttpResponseConsumer(request, listener, cookieJar),
            new QQHttpResponseCallback(listener));
       
      }else{
        throw new QQException(QQErrorCode.IO_ERROR, "not support http method:" + request.getMethod());
      }
    } catch (IOException e) {
      throw new QQException(QQErrorCode.IO_ERROR);
    }
  }
View Full Code Here

          .getSchemeRegistry().register(new AsyncScheme("https", 443, new SSLLayeringStrategy(sslContext)));
      asyncHttpClient.setRedirectStrategy(new QQDefaultRedirectStrategy());
      asyncHttpClient.start();
      cookieJar = new QQHttpCookieJar();
    } catch (IOReactorException e) {
      throw new QQException(QQErrorCode.INIT_ERROR, e);
    }
  }
View Full Code Here

  public void destroy() throws QQException {
    super.destroy();
    try {
      asyncHttpClient.shutdown();
    } catch (InterruptedException e) {
      throw new QQException(QQErrorCode.UNKNOWN_ERROR, e);
    }
  }
View Full Code Here

    try {
      QQActionEvent event = eventQueue.take();
      hasEvent = !isFinalEvent(event);
      return event;
    } catch (InterruptedException e) {
      throw new QQException(QQErrorCode.WAIT_INTERUPPTED, e);
    }
  }
View Full Code Here

      return null;
    }
    try {
      event = eventQueue.poll(timeoutMs, TimeUnit.MICROSECONDS);
    } catch (InterruptedException e) {
      throw new QQException(QQErrorCode.WAIT_INTERUPPTED, e);
    }
    if(event == null){
      throw new QQException(QQErrorCode.WAIT_TIMEOUT);
    }else{
      hasEvent = !isFinalEvent(event);
      return event;
    }
  }
View Full Code Here

    while( (event = waitEvent()) != null){
      if( isFinalEvent(event) ){
        return event;
      }
    }
    throw new QQException(QQErrorCode.UNKNOWN_ERROR);
  }
View Full Code Here

      // 空,没有新邮件
      notifyActionEvent(QQActionEvent.Type.EVT_OK, null);
    } else if(content.startsWith("({e:-100")){
      // 凭证已经失效,需要重新登录或者获取wpkey 
      notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
          new QQException(QQException.QQErrorCode.INVALID_LOGIN_AUTH, content));
    } else {
      content = content.substring(1, content.length() - 1);
      JSONArray arr = new JSONArray(content);
      // 封装返回的邮件列表
      List<QQEmail> list = new ArrayList<QQEmail>();
View Full Code Here

            default:
          }
        }else if( value instanceof String){
          addContentItem(new TextItem((String) value));
        }else{
          throw new QQException(QQErrorCode.UNKNOWN_ERROR, "unknown msg content type:" + value.toString());
        }
      }
    } 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.