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

com.hivemq.client.mqtt.MqttClientTransportConfigBuilderBase Maven / Gradle / Ivy

Go to download

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support

There is a newer version: 1.3.3
Show newest version
/*
 * Copyright 2018 dc-square and the HiveMQ MQTT Client Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.hivemq.client.mqtt;

import com.hivemq.client.annotations.DoNotImplement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.net.InetAddress;
import java.net.InetSocketAddress;

/**
 * Builder base for a {@link MqttClientTransportConfig}.
 *
 * @author Silvio Giebl
 * @since 1.1
 */
@DoNotImplement
public interface MqttClientTransportConfigBuilderBase> {

    /**
     * Sets the {@link MqttClientTransportConfig#getServerAddress() server address} to connect to.
     *
     * @param address the server address.
     * @return the builder.
     */
    @NotNull B serverAddress(@NotNull InetSocketAddress address);

    /**
     * Sets the server host to connect to.
     *
     * @param host the server host.
     * @return the builder.
     */
    @NotNull B serverHost(@NotNull String host);

    /**
     * Sets the server host to connect to.
     *
     * @param host the server host.
     * @return the builder.
     */
    @NotNull B serverHost(@NotNull InetAddress host);

    /**
     * Sets the server port to connect to.
     *
     * @param port the server port.
     * @return the builder.
     */
    @NotNull B serverPort(int port);

    /**
     * Sets the {@link MqttClientTransportConfig#getSslConfig() secure transport configuration} to the default
     * configuration.
     * 

* This means that the systems default trust store, ciphers and protocols are used. * * @return the builder. */ @NotNull B sslWithDefaultConfig(); /** * Sets the optional {@link MqttClientTransportConfig#getSslConfig() secure transport configuration}. * * @param sslConfig the secure transport configuration or null to remove any previously set secure * transport configuration. * @return the builder. */ @NotNull B sslConfig(@Nullable MqttClientSslConfig sslConfig); /** * Fluent counterpart of {@link #sslConfig(MqttClientSslConfig)}. *

* Calling {@link MqttClientSslConfigBuilder.Nested#applySslConfig()} on the returned builder has the effect of * extending the current secure transport configuration. * * @return the fluent builder for the secure transport configuration. * @see #sslConfig(MqttClientSslConfig) */ @NotNull MqttClientSslConfigBuilder.Nested sslConfig(); /** * Sets the {@link MqttClientTransportConfig#getWebSocketConfig() WebSocket transport configuration} to the default * configuration. * * @return the builder. */ @NotNull B webSocketWithDefaultConfig(); /** * Sets the optional {@link MqttClientTransportConfig#getWebSocketConfig() WebSocket transport configuration}. * * @param webSocketConfig the WebSocket transport configuration or null to remove any previously set * WebSocket transport configuration. * @return the builder. */ @NotNull B webSocketConfig(@Nullable MqttWebSocketConfig webSocketConfig); /** * Fluent counterpart of {@link #webSocketConfig(MqttWebSocketConfig)}. *

* Calling {@link MqttWebSocketConfigBuilder.Nested#applyWebSocketConfig()} on the returned builder has the effect * of extending the current WebSocket transport configuration. * * @return the fluent builder for the WebSocket configuration. * @see #webSocketConfig(MqttWebSocketConfig) */ @NotNull MqttWebSocketConfigBuilder.Nested webSocketConfig(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy