Package io.higgs.http.client.future

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


        }
        if (perPage > 0) {
            b.put("per_page", perPage);
        }
        URI uri = b.forURL(config.newAPIEndpointURI(GET));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new ManagedSourceList())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here


     * @return the managed source for the ID provided
     */
    public FutureData<ManagedSource> get(String id) {
        FutureData<ManagedSource> future = new FutureData<ManagedSource>();
        URI uri = newParams().put("id", id).forURL(config.newAPIEndpointURI(GET));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new ManagedSource())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        }
        if (perPage > 0) {
            b.put("per_page", perPage);
        }
        URI uri = b.forURL(config.newAPIEndpointURI(GET));
        Request request = config.http().GET(uri, new PageReader(newRequestCallback(future, new ManagedSourceLog())));
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        if (id == null || id.isEmpty()) {
            throw new IllegalArgumentException("A push subscription ID is required");
        }
        FutureData<PushSubscription> future = new FutureData<PushSubscription>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(PAUSE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushSubscription())))
                .form("id", id);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        if (id == null || id.isEmpty()) {
            throw new IllegalArgumentException("A push subscription ID is required");
        }
        FutureData<PushSubscription> future = new FutureData<PushSubscription>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(RESUME));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushSubscription())))
                .form("id", id);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        if (id == null || id.isEmpty()) {
            throw new IllegalArgumentException("A push subscription ID is required");
        }
        FutureData<PushSubscription> future = new FutureData<PushSubscription>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(STOP));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushSubscription())))
                .form("id", id);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        if (id == null || id.isEmpty()) {
            throw new IllegalArgumentException("A push subscription ID is required");
        }
        FutureData<DataSiftResult> future = new FutureData<DataSiftResult>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(DELETE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new DataSiftResult())))
                .form("id", id);
        applyConfig(request).execute();
        return future;
    }
View Full Code Here

        if (id == null || id.isEmpty() || connector == null) {
            throw new IllegalArgumentException("A push subscription ID and output parameters is required");
        }
        FutureData<PushSubscription> future = new FutureData<PushSubscription>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(UPDATE));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushSubscription())))
                .form("id", id);
        for (Map.Entry<String, String> e : connector.parameters().verifyAndGet().entrySet()) {
            request.form(e.getKey(), e.getValue());
        }
        if (name != null && !name.isEmpty()) {
View Full Code Here

        if (id == null || id.isEmpty()) {
            throw new IllegalArgumentException("A push subscription ID is required");
        }
        final FutureData<PulledInteractions> future = new FutureData<PulledInteractions>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(PULL));
        POST request = config.http().POST(uri, new PageReader(new Function2<String, Response>() {
            public void apply(String s, Response response) {
                if (!response.hasFailed()) {
                    JavaType type = DataSiftClient.MAPPER.getTypeFactory()
                            .constructCollectionType(List.class, Interaction.class);
                    try {
View Full Code Here

     * @return a set of log messages
     */
    public FutureData<PushLogMessages> log(String id, int page, int perPage, String orderBy, String orderDirection) {
        FutureData<PushLogMessages> future = new FutureData<PushLogMessages>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(LOG));
        POST request = config.http().POST(uri, new PageReader(newRequestCallback(future, new PushLogMessages())));
        if (id != null && !id.isEmpty()) {
            request.form("id", id);
        }
        if (page > 0) {
            request.form("page", page);
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.