All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.resthub.web.support.AsyncEntityHandler Maven / Gradle / Ivy

Go to download

RESThub webservice client for requesting REST webservices with JSON support bundled

The newest version!
package org.resthub.web.support;

import com.ning.http.client.AsyncCompletionHandler;
import org.resthub.web.Response;

import java.util.ArrayList;
import java.util.List;

public class AsyncEntityHandler extends AsyncCompletionHandler {

    protected List bodyReaders = new ArrayList();

    public void setBodyReaders(List brs) {
        this.bodyReaders = brs;
    }

    public void addBodyReader(BodyReader br) {
        this.bodyReaders.add(br);
    }

    @Override
    public Response onCompleted(com.ning.http.client.Response rspns) throws Exception {

        Response resp = new Response(rspns);
        resp.addBodyReaders(this.bodyReaders);

        return resp;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy