Package net.solosky.maplefetion.util

Examples of net.solosky.maplefetion.util.ResponseFuture


     */
    private void register(String credential) throws RequestTimeoutException, InterruptedException, IllegalResponseException, TransferException
    {
      //发送注册信息
    SipcRequest request = this.messageFactory.createRegisterChatRequest(credential);
    ResponseFuture future = ResponseFuture.wrap(request);
    this.process(request);
    SipcResponse response = future.waitResponse();
    assertStatus(response.getStatusCode(), SipcStatus.ACTION_OK);
    }
View Full Code Here


            .createInviteRequest(
                    this.mainBuddy.getUri(),
                    this.context.getTransferFactory()
                            .getDefaultTransferLocalPort());
    this.callHelper.set(request);
    ResponseFuture future = ResponseFuture.wrap(request);
    this.process(request);

    int status = future.waitResponse().getStatusCode();
    if (status == SipcStatus.TRYING) {
      assertStatus(future.waitResponse().getStatusCode(),
              SipcStatus.ACTION_OK);
    } else if (status == SipcStatus.ACTION_OK) {
    } else {
      throw new IllegalResponseException("Unexpected response status");
    }
View Full Code Here

   */
  public String startChat() throws TransferException, RequestTimeoutException, InterruptedException, IllegalResponseException
  {
    this.ensureOpened();
    SipcRequest request = this.getMessageFactory().createStartChatRequest();
      ResponseFuture future = ResponseFuture.wrap(request);
      this.process(request);
      SipcResponse response = future.waitResponse();
      assertStatus(response.getStatusCode(), SipcStatus.ACTION_OK);
      return response.getHeader(SipcHeader.AUTHORIZATION).getValue();
  }
View Full Code Here

    private void invite() throws TransferException, IllegalResponseException, RequestTimeoutException, InterruptedException
    {
      SipcRequest request = this.getMessageFactory().createInviteRequest(
          this.group.getUri(),this.context.getTransferFactory().getDefaultTransferLocalPort());
      this.helper.set(request);
      ResponseFuture future = ResponseFuture.wrap(request);
      this.process(request);
     
      int status = future.waitResponse().getStatusCode();
      if(status==SipcStatus.TRYING) {
        assertStatus(future.waitResponse().getStatusCode(), SipcStatus.ACTION_OK);
      }else if(status==SipcStatus.ACTION_OK) {
      }else {
        throw new IllegalResponseException("Unexpected response status");
      }
    }
View Full Code Here

     */
    private void setPresence() throws TransferException, RequestTimeoutException, InterruptedException, IllegalResponseException
    {
      SipcRequest request = this.getMessageFactory().createSetGroupPresenceRequest(group.getUri(), Presence.ONLINE);
      this.helper.set(request);
      ResponseFuture future = ResponseFuture.wrap(request);
      this.process(request);
      SipcResponse response = future.waitResponse();
      assertStatus(response.getStatusCode(), SipcStatus.ACTION_OK);
    }
View Full Code Here

     */
    private void subscribeNotify() throws TransferException, IllegalResponseException, RequestTimeoutException, InterruptedException
    {
      SipcRequest request = this.getMessageFactory().createSubscribeGroupNotifyRequest(this.group.getUri());
      this.helper.set(request);
      ResponseFuture future = ResponseFuture.wrap(request);
      this.process(request);
      SipcResponse response = future.waitResponse();
      assertStatus(response.getStatusCode(), SipcStatus.ACTION_OK);
    }
View Full Code Here

     */
    private void bye() throws TransferException, RequestTimeoutException, InterruptedException, IllegalResponseException
    {
      SipcRequest request = this.getMessageFactory().createLogoutRequest(this.group.getUri());
      this.helper.set(request);
      ResponseFuture future = ResponseFuture.wrap(request);
      this.process(request);
      SipcResponse response = future.waitResponse();
      assertStatus(response.getStatusCode(), SipcStatus.ACTION_OK);
    }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.util.ResponseFuture

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.