Package io.higgs.http.client.future

Examples of io.higgs.http.client.future.PageReader


            throw new IllegalArgumentException("A subscription ID is required");
        }

        FutureData<PushSubscription> future = new FutureData<PushSubscription>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(GET));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushSubscription())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here


     */
    public FutureData<PushCollection> get(Stream hash, int page, int perPage, String orderBy,
                                          String orderDirection, boolean includeFinished) {
        FutureData<PushCollection> future = new FutureData<PushCollection>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(GET));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushCollection())));
        request.form("hash", hash.hash()).form("include_finished", includeFinished ? 1 : 0);
        if (page > 0) {
            request.form("page", page);
        }
        if (perPage > 0) {
View Full Code Here

     */
    public FutureData<PushCollection> get(HistoricsQuery historics, int page, int perPage, String orderBy,
                                          String orderDirection, boolean includeFinished) {
        FutureData<PushCollection> future = new FutureData<PushCollection>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(GET));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushCollection())));
        request.form("historics_id", historics.getId()).form("include_finished", includeFinished ? 1 : 0);
        if (page > 0) {
            request.form("page", page);
        }
        if (perPage > 0) {
View Full Code Here

     * @return the results of the validation
     */
    public <T extends PushConnector> FutureData<PushValidation> validate(T connector) {
        FutureData<PushValidation> future = new FutureData<PushValidation>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(VALIDATE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushValidation())))
                .form("output_type", connector.type().value());
        for (Map.Entry<String, String> e : connector.parameters().verifyAndGet().entrySet()) {
            request.form(e.getKey(), e.getValue());
        }
        applyConfig(request).execute();
View Full Code Here

                                                              FutureData<PushSubscription> future,
                                                              PushSubscription subscription,
                                                              PreparedHistoricsQuery historics,
                                                              Stream stream) {
        URI uri = newParams().forURL(config.newAPIEndpointURI(CREATE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, subscription)))
                .form("output_type", connector.type().value())
                .form("name", name);

        for (Map.Entry<String, String> e : connector.parameters().verifyAndGet().entrySet()) {
            request.form(e.getKey(), e.getValue());
View Full Code Here

     *         validation was successful or not
     */
    public FutureData<Validation> validate(String csdl) {
        FutureData<Validation> future = new FutureData<Validation>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(VALIDATE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new Validation())))
                .form("csdl", csdl);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

     *         to get the hash for the compiled CSDL
     */
    public FutureData<Stream> compile(String csdl) {
        FutureData<Stream> future = new FutureData<Stream>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(COMPILE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new Stream())))
                .form("csdl", csdl);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

     * @return The balance on the account being used to make API calls
     */
    public FutureData<Balance> balance() {
        FutureData<Balance> future = new FutureData<Balance>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(BALANCE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Balance())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        final Dpu dpu = new Dpu();
        //
        final FutureResponse<Stream> response = new FutureResponse<Stream>() {
            public void apply(Stream stream) {
                URI uri = newParams().put("hash", stream.hash()).forURL(config.newAPIEndpointURI(DPU));
                Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, dpu)));
                applyConfig(request).execute();
            }
        };
        unwrapFuture(streamFuture, future, dpu, response);
        return future;
View Full Code Here

            case DAY:
            default:
                period = "day";
        }
        URI uri = newParams().put("period", period).forURL(config.newAPIEndpointURI(USAGE));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new Usage())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

TOP

Related Classes of io.higgs.http.client.future.PageReader

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.