Android Open Source - nodechat-android Http Request Info






From Project

Back to project page nodechat-android.

License

The source code is released under:

Apache License

If you think the Android project nodechat-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.vt.ece4564;
// w  w w  . ja v a  2  s . co m
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpUriRequest;

public class HttpRequestInfo {
//  public static final int RESPONSE_HTML = 0x0;
//  public static final int RESPONSE_JSON = 0x1;
//  public static final int RESPONSE_XML = 0x2;
//  public static final int RESPONSE_RSS = 0x3;
  
  private HttpUriRequest request_;
  private HttpCallback callback_;
  private Exception exception_;
  private HttpResponse response_;
  private Class responseClass_;
  
  public HttpRequestInfo(HttpUriRequest request, HttpCallback callback){
    super();
    request_ = request;
    callback_ = callback;
    responseClass_ = callback.getClass();
  }
  

  public HttpUriRequest getRequest() {
    return request_;
  }

  public void setRequest(HttpUriRequest request) {
    request_ = request;
  }

  public HttpCallback getCallback() {
    return callback_;
  }

  public void setCallback(HttpCallback callback) {
    callback_ = callback;
  }

  public Exception getException() {
    return exception_;
  }

  public void setException(Exception exception) {
    exception_ = exception;
  }

  public HttpResponse getResponse() {
    return response_;
  }

  public void setResponse(HttpResponse response) {
    response_ = response;
  }

  public void requestFinished(){
    if(exception_ != null){
      callback_.onError(exception_);
    }
    else {
      callback_.onResponse(response_);
    }
  }
}




Java Source Code List

org.vt.ece4564.AsyncHttpTask.java
org.vt.ece4564.ChatActivity.java
org.vt.ece4564.ChatClient.java
org.vt.ece4564.ChatListAdapter.java
org.vt.ece4564.ChatUtils.java
org.vt.ece4564.HttpCallback.java
org.vt.ece4564.HttpRequestInfo.java
org.vt.ece4564.HttpUtils.java
org.vt.ece4564.JoinActivity.java
org.vt.ece4564.Options.java