// Copyright (c) 2020 UWB & LESP.
// The UWB & LESP license this file to you under the MIT license.

package cz.senslog.connector.app.config.api;


/**
 * The interface {@code DatabaseBuilder} provides a configuration
 * to create new connection to a database.
 *
 * @author Lukas Cerny
 * @version 1.0
 * @since 1.0
 */
public interface DatabaseBuilder {

    /**
     * Sets connection url to the configuration.
     * @param connectionUrl - connection url to the database.
     * @return instance of builder {@code DatabaseBuilder}.
     */
    DatabaseBuilder connectionUrl(String connectionUrl);

    /**
     * Sets username to the configuration.
     * @param username - username to the database.
     * @return instance of builder {@code DatabaseBuilder}.
     */
    DatabaseBuilder username(String username);

    /**
     * Sets password to the configuration.
     * @param password - password to the database.
     * @return instance of builder {@code DatabaseBuilder}.
     */
    DatabaseBuilder password(String password);

    /**
     * Identifier of connector name in a configuration database.
     * @param connectorName connector name.
     * @return instance of builder {@code DatabaseBuilder}.
     */
    DatabaseBuilder connectorName(String connectorName);

    /**
     * Creates a new instance with the configuration.
     * @return new instance of {@link DatabaseConfigurationService}.
     */
    DatabaseConfigurationService build();
}