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

com.iteaj.iot.client.http.HttpClient Maven / Gradle / Ivy

The newest version!
package com.iteaj.iot.client.http;

import com.iteaj.iot.client.ClientComponent;
import com.iteaj.iot.client.IotClient;

import java.util.function.Consumer;
import java.util.function.Function;

/**
 * http客户端
 */
public abstract class HttpClient implements IotClient {

    private HttpClientComponent component;
    private HttpClientConnectProperties properties;

    public HttpClient(HttpClientConnectProperties properties, HttpClientComponent component) {
        this.component = component;
        this.properties = properties;
    }

    @Override
    public int getPort() {
        return getConfig().getPort();
    }

    @Override
    public String getHost() {
        return getConfig().getHost();
    }

    @Override
    public HttpClientConnectProperties getConfig() {
        return this.properties;
    }

    public abstract void get(HttpClientMessage requestMessage);

    public abstract void get(HttpClientMessage requestMessage, Consumer call);

    public abstract void post(HttpClientMessage requestMessage);

    public abstract void post(HttpClientMessage requestMessage, Consumer call);

    @Override
    public Object connect() {
        return null;
    }

    @Override
    public Object disconnect() {
        return null;
    }

    @Override
    public ClientComponent getClientComponent() {
        return this.component;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy