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

com.heroku.api.connection.Connection Maven / Gradle / Ivy

There is a newer version: 0.46
Show newest version
package com.heroku.api.connection;

import com.heroku.api.request.Request;

import java.util.Map;

/**
 * Connection interface for connecting to the Heroku API.
 *
 * @author Naaman Newbold
 */
public interface Connection {


    /**
     * Synchronously execute the given request, using a different apiKey than the one associated with this connection
     *
     * @param request the request to execute
     * @param      the response type
     * @param apiKey  the apiKey of the user to make the request on behalf of
     * @return the response as parsed by the request object
     */
     T execute(Request request, String apiKey);


    /**
     * Synchronously execute the given request, using a different apiKey than the one associated with this connection
     *
     * @param request the request to execute
     * @param      the response type
     * @param extraHeaders any extra headers to send with the request
     * @param apiKey  the apiKey of the user to make the request on behalf of
     * @return the response as parsed by the request object
     */
     T execute(Request request, Map extraHeaders, String apiKey);

    /**
     * Release any resources associated with this connection
     */
    void close();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy